/* ==========================================================================
   Valheim World Generator — global stylesheet
   Dark Norse / viking direction. Palette per project UI spec.
   ========================================================================== */

:root {
  /* surfaces */
  --bg: #0f1419;
  --bg-deep: #0a0e12;
  --bg-alt: #131920;
  --panel: #1a2028;
  --panel-2: #212832;

  /* brand */
  --gold: #c8a25a;
  --gold-bright: #e2c07c;
  --gold-dim: #8f7238;
  --forest: #4a7c59;
  --danger: #b5483a;

  /* text */
  --text: #e8e4dc;
  --text-dim: #8a8578;
  --text-faint: #6b675d;

  /* lines */
  --border: rgba(200, 162, 90, 0.18);
  --border-strong: rgba(200, 162, 90, 0.34);

  /* typography */
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* geometry */
  --radius: 8px;
  --radius-lg: 12px;
  --wrap: 1160px;
  --wrap-narrow: 780px;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);
  --glow: 0 0 0 1px rgba(200, 162, 90, 0.35), 0 0 22px rgba(200, 162, 90, 0.12);
}

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

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  /* faint norse weave: two crossing repeating gradients, no image request */
  background-image:
    repeating-linear-gradient(60deg, rgba(200, 162, 90, 0.022) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(-60deg, rgba(200, 162, 90, 0.022) 0 1px, transparent 1px 46px),
    radial-gradient(1200px 620px at 50% -260px, rgba(200, 162, 90, 0.07), transparent 70%);
  background-attachment: fixed;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0.005em;
  margin: 0 0 0.55em;
  color: var(--text);
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.05rem);
}
h2 {
  font-size: clamp(1.45rem, 2.7vw, 1.95rem);
  margin-top: 1.9em;
}
h3 {
  font-size: clamp(1.12rem, 1.8vw, 1.28rem);
  margin-top: 1.6em;
}

p {
  margin: 0 0 1.05em;
}

a {
  color: var(--gold-bright);
  text-decoration-color: rgba(200, 162, 90, 0.4);
  text-underline-offset: 3px;
}
a:hover {
  color: #f3dfae;
  text-decoration-color: currentColor;
}

ul,
ol {
  padding-left: 1.25em;
}
li {
  margin-bottom: 0.42em;
}

strong {
  color: #f3efe6;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.4em 0;
}

img,
svg,
canvas {
  max-width: 100%;
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.38em;
  color: var(--gold-bright);
  white-space: nowrap;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}
.wrap-narrow {
  width: 100%;
  max-width: var(--wrap-narrow);
  margin-inline: auto;
  padding-inline: 20px;
}

main {
  display: block;
}

.section {
  padding: 3.2rem 0;
}
.section--tight {
  padding: 2.2rem 0;
}
.section--alt {
  background: linear-gradient(180deg, rgba(10, 14, 18, 0) 0%, rgba(10, 14, 18, 0.6) 12%, rgba(10, 14, 18, 0.6) 88%, rgba(10, 14, 18, 0) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.lede {
  font-size: 1.09rem;
  color: #cdc8bd;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.6em;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 20, 25, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover {
  color: var(--gold-bright);
}
.brand__mark {
  color: var(--gold);
  display: inline-flex;
}
.brand__sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}
.nav a {
  padding: 0.42rem 0.68rem;
  border-radius: 6px;
  font-size: 0.93rem;
  color: #c4bfb4;
  text-decoration: none;
  border: 1px solid transparent;
}
.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}
.nav a[aria-current="page"] {
  color: var(--gold-bright);
  border-color: var(--border-strong);
  background: rgba(200, 162, 90, 0.08);
}

.nav-toggle {
  display: none;
}

@media (max-width: 1000px) {
  .nav {
    gap: 0;
  }
  .nav a {
    padding: 0.4rem 0.5rem;
    font-size: 0.87rem;
  }
}
@media (max-width: 780px) {
  .site-header__inner {
    flex-wrap: wrap;
    padding-block: 0.6rem;
  }
  .nav {
    margin-left: 0;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }
}

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

.hero {
  position: relative;
  padding: 4rem 0 3rem;
  text-align: center;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 320px at 50% 0%, rgba(200, 162, 90, 0.1), transparent 72%),
    linear-gradient(180deg, transparent 62%, rgba(10, 14, 18, 0.75) 100%);
}
.hero > .wrap {
  position: relative;
  z-index: 1;
}
.hero h1 {
  margin-bottom: 0.35em;
}
.hero__sub {
  font-size: clamp(1.02rem, 1.9vw, 1.22rem);
  color: #c9c4b9;
  max-width: 44rem;
  margin: 0 auto 1.6rem;
}
.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.15rem;
  justify-content: center;
  margin-top: 1.35rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.hero__badges span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.hero__badges svg {
  color: var(--forest);
  flex: none;
}

/* ---------- tool panel ---------- */

.tool {
  background: linear-gradient(180deg, var(--panel) 0%, #161c23 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin: 0 auto;
  max-width: 720px;
  text-align: left;
}

.tool__tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.28rem;
  margin-bottom: 1.15rem;
}
.tool__tab {
  flex: 1;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.92rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}
.tool__tab[aria-selected="true"] {
  background: rgba(200, 162, 90, 0.13);
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.tool__pane[hidden] {
  display: none;
}

.dropzone {
  /* <label> is inline by default: without this the border and padding split
     across text lines instead of forming one box. */
  display: block;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(10, 14, 18, 0.55);
  padding: 1.7rem 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover,
.dropzone.is-over {
  border-color: var(--gold);
  background: rgba(200, 162, 90, 0.06);
}
.dropzone svg {
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.dropzone__hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0.35rem 0 0;
}

.field-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.field-row > input {
  flex: 1 1 220px;
}

input[type="text"],
input[type="search"] {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  padding: 0.72rem 0.9rem;
}
input[type="text"]:focus,
input[type="search"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 162, 90, 0.14);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
  color: #17130a;
  border-color: var(--gold-bright);
}
.btn--primary:hover {
  filter: brightness(1.07);
  color: #17130a;
}
.btn--ghost {
  background: transparent;
  color: var(--gold-bright);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  background: rgba(200, 162, 90, 0.09);
  color: #f3dfae;
}

.tool__note {
  font-size: 0.83rem;
  color: var(--text-faint);
  margin: 0.9rem 0 0;
}

/* extraction result */
.result {
  margin-top: 1.15rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(74, 124, 89, 0.08);
  padding: 1.05rem 1.15rem;
}
.result--error {
  background: rgba(181, 72, 58, 0.1);
  border-color: rgba(181, 72, 58, 0.45);
}
.result h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}
.result dl {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
}
.result dt {
  color: var(--text-dim);
  font-size: 0.88rem;
}
.result dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-all;
}
.result dd.is-flag {
  font-family: var(--font-body);
  color: var(--gold-bright);
}
.result__foot {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ---------- cards / grids ---------- */

.grid {
  display: grid;
  gap: 1rem;
}
.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
}
.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
a.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--glow);
  color: inherit;
}
.card__title {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.3rem;
}
.card__text {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0;
}
.card__kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.55rem;
}
.card__more {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--gold);
}

/* spec / fact list */
.facts {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin: 1.2rem 0;
  padding: 0;
  list-style: none;
}
.facts li {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  margin: 0;
}
.facts b {
  display: block;
  color: var(--gold-bright);
  font-size: 0.95rem;
}

/* seed cards */
.seed-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.seed-card__code {
  font-family: var(--font-mono);
  font-size: 1.08rem;
  color: var(--gold-bright);
  display: block;
  margin-bottom: 0.35rem;
  word-break: break-all;
}
.seed-card__meta {
  font-size: 0.86rem;
  color: var(--text-dim);
  margin: 0;
}
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.tag--easy {
  color: #9ed0ac;
  border-color: rgba(74, 124, 89, 0.55);
}
.tag--hard {
  color: #e0a091;
  border-color: rgba(181, 72, 58, 0.5);
}

/* ---------- tables ---------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.3rem 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 520px;
}
caption {
  caption-side: top;
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-size: 0.83rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
th,
td {
  text-align: left;
  padding: 0.62rem 0.9rem;
  border-bottom: 1px solid rgba(200, 162, 90, 0.09);
  vertical-align: top;
}
thead th {
  background: rgba(200, 162, 90, 0.07);
  color: var(--gold-bright);
  font-weight: 600;
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.018);
}
td code,
th code {
  white-space: nowrap;
}

/* ---------- FAQ ---------- */

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 0.6rem;
  overflow: hidden;
}
.faq details[open] {
  border-color: var(--border-strong);
}
.faq summary {
  cursor: pointer;
  padding: 0.85rem 1.05rem;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  list-style: none;
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::before {
  content: "+";
  color: var(--gold);
  font-family: var(--font-mono);
  flex: none;
}
.faq details[open] summary::before {
  content: "–";
}
.faq summary:hover {
  background: rgba(255, 255, 255, 0.025);
}
.faq__answer {
  padding: 0 1.05rem 1.05rem 2.1rem;
  color: #cdc8bd;
  font-size: 0.95rem;
}
.faq__answer > :last-child {
  margin-bottom: 0;
}

/* ---------- misc blocks ---------- */

.callout {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  background: rgba(200, 162, 90, 0.06);
  border-radius: 6px;
  padding: 1rem 1.15rem;
  margin: 1.4rem 0;
}
.callout--warn {
  border-left-color: var(--danger);
  background: rgba(181, 72, 58, 0.08);
  border-color: rgba(181, 72, 58, 0.4);
}
.callout > :last-child {
  margin-bottom: 0;
}
.callout__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--gold-bright);
}
.callout--warn .callout__title {
  color: #e6a897;
}

.source-note {
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-faint);
}
.source-note a {
  color: var(--text-dim);
}

/* breadcrumbs */
.crumbs {
  font-size: 0.83rem;
  color: var(--text-faint);
  padding: 1.1rem 0 0;
}
.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}
.crumbs li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--text-faint);
}
.crumbs a {
  color: var(--text-dim);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--gold-bright);
}

/* related links */
.related {
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}
.related h2 {
  font-size: 1.15rem;
  margin-top: 0;
}
.related ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.related li {
  margin: 0;
}
.related a {
  display: block;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
}
.related a:hover {
  border-color: var(--border-strong);
  color: var(--gold-bright);
}

/* ads */
.ad-slot {
  margin: 2rem auto;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(10, 14, 18, 0.4);
  color: var(--text-faint);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.site-footer {
  margin-top: 3.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
  padding: 2.6rem 0 1.6rem;
  font-size: 0.9rem;
}
.site-footer__cols {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: 1.6fr repeat(3, 1fr);
}
@media (max-width: 820px) {
  .site-footer__cols {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .site-footer__cols {
    grid-template-columns: 1fr;
  }
}
.site-footer h2 {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.75rem;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer li {
  margin-bottom: 0.42rem;
}
.site-footer a {
  color: #b9b4a9;
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--gold-bright);
}
.site-footer__legal {
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  justify-content: space-between;
}

/* ---------- utility ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: #17130a;
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  left: 0;
}

.prose > h2:first-child,
.prose > h3:first-child {
  margin-top: 0;
}
.prose {
  max-width: 62ch;
}

@media print {
  .site-header,
  .site-footer,
  .ad-slot,
  .related,
  .hero__badges {
    display: none !important;
  }
  body {
    background: #fff;
    color: #111;
  }
}


