/* prayoga — quiet editorial theme */
:root {
  --paper: #f7f5ef;
  --paper-2: #efebe1;
  --ink: #1a1a18;
  --ink-soft: #6b6860;
  --ink-faint: #a29e94;
  --accent: #c8672a;            /* used sparingly: hover, focus, live status */
  --rule: rgba(26, 26, 24, 0.10);
  --grid: rgba(26, 26, 24, 0.05);
  --serif: "Fraunces", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --deva: "Tiro Devanagari Hindi", "Noto Serif Devanagari", serif;
  --max: 1040px;
  --measure: 40rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191917;
    --paper-2: #21201d;
    --ink: #ecebe6;
    --ink-soft: #a19e96;
    --ink-faint: #6f6c65;
    --accent: #e08a52;
    --rule: rgba(236, 235, 230, 0.10);
    --grid: rgba(236, 235, 230, 0.04);
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--paper); color: var(--ink);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-line: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 0.2em; transition: color .15s ease, text-decoration-color .15s ease; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { left: 16px; top: 16px; background: var(--paper-2); padding: 8px 12px; z-index: 10; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; margin: 0; }
h1, .hero-line, .section-head h2 { text-transform: lowercase; }   /* top-level titles are lowercase; headings inside a page keep their own case */
h1 { font-size: clamp(2.4rem, 5.5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.2rem; font-weight: 600; }
.mono, code { font-family: var(--mono); font-size: 0.86em; }
.muted { color: var(--ink-soft); }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Small mono labels: dates, codes, breadcrumbs */
.kicker, .label {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em;
  color: var(--ink-soft); margin: 0 0 1.25rem;
}
.kicker a { text-decoration: none; }
.kicker a:hover { color: var(--accent); }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: var(--measure); margin-top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: var(--paper-2);   /* same tint as the footer */
  border-bottom: 1px solid var(--rule);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { color: var(--ink); display: inline-flex; }
.brand-mark svg { width: 26px; height: 26px; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { font-size: 0.9rem; text-decoration: none; color: var(--ink-soft); }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); }

/* Wordmark */
.wordmark { display: block; font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.brand-wordmark { display: inline-block; font-size: 1.35rem; color: var(--ink); position: relative; top: -0.1em; }
.brand:hover .brand-wordmark { color: var(--ink); }
.hero-wordmark { font-size: clamp(4rem, 13vw, 8.5rem); color: var(--ink); }

/* Hero */
.hero { padding: clamp(80px, 14vw, 176px) 0 clamp(56px, 9vw, 112px); }
.hero-title { display: grid; gap: 0.6em; margin: 0; }
.hero-line { font-family: var(--serif); font-size: clamp(1.35rem, 2.6vw, 1.9rem); font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }

/* Sections */
.section { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--rule); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 1.25rem; }
.section-link { font-size: 0.9rem; color: var(--ink-soft); text-decoration: none; }
.section-link:hover { color: var(--accent); }

/* Rows: experiments and notes share one list style */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.rows > li { border-bottom: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: 7rem 1fr auto; align-items: baseline; gap: 20px; padding: 18px 0; text-decoration: none; color: var(--ink); }
.row-nometa { grid-template-columns: 1fr auto; }
.row-meta { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); }
.row-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.row-sub { display: block; font-family: var(--sans); font-weight: 400; font-size: 0.95rem; color: var(--ink-soft); margin-top: 4px; letter-spacing: 0; }
.row-arrow { color: var(--ink-faint); transition: transform .2s ease, color .2s ease; }
a.row:hover { color: var(--ink); }
a.row:hover .row-title { color: var(--accent); }
a.row:hover .row-arrow { color: var(--accent); transform: translateX(3px); }
.empty { color: var(--ink-soft); padding: 18px 0; }

/* Status: a small dot and a word */
.status { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: 0.1em; }
.status-running::before { background: var(--accent); }
.status-shipped::before { background: var(--ink); }
.status-killed { text-decoration: line-through; }

/* Contact line */
.contact-line { display: flex; gap: 20px; align-items: baseline; }
.contact-line .label { margin: 0; }

/* Pages */
.page { padding-top: clamp(56px, 9vw, 112px); padding-bottom: clamp(64px, 9vw, 120px); }
.page-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); max-width: 48rem; }
.page-head.page-head-row { max-width: none; }
.page-head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.prose { max-width: var(--measure); font-size: 1.05rem; }
.prose h2 { font-size: 1.5rem; margin: 2em 0 0.6em; }
.prose h3 { margin: 1.6em 0 0.5em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose blockquote { margin: 1.5em 0; padding-left: 1em; border-left: 2px solid var(--rule); color: var(--ink-soft); }

/* Spec rows (experiment pages) and dictionary rows (about) share a look */
.spec { margin: 0 0 clamp(2rem, 5vw, 3rem); max-width: 48rem; border-top: 1px solid var(--rule); }
.spec > div { display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.spec dt { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); padding-top: 0.2em; }
.spec dd { margin: 0; }
.hypothesis { margin: 0 0 2.5rem; max-width: 48rem; padding: 0; border: 0; }
.hypothesis .label { margin-bottom: 0.5rem; }
.hypothesis p:last-child { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; line-height: 1.4; letter-spacing: -0.01em; margin: 0; }

.exp-notes { margin-top: clamp(3rem, 7vw, 5rem); max-width: 48rem; }
.exp-notes h2 { margin-bottom: 1.25rem; }
.policy-date { font-size: 0.85rem; color: var(--ink-soft); }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 4rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); max-width: var(--measure); font-size: 0.95rem; }
.post-nav a { text-decoration: none; color: var(--ink-soft); }
.post-nav a:hover { color: var(--accent); }

.notfound h1 { margin-bottom: 1.25rem; }

/* About: dictionary entry */
.entry { max-width: 48rem; }
.entry p { margin: 0; }
.entry-head { padding-bottom: 2rem; border-bottom: 1px solid var(--rule); }
.entry-word { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; font-size: clamp(3.5rem, 9vw, 5.5rem); line-height: 1; color: var(--ink); }
.entry-deva { font-family: var(--deva); font-size: 1.6rem; line-height: 1.3; color: var(--ink-soft); margin-top: 0.9rem !important; }
.entry-gram { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.6rem !important; }
.entry-body { margin: 0; }
.entry-row { display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); }
.entry-row dt { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); padding-top: 0.3em; }
.entry-row dd { margin: 0; }
.entry-row dd > * + * { margin-top: 0.7rem; }
.prose .senses { list-style: none; counter-reset: sense; padding: 0; margin: 0; }
.prose .senses li { counter-increment: sense; display: grid; grid-template-columns: 1.6rem 1fr; padding: 0.15rem 0; margin: 0; }
.prose .senses li::before { content: counter(sense); font-family: var(--mono); font-size: 0.78rem; color: var(--ink-faint); padding-top: 0.3em; }
.entry-source { font-size: 0.85rem; color: var(--ink-soft); margin-top: 1rem !important; }
.about-contact { margin-top: 3.5rem; font-size: 0.95rem; }
.about-contact .mono { font-size: 0.78rem; color: var(--ink-soft); margin-right: 1.25rem; }

/* Footer */
.site-footer { flex-shrink: 0; border-top: 1px solid var(--rule); background: var(--paper-2); padding: 28px 0 32px; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); }
.footer-inner { display: flex; align-items: baseline; }
.footer-inner p { margin: 0; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding-left: 20px; padding-right: 20px; }
  .site-nav { gap: 16px; }
  .brand-wordmark { font-size: 1.25rem; }
  .row { grid-template-columns: 1fr auto; gap: 4px 16px; }
  .row-meta { grid-column: 1 / -1; }
  .spec > div, .entry-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .contact-line { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
