/* ============================================================
   MILU — One-person game studio
   "The Almanac" — warm, hand-made, editorial-indie
   ============================================================ */

:root {
  /* Surfaces — warm paper / parchment */
  --paper:        #f3e8d3;
  --paper-soft:   #f8efde;
  --paper-deep:   #e8d9bf;
  --paper-shade:  #d8c6a7;
  --paper-card:   #fbf5e7;

  /* Ink — warm dark, never pure black */
  --ink:          #221911;
  --ink-soft:     #4a3a2a;
  --ink-faint:    #8a7355;
  --ink-rule:     rgba(34, 25, 17, 0.18);

  /* Accents */
  --ember:        #c8703c;   /* warm orange — primary */
  --ember-deep:   #a85a2c;
  --rust:         #b53737;   /* doppit red */
  --gold:         #b8922e;
  --gold-soft:    #d6a85a;
  --ivy:          #5a8a5e;
  --plum:         #714060;
  --indigo:       #2a3a6a;

  /* Game-specific accents (used in tiles) */
  --c-doppit:           #b53737;
  --c-towndetective:    #c9a84c;
  --c-historical:       #d49146;
  --c-petcafe:          #c8703c;
  --c-stateoffortune:   #6a4a96;

  /* Type scale */
  --display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --body:    'Newsreader', 'Source Serif 4', Georgia, serif;
  --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Rhythm */
  --content-max: 1140px;
  --content-narrow: 780px;
  --gutter: clamp(20px, 4vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #1a1410;
    --paper-soft:   #221a14;
    --paper-deep:   #2a2018;
    --paper-shade:  #34281c;
    --paper-card:   #251c14;
    --ink:          #f0e3c6;
    --ink-soft:     #c4b393;
    --ink-faint:    #8a7355;
    --ink-rule:     rgba(240, 227, 198, 0.18);
    color-scheme: dark;
  }
}

/* ─── Reset / base ─────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  /* Paper grain — subtle SVG noise overlay */
  background-image:
    radial-gradient(circle at 20% 0%, rgba(200, 112, 60, 0.04), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(184, 146, 46, 0.05), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.15  0 0 0 0 0.12  0 0 0 0 0.08  0 0 0 0.07 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a {
  color: var(--ember-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(168, 90, 44, 0.4);
  transition: color 200ms ease, text-decoration-color 200ms ease;
}
a:hover { color: var(--rust); text-decoration-color: currentColor; }

::selection { background: var(--gold-soft); color: var(--ink); }

/* ─── Layout containers ────────────────────────────────────── */

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap-narrow {
  max-width: var(--content-narrow);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ─── Typography ───────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  font-variation-settings: "opsz" 144;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-variation-settings: "opsz" 36; }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-variation-settings: "opsz" 24; }

.display-italic { font-style: italic; }

.eyebrow {
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember-deep);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before, .eyebrow::after {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.eyebrow.solo::after { display: none; }

p { margin: 0 0 1em; }

.lede {
  font-size: clamp(1.15rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-soft);
  font-style: italic;
  font-family: var(--display);
  font-weight: 400;
  font-variation-settings: "opsz" 18;
}

.fine {
  font-size: 0.85rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* ─── Header / nav ─────────────────────────────────────────── */

.site-header {
  padding: 24px 0 0;
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, var(--paper) 70%, transparent);
  z-index: 50;
  backdrop-filter: blur(6px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 4px;
  padding-bottom: 16px;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.7rem;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-variation-settings: "opsz" 60;
}
.wordmark .dot {
  width: 7px;
  height: 7px;
  background: var(--rust);
  border-radius: 50%;
  display: inline-block;
  transform: translateY(-4px);
}
.wordmark:hover { color: var(--rust); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 32px);
}
.nav a {
  font-family: var(--display);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-decoration: none;
  font-style: italic;
  font-variation-settings: "opsz" 24;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 180ms ease, border-color 180ms ease;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--ember); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--rust); }

/* ─── Hero ─────────────────────────────────────────────────── */

.hero {
  padding: clamp(56px, 9vw, 120px) 0 clamp(40px, 6vw, 72px);
  position: relative;
}
.hero h1 {
  font-style: italic;
  font-weight: 400;
  max-width: 14ch;
  font-variation-settings: "opsz" 144;
}
.hero h1 em {
  font-style: normal;
  font-weight: 600;
  color: var(--rust);
}
.hero .lede {
  max-width: 38ch;
  margin-top: 22px;
}
.hero-decor {
  position: absolute;
  top: 10%;
  right: var(--gutter);
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  opacity: 0.6;
}

/* Dotted ornament (echoes Doppit pips) */
.pip-row {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 18px 0;
}
.pip-row .pip {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rust);
}
.pip-row .pip:nth-child(2) { background: var(--ember); }
.pip-row .pip:nth-child(3) { background: var(--gold); }
.pip-row .pip:nth-child(4) { background: var(--ivy); }
.pip-row .pip:nth-child(5) { background: var(--indigo); }

/* ─── Section rhythm ───────────────────────────────────────── */

section { padding: clamp(48px, 7vw, 96px) 0; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-style: italic;
  font-weight: 400;
  max-width: 22ch;
  font-variation-settings: "opsz" 56;
}
.section-head .aside {
  max-width: 32ch;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.rule {
  border: 0;
  border-top: 1px solid var(--ink-rule);
  margin: 0;
}
.rule-dotted {
  border: 0;
  height: 4px;
  background-image: radial-gradient(circle, var(--ink-faint) 1px, transparent 1.5px);
  background-size: 10px 4px;
  background-repeat: repeat-x;
  background-position: center;
  margin: 12px 0;
  opacity: 0.5;
}

/* ─── Games grid ───────────────────────────────────────────── */

.games {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper-card);
  border: 1px solid var(--ink-rule);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 1px 0 var(--paper-shade), 0 14px 32px -20px rgba(34, 25, 17, 0.35);
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.3, 1.2),
              box-shadow 280ms ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 1px 0 var(--paper-shade), 0 22px 44px -18px rgba(34, 25, 17, 0.45);
}

.card-art {
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--ink-rule);
}
.card-art svg { width: 100%; height: 100%; display: block; }

.card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-title {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.55rem;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 36;
}
.card-credit {
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.card-tag {
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember-deep);
  font-weight: 600;
}
.card-tag.coming { color: var(--plum); }
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.card-meta .arrow {
  font-family: var(--display);
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-style: italic;
  transition: transform 250ms ease, color 250ms ease;
}
.card:hover .arrow { transform: translateX(4px); color: var(--rust); }

.card-summary {
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* Grid spans */
.card.lg { grid-column: span 12; }
.card.md { grid-column: span 6; }
.card.sm { grid-column: span 4; }

@media (min-width: 900px) {
  .card.lg { grid-column: span 8; }
  .card.md { grid-column: span 4; }
  .card.sm { grid-column: span 4; }
}
@media (max-width: 700px) {
  .card.lg, .card.md, .card.sm { grid-column: span 12; }
}

/* ─── About preview ────────────────────────────────────────── */

.about-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
@media (max-width: 800px) { .about-preview { grid-template-columns: 1fr; } }

.about-portrait {
  aspect-ratio: 4 / 5;
  background: var(--paper-deep);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 0 var(--paper-shade), 0 30px 50px -30px rgba(34, 25, 17, 0.45);
}

.about-text h2 { margin-bottom: 18px; }
.about-text p { font-size: 1.05rem; line-height: 1.65; color: var(--ink-soft); }

/* ─── Press preview / contact ──────────────────────────────── */

.press-band {
  background: var(--paper-soft);
  border-top: 1px solid var(--ink-rule);
  border-bottom: 1px solid var(--ink-rule);
}
.press-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
@media (max-width: 800px) { .press-grid { grid-template-columns: 1fr; } }

.contact-card {
  background: var(--paper-card);
  border: 1px solid var(--ink-rule);
  border-radius: 6px;
  padding: 28px;
  box-shadow: 0 2px 0 var(--paper-shade);
}
.contact-card .email {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  font-weight: 500;
  color: var(--ink);
  word-break: break-all;
  font-variation-settings: "opsz" 36;
}
.contact-card .email a {
  text-decoration-color: var(--ember);
  color: var(--ink);
}
.contact-card .email a:hover { color: var(--rust); }

/* ─── Press screenshots ────────────────────────────────────── */

.press-shot {
  display: block;
  max-width: 520px;
  margin: 32px 0 12px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--ink-rule);
  box-shadow: 0 2px 0 var(--paper-shade), 0 14px 32px -20px rgba(34, 25, 17, 0.4);
}
.press-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
}

/* ─── Press kit list ───────────────────────────────────────── */

.press-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.press-list li {
  border-bottom: 1px dotted var(--ink-rule);
  padding-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}
.press-list strong {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.1rem;
}
.press-list .meta {
  font-size: 0.85rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* ─── Buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-style: italic;
  font-size: 1rem;
  font-weight: 500;
  color: var(--paper-soft);
  background: var(--ink);
  padding: 12px 22px;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: transform 180ms ease, background 200ms ease, color 200ms ease;
  letter-spacing: 0.01em;
}
.btn:hover { background: var(--rust); border-color: var(--rust); transform: translateY(-1px); }
.btn .arrow { transition: transform 220ms ease; }
.btn:hover .arrow { transform: translateX(4px); }

.btn.ghost {
  background: transparent;
  color: var(--ink);
}
.btn.ghost:hover { background: var(--ink); color: var(--paper-soft); }

/* ─── Footer ───────────────────────────────────────────────── */

.site-footer {
  padding: 48px 0 72px;
  border-top: 1px solid var(--ink-rule);
  margin-top: 48px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer .credit {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.site-footer .ornament {
  font-family: var(--display);
  color: var(--ink-faint);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ─── Detail page layout (per-game / about / press) ────────── */

.detail {
  padding: clamp(36px, 6vw, 72px) 0 clamp(48px, 7vw, 96px);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-art {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 0 var(--paper-shade), 0 26px 60px -28px rgba(34, 25, 17, 0.5);
}
.detail-art svg { width: 100%; height: 100%; }

.detail-text h1 {
  font-style: italic;
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  margin-bottom: 12px;
  font-variation-settings: "opsz" 96;
}
.detail-text h1 .ampersand {
  font-style: italic;
  color: var(--ember);
}
.detail-text .lede { margin-bottom: 24px; }

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--ink-rule);
  border-bottom: 1px solid var(--ink-rule);
  margin: 24px 0 32px;
}
.detail-meta dt {
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember-deep);
  font-weight: 600;
  margin-bottom: 6px;
}
.detail-meta dd {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  margin: 0;
  font-variation-settings: "opsz" 18;
}

.actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

article p { line-height: 1.7; }

article h2 {
  font-style: italic;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  margin: 36px 0 14px;
  font-variation-settings: "opsz" 36;
}

article ul { padding-left: 1.2em; margin: 0 0 1em; }
article li { margin-bottom: 0.4em; line-height: 1.6; }

/* ─── Subtle animations ────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade { animation: fadeUp 700ms cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.fade-1 { animation-delay: 90ms; }
.fade-2 { animation-delay: 180ms; }
.fade-3 { animation-delay: 270ms; }
.fade-4 { animation-delay: 360ms; }
.fade-5 { animation-delay: 450ms; }
.fade-6 { animation-delay: 540ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ─── Skip link ────────────────────────────────────────────── */

.skip {
  position: absolute;
  left: -9999px;
  top: -9999px;
}
.skip:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  background: var(--ink);
  color: var(--paper-soft);
  padding: 8px 14px;
  border-radius: 4px;
  z-index: 100;
}

/* ─── Tile-specific art tweaks ─────────────────────────────── */

.tile-doppit { background: #e8d9bf; }
.tile-doppit svg .pip { fill: #b53737; }

.tile-towndetective { background: #0c1019; }
.tile-historical { background: #1a1208; }
.tile-petcafe { background: #2a1f14; }
.tile-stateoffortune {
  background: radial-gradient(ellipse at 30% 20%, #2a2350, #0a0816 70%);
}
