/* Hexetera web: one design language with the game (2026-11-06)
   Tokens come straight from the game (Palette.cs, Hud.cs, Skeuo.cs, MenuUI.cs): the same charcoal well, steel
   surfaces, lime accent, Fredoka One display face, rounded flat-top hexes with the tile bevel, buttons that light
   their frame lime on hover and punch on press. */

:root {
  /* palette (Palette.cs) */
  --charcoal: #1A1A1A;   /* background, dark ink */
  --slot: #232121;       /* empty socket, one shade under a tile face */
  --steel: #2E2C2C;      /* quiet surface, button face */
  --mid: #3E3B3B;        /* borders, frames */
  --ink: #ECECE6;        /* text */
  --dim: rgba(236, 236, 230, .68);
  --lime: #9BE22D;       /* accent, primary button */
  --lime-hot: #ABE452;   /* primary button hovered: lime toward ink by 20 % (MenuUI.StyleButton) */
  --steel-hot: #393737;  /* button hovered: steel toward ink by 6 % */
  --danger: #F2552C;     /* the H */
  --gold: #F2BE2E;       /* the first E */
  --relay: #2F80ED;      /* the X */
  --core: #7CC93A;       /* Hextor, healthy */
  --panel: #0E0E0E;      /* the menu column */
  /* shape (Skeuo.cs: card radius 22 Figma px; the menu buttons' 10-unit rounding) */
  --r-btn: 12px;
  --r-card: 18px;
  --frame: 2px;
  /* depth: the tile bevel (rim 2 px, blur 4, 25 %) and the cards' drop shadow (y 6, blur 12, 19 %) */
  --bevel: inset 0 2px 4px rgba(255, 255, 255, .07), inset 0 -2px 4px rgba(0, 0, 0, .28);
  --drop: 0 6px 12px rgba(0, 0, 0, .19);
  /* motion (the game's tween curves) */
  --out-back: cubic-bezier(.34, 1.56, .64, 1);
  --out-quad: cubic-bezier(.5, 1, .89, 1);
  --t-fast: 120ms;
  --display: "Fredoka One", "Fredoka", system-ui, sans-serif;
  --text: "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--charcoal); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 400 17px/1.62 var(--text);
  background: transparent;   /* the html carries the charcoal, so the socket grid (z -1) shows through */
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* ---- the board: a field of empty sockets (flat-top, like the game's grid), fading out around the content */
.board-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("hex-sockets.svg");
  background-size: 84px auto;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 32%, transparent 0, rgba(0,0,0,.55) 55%, #000 100%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 32%, transparent 0, rgba(0,0,0,.55) 55%, #000 100%);
  opacity: .9;
}

main { max-width: 760px; margin: 0 auto; padding: 28px 20px 64px; }

/* ---- type */
h1, h2, h3, .display { font-family: var(--display); font-weight: 400; letter-spacing: .01em; }
h1 { font-size: 44px; line-height: 1.08; margin: 10px 0 10px; color: var(--ink); }
h2 { font-size: 24px; line-height: 1.2; margin: 0 0 12px; }
p { margin: 0 0 12px; }
b, strong { color: var(--ink); font-weight: 600; }
.lead { color: var(--dim); margin: 0 0 28px; font-size: 18px; }

a { color: var(--lime); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
    transition: text-decoration-thickness var(--t-fast), color var(--t-fast); }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 6px; }

/* ---- header (sub-pages): the logo lockup and the language switch */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); border-radius: 12px; }
.brand .hextor { width: 46px; height: 40px; }
.brand .word { font-size: 27px; }

/* ---- the wordmark: Fredoka One, H red, E gold, X blue, ETERA light (LogoReveal.LetterColor) */
.word { font-family: var(--display); line-height: 1; letter-spacing: .06em; white-space: nowrap; display: inline-flex; }
.word .ch { display: inline-block; color: var(--ink); will-change: transform;
            text-shadow: 0 .06em 0 rgba(0, 0, 0, .35); }
.word .ch:nth-child(1) { color: var(--danger); }
.word .ch:nth-child(2) { color: var(--gold); }
.word .ch:nth-child(3) { color: var(--relay); }
.word .ch:last-child { letter-spacing: 0; }

/* ---- Hextor (the game's Core face: rounded flat-top hex, healthy green, the tile bevel) */
.hextor { display: inline-block; position: relative; flex: none; }
.hextor svg { width: 100%; height: 100%; overflow: visible; display: block; }
.hextor .body { transform-box: fill-box; transform-origin: 50% 100%; }
.hextor .eyes { transform-box: fill-box; transform-origin: 50% 50%; }
.hextor .look-surprised, .hextor .mouth-oh, .hextor .mouth-grin { display: none; }
.hextor.surprised .look-normal, .hextor.surprised .mouth-smile { display: none; }
.hextor.surprised .look-surprised, .hextor.surprised .mouth-oh { display: inline; }
.hextor.grin .mouth-smile { display: none; }
.hextor.grin .mouth-grin { display: inline; }

/* ---- buttons: the game's menu button (steel face, 2 px frame, Fredoka One caps; hover lights the frame lime,
        press punches) */
.btn {
  --face: var(--steel); --frame-c: var(--mid); --label: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 22px;
  font: 400 18px/1.1 var(--display); letter-spacing: .03em; text-transform: uppercase; text-decoration: none;
  color: var(--label); background: var(--face);
  border: var(--frame) solid var(--frame-c); border-radius: var(--r-btn);
  box-shadow: var(--bevel), var(--drop);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--out-quad);
}
.btn:hover { text-decoration: none; }
@media (hover: hover) {
  .btn:hover { --face: var(--steel-hot); --frame-c: var(--lime); }
  .btn.primary:hover { --face: var(--lime-hot); --frame-c: var(--lime-hot); }
}
.btn:active { transform: scale(.97); }
.btn.punch { animation: punch 150ms var(--out-quad); }
.btn.primary { --face: var(--lime); --frame-c: var(--lime); --label: var(--charcoal); }
.btn .hint { font: 600 12px/1 var(--text); opacity: .7; text-transform: none; letter-spacing: 0; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@keyframes punch { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }

/* ---- language switch: a pill of two game buttons */
.lang { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: var(--frame) solid var(--mid); border-radius: 14px; }
.lang button {
  font: 400 14px/1 var(--display); letter-spacing: .05em; color: var(--dim); background: transparent;
  border: var(--frame) solid transparent; border-radius: 10px; padding: 8px 12px; min-height: 36px; min-width: 44px; cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
@media (hover: hover) { .lang button:hover { color: var(--ink); border-color: var(--mid); } }
.lang button[aria-pressed="true"] { background: var(--lime); color: var(--charcoal); border-color: var(--lime); }
.lang button:active { transform: scale(.95); }

/* ---- cards: the game's raised panels */
.card { background: var(--steel); border: var(--frame) solid var(--mid); border-radius: var(--r-card); box-shadow: var(--bevel), var(--drop); }
.summary { padding: 16px 20px; margin: 0 0 30px; border-color: var(--lime); }
.summary p { margin: 0; }
.contact { padding: 22px 22px 20px; margin-bottom: 36px; }
.contact p { margin: 10px 0 0; color: var(--dim); font-size: 15px; }
.mail { margin: 4px 0 4px; word-break: break-all; text-transform: none; letter-spacing: .01em; font-size: 20px; }

/* numbered sections: the number sits on a little tile */
.sec { display: flex; align-items: center; gap: 12px; margin: 34px 0 12px; }
.sec .num { position: relative; flex: none; width: 38px; height: 34px; display: grid; place-items: center;
            font: 16px/1 var(--display); color: var(--lime); }
.sec .num svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sec .num span { position: relative; }
.sec h2 { margin: 0; }
main > p, main > ul, .prose p, .prose ul { color: var(--dim); }
main > ul, .prose ul { padding-left: 22px; margin: 0 0 12px; }
main > ul li, .prose ul li { margin: 4px 0; }
main > ul li::marker, .prose ul li::marker { color: var(--lime); }

/* FAQ: game panels that open */
details.card { margin: 0 0 12px; overflow: hidden; transition: border-color var(--t-fast); }
@media (hover: hover) { details.card:hover { border-color: var(--lime); } }
details.card[open] { border-color: var(--lime); }
summary { cursor: pointer; list-style: none; padding: 16px 64px 16px 20px; font-weight: 600; position: relative; border-radius: var(--r-card); }
summary::-webkit-details-marker { display: none; }
summary .plus { position: absolute; right: 16px; top: 50%; width: 34px; height: 30px; margin-top: -15px; display: grid; place-items: center; }
summary .plus svg { position: absolute; inset: 0; width: 100%; height: 100%; }
summary .plus i { position: relative; display: block; width: 12px; height: 12px; transition: transform 220ms var(--out-back); }
summary .plus i::before, summary .plus i::after { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 2.5px; border-radius: 2px; background: var(--lime); }
summary .plus i::after { transform: rotate(90deg); }
details[open] summary .plus i { transform: rotate(135deg); }
summary:focus-visible { outline-offset: -3px; }
details .body { padding: 0 20px 16px; color: var(--dim); }
details .body p { margin: 0 0 10px; }

/* footer */
footer { margin-top: 44px; padding-top: 18px; border-top: var(--frame) solid var(--steel); color: var(--dim); font-size: 14px;
         display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
footer .mini { display: inline-flex; align-items: center; gap: 8px; }
footer .mini .hextor { width: 22px; height: 19px; }

/* bilingual content */
[data-lang] { display: none; }
html[lang="en"] [data-lang="en"], html[lang="es"] [data-lang="es"] { display: revert; }

/* ---- entrance: like the menu revealing after the intro (fade + small scale-up, one after another) */
.reveal { opacity: 0; transform: translateY(8px) scale(.98); }
.reveal.in { opacity: 1; transform: none; transition: opacity 300ms var(--out-quad), transform 300ms var(--out-back); transition-delay: var(--d, 0ms); }

/* ================================================================== landing */
.home { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
        text-align: center; padding: 32px 20px 40px; gap: 22px; }
.home .logo { --cap: clamp(34px, 9.6vw, 70px); position: relative; display: flex; flex-direction: column; align-items: center;
              gap: calc(var(--cap) * .6); cursor: default; }
.home .logo .hextor { width: calc(var(--cap) * 2.4); height: calc(var(--cap) * 2.4 * .866); cursor: pointer; }
.home .logo .word { font-size: calc(var(--cap) / .7); margin: 0; }
.home .logo .word .ch { cursor: pointer; }
.home .tagline { color: var(--dim); margin: 0; font-size: 18px; }
.home .links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.home .links .btn { min-width: 190px; }
.home .studio { margin-top: 18px; font-size: 13px; color: rgba(236, 236, 230, .45); letter-spacing: .02em; }

/* the intro's stage (tiles, sparks, rings), above everything while it plays */
.stage { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.tile { position: absolute; left: 0; top: 0; }
.tile .bounce, .tile .pop { position: absolute; inset: 0; transform-origin: 50% 50%; }
.tile svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tile .glyph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); line-height: 1; }
.fly { position: absolute; left: 0; top: 0; font-family: var(--display); line-height: 1; transform-origin: 50% 50%; will-change: transform; }
.spark { position: absolute; left: 0; top: 0; width: 8px; height: 8px; border-radius: 2px; }
.ring { position: absolute; left: 0; top: 0; border-radius: 50%; border: 3px solid var(--lime); }
.skip-hint { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 6; font: 400 13px/1 var(--display);
             letter-spacing: .08em; color: rgba(236, 236, 230, .4); text-transform: uppercase; transition: opacity 300ms; }
.intro-hidden { visibility: hidden; }

@media (max-width: 480px) {
  h1 { font-size: 36px; }
  .brand .word { font-size: 22px; } .brand .hextor { width: 38px; height: 33px; }
  .mail { font-size: 17px; }
  .home .links .btn { min-width: 0; flex: 1 1 140px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* before the script mounts the live Hextor, the static one fills the same box */
.hextor > img { width: 100%; height: 100%; display: block; }
