/* ==========================================================================
   Owl Orchard — shared stylesheet
   One file, no build step, no dependencies. Light + dark.
   ========================================================================== */

/* ---------- fonts ---------- */

/* Manrope, variable weight 300-800, latin subset only. Self-hosted
   (SIL OFL 1.1) from public/assets/ — no third-party request. Headings only;
   body text stays on the system stack. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/assets/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */

:root {
  --bg:            #fbfaf7;
  --bg-band:       #f3f1ea;
  --surface:       #ffffff;
  --surface-2:     #faf9f5;
  --border:        #e5e1d7;
  --border-strong: #d5d0c2;
  --text:          #1e2419;
  --text-2:        #454e3e;
  --muted:         #6d7665;
  --brand:         #2f5d3f;
  --brand-2:       #3d7a52;
  --on-brand:      #ffffff;
  --accent:        var(--brand);
  --accent-tint:   rgba(47, 93, 63, 0.10);

  --shadow-sm: 0 1px 2px rgba(30, 36, 25, 0.05);
  --shadow:    0 1px 3px rgba(30, 36, 25, 0.05), 0 12px 32px -14px rgba(30, 36, 25, 0.20);
  --shadow-lg: 0 2px 6px rgba(30, 36, 25, 0.06), 0 28px 64px -24px rgba(30, 36, 25, 0.28);

  --radius:    18px;
  --radius-sm: 11px;

  --w-page:  1080px;
  --w-prose: 800px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter,
          Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Manrope", var(--font);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #12140f;
    --bg-band:       #171a13;
    --surface:       #1b1f17;
    --surface-2:     #20241a;
    --border:        #2d3226;
    --border-strong: #3c4333;
    --text:          #eae8de;
    --text-2:        #c2c8b8;
    --muted:         #98a18d;
    --brand:         #93cba3;
    --brand-2:       #addbb9;
    --on-brand:      #10160f;
    --accent:        var(--brand);
    --accent-tint:   rgba(147, 203, 163, 0.13);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow:    0 1px 3px rgba(0, 0, 0, 0.45), 0 12px 32px -14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.5), 0 28px 64px -24px rgba(0, 0, 0, 0.7);
  }
}

/* per-app accents — set on a section or card */
.t-hexchess  { --accent: #b9762c; --accent-tint: rgba(216, 142, 63, 0.14); }
.t-politica  { --accent: #1b5fa8; --accent-tint: rgba(31, 105, 187, 0.13); }
.t-prism     { --accent: #7248d8; --accent-tint: rgba(124, 92, 224, 0.14); }
.t-cardgames { --accent: #0f8f60; --accent-tint: rgba(18, 168, 112, 0.13); }
.t-poker     { --accent: #c9342c; --accent-tint: rgba(227, 59, 51, 0.13); }

@media (prefers-color-scheme: dark) {
  .t-hexchess  { --accent: #e2a463; }
  .t-politica  { --accent: #7db2ec; }
  .t-prism     { --accent: #b299f5; }
  .t-cardgames { --accent: #52ceA0; }
  .t-poker     { --accent: #f0837c; }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-2); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 0 0 10px 0;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 36px);
}

.prose { max-width: var(--w-prose); }

.section { padding: clamp(52px, 8vw, 88px) 0; }
.section-sm { padding: clamp(36px, 5vw, 56px) 0; }

.band {
  background: var(--bg-band);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.rule { border: 0; border-top: 1px solid var(--border); margin: clamp(40px, 6vw, 64px) 0; }

/* ---------- type ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.18;
  letter-spacing: -0.021em;
  margin: 0 0 0.5em;
  font-weight: 700;
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: clamp(2.05rem, 1.5rem + 2.4vw, 3.1rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.85rem); margin-top: 0; }
h3 { font-size: 1.13rem; letter-spacing: -0.012em; margin-bottom: 0.35em; }
h4 { font-size: 1rem; letter-spacing: 0; }

.prose h2 { margin-top: 2.1em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.9em; }

p { margin: 0 0 1.05em; color: var(--text-2); }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.28rem);
  line-height: 1.55;
  color: var(--text-2);
  margin-bottom: 1.4em;
  text-wrap: pretty;
}

.eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 640;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9em;
}

.small { font-size: 0.92rem; color: var(--muted); }

ul, ol { padding-left: 1.35em; margin: 0 0 1.05em; color: var(--text-2); }
li { margin-bottom: 0.45em; }
li::marker { color: var(--muted); }

strong { color: var(--text); font-weight: 630; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

/* ---------- header ---------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  header.site { background: var(--bg); }
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 10px 28px;
  min-height: 70px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.015em;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
  padding: 4px 0;
}

.brand svg { width: 38px; height: 20px; color: var(--brand); flex: none; }
.brand:hover { color: var(--brand); }

nav.site {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  align-items: center;
}

nav.site a {
  color: var(--muted);
  text-decoration: none;
  font-size: 1.03rem;
  font-weight: 520;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

nav.site a:hover { color: var(--text); }
nav.site a[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 9vw, 104px) 0 clamp(44px, 7vw, 76px);
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 130%;
  background:
    radial-gradient(58% 62% at 18% 8%, var(--accent-tint), transparent 68%),
    radial-gradient(46% 56% at 88% 4%, var(--accent-tint), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero .wrap { position: relative; z-index: 1; }

.hero h1 { margin-bottom: 0.42em; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1;
  padding: 13px 22px;
  border-radius: 11px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease,
              border-color 0.15s ease, color 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--on-brand);
}
.btn-primary:hover {
  color: var(--on-brand);
  filter: brightness(1.08);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.btn[aria-disabled="true"] {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--border);
  cursor: default;
  box-shadow: none;
}
.btn[aria-disabled="true"]:active { transform: none; }

/* ---------- stat strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: clamp(34px, 5vw, 52px);
}

.stat { background: var(--surface); padding: 20px 22px; }
.stat dt { font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.stat dd {
  margin: 0;
  font-size: 1.42rem;
  font-weight: 660;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ---------- app grid ---------- */

.appgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(16px, 2vw, 22px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  color: inherit;
}
.card:hover::before { opacity: 1; }

.card-top { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }

.card img.icon {
  width: 64px;
  height: 64px;
  flex: none;
}

.card h3 { margin: 0 0 3px; font-size: 1.08rem; }
.card .card-sub { margin: 0; font-size: 0.85rem; color: var(--muted); }
.card p.desc { font-size: 0.95rem; margin: 0 0 16px; flex: 1; }

.card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.card .more {
  margin-left: auto;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- pills ---------- */

.pills { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 4px; padding: 0; list-style: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.755rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 10px;
  margin: 0;
  white-space: nowrap;
}

.pill-live { color: var(--accent); background: var(--accent-tint); border-color: transparent; }
.pill-soon { color: var(--muted); border-style: dashed; }

/* ---------- app detail hero ---------- */

.app-head {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 28px);
  margin-bottom: 22px;
}

.app-head img {
  width: clamp(84px, 12vw, 116px);
  height: clamp(84px, 12vw, 116px);
  flex: none;
}

.app-head h1 { margin: 0 0 6px; }
.app-head .tagline { margin: 0 0 10px; color: var(--muted); font-size: 1.02rem; }

/* ---------- panorama banner ---------- */

.pano {
  display: flex;
  justify-content: center;
  justify-content: safe center;
  overflow-x: auto;
  overflow-y: hidden;
  line-height: 0;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.pano img {
  height: clamp(260px, 34vw, 430px);
  width: auto;
  max-width: none;
  flex: none;
}

.pano-hint {
  margin: 11px 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

/* only shown once JS confirms the banner actually overflows */
.pano-hint span { display: none; }
.pano-hint.is-scrollable span { display: inline; }

/* ---------- feature grid ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: clamp(20px, 2.6vw, 30px);
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.features > li { margin: 0; }
.features h3 { margin: 0 0 5px; font-size: 1.02rem; }
.features h3::before {
  content: "";
  display: block;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  margin-bottom: 11px;
}
.features p { font-size: 0.94rem; margin: 0; }

/* ---------- definition table ---------- */

.deftable {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 0;
  background: var(--surface);
}

.deftable > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) 1fr;
  gap: 16px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  font-size: 0.94rem;
}
.deftable > div:first-child { border-top: 0; }
.deftable dt { color: var(--muted); margin: 0; }
.deftable dd { margin: 0; color: var(--text-2); }

@media (max-width: 520px) {
  .deftable > div { grid-template-columns: 1fr; gap: 3px; }
}

/* ---------- callout ---------- */

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 22px;
  margin: 26px 0;
}
.callout p { margin-bottom: 0.6em; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */

footer.site {
  border-top: 1px solid var(--border);
  background: var(--bg-band);
  padding: clamp(40px, 6vw, 58px) 0 34px;
  font-size: 0.93rem;
  color: var(--muted);
}

.foot-grid {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) repeat(auto-fit, minmax(140px, 1fr));
  gap: 30px 34px;
}

.foot-grid h4 {
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 640;
}

.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: 7px; }
.foot-grid a { color: var(--text-2); text-decoration: none; }
.foot-grid a:hover { color: var(--brand); text-decoration: underline; }
.foot-grid p { color: var(--muted); font-size: 0.92rem; }

.foot-brand { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.foot-brand svg { width: 33px; height: 18px; color: var(--brand); }
.foot-brand span { font-weight: 640; color: var(--text); font-size: 1rem; }

.foot-legal {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  font-size: 0.87rem;
}
.foot-legal p { margin: 0; }
.foot-legal a { color: var(--muted); }

/* ---------- reveal on scroll (JS-gated) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 620px) {
  body { font-size: 16px; }
  .app-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .card { padding: 20px; }
  .hero-actions .btn { flex: 1 1 100%; }
}
