/* Quarterlight — studio site. Shares the games' night-sky design language.
   Palette from _brand/brand_kit.md. */
:root {
  --petrol:   #1F3D4A;
  --petrol-2: #17313c;
  --petrol-3: #12252e;
  --graphite: #22262E;
  --ivory:    #F1EDE3;
  --brass:    #B89968;
  --smoke:    #7B8088;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.33, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 1040px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--petrol-3); color: var(--ivory);
  font-family: var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  line-height: 1.6; overflow-x: hidden; position: relative;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(45% 32% at 26% 30%, rgba(184,153,104,0.07), transparent 70%),
    radial-gradient(40% 30% at 78% 18%, rgba(111,168,199,0.06), transparent 70%),
    radial-gradient(130% 90% at 50% 22%, #295061 0%, #1f3d4a 32%, #17313c 60%, #10222b 100%);
  background-size: 200% 200%, 220% 220%, 100% 100%;
  background-position: 0% 0%, 100% 0%, 0 0;
  animation: sky-drift 46s ease-in-out infinite;
}
@keyframes sky-drift { 0%,100%{background-position:0% 0%,100% 0%,0 0} 50%{background-position:60% 40%,30% 70%,0 0} }
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, rgba(241,237,227,0.5), transparent 60%),
    radial-gradient(1px 1px at 27% 42%, rgba(241,237,227,0.3), transparent 60%),
    radial-gradient(1.2px 1.2px at 41% 12%, rgba(241,237,227,0.4), transparent 60%),
    radial-gradient(1.6px 1.6px at 68% 8%, rgba(184,153,104,0.5), transparent 60%),
    radial-gradient(1px 1px at 74% 48%, rgba(241,237,227,0.3), transparent 60%),
    radial-gradient(1.3px 1.3px at 86% 22%, rgba(241,237,227,0.4), transparent 60%),
    radial-gradient(1px 1px at 9% 66%, rgba(241,237,227,0.3), transparent 60%),
    radial-gradient(1.5px 1.5px at 33% 78%, rgba(184,153,104,0.35), transparent 60%),
    radial-gradient(1px 1px at 63% 72%, rgba(241,237,227,0.3), transparent 60%),
    radial-gradient(1px 1px at 82% 84%, rgba(241,237,227,0.28), transparent 60%);
  animation: twinkle 7s ease-in-out infinite;
}
@keyframes twinkle { 0%,100%{opacity:0.82} 50%{opacity:1} }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* --- polish: brand selection + keyboard focus --- */
::selection { background: var(--brass); color: var(--graphite); }
a:focus-visible, .btn:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 2px;
}

/* --- nav --- */
.nav {
  position: sticky; top: 0; z-index: 20; border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.nav.scrolled {
  background: rgba(16,34,43,0.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(184,153,104,0.16); box-shadow: 0 10px 30px -20px rgba(0,0,0,0.8);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; max-width: var(--wrap); margin: 0 auto;
}
@media (max-width: 560px) { .nav-links a:not(.cta) { display: none; } }
.wordmark {
  font-family: var(--serif); font-weight: 500; font-variant: small-caps;
  letter-spacing: 0.32em; font-size: 17px; color: var(--ivory); text-decoration: none; padding-left: 0.32em;
}
.wordmark .notch { color: var(--brass); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { font-size: 13px; letter-spacing: 0.04em; color: var(--smoke); text-decoration: none; transition: color 0.3s var(--ease); }
.nav-links a:hover { color: var(--ivory); }
.nav-links a.cta { color: var(--brass); }
.nav-links a.cta:hover { color: var(--ivory); }

/* --- buttons --- */
.btn {
  display: inline-block; font-family: var(--sans); font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ivory); background: transparent;
  border: 1px solid var(--brass); border-radius: 3px; padding: 14px 30px; cursor: pointer;
  text-decoration: none; transition: background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:hover { background: var(--brass); color: var(--graphite); box-shadow: 0 8px 26px -10px rgba(184,153,104,0.6); }
.btn.ghost { border-color: rgba(184,153,104,0.4); }

/* --- hero --- */
.hero-shell { position: relative; }
#sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.85; }
.hero { text-align: center; padding: 90px 0 70px; position: relative; z-index: 1; }
.hero .eyebrow { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass); margin-bottom: 26px; }
.hero h1 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(46px, 9vw, 92px); line-height: 1.02;
  letter-spacing: 0.005em; margin-bottom: 24px;
}
.hero h1 em { font-style: italic; color: var(--brass); }
.hero .lede { font-size: clamp(15px, 2.2vw, 18px); color: var(--ivory); opacity: 0.82; max-width: 560px; margin: 0 auto 38px; }
.hero .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .microcta { margin-top: 20px; font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--smoke); }

/* --- section framing --- */
.section { padding: 70px 0; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head .k { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--smoke); margin-bottom: 14px; }
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 5vw, 44px); line-height: 1.1; }
.section-head p { color: var(--smoke); max-width: 520px; margin: 14px auto 0; font-size: 15px; }
.rule { height: 1px; max-width: var(--wrap); margin: 0 auto; background: linear-gradient(90deg, transparent, rgba(184,153,104,0.4) 15%, rgba(184,153,104,0.4) 85%, transparent); opacity: 0.6; }

/* --- games grid --- */
.games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 620px) { .games { grid-template-columns: 1fr; } }
.gcard {
  position: relative; display: block; padding: 26px 26px 24px; border-radius: 12px; overflow: hidden;
  text-decoration: none; color: var(--ivory);
  background: radial-gradient(130% 120% at 0% 0%, rgba(255,255,255,0.035), transparent 55%), linear-gradient(180deg, rgba(23,49,60,0.7), rgba(16,34,43,0.8));
  border: 1px solid rgba(184,153,104,0.18);
  transition: transform 0.4s var(--ease-out), border-color 0.35s var(--ease), box-shadow 0.4s var(--ease);
}
.gcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--hue); box-shadow: 0 0 22px 1px var(--hue); opacity: 0.8; }
.gcard:hover { transform: translateY(-3px); border-color: rgba(184,153,104,0.5); box-shadow: 0 22px 46px -26px rgba(0,0,0,0.85); }
.gcard .gtop { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.gcard .gletter { font-family: var(--serif); font-weight: 600; font-size: 34px; color: var(--hue); line-height: 1; text-shadow: 0 0 20px color-mix(in srgb, var(--hue) 70%, transparent); }
.gcard .gname { font-family: var(--serif); font-size: 27px; letter-spacing: 0.01em; }
.gcard .gkind { margin-left: auto; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); }
.gcard .gdesc { font-size: 14px; color: var(--smoke); line-height: 1.5; }
.more { text-align: center; color: var(--smoke); font-size: 13px; letter-spacing: 0.02em; margin-top: 32px; font-style: italic; font-family: var(--serif); font-size: 17px; }
.collect-note { text-align: center; color: var(--smoke); font-size: 14px; line-height: 1.6; margin-top: 12px; max-width: 520px; margin-left: auto; margin-right: auto; }
.collect-note a { color: var(--brass); text-decoration: none; border-bottom: 1px solid rgba(184,153,104,0.35); transition: border-color 0.3s var(--ease); }
.collect-note a:hover { border-color: var(--brass); }

/* --- manifesto --- */
.manifesto p { max-width: 60ch; margin: 0 auto; color: var(--smoke); font-size: 16px; line-height: 1.7; }
.manifesto p + p { margin-top: 18px; }
.manifesto .maker { margin-top: 26px; font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--brass); letter-spacing: 0.01em; }

/* --- features trio --- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 720px) { .features { grid-template-columns: 1fr; gap: 18px; } }
.feat { text-align: center; padding: 14px 10px; }
.feat .fmark { font-family: var(--serif); font-size: 30px; color: var(--brass); line-height: 1; margin-bottom: 14px; }
.feat h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin-bottom: 8px; }
.feat p { color: var(--smoke); font-size: 14px; line-height: 1.55; }

/* --- join (newsletter + support) --- */
.join { text-align: center; }
.news { display: flex; gap: 10px; max-width: 440px; margin: 26px auto 0; }
@media (max-width: 480px) { .news { flex-direction: column; } }
.news input {
  flex: 1; background: rgba(255,255,255,0.03); border: 1px solid rgba(184,153,104,0.3);
  border-radius: 3px; color: var(--ivory); padding: 14px 16px; font-family: var(--sans); font-size: 14px;
  outline: none; transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.news input:focus { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(184,153,104,0.12); }
.news input::placeholder { color: var(--smoke); }
.news .btn { white-space: nowrap; cursor: pointer; }
.subnote { color: var(--smoke); font-size: 12px; margin-top: 14px; letter-spacing: 0.02em; }
.subnote.ok { color: var(--brass); }
.support { margin-top: 52px; padding-top: 40px; border-top: 1px solid rgba(184,153,104,0.14); }
.support h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin-bottom: 10px; }
.support p { color: var(--smoke); font-size: 14px; max-width: 460px; margin: 0 auto 20px; }

/* --- footer --- */
.footer { padding: 60px 0 46px; text-align: center; }
.footer .wordmark { font-size: 15px; display: inline-block; margin-bottom: 14px; }
.footer p { color: var(--smoke); font-size: 12.5px; letter-spacing: 0.03em; }
.footer .made { margin-top: 8px; opacity: 0.7; }

/* --- scroll reveal --- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } .reveal { opacity: 1; transform: none; transition: none; } }
