/* arawan.gajajiva.com: a quiet frame that each section's own pictures sit in. Dark by default,
   with a light theme (static/js/theme.js sets data-theme on <html>; without script the system
   setting decides). See "Site redesign" in docs/design-notes.md. */

/* Fonts, self-hosted (the CSP allows only this site), Latin subsets. Licenses: /fonts/OFL-*.txt */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/instrument-serif-latin-400.woff2) format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(/fonts/instrument-serif-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fonts/inter-latin-400-600.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/ibm-plex-mono-latin-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/fonts/ibm-plex-mono-latin-500.woff2) format("woff2"); }

:root {
  --ground: #15181d; --surface: #1d2127; --wash: #23282f;
  --ink: #edebe6; --muted: #a6a9b0; --line: #2e333b; --accent: #e9a46b;
  /* The Welcome to the Machine band stays dark in both themes. */
  --band: #171a20; --band-ink: #e6e3dc; --band-muted: #a9acb3; --band-accent: #e9a46b;
  --serif: "Instrument Serif", Georgia, "Iowan Old Style", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --page: 1200px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --ground: #f6f5f1; --surface: #fff; --wash: #eceae4;
    --ink: #1c1f24; --muted: #5b5e65; --line: #e2dfd8; --accent: #a24f2a;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --ground: #f6f5f1; --surface: #fff; --wash: #eceae4;
  --ink: #1c1f24; --muted: #5b5e65; --line: #e2dfd8; --accent: #a24f2a;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ground); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--ground); color: var(--ink); font: 400 17px/1.6 var(--sans); }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: min(var(--page), 100% - 64px); margin: 0 auto; padding: 56px 0 24px; flex: 1; }
@media (max-width: 640px) { .wrap { width: calc(100% - 40px); padding-top: 32px; } }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
h1 { font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1; margin: 0 0 22px; letter-spacing: -.015em; }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); line-height: 1.1; margin: 0; }
h3 { font-size: 1.75rem; line-height: 1.1; margin: 0 0 6px; }
.kicker, .label { margin: 0 0 18px; font: 500 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.label { margin: 0 0 6px; font-size: 11px; line-height: 1; }
.label.soon { color: var(--muted); }
.mono { font: 400 13px/1.5 var(--mono); color: var(--muted); }
.lede { max-width: 38em; margin: 0; color: var(--muted); }
.muted { color: var(--muted); }

/* Top bar: site name, the sections, then the theme button. On phones the sections and the
   theme button move into the menu (a popover: it opens and closes without script). */
.top { border-bottom: 1px solid var(--line); background: var(--ground); }
.bar { width: min(var(--page), 100% - 64px); margin: 0 auto; padding: 18px 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 36px; }
.brand { display: flex; align-items: baseline; gap: 12px; color: var(--ink); text-decoration: none;
  font: 400 34px/1 var(--serif); letter-spacing: -.01em; }
.brand span { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sections { flex: 1 1 auto; }
.sections ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 26px; }
.sections a { display: block; padding: 10px 0 8px; border-bottom: 2px solid transparent;
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.sections a:hover { color: var(--ink); }
.sections a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.tools { display: flex; align-items: center; gap: 12px; }
/* Personal / Work: a "Work" link goes here, set off by a divider, once /work/ exists. */

.theme, .menu-open, .menu-close { display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 44px; height: 44px; padding: 0; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.theme:hover, .menu-open:hover, .menu-close:hover { background: var(--wash); }
.theme .theme-name { display: none; }
:root:not([data-theme]) .theme { display: none; }   /* no script, no switching */
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: block; }
.menu-open { display: none; border: 0; background: var(--wash); }

.menu { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
  padding: 0; border: 0; background: var(--ground); color: var(--ink); overflow: auto; }
.menu:popover-open { display: flex; flex-direction: column; }
.menu::backdrop { background: transparent; }
.menu-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.menu-head .brand { font-size: 30px; }
.menu-close { border: 0; background: var(--wash); }
.menu nav { flex: 1; padding: 8px 20px 0; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu nav > ul > li { border-bottom: 1px solid var(--line); }
.menu nav > ul > li > a { display: flex; align-items: center; justify-content: space-between; min-height: 56px;
  color: var(--ink); text-decoration: none; font: 400 28px/1.1 var(--serif); }
.menu nav > ul > li > a[aria-current]::after { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }
.menu nav li ul { padding: 0 0 10px 16px; }
.menu nav li li a { display: flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 15px; }
.menu nav li li a[aria-current] { color: var(--ink); }
.menu-foot { padding: 14px 20px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.menu-foot .theme { padding: 0 16px; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.menu-foot .theme .theme-name { display: inline; }

@media (max-width: 820px) {
  .bar { width: auto; padding: 12px 12px 12px 20px; justify-content: space-between; flex-wrap: nowrap; }
  .bar .brand { font-size: 30px; }
  .bar .brand span, .sections, .bar .theme { display: none; }
  .menu-open { display: inline-flex; }
}

/* A section's band: its name, an intro on its landing page, and the tab row. Welcome to the
   Machine's band is dark in both themes. */
.band { background: var(--band); color: var(--band-ink); border-bottom: 1px solid var(--line); }
.band-in { width: min(var(--page), 100% - 64px); margin: 0 auto; padding: 48px 0 0; }
.band .kicker { color: var(--band-accent); }
.band h1 { max-width: 14em; font-size: clamp(2.6rem, 5.5vw, 3.75rem); line-height: 1.02; margin: 0 0 18px; }
.band .lede { color: var(--band-muted); margin: 0 0 36px; }
.band a { color: var(--band-accent); }
.tabs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 32px;
  font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.tabs a { display: block; padding: 14px 0 16px; border-bottom: 2px solid transparent; color: var(--band-muted); text-decoration: none; }
.tabs a:hover { color: var(--band-ink); }
.tabs a[aria-current] { color: #f3efe7; border-bottom-color: var(--band-accent); }
@media (max-width: 640px) { .band-in { width: calc(100% - 40px); padding-top: 32px; } }

/* Cards and lists */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px;
  border-top: 1px solid var(--line); padding-top: 22px; margin: 96px 0 28px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.card { display: block; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); text-decoration: none; }
a.card:hover { border-color: var(--muted); }
.card .pic { display: block; width: 100%; height: 170px; object-fit: cover; background: var(--wash); }
.card .pic.icon { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.card .pic.text { padding: 20px; background: var(--band); color: #d9d6cf; font: 400 13px/1.55 var(--mono); overflow: hidden; }
.card .pic.text b { font-weight: 400; color: var(--band-accent); }
.card .pic.text span { color: #8b8f97; }
.card .body { padding: 18px 20px 22px; }
.card .body p:last-child { margin: 0; font-size: 15px; color: var(--muted); }

.recent { display: flex; flex-wrap: wrap; gap: 24px 56px; margin-top: 96px; }
.recent .head { flex: 1 1 240px; border-top: 1px solid var(--line); padding-top: 22px; }
.recent ol { flex: 999 1 560px; min-width: 0; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.recent li { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.recent .when { flex: 0 0 120px; font: 400 13px/1.8 var(--mono); color: var(--muted); }
.recent .where { flex: 0 0 210px; font: 500 12px/2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.recent a { flex: 1 1 240px; color: var(--ink); text-decoration: none; font-weight: 500; }
.recent a:hover { text-decoration: underline; }

/* The morning photo: on the home page next to the heading, on /sunrise/ across the page. */
.hero { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: flex-end; }
.hero .text { flex: 1 1 320px; max-width: 380px; padding-bottom: 8px; }
.hero .text p:last-child { margin: 0; color: var(--muted); }
.viewer { flex: 999 1 560px; min-width: 0; margin: 0; }
.viewer img, .viewer .empty { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 6px; background: var(--wash); }
.viewer .empty { margin: 0; display: flex; align-items: center; justify-content: center; padding: 16px; color: var(--muted); text-align: center; }
.viewer figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; }
.viewer .when { font: 400 13px/1.4 var(--mono); color: var(--muted); }
.viewer .steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 18px; cursor: pointer; }
.step:hover:not(:disabled) { background: var(--wash); }
.step:disabled { opacity: .35; cursor: default; }
.viewer .steps a { margin-left: 8px; font-size: 14px; font-weight: 500; }

/* /sunrise/: the year-ago photo and the archive, a month at a time. */
.sunrise-below { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; margin-top: 20px; }
.sunrise-below .note { margin: 0; max-width: 34em; color: var(--muted); }
.yearago { margin: 0; }
.yearago a { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 15px; }
.yearago a:hover span { text-decoration: underline; }
.yearago img { border-radius: 4px; border: 1px solid var(--line); }
.months h3 { margin: 40px 0 14px; font-size: 1.6rem; }
.months ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.months a { display: block; color: var(--muted); text-decoration: none; font: 400 12px/1.6 var(--mono); }
.months a:hover, .months a[aria-current] { color: var(--ink); }
.months img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 3px; background: var(--wash); border: 1px solid var(--line); }
.months a[aria-current] img { border-color: var(--accent); outline: 1px solid var(--accent); }

/* Welcome to the Machine overview (/ai/) */
.panels { display: flex; flex-wrap: wrap; gap: 32px; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 32px 36px 36px; }
.panel.wide { flex: 3 1 520px; }
.panel.narrow { flex: 2 1 340px; }
.panel h2 { margin: 0 0 6px; }
.panel .mono { margin: 0 0 24px; }
.panel blockquote { margin: 0 0 24px; padding: 22px 26px; background: var(--wash); border-radius: 6px;
  font: 400 22px/1.5 var(--serif); }
.panel blockquote .ptext { white-space: pre-line; }
.panel blockquote footer { margin-top: 12px; font: 400 13px/1.4 var(--mono); color: var(--muted); }
.panel .more { font-weight: 600; }
@media (max-width: 640px) { .panel { padding: 24px 20px 26px; } }

/* "For AI agents" instructions (/ai/, /machines/, /register/): a collapsed line, opened on a click. */
.howto { margin: 36px 0 0; max-width: 46em; color: var(--muted); font-size: .85rem; }
.howto summary { cursor: pointer; width: fit-content; }
.howto summary:hover, .howto[open] summary { color: var(--ink); }
.howto[open] { padding: 12px 16px 6px; border: 1px dashed var(--line); border-radius: 6px; }
.howto[open] summary { margin-bottom: 10px; }
.howto ol { padding-left: 1.3em; margin: 0 0 6px; }
.howto li p, .howto > p { margin: 0 0 6px; }
.howto code { font: .8rem/1.5 var(--mono); word-break: break-all; color: var(--accent); }

/* Short pages: 404, "thanks for signing", "passage received". */
.simple { max-width: 40em; padding-top: 12vh; }
.simple .lede { margin: 0 0 24px; }

/* Footer */
.foot { width: min(var(--page), 100% - 64px); margin: 72px auto 0; padding: 28px 0 48px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; font-size: 14px; color: var(--muted); }
@media (max-width: 640px) { .foot { width: calc(100% - 40px); } }
.foot p { margin: 0; }
.fact { font-style: italic; }
.agents { font-size: 13px; }
.agents summary { cursor: pointer; width: fit-content; }
.agents summary:hover, .agents[open] summary { color: var(--ink); }
.agents p { margin: 6px 0 0; max-width: 34em; }
.agents code { font: 12px/1.5 var(--mono); word-break: break-all; color: var(--ink); }
.admin { flex-basis: 100%; font-size: 13px; }
.admin a { color: var(--muted); }
