/* <Big Yikes> design system v4: tactile. Read DESIGN.md (reference lock + decision ledger) before editing.
   Reference lock: Duolingo's product UI owns the component language (buttons on a darker lip that sink when pressed,
   2px outlines with a heavier bottom edge instead of shadows, chunky rounded type, thick progress bars, medal ranks);
   Discord lends headline scale. Big Yikes keeps its own charcoal + yellow, logos, mascots and Valheim art.
   Rules kept from the Figma kit "BY Tactile": one yellow primary action per task area, a selected marker for
   navigation, status always in words, targets >= 44px, 120ms feedback; pressing moves only by transform. */

:root {
  color-scheme: dark;

  /* Canvas: the charcoal of the guild icon */
  --ground: #090908;       /* by-tactile-bg-canvas: near-black, so yellow and white read at full strength */
  --ground-2: #10100E;     /* alternate band */
  --surface: #171715;      /* dark enamel: secondary actions, interactive containers */
  --surface-2: #222220;    /* hover / raised enamel */
  --ink: #FBFBF6;          /* by-tactile-text-primary */
  --muted: #B4B4AB;        /* by-tactile-text-secondary */
  --line: #2E2E2A;         /* 2px outlines and dividers */
  --line-strong: #66665E;  /* control outlines + their lip (3:1 against canvas and enamel) */

  /* Big Yikes yellow (logo + bot role). Role: logo, the one primary action per area, focus ring, selected marker. Nothing else. */
  --yikes: #FFCD00;        /* brand yellow (Figma) */
  --yikes-hover: #FFD633;
  --yikes-lip: #B38F00;    /* the darker edge a yellow button sits on */
  --yikes-ink: #090908;
  --outline: #000;          /* the logo's black keyline */

  /* Kept for components shared with older pages: they now mean the brand action color. */
  --brand: var(--yikes);
  --accent: var(--yikes);
  --accent-ink: var(--yikes-ink);
  --accent-text: var(--yikes);
  --accent-soft: var(--surface-2);   /* kept for old pages: no tinted washes */

  /* Semantic */
  --online: #3DDC84;
  --danger: #F05252;
  /* Status fills (always beside a word) and the lit key (a picked option). */
  --good-fill: #2E9E5B;  --good-lip: #1D6B3C;  --good-ink: #5BE38F;
  --danger-fill: #D64545; --danger-hover: #E05252; --danger-lip: #8E2626; --danger-ink: #F59A9A;
  --lit-lip: #9C9C93;    /* the edge under a lit (near-white) key */
  --lit-sub: #55554E;    /* secondary text on a lit key */
  --line-hover: #7A7A72; /* outline of a hovered control */
  --ink-2: #D9D9D2;      /* bright secondary text */
  --note-bg: var(--surface-2);
  --note-ink: #F5DE8A;

  /* In-game tooltip (game world UI, used on the Valheim page) */
  --tip-bg: #14161A;
  --tip-edge: #3A3E45;
  --tip-title: #F4F1EA;
  --tip-sub: #8FB7FF;
  --tip-stat: #5BE37F;
  --tip-flavor: #C9B98A;

  --shadow: 0 1px 0 rgb(255 255 255 / .04) inset, 0 18px 40px -24px rgb(0 0 0 / .9);

  /* Lilita One: chunky rounded display (headlines only, one weight). Nunito: rounded UI and body text. */
  --display: "Lilita One", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  /* Type: Meta 14/20, Body 17/26, Lead 20/30, Title 26/30 (display), Display 52/56, Poster up to 84 */
  --fs-sm: .875rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.625rem;
  --fs-hero: clamp(2.4rem, 5.6vw, 3.25rem);
  --fs-poster: clamp(2.8rem, 7.5vw, 5.25rem);

  --gap-1: 6px; --gap-2: 12px; --gap-3: 20px; --gap-4: 32px; --gap-5: 56px; --gap-6: 96px;
  --radius-card: 16px;
  --radius-control: 14px;
  --lip: 4px;              /* tactile depth under buttons, cards and keycaps */
  --tap: 48px;
  --gutter: 64px;
  --ease: 120ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ground); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--fs-base);
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }

.page { max-width: 720px; margin: 0 auto; padding-block: var(--gap-4) var(--gap-5); padding-inline: 24px; }
.wrap { max-width: calc(1312px + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }
@media (max-width: 960px) { :root { --gutter: 24px; } }

h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-family: var(--display); font-weight: 400; font-size: var(--fs-hero); line-height: 1.08; letter-spacing: .005em; }
h2 { font-family: var(--display); font-weight: 400; font-size: var(--fs-xl); line-height: 30px; letter-spacing: .01em; margin-block: var(--gap-5) var(--gap-3); }
h3 { font-size: var(--fs-lg); font-weight: 800; line-height: 1.3; }
p { margin: 0 0 var(--gap-2); max-width: 62ch; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--yikes-lip); }
a:hover { text-decoration-color: var(--yikes); }
strong { font-weight: 800; }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface); color: var(--ink); padding: .12em .42em; border-radius: 6px; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
/* Skip link: first focusable thing on every page, visible only when focused */
.skip { position: absolute; left: 12px; top: -64px; z-index: 60; background: var(--yikes); color: var(--yikes-ink); font-weight: 800; padding: 10px 14px; border-radius: 12px; text-decoration: none; box-shadow: 0 var(--lip) 0 var(--yikes-lip); }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--yikes); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--yikes); color: var(--yikes-ink); }

/* ---------------------------------------------------------------- site header */
.site-head { position: sticky; top: 0; z-index: 30; background: rgb(16 17 16 / .92); backdrop-filter: blur(10px); border-bottom: 2px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: var(--gap-3); min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; flex: none; }
.wordmark img { height: 40px; width: auto; }
.site-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.site-nav a:not(.btn) { color: var(--muted); font: 800 .8125rem/1 var(--body); letter-spacing: .07em; text-transform: uppercase; text-decoration: none; padding: 0 14px; min-height: 44px; display: inline-flex; align-items: center;
  border: 2px solid transparent; border-radius: 12px; transition: color var(--ease), background-color var(--ease), border-color var(--ease); }
.site-nav a:not(.btn):hover { color: var(--ink); }
.site-nav a:not(.btn):hover { background: var(--surface); }
/* current page: a small raised yellow coin before the label (the coin language of steps and reached biomes) */
.site-nav a[aria-current="page"] { color: var(--ink); gap: 10px; }
.site-nav a[aria-current="page"]::before, .subnav a[aria-current="page"]::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--yikes); box-shadow: 0 2px 0 var(--yikes-lip); flex: none; }
.site-nav .btn { margin-left: 8px; }
.site-head .menu-toggle { display: none; margin-left: auto; }
@media (max-width: 960px) {
  .site-head .menu-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ground); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 20px; margin: 0; }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { min-height: 48px; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin: 16px 0 0; width: 100%; }
  .wordmark img { height: 34px; }
}

/* Older pages' nameplate (kept for Longhouse) */
.nameplate { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-2); padding-block: var(--gap-2); margin-bottom: var(--gap-4); border-bottom: 1px solid var(--line); }
.mark { font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: var(--yikes); text-decoration: none; white-space: nowrap; }
.mark .br, .mark .nm { display: inline-block; }
.subnav { display: flex; gap: 4px; }
.subnav a { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; padding: 6px 10px; border-radius: 8px; min-height: 36px; display: inline-flex; align-items: center; }
.subnav a[aria-current="page"] { color: var(--ink); gap: 8px; }

/* ---------------------------------------------------------------- buttons (tactile)
   A button sits on a darker lip and sinks into it when pressed (transform only, so nothing around it moves).
   Primary: yellow, one per task area. Secondary (.ghost / .secondary): dark enamel with an outline and lip.
   Labels are short, bold and uppercase with tracking (the reference's button voice; buttons only). */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 22px; border-radius: var(--radius-control);
  background: var(--yikes); color: var(--yikes-ink); border: 0; box-shadow: 0 var(--lip) 0 var(--yikes-lip);
  font: 800 .9375rem/1 var(--body); letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.btn:hover { background: var(--yikes-hover); }
.btn:active { transform: translateY(var(--lip)); box-shadow: 0 0 0 var(--yikes-lip); }
.btn[disabled], .btn[aria-disabled="true"] { background: #262624; color: #8A8A82; box-shadow: 0 var(--lip) 0 #1A1A18; cursor: not-allowed; transform: none; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: .8125rem; }
.btn.ghost, .btn.secondary { background: var(--surface); color: var(--ink); border: 2px solid var(--line-strong); box-shadow: 0 var(--lip) 0 var(--line-strong); }
.btn.ghost:hover, .btn.secondary:hover { background: var(--surface-2); }
.btn.ghost:active, .btn.secondary:active { box-shadow: 0 0 0 var(--line-strong); }
.btn.is-done { background: var(--ink); color: var(--yikes-ink); border-color: var(--ink); box-shadow: 0 var(--lip) 0 #9EA097; }

/* Badge: a small squared label token (never a pill). Uppercase + tracked like the buttons. */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 7px; border: 2px solid var(--line-strong); background: var(--ground);
  color: var(--muted); font: 800 .6875rem/1 var(--body); letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.badge.hot { border-color: var(--yikes); color: var(--yikes-ink); background: var(--yikes); }
.badge.good { border-color: var(--online); color: #04220F; background: var(--online); }
.badge.bad { border-color: var(--danger); color: #2A0606; background: var(--danger); }

/* ---------------------------------------------------------------- shared page parts */
.lede { color: var(--muted); font-size: var(--fs-lg); line-height: 30px; margin-top: var(--gap-2); }
.live { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: var(--fs-sm); color: var(--ink); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--online); flex: none; }
.dot.off { background: var(--danger); }

/* Server card (Valheim guide): interactive (copy buttons), so it is a container */
.card { margin-top: var(--gap-4); background: var(--surface); border: 2px solid var(--line); border-bottom-width: calc(var(--lip) + 2px); border-radius: var(--radius-card); overflow: hidden; }
.status { display: flex; flex-wrap: wrap; gap: var(--gap-1) var(--gap-3); padding: var(--gap-2) 18px; border-bottom: 2px solid var(--line); color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.status span { display: inline-flex; align-items: center; gap: 6px; }
.status .online { color: var(--ink); }
.field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--gap-1) var(--gap-3); padding: 18px; }
.field + .field { border-top: 2px solid var(--line); }
.field .label { grid-column: 1 / -1; color: var(--muted); font-size: var(--fs-sm); font-weight: 800; }
.field .value { font-family: var(--mono); font-weight: 600; font-size: clamp(1.15rem, 4.6vw, 1.55rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; user-select: all; }
.field .value.cmd { font-size: clamp(.82rem, 3.3vw, 1rem); line-height: 1.5; }
.field .value.plain { font-family: var(--body); font-size: var(--fs-lg); user-select: auto; display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 460px) { .field { grid-template-columns: minmax(0, 1fr); } .field .btn { width: 100%; } .status { padding-inline: 16px; } }

/* Numbered steps: real sequences only */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: var(--gap-4); }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 18px; align-items: start; }
/* Step medallions: yellow coin on its lip, like a quest marker */
.steps > li::before { content: counter(step); display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--yikes); color: var(--yikes-ink); font: 1.5rem/1 var(--display); box-shadow: 0 var(--lip) 0 var(--yikes-lip); }
.steps .muted { color: var(--muted); }
.path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-block: 8px; }
.key { font-weight: 800; font-size: var(--fs-sm); background: var(--surface); border: 2px solid var(--line-strong); border-bottom-width: var(--lip); border-radius: 10px; padding: 3px 10px; white-space: nowrap; }
.path .then { color: var(--muted); font-size: var(--fs-sm); }
.ways { margin: 12px 0 0; padding-left: 1.1em; display: grid; gap: 10px; color: var(--muted); }
.ways strong { color: var(--ink); }

/* In-game tooltip: the Valheim page's bold element */
.tooltip { max-width: 440px; background: var(--tip-bg); color: var(--tip-title); border: 1px solid var(--tip-edge); border-radius: 6px;
  box-shadow: inset 0 0 0 3px var(--tip-bg), inset 0 0 0 4px rgb(255 255 255 / .06); padding: 16px 18px; line-height: 1.45; }
.tooltip .t-title { font-weight: 700; font-size: var(--fs-lg); }
.tooltip .t-sub { color: var(--tip-sub); font-size: var(--fs-sm); margin-bottom: 10px; }
.tooltip ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tooltip li { color: var(--tip-stat); display: flex; align-items: center; gap: 10px; min-height: 28px; }
.tooltip li .vi { width: 24px; height: 24px; flex: none; filter: drop-shadow(0 1px 1px rgb(0 0 0 / .7)); }  /* Valheim item icons */
.tooltip .t-flavor { color: var(--tip-flavor); font-style: italic; margin-top: 10px; font-size: var(--fs-sm); }

.note { background: var(--note-bg); color: var(--ink); border-radius: var(--radius-control); padding: 14px 16px; margin-top: var(--gap-4); }

details { border-bottom: 2px solid var(--line); }
details:first-of-type { border-top: 2px solid var(--line); }
summary { min-height: var(--tap); display: flex; align-items: center; justify-content: space-between; gap: var(--gap-2); cursor: pointer; font-weight: 800; list-style: none; padding-block: 12px; }
summary::-webkit-details-marker { display: none; }
summary .icon { color: var(--muted); transition: transform var(--ease); }
details[open] summary .icon { transform: rotate(180deg); }
details > div { padding-bottom: 14px; color: var(--muted); }

.footer { margin-top: var(--gap-5); padding-top: var(--gap-3); border-top: 2px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }

/* ---------------------------------------------------------------- progress kit (world progress, achievements)
   One vocabulary everywhere progress shows (Longhouse, Hall of Fame, home). After game achievement screens and the
   reference's learning path: EARNED looks collected (full-colour art on a raised gold coin/tile + a check),
   NEXT is a dashed yellow ring, LOCKED looks absent (grey silhouette in a sunken socket + a lock). Every state also
   says its word, so colour is never the only signal. Markup: .meters > .meter, ol.journey > li.node, .trophies > .trophy */
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 24px; margin-bottom: 18px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-weight: 800; }
.meter-top span { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.meter-top span b { color: var(--ink); font-size: 1rem; }
.bar { position: relative; height: 16px; border-radius: 999px; background: var(--ground); border: 2px solid var(--line); overflow: hidden; }
.bar > span { position: absolute; inset: 0; border-radius: 999px; background: var(--yikes); box-shadow: inset 0 -4px 0 rgb(0 0 0 / .18);
  transform-origin: left; transform: scaleX(0); transition: transform 600ms ease; }

.journey { list-style: none; margin: 0 0 18px; padding: 2px 2px 10px; display: flex; overflow-x: auto; scrollbar-width: thin; }
.node { position: relative; flex: 1 0 72px; display: grid; justify-items: center; align-content: start; gap: 6px; text-align: center; }
.node::before { content: ""; position: absolute; top: 25px; left: -50%; right: 50%; height: 6px; border-radius: 3px; background: var(--line); }
.node:first-child::before { display: none; }
.node.reached::before { background: var(--yikes); }
.coin { position: relative; z-index: 1; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; }
.coin .vi { width: 34px; height: 34px; }
.node b { font-size: .8125rem; font-weight: 800; line-height: 1.15; }
.node small, .trophy small { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 800; line-height: 1.2; color: var(--muted); }

.trophies { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; }
.trophy { position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 14px 10px 12px; border-radius: 16px; text-align: center; }
.trophy .vi { width: 52px; height: 52px; margin-bottom: 2px; }
.trophy b { font-size: .875rem; font-weight: 800; line-height: 1.15; }

/* earned / reached: raised gold, check seal */
.node.reached .coin { background: var(--yikes); box-shadow: 0 var(--lip) 0 var(--yikes-lip); }
.trophy.earned { background: var(--yikes); border: 2px solid var(--yikes); box-shadow: 0 var(--lip) 0 var(--yikes-lip); color: var(--yikes-ink); }
.trophy.earned b, .trophy.earned small { color: var(--yikes-ink); }
.node.reached small { color: var(--ink); }
.node.reached .coin::after, .trophy.earned::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ground);
  background: var(--on, var(--good-fill)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat; }
.node.reached .coin::after { right: -5px; bottom: -3px; }
.trophy.earned::after { right: 8px; top: 8px; }

/* next up: dashed ring, art in plain grey */
.node.next .coin { background: var(--surface); border: 3px dashed var(--yikes); }
.node.next .coin .vi { filter: grayscale(1); opacity: .9; }
.node.next small { color: var(--yikes); }

/* locked / not yet: sunken socket, silhouette, lock seal */
.node.locked .coin, .trophy.locked { background: var(--ground); border: 2px solid var(--line); box-shadow: inset 0 3px 0 rgb(0 0 0 / .4); }
.node.locked .coin .vi, .trophy.locked .vi { filter: brightness(0) invert(.36); opacity: .75; }
.node.locked .coin::after, .trophy.locked::after { content: ""; position: absolute; width: 18px; height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23AFB3AA' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2zm6 3a1 1 0 1 0 2 0a1 1 0 0 0-2 0m-3-5V7a4 4 0 1 1 8 0v4'/%3E%3C/svg%3E") center / 16px no-repeat; }
.node.locked .coin::after { right: -6px; bottom: -4px; background-color: var(--ground); border-radius: 50%; width: 22px; height: 22px; }
.trophy.locked::after { right: 8px; top: 8px; }
/* before the server reports progress: neutral, no lock (nothing is known yet) */
.trophy.unknown, .node.unknown .coin { background: var(--ground); border: 2px solid var(--line); }
.trophy.unknown .vi, .node.unknown .coin .vi { filter: grayscale(1); opacity: .55; }

/* Seasonal decorations. Big Yikes themes for holidays: assets/js/season.js sets <html data-season>, and each season's
   decoration only draws inside it. .season-deco marks a section that can carry one. */
.season-deco { position: relative; isolation: isolate; }
/* Halloween: spider-web corners from the guild's Halloween banner. */
html[data-season="halloween"] .season-deco::before, html[data-season="halloween"] .season-deco::after { content: ""; position: absolute; width: min(38vw, 360px); aspect-ratio: 1; z-index: -1; pointer-events: none; opacity: .22;
  background: url("/assets/brand/web.svg") no-repeat center / contain; }
.season-deco::before { top: 0; left: 0; }
.season-deco::after { right: 0; bottom: 0; transform: rotate(180deg); }
/* Winter (Dec 1 to Jan 6): icicles from a snowy eave in the top corner, a snowdrift in the opposite one; the same faint
   white line art as Halloween's webs. */
html[data-season="winter"] .season-deco::before, html[data-season="winter"] .season-deco::after { content: ""; position: absolute; width: min(38vw, 360px); aspect-ratio: 1; z-index: -1; pointer-events: none; opacity: .24; }
html[data-season="winter"] .season-deco::before { background: url("/assets/brand/winter-top.svg") no-repeat center / contain; }
html[data-season="winter"] .season-deco::after { background: url("/assets/brand/winter-bottom.svg") no-repeat center / contain; transform: none; }

/* Motion (GSAP) */
.js-anim [data-intro] { visibility: hidden; }
h1 .line-mask { padding-bottom: .16em; margin-bottom: -.16em; }   /* SplitText line masks: room for descenders */

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
