:root {
  --bg: #1a1d21;
  --surface: rgba(33, 37, 42, 0.92);
  --border: #3a4149;
  --text: #e7e4dd;
  --muted: #9aa1a9;
  --accent: #8fd0ea;                /* solid icy blue — borders, hovers, fallback */
  --accent-ink: #0c2436;            /* dark ink for text on the light-blue button */
  --accent-grad: linear-gradient(180deg, #d9f1fa 0%, #9dd9ef 30%, #57a9df 62%, #2f78c2 100%);
  --btn-grad: linear-gradient(180deg, #f0faff 0%, #b9e4f5 55%, #8fd0ea 100%);

  /* Background image treatment (kept well behind the content) */
  --bg-image: url("img/valheim-background.jpg");
  --bg-overlay: rgba(19, 21, 25, 0.82);
  --bg-blur: 3px;
  --bg-saturate: 0.8;
  --bg-scale: 1.06;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-size: 16px;
}

/* Fixed background: photo + dark tint + vignette, blurred and pushed back */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(125% 90% at 50% 0%, transparent 42%, rgba(10, 11, 13, 0.55) 100%),
    linear-gradient(var(--bg-overlay), var(--bg-overlay)),
    var(--bg-image) center / cover no-repeat;
  filter: blur(var(--bg-blur)) saturate(var(--bg-saturate));
  transform: scale(var(--bg-scale));
  transform-origin: center;
}

/* Ember particle canvas — sits above the photo, below the content */
#embers {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
  pointer-events: none;
}

/* Custom scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: #3f4750 transparent;
}
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #3f4750;
  border-radius: 999px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #55606b; }
::-webkit-scrollbar-corner { background: transparent; }

/* Every link is a button (see the a, .btn rule further down). */

.wrap { position: relative; max-width: 820px; margin: 0 auto; padding: 2.5rem 1.25rem 1rem; }

/* Language switch — floated, takes no layout height */
.langbar {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  display: flex;
  gap: 0.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}
.langbar a {
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  border: 1px solid transparent;
}

/* Language blocks: show only the ones matching <html lang> */
html[lang="en"] [data-lang="no"],
html[lang="no"] [data-lang="en"] { display: none; }

/* Hero + countdown */
.hero {
  text-align: center;
  /* bottom padding trimmed: .cd-live below reserves its own line, so the
     end-of-countdown messages appear without pushing the border or cards */
  padding: 1rem 0 0.2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.hero h1 { margin: 0 0 0.25rem; font-size: 2.25rem; letter-spacing: 0.02em; }
.lead { margin: 0.25rem 0; }
.when { margin: 0.25rem 0 1.5rem; color: var(--muted); font-size: 0.95rem; }

.countdown {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.unit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  min-width: 78px;
}
.num {
  display: block;
  font-size: 1.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.lbl {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.cd-note { margin: 1rem 0 0; color: var(--muted); min-height: 1.2em; }
.cd-note.go { color: var(--accent); font-weight: 600; font-size: 1.1rem; }
.cd-live {
  margin: 0.4rem 0 0;
  min-height: 1.6em;        /* reserve its line up-front so it can't shift the layout */
  color: var(--muted);
  font-size: 0.95rem;
  visibility: hidden;
}
.cd-live.show { visibility: visible; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.card h2 { margin: 0.25rem 0 0.75rem; font-size: 1.3rem; }
.card h3 { margin: 1.5rem 0 0.5rem; font-size: 1rem; color: var(--accent); }
.card h3:first-of-type { margin-top: 0.5rem; }

/* Collapsible cards */
details.card { padding: 0; }
details.card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2 { margin: 0; }
details.card > summary::after {
  content: "+";
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
}
details.card[open] > summary::after { content: "\2212"; }
details.card[open] > summary { border-bottom: 1px solid var(--border); }
.card-body { padding: 1.25rem 1.5rem; }
.card-body > *:first-child { margin-top: 0; }

/* Guide screenshots */
.shot {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.6rem 0 0.2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: zoom-in;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.85);
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
}
.lightbox-close:hover { color: var(--accent); }

/* Buttons (.btn + the EN/NO switch): white text on a bordered tile at rest,
   blue gradient text + lit border on hover. The gradient background is always
   present; only the text fill toggles, so the hover fades cleanly both ways
   instead of blinking (background-clip can't be transitioned). */
.btn {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  transition: color 0.18s ease, -webkit-text-fill-color 0.18s ease,
              border-color 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover {
  border-color: #6ea3ba;
  color: transparent;
  -webkit-text-fill-color: transparent;
  box-shadow: 0 0 9px rgba(143, 208, 234, 0.16);
}

/* Text links (guide, mod list, any inline link): blue gradient text like the
   headings, marked as links by a trailing external-link glyph. On hover an
   underline grows out from the centre. */
a:not(.btn) {
  position: relative;
  display: inline-block;
  line-height: 1.2;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}
/* Underline that grows out from the centre on hover, collapses back on leave */
a:not(.btn)::before {
  content: "";
  position: absolute;
  left: 0;
  right: calc(12px + 0.3em);   /* stop just before the trailing glyph */
  bottom: 0.1em;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.45s ease;
}
a:not(.btn):hover::before { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  a:not(.btn)::before { transition: none; }
}
a:not(.btn)::after {
  content: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='12'%20viewBox='0%200%2024%2024'%3E%3Cdefs%3E%3ClinearGradient%20id='lk'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3E%3Cstop%20offset='0'%20stop-color='%23d9f1fa'/%3E%3Cstop%20offset='1'%20stop-color='%2357a9df'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg%20fill='none'%20stroke='url(%23lk)'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M14%205h5v5'/%3E%3Cpath%20d='M19%205l-8%208'/%3E%3Cpath%20d='M18%2014v4a1.6%201.6%200%200%201-1.6%201.6H6.6A1.6%201.6%200%200%201%205%2018V7.6A1.6%201.6%200%200%201%206.6%206h4'/%3E%3C/g%3E%3C/svg%3E");
  margin-left: 0.3em;
  vertical-align: -0.06em;
}

ol, ul { padding-left: 1.25rem; }
ol li, ul li { margin: 0.35rem 0; }

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

/* Mod list */
.mods { list-style: none; padding: 0; }
.mods li { padding: 0.6rem 0; border-top: 1px solid var(--border); }
.mods li:first-child { border-top: 0; }
.mods li a { font-weight: 600; }
.mods .by { color: var(--muted); font-size: 0.8rem; margin-left: 0.4rem; }
.mods li p { margin: 0.2rem 0 0; font-size: 0.92rem; }

/* Skills list */
.skills { list-style: none; padding: 0; }
.skills > li { padding: 0.7rem 0; border-top: 1px solid var(--border); }
.skills > li:first-child { border-top: 0; }
.skills h4 { margin: 0 0 0.35rem; font-size: 1rem; font-weight: 400; }
/* Milestone rows: a fixed-width label ("Lv 25", "XP"…) beside its
   description, separated by a thin rule so a run of milestones reads as
   distinct rows instead of a wall of text. The description wraps in its own
   space instead of running back under the label. */
.milestones {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
}
.milestones:last-child { margin-bottom: 0; }
.milestones li {
  display: flex;
  align-items: flex-start; /* keep the label's own box single-line-tall even
    when its description wraps to 2 lines — flex's default "stretch" was
    taller-than-text-height, which stretched the label's gradient with it,
    making that label read as a different shade than a one-line row's */
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--border);
}
.milestones li:first-child { border-top: 0; }
.milestones li > strong {
  flex: 0 0 6rem;
  font-size: 0.85rem;
  white-space: nowrap;
}
.milestones li > span {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.88rem;
}

footer { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 2rem; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); }
footer p { margin: 0.25rem 0; }

@media (max-width: 480px) {
  .wrap { padding: 1.75rem 1rem 3rem; }
  .hero h1 { font-size: 1.8rem; }
  .num { font-size: 1.5rem; }
  .unit { min-width: 64px; padding: 0.6rem 0.75rem; }
  .card { padding: 1rem 1.1rem; }
  details.card { padding: 0; }
  details.card > summary { padding: 0.9rem 1.1rem; }
  .card-body { padding: 1rem 1.1rem; }
  .milestones li { flex-direction: column; gap: 0.15rem; }
  .milestones li > strong { flex-basis: auto; }
}

/* Blue gradient for emphasised text: headings, <strong>, the countdown.
   Plain body text stays white, secondary text grey. Links are white and turn
   gradient on hover. .btn is excluded — it sets its own gradient text above. */
.num,
.cd-note.go,
.hero h1,
.card h2,
.card h3,
strong {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;   /* the hero's shadow muddies gradient-clipped text */
}
/* Language switch: grey by default, blue gradient text when active or hovered.
   Placed after the a:not(.btn) rules so it wins the cascade. */
.langbar a {
  font-weight: 400;
  text-decoration: none;
  background: none;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  box-shadow: none;
}
.langbar a::before, .langbar a::after { content: none; }
.langbar a[aria-current="true"],
.langbar a:not([aria-current="true"]):hover {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.langbar a[aria-current="true"] {
  border-color: var(--border);
  font-weight: 600;
}
