/* SkillDrasil site. Valheim look: dark wood, iron rims, ember orange, parchment text. */
:root {
  --night: #0d0a08;
  --wood-1: #3a2a1d;
  --wood-2: #2b1f16;
  --wood-3: #1f1610;
  --rim: #8a6634;
  --rim-dark: #4a3720;
  --ember: #ff9f2e;
  --gold: #f2b24a;
  --parchment: #e7dcc4;
  --muted: #b9a888;
  --shade: rgba(0, 0, 0, 0.42);
  --radius: 6px;
  --head: 'Alegreya SC', Georgia, serif;
  --body: 'Alegreya', Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--parchment);
  font: 18px/1.55 var(--body);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 140, 40, 0.16), transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(60, 90, 110, 0.18), transparent 60%),
    var(--night);
  min-height: 100vh;
}

a { color: var(--gold); }
a:hover { color: var(--ember); }
img { max-width: 100%; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* ---------- carved wood panel ---------- */
.panel {
  position: relative;
  background:
    repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 9px, rgba(255, 220, 160, 0.03) 9px 11px, transparent 11px 23px),
    repeating-linear-gradient(88deg, transparent 0 40px, rgba(0, 0, 0, 0.18) 40px 42px, transparent 42px 97px),
    linear-gradient(180deg, var(--wood-1), var(--wood-2) 60%, var(--wood-3));
  border: 3px solid var(--rim);
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 0 2px var(--rim-dark),
    inset 0 0 40px rgba(0, 0, 0, 0.55),
    0 12px 40px rgba(0, 0, 0, 0.6);
  padding: 28px;
}
/* iron rivets in the corners */
.panel::before, .panel::after {
  content: '';
  position: absolute;
  top: 8px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d8b47a, #6b4c25 70%);
  box-shadow: 0 1px 2px #000;
}
.panel::before { left: 8px; }
.panel::after { right: 8px; }

h1, h2, h3 {
  font-family: var(--head);
  color: var(--ember);
  text-shadow: 0 2px 0 #000, 0 0 18px rgba(255, 140, 30, 0.25);
  margin: 0 0 0.4em;
  line-height: 1.15;
}
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: 24px; }

.runes {
  font-family: 'Noto Sans Runic', var(--body);
  color: var(--rim);
  letter-spacing: 0.6em;
  font-size: 18px;
  text-align: center;
  user-select: none;
  opacity: 0.85;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  gap: 12px;
}
.brand { font-family: var(--head); font-weight: 800; color: var(--gold); text-decoration: none; font-size: 22px; letter-spacing: 0.08em; }
.topbar nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; font-family: var(--head); }
.topbar nav a:hover { color: var(--gold); }
.lang { display: inline-flex; border: 2px solid var(--rim); border-radius: 4px; overflow: hidden; }
.lang a { padding: 2px 10px; color: var(--muted); }
.lang a[aria-current] { background: var(--rim); color: #1a120a; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 56px 0 40px; }
.hero h1 {
  font-size: clamp(48px, 10vw, 104px);
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 8px 0 4px;
  background: linear-gradient(180deg, #ffe0a0 0%, var(--gold) 45%, #b5651d 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #000) drop-shadow(0 0 24px rgba(255, 140, 30, 0.35));
  text-shadow: none;
}
.hero .tagline { font-size: clamp(20px, 2.6vw, 26px); color: var(--parchment); max-width: 760px; margin: 0 auto 28px; font-style: italic; }
.hero .meta { color: var(--muted); font-size: 15px; margin-top: 14px; }

.buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  font-family: var(--head);
  font-size: 20px;
  padding: 10px 26px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--gold);
  background: linear-gradient(180deg, #4a3523, #2a1d13);
  border: 2px solid var(--rim);
  box-shadow: inset 0 0 0 1px var(--rim-dark), 0 4px 12px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 0 #000;
  transition: transform 0.1s, box-shadow 0.15s;
}
.btn:hover { color: #ffd38a; box-shadow: inset 0 0 0 1px var(--rim-dark), 0 0 18px rgba(255, 150, 40, 0.35); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(180deg, #b9651c, #7a3c0f); color: #fff1d6; border-color: #e0a050; }

section { padding: 36px 0; }
.intro { text-align: center; max-width: 820px; margin: 0 auto; }
.intro p { font-size: 20px; }

/* ---------- vanilla vs tree ---------- */
.versus { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; text-align: left; }
.versus h3 { font-size: 22px; }
.versus ul { margin: 0; padding-left: 1.1em; }
.versus .old h3 { color: var(--muted); text-shadow: 0 2px 0 #000; }

/* ---------- explorer ---------- */
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.tab {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 18px var(--head);
  color: var(--parchment);
  background: linear-gradient(180deg, #3b2b1e, #22180f);
  border: 2px solid var(--rim-dark);
  border-radius: 4px;
  padding: 8px 6px;
  cursor: pointer;
}
.tab img { width: 30px; height: 30px; }
.tab:hover { border-color: var(--rim); }
.tab[aria-selected="true"] { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 14px rgba(255, 160, 40, 0.3); background: linear-gradient(180deg, #4d3725, #2a1d13); }

.explorer-body { display: grid; grid-template-columns: 1fr 340px; gap: 14px; }
.explorer-body > *, .versus > *, .two > *, .tabs > * { min-width: 0; } /* let grid cells shrink below the SVG's natural width */
.tree { width: 100%; height: auto; background: var(--shade); border-radius: 4px; display: block; }
.tree .root, .tree .branchline { stroke: #4b3522; stroke-width: 6; }
.tree .branchline { stroke-width: 8; }
.tree .trunk { stroke: #4b3522; stroke-width: 16; }
.tree .sap { stroke: var(--ember); stroke-width: 6; opacity: 0.85; }
.tree .gate { fill: var(--parchment); }
.tree .gate-label { fill: var(--parchment); font: 600 16px var(--body); text-anchor: middle; }
.tree .label { fill: var(--parchment); font: 600 15px var(--body); text-anchor: middle; paint-order: stroke; stroke: #000; stroke-width: 3px; }
.tree .node { cursor: pointer; outline: none; }
.tree .node .ring { opacity: 0; transition: opacity 0.15s; }
.tree .node:hover .ring, .tree .node:focus .ring { opacity: 1; }
.tree .node:hover .label, .tree .node:focus .label { fill: var(--ember); }

.card {
  background: var(--shade);
  border-radius: 4px;
  padding: 22px 18px;
  text-align: center;
  min-height: 300px;
}
.card h3 { margin: 10px 0 2px; }
.card .kind { color: var(--muted); margin: 0 0 8px; font-size: 16px; }
.card .effect { font-weight: 700; font-size: 19px; }
.card .lore { font-style: italic; color: var(--muted); }
.card .hint { font-size: 15px; color: var(--muted); border-top: 1px solid var(--rim-dark); padding-top: 10px; margin-top: 14px; }
.card-icon {
  width: 112px; height: 112px; margin: 0 auto;
  background: url(icons/frame_mastery.svg) center / contain no-repeat;
  display: grid; place-items: center;
}
.card-icon.perk { background-image: url(icons/frame_perk.svg); }
.card-icon img { width: 72px; height: 72px; }
.pips { display: flex; gap: 4px; justify-content: center; margin: 6px 0; }
.pips i { width: 12px; height: 12px; background: var(--gold); transform: rotate(45deg); opacity: 0.85; }

/* ---------- feature cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.feature { background: var(--shade); border: 1px solid var(--rim-dark); border-radius: 4px; padding: 18px; }
.feature img { width: 56px; height: 56px; display: block; margin-bottom: 6px; }
.feature h3 { font-size: 22px; }
.feature p { margin: 0; }

figure { margin: 0; }
figure img { border: 3px solid var(--rim); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); display: block; }
figcaption { color: var(--muted); text-align: center; font-size: 15px; margin-top: 8px; font-style: italic; }

/* ---------- tables, steps, code ---------- */
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rim-dark); vertical-align: top; }
th { font-family: var(--head); color: var(--gold); font-weight: 600; }
td:first-child { white-space: nowrap; }
code { font-family: Consolas, 'Courier New', monospace; font-size: 0.88em; background: rgba(0, 0, 0, 0.45); padding: 1px 6px; border-radius: 3px; color: #ffd9a0; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; }

ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
ol.steps li { counter-increment: step; position: relative; padding: 4px 0 14px 52px; }
ol.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font: 700 20px var(--head);
  color: #1a120a;
  background: radial-gradient(circle at 35% 35%, #ffd38a, #b5651d);
  border-radius: 50%;
  box-shadow: 0 2px 6px #000;
}

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

footer { text-align: center; color: var(--muted); padding: 30px 0 50px; font-size: 15px; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .explorer-body { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .versus, .two { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .panel { padding: 18px 14px; }
  .tabs { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .tab { flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 2px; }
  .tab img { width: 24px; height: 24px; }
  .topbar nav .links { display: none; }
}
