/* =====================================================================
   YUME — the log
   A reading room next door to the instrument panel. Same person, same
   palette, quieter room: no scripts at all, no tracking, no cookies.
   Latin text is set in a newspaper serif; Japanese falls through to the
   mincho already on the reader's machine, so a post in either language
   is set properly without shipping a five-megabyte font to do it.
   ===================================================================== */

:root {
  --bg: #0C0C10;
  --ink: #ECECEA;
  --gray: #8C8C97;
  --faint: #5E5E68;
  --line: #23232B;
  --accent: #7A8CFF;
  --soft: #15151B;

  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --read: "Newsreader", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho",
          "Noto Serif JP", "Noto Serif CJK JP", serif;
}

/* daylight, if that is what the reader's machine asked for */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #FFFFFF;
    --ink: #101010;
    --gray: #6A6A6A;
    --faint: #9A9A9A;
    --line: #E7E7E7;
    --accent: #2F45FF;
    --soft: #F6F6F4;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark light; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--read);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ---------- the strip along the top ---------- */

.top {
  border-bottom: 1px solid var(--line);
}

.top-in {
  max-width: 44rem;
  margin: 0 auto;
  padding: 15px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark .dot { color: var(--accent); }

.top-back {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray);
  text-decoration: none;
  transition: color 0.25s ease;
}

.top-back:hover { color: var(--accent); }

/* ---------- shared measure ---------- */

.sheet {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 24px 88px;
}

/* ---------- the log's own head ---------- */

.log-head { padding: 68px 0 44px; }

.log-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(38px, 7vw, 56px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.log-title .dot { color: var(--accent); }

.log-blurb {
  margin-top: 18px;
  max-width: 30em;
  font-size: 17px;
  line-height: 1.7;
  color: var(--gray);
}

/* ---------- the entries ----------
   Posts are in time order, so time is what the list is built on: a year
   states itself once and then stays quiet until it changes. */

.year {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--faint);
  padding: 26px 0 10px;
  border-top: 1px solid var(--line);
}

.entry { border-top: 1px solid var(--line); }

.year + .entry { border-top: 0; }

.entry a {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 22px 12px 24px 0;
  text-decoration: none;
  transition: background-color 0.25s ease;
}

.entry a:hover,
.entry a:focus-visible {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.entry time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  padding-left: 12px;
  white-space: nowrap;
}

.entry h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  transition: color 0.25s ease;
}

.entry a:hover h2,
.entry a:focus-visible h2 { color: var(--accent); }

.entry p {
  margin-top: 7px;
  font-size: 15px;
  line-height: 1.72;
  color: var(--gray);
}

.empty {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
}

/* ---------- a post ---------- */

.post-head {
  padding: 62px 0 34px;
  border-bottom: 1px solid var(--line);
}

.post-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.post-title {
  margin-top: 14px;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(29px, 5vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.post-lede {
  margin-top: 16px;
  max-width: 32em;
  font-size: 17px;
  line-height: 1.7;
  color: var(--gray);
}

/* Japanese has no italic. Asking for one only gets a machine-made slant, so
   the lede and quotes lean only where a real italic exists. */
html:not([lang="ja"]) .post-lede,
html:not([lang="ja"]) .prose blockquote { font-style: italic; }

/* ---------- the body of a post ----------
   Everything below styles what the writing itself produces. */

.prose {
  padding: 40px 0 8px;
  max-width: 36rem;
  font-size: 18px;
  line-height: 1.86;
  letter-spacing: 0.003em;
}

.prose > * + * { margin-top: 1.5em; }

.prose h2 {
  margin-top: 2.4em;
  font-family: var(--display);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.prose h3 {
  margin-top: 2em;
  font-family: var(--display);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.prose a:hover { opacity: 0.72; }

.prose strong { font-weight: 600; }

.prose ul, .prose ol { padding-left: 1.35em; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--faint); }

.prose blockquote {
  border-left: 2px solid var(--line);
  padding: 2px 0 2px 20px;
  color: var(--gray);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.prose pre {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
}

.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.prose hr {
  border: 0;
  width: 64px;
  height: 1px;
  background: var(--line);
  margin: 3em 0;
}

/* ---------- where a post lets you out ---------- */

.post-foot {
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12.5px;
}

.post-foot a {
  color: var(--gray);
  text-decoration: none;
  transition: color 0.25s ease;
}

.post-foot a:hover { color: var(--accent); }

.post-foot .to-log { color: var(--faint); }

/* ---------- the bottom of every page ---------- */

.foot {
  border-top: 1px solid var(--line);
}

.foot-in {
  max-width: 44rem;
  margin: 0 auto;
  padding: 22px 24px 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

.foot a { color: var(--gray); text-decoration: none; transition: color 0.25s ease; }
.foot a:hover { color: var(--accent); }

/* ---------- keyboards, phones, paper ---------- */

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

@media (max-width: 620px) {
  .entry a { grid-template-columns: 1fr; gap: 8px; padding: 20px 0 22px; }
  .entry time { padding-left: 0; }
  .log-head { padding: 46px 0 32px; }
  .post-head { padding: 40px 0 28px; }
  .prose { font-size: 17px; }
}

@media print {
  .top, .foot, .post-foot { display: none; }
  body { background: #fff; color: #000; }
  .prose a { color: #000; }
}

/* ---------- what gets attached to a post ----------
   A film keeps its own shape whatever the window does; a player from
   somewhere else is held in a box with the right proportions so nothing
   jumps around while it loads. */

.prose video,
.prose audio {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #000;
}

.prose audio { border-radius: 999px; background: var(--soft); }

.frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #000;
}

.frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- the way back ----------
   A post is a dead end unless it says where the door is, so it says so
   twice: once before the reading starts and once when it is over. */

.back-up {
  padding-top: 26px;
  font-family: var(--mono);
  font-size: 12px;
}

.back-up a {
  color: var(--gray);
  text-decoration: none;
  transition: color 0.25s ease;
}

.back-up a:hover { color: var(--accent); }

.back-home {
  margin-top: 30px;
  text-align: center;
}

.back-home a {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--gray);
  text-decoration: none;
  padding: 11px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.back-home a:hover,
.back-home a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* a post that is saved but not listed says so on its own page */
.post-draft {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
  display: inline-block;
}
