/* ============================================================
   Quietmill brand site — design system
   Palette: warm paper / deep ink, wheat-gold + mill-blue accents
   Type: Fraunces (display) + Inter (text)
   ============================================================ */

:root {
  --paper: #faf8f5;
  --paper-2: #f1eee8;
  --ink: #10151d;
  --ink-2: #2a3340;
  --fg: #1c242e;
  --muted: #5c6674;
  --line: #e3ded4;
  --gold: #c98a2b;
  --gold-soft: #f3e3c6;
  --blue: #0b5fff;
  --blue-ink: #0a49c2;
  --card: #ffffff;
  --hero-fg: #f2f0ea;
  --hero-muted: #a8b0bc;
  --shadow: 0 1px 2px rgba(20, 26, 34, 0.05), 0 8px 28px rgba(20, 26, 34, 0.07);
  --shadow-lift: 0 2px 4px rgba(20, 26, 34, 0.06), 0 18px 44px rgba(20, 26, 34, 0.13);
  --radius: 14px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10151c;
    --paper-2: #0c1017;
    --ink: #0b0f15;
    --ink-2: #10151c;
    --fg: #e6e9ee;
    --muted: #98a3b1;
    --line: #27303c;
    --gold: #e0a94e;
    --gold-soft: #3a2f1a;
    --blue: #5b93ff;
    --blue-ink: #85adff;
    --card: #171f29;
    --hero-fg: #eef0f4;
    --hero-muted: #9aa5b3;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 44px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-text);
  background: var(--paper);
  color: var(--fg);
  line-height: 1.65;
  font-size: 16.5px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.4rem; }
.wrap-narrow { max-width: 780px; margin: 0 auto; padding: 0 1.4rem; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 3.9rem); margin: 0 0 1.1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 0.9rem; }
h3 { font-size: 1.25rem; margin: 0 0 0.4rem; }

.accent { color: var(--gold); font-style: italic; }
.lede { font-size: clamp(1.08rem, 1.8vw, 1.28rem); color: var(--muted); max-width: 40em; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .bar {
  max-width: 1080px; margin: 0 auto; padding: 0.85rem 1.4rem;
  display: flex; align-items: center; gap: 1.4rem;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1.22rem;
  color: var(--fg); text-decoration: none; letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.brand .mark-sails { transform-origin: 32px 32px; transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.brand:hover .mark-sails { transform: rotate(90deg); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; }
.site-nav a {
  color: var(--muted); font-size: 0.95rem; font-weight: 500; text-decoration: none;
  padding: 0.2rem 0; border-bottom: 2px solid transparent; transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--fg); }
.site-nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--gold); }
.site-nav .nav-cta, .site-nav a.nav-cta[aria-current="page"] {
  color: var(--paper); background: var(--fg); border: none; border-bottom: none;
  padding: 0.45rem 1rem; border-radius: 999px; transition: transform 0.15s ease, opacity 0.2s ease;
}
.site-nav .nav-cta:hover { color: var(--paper); opacity: 0.9; transform: translateY(-1px); }

.nav-toggle {
  display: none; margin-left: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; width: 42px; height: 42px; padding: 0; cursor: pointer; color: var(--fg);
  transition: border-color 0.2s ease;
}
.nav-toggle:active { border-color: var(--gold); }
.nav-toggle span {
  display: block; width: 18px; height: 2px; border-radius: 2px;
  background: var(--fg); margin: 4px auto; padding: 0;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.18s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0.4); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: calc(100% + 8px); left: 0.9rem; right: 0.9rem;
    display: flex; flex-direction: column; align-items: stretch; gap: 0.15rem;
    background: color-mix(in srgb, var(--paper) 98%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--line); border-radius: 16px;
    padding: 0.6rem; box-shadow: var(--shadow-lift);
    opacity: 0; visibility: hidden; transform: translateY(-10px) scale(0.98);
    transform-origin: top right; pointer-events: none;
    transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.24s;
  }
  .site-nav.open {
    opacity: 1; visibility: visible; transform: none; pointer-events: auto;
    transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .site-nav a {
    padding: 0.7rem 0.9rem; font-size: 1.04rem; border-radius: 10px;
    border-bottom: none; color: var(--fg);
  }
  .site-nav a:active { background: var(--paper-2); }
  .site-nav a[aria-current="page"] { border-bottom: none; background: var(--gold-soft); color: var(--fg); }
  .site-nav .nav-cta {
    margin-top: 0.4rem; text-align: center; padding: 0.7rem 0.9rem; border-radius: 12px;
  }
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--ink); color: var(--hero-fg);
}
.hero .wrap { position: relative; z-index: 2; padding-top: clamp(4rem, 10vw, 7.5rem); padding-bottom: clamp(4rem, 9vw, 6.5rem); }
/* .hero-mill--contained lives INSIDE .hero .wrap so it anchors to the
   content column (not the viewport edge) on wide screens */
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.4rem;
}
.hero .eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--gold); display: inline-block; }
.hero h1 { color: var(--hero-fg); max-width: 15em; }
.hero .lede { color: var(--hero-muted); }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.32; z-index: 1; pointer-events: none; }
.hero-orb.a { width: 480px; height: 480px; right: -140px; top: -40px; background: radial-gradient(circle, rgba(11, 95, 255, 0.38) 0%, rgba(11, 95, 255, 0.14) 38%, transparent 62%); animation: drift-a 16s ease-in-out infinite alternate; }
.hero-orb.b { width: 420px; height: 420px; left: -160px; bottom: -220px; background: radial-gradient(circle, rgba(201, 138, 43, 0.3) 0%, rgba(201, 138, 43, 0.11) 38%, transparent 62%); animation: drift-b 19s ease-in-out infinite alternate; }
@media (max-width: 760px) { .hero-orb { opacity: 0.18; filter: blur(80px); } }
@keyframes drift-a { from { transform: translate(0, 0) scale(1); } to { transform: translate(-60px, 40px) scale(1.12); } }
@keyframes drift-b { from { transform: translate(0, 0) scale(1); } to { transform: translate(50px, -40px) scale(1.08); } }
.hero-grain { position: absolute; inset: 0; z-index: 1; opacity: 0.16; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E"); }

.hero-mill {
  position: absolute; right: clamp(-80px, 4vw, 90px); bottom: -70px; z-index: 1;
  opacity: 0.09; pointer-events: none;
}
@media (prefers-color-scheme: dark) { .hero-mill { opacity: 0.15; } }
.hero-mill--contained { bottom: 0; right: clamp(8px, 2vw, 48px); z-index: -1; }
.hero-mill--sm { width: 210px; height: 210px; opacity: 0.14; }
@media (prefers-color-scheme: dark) { .hero-mill--sm { opacity: 0.24; } }
@media (max-width: 760px) { .hero-mill--contained { width: 240px; height: 240px; right: 2vw; } }
.hero-mill .mill-spin { transform-origin: 32px 32px; animation: mill-turn 46s linear infinite; }
@keyframes mill-turn { to { transform: rotate(360deg); } }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.98rem; text-decoration: none;
  padding: 0.72rem 1.45rem; border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: #171207; box-shadow: 0 6px 22px rgba(201, 138, 43, 0.35); }
.btn-gold:hover { box-shadow: 0 10px 28px rgba(201, 138, 43, 0.45); color: #171207; }
.btn-ghost { color: var(--hero-fg); border: 1px solid rgba(255, 255, 255, 0.28); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.6); color: var(--hero-fg); }
.btn-blue { background: var(--blue); color: #fff; box-shadow: 0 6px 22px rgba(11, 95, 255, 0.3); }
.btn-blue:hover { color: #fff; box-shadow: 0 10px 28px rgba(11, 95, 255, 0.4); }
.btn-outline { color: var(--fg); border: 1px solid var(--line); background: var(--card); }
.btn-outline:hover { color: var(--fg); border-color: var(--muted); }

/* honest stat strip */
.stat-strip {
  display: flex; flex-wrap: wrap; gap: clamp(1.2rem, 4vw, 3.4rem);
  margin-top: clamp(2.4rem, 5vw, 3.6rem); padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.stat-strip .stat { min-width: 130px; }
.stat-strip .num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--hero-fg); line-height: 1.1; }
.stat-strip .num em { font-style: normal; color: var(--gold); }
.stat-strip .lbl { font-size: 0.86rem; color: var(--hero-muted); margin-top: 0.15rem; }

/* ---------- sections ---------- */
section.block { padding: clamp(3.2rem, 7vw, 5.5rem) 0; }
section.block.tint { background: var(--paper-2); }
.kicker {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 0.7rem;
}
.section-head { max-width: 620px; margin-bottom: 2.4rem; }
.section-head p { color: var(--muted); margin: 0; }

/* cards */
.grid { display: grid; gap: 1.2rem; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.platforms { grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); }
@media (max-width: 880px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid.cols-3, .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.4rem; box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card .ico {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold); margin-bottom: 0.9rem; font-size: 1.15rem;
}
.card p { color: var(--muted); font-size: 0.97rem; margin: 0.3rem 0 0; }
.card h3 a { color: inherit; }

/* platform tiles */
.platform {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.05rem 1.05rem; box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.platform:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.platform .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.platform .dot.live { background: #1f9d55; box-shadow: 0 0 0 4px rgba(31, 157, 85, 0.16); }
.platform .dot.soon { background: var(--gold); box-shadow: 0 0 0 4px rgba(201, 138, 43, 0.16); }
.platform .name { font-weight: 600; white-space: nowrap; }
.platform .state { margin-left: auto; font-size: 0.68rem; color: var(--muted); letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; }

/* pills */
.pill {
  display: inline-block; font-size: 0.78rem; font-weight: 500;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.16rem 0.75rem; color: var(--muted); margin: 0 0.4rem 0.5rem 0;
  background: var(--paper);
}

/* featured app split */
.feature-split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.6rem, 4vw, 3.2rem); align-items: center; }
@media (max-width: 880px) { .feature-split { grid-template-columns: 1fr; } }
.shot {
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow-lift); overflow: hidden; background: var(--card);
}
.shot img { display: block; width: 100%; height: auto; }

/* mock product panel (illustrative, theme-native) */
.mockpanel {
  background: var(--ink-2); border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius); box-shadow: var(--shadow-lift);
  padding: 1.3rem 1.4rem; color: #dfe4ea; font-size: 0.88rem;
  transform: rotate(-1.2deg);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mockpanel:hover { transform: rotate(0deg) translateY(-3px); }
.mockpanel .mp-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.mockpanel .mp-title { font-weight: 700; color: #f2f0ea; letter-spacing: 0.01em; }
.mockpanel .mp-status {
  margin-left: auto; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold); border: 1px solid rgba(224, 169, 78, 0.45); border-radius: 999px; padding: 0.14rem 0.65rem;
  white-space: nowrap;
}
.mockpanel .mp-row { display: flex; align-items: center; gap: 0.65rem; padding: 0.42rem 0; }
.mockpanel .mp-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 0.62rem; font-weight: 700; color: #10151c;
}
.mockpanel .mp-avatar.a { background: #e8b563; }
.mockpanel .mp-avatar.b { background: #7fa8ff; }
.mockpanel .mp-pill {
  margin-left: auto; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em;
  color: #9aa5b3; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 4px; padding: 0.1rem 0.45rem;
}
.mockpanel .mp-divider { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.09); margin: 0.9rem 0; }
.mockpanel .mp-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #7d8894; margin-bottom: 0.5rem; }
.mockpanel .mp-log { display: grid; gap: 0.45rem; }
.mockpanel .mp-log div { display: flex; gap: 0.7rem; align-items: baseline; }
.mockpanel .mp-time { color: #6f7a87; font-variant-numeric: tabular-nums; font-size: 0.78rem; flex: none; }
.mockpanel .mp-log .hl { color: var(--gold); }
.mockpanel .mp-note { margin-top: 1rem; font-size: 0.72rem; color: #6f7a87; text-align: right; font-style: italic; }

/* checklist */
ul.checks { list-style: none; padding: 0; margin: 1.1rem 0 0; }
ul.checks li { padding-left: 1.9rem; position: relative; margin: 0.65rem 0; color: var(--fg); }
ul.checks li::before {
  content: "✓"; position: absolute; left: 0; top: 0.05em;
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: var(--gold-soft); color: var(--gold);
  font-size: 0.75rem; font-weight: 800; display: grid; place-items: center;
}
ul.checks li span { color: var(--muted); }

/* principles (numbered editorial list) */
.principles { counter-reset: p; display: grid; gap: 0; margin-top: 1rem; }
.principle {
  counter-increment: p; display: grid; grid-template-columns: 84px 1fr; gap: 1.4rem;
  padding: 1.9rem 0; border-top: 1px solid var(--line);
}
.principle:last-child { border-bottom: 1px solid var(--line); }
.principle::before {
  content: "0" counter(p);
  font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; color: var(--gold);
  line-height: 1;
}
.principle h3 { margin-top: 0.15rem; }
.principle p { color: var(--muted); margin: 0.4rem 0 0; max-width: 44em; }
@media (max-width: 600px) { .principle { grid-template-columns: 1fr; gap: 0.4rem; } }

/* CTA band */
.cta-band { background: var(--ink); color: var(--hero-fg); position: relative; overflow: hidden; }
.cta-band .hero-orb.a { top: auto; bottom: -260px; }
.cta-band .hero-orb.b { bottom: -260px; }
.cta-band .wrap { position: relative; z-index: 2; padding-top: clamp(3rem, 6vw, 4.5rem); padding-bottom: clamp(3rem, 6vw, 4.5rem); text-align: center; }
.cta-band h2 { color: var(--hero-fg); }
.cta-band p { color: var(--hero-muted); max-width: 34em; margin: 0 auto; }
.cta-band .btn-row { justify-content: center; }

/* prose pages */
.prose { max-width: 720px; }
.prose p { color: var(--fg); }
.prose p.muted, .muted { color: var(--muted); }
.prose h2 { margin-top: 2.6rem; }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 1.6rem 0 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.6rem 1.6rem; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 0.4em;
  width: 12px; height: 12px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}
.timeline .when { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.timeline p { margin: 0.2rem 0 0; color: var(--muted); }

/* contact cards */
.contact-card a.big { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; word-break: break-all; }

/* footer */
.site-footer { background: var(--ink); color: var(--hero-muted); margin-top: 0; }
.site-footer .wrap { padding-top: 3rem; padding-bottom: 2.2rem; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer .brand { color: var(--hero-fg); }
.site-footer p { font-size: 0.92rem; max-width: 30em; }
.site-footer h4 { color: var(--hero-fg); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; margin: 0.4rem 0 0.8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0.45rem 0; }
.site-footer a { color: var(--hero-muted); }
.site-footer a:hover { color: var(--hero-fg); }
.site-footer .legal {
  border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 2.2rem; padding-top: 1.3rem;
  font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
}

/* scroll reveal — progressive enhancement only.
   Content is visible by default; the tiny head script adds html.anim
   (skipped for reduced-motion), and site.js force-reveals leftovers on a
   fallback timer, so no-JS users, crawlers and headless renders always
   see the full page. */
html.anim .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.65s ease, transform 0.65s ease; transition-delay: var(--d, 0s); }
html.anim .reveal.in { opacity: 1; transform: none; }

/* 404 */
.notfound { min-height: 58vh; display: grid; place-items: center; text-align: center; padding: 4rem 1.4rem; }
.notfound .code { font-family: var(--font-display); font-size: clamp(5rem, 16vw, 9rem); font-weight: 700; color: var(--gold); line-height: 1; }
