/* ============================================================
   Kintara Compass — visual system
   Inspired by kintara.gg: sky-blue isometric world, Cinzel
   engraved titles, drifting voxel clouds, frosted glass, and
   engraved orange CTAs. Navy ink on a floating codex panel.
   ============================================================ */

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url('fonts/cinzel-variable.woff2') format('woff2');
}

:root {
  /* Sky / brand */
  --sky:       #5fa1cf;
  --sky-hi:    #9ad2ef;
  --sky-mid:   #4e93c6;
  --sky-lo:    #326d9f;

  /* Navy ink (on light panels) */
  --ink:       #14324c;
  --ink-2:     #234c6d;
  --ink-soft:  #48688a;
  --ink-mute:  #7b96b0;

  /* Light surfaces */
  --panel:      #ffffff;
  --panel-frost: rgba(255, 255, 255, 0.95);
  --panel-sub:  #eef4fb;
  --panel-sub2: #e4eef8;
  --line:       #d7e3f0;
  --line-strong:#bcd0e4;

  /* Accents */
  --orange-1: #ffaf5e;
  --orange-2: #ff8a3a;
  --orange-3: #ed6f1c;
  --cta-rim:  #6e3010;
  --cta-text: #4f210a;

  --green:      #2f8659;
  --green-soft: #e2f4ea;
  --green-line: #a9dcc0;
  --live:       #54e07f;

  --gold:       #c98f12;
  --gold-2:     #e8b64c;
  --gold-soft:  #fbf1d8;
  --gold-line:  #ecd18f;

  --red:        #cf4444;
  --red-deep:   #a83030;
  --red-soft:   #fce8e6;
  --red-line:   #f0b8b2;

  --blue:       #2f7fbf;

  --radius:    10px;
  --radius-lg: 16px;
  --shadow-panel:
    0 18px 50px rgba(14, 44, 74, 0.28),
    0 4px 12px rgba(14, 44, 74, 0.12);
  --shadow-soft: 0 6px 20px rgba(14, 44, 74, 0.10);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font-display: 'Cinzel', 'Trajan Pro', 'Palatino Linotype', Georgia, serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --max-w: 1020px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  min-height: 100%;
  /* Fixed sky gradient lives on <html> so it always fills the viewport,
     with no clipping gap below a shorter <body>. */
  background:
    radial-gradient(130% 90% at 50% -20%, var(--sky-hi) 0%, transparent 55%),
    linear-gradient(178deg, var(--sky) 0%, var(--sky-mid) 48%, var(--sky-lo) 100%) fixed;
  background-color: var(--sky-mid);
}

body {
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--ink);
  line-height: 1.66;
  background: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding-left: 1.1rem; padding-right: 1.1rem; }

/* ============================================================
   Sky backdrop — drifting voxel clouds (injected by site.js)
   ============================================================ */
.kn-sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.kn-cloud {
  position: absolute;
  will-change: transform;
  opacity: 0.55;
  animation: cloud-drift linear infinite;
}
.kn-cloud--rev { animation-name: cloud-drift-rev; }
.kn-cloud b {
  position: absolute;
  display: block;
  background: #ffffff;
  border-radius: 5px;
  box-shadow: 0 6px 0 rgba(210, 232, 248, 0.7) inset;
}
@keyframes cloud-drift {
  from { transform: translate3d(-42vw, 0, 0) scale(var(--s, 1)); }
  to   { transform: translate3d(142vw, 0, 0) scale(var(--s, 1)); }
}
@keyframes cloud-drift-rev {
  from { transform: translate3d(142vw, 0, 0) scale(var(--s, 1)); }
  to   { transform: translate3d(-42vw, 0, 0) scale(var(--s, 1)); }
}
@media (prefers-reduced-motion: reduce) {
  .kn-cloud { animation: none; }
}

/* ============================================================
   Header / nav — frosted glass bar
   ============================================================ */
header.site {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.68);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 24px rgba(14, 44, 74, 0.14);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.72rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--ink);
  font-size: 1rem;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.logo::before {
  content: "";
  width: 15px; height: 15px;
  border-radius: 4px;
  background: linear-gradient(150deg, var(--orange-1), var(--orange-3));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6), 0 2px 5px rgba(110, 42, 10, 0.35);
  transform: rotate(45deg);
}
nav.main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.22rem;
  margin-left: auto;
}
nav.main a {
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
nav.main a:hover { color: var(--ink); text-decoration: none; background: rgba(47, 127, 191, 0.12); }
nav.main a.active {
  color: #fff;
  background: linear-gradient(180deg, var(--orange-1), var(--orange-3));
  box-shadow: inset 0 1px 0 rgba(255, 236, 200, 0.55), 0 2px 6px rgba(110, 42, 10, 0.28);
}

/* ============================================================
   Hero — Cinzel title floating over the sky/scene
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--sky-hi), var(--sky-mid));
  border-bottom: 3px solid rgba(255, 255, 255, 0.35);
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  z-index: 0;
  image-rendering: pixelated;
}
.hero::after {
  /* Scrim — keeps the white Cinzel title legible over the busy scene */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(28, 70, 108, 0.18) 0%, rgba(20, 52, 84, 0.62) 100%);
}
.hero__inner {
  position: relative;
  z-index: 2;
  padding: clamp(2.6rem, 7vw, 5rem) 1.1rem clamp(2.4rem, 6vw, 4.4rem);
  text-align: center;
}
.hero__eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.9rem;
  text-shadow: 0 1px 6px rgba(12, 36, 60, 0.5);
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  color: #fff;
  line-height: 1.04;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(2.1rem, 6.5vw, 4.2rem);
  text-shadow: 0 2px 0 rgba(20, 50, 80, 0.35), 0 10px 34px rgba(12, 36, 60, 0.55);
  margin-bottom: 0.2rem;
}
.hero__sub {
  max-width: 40ch;
  margin: 0.9rem auto 0;
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 10px rgba(12, 36, 60, 0.6);
}
.hero__cta {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

/* ============================================================
   Engraved orange CTA button (kintara.gg style)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  min-height: 46px;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  color: var(--cta-text);
  background: linear-gradient(180deg, var(--orange-1) 0%, var(--orange-2) 48%, var(--orange-3) 100%);
  border: 1px solid var(--cta-rim);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.22),
    inset 0 2px 0 rgba(255, 236, 200, 0.55),
    inset 0 -3px 10px rgba(110, 42, 10, 0.36);
  text-shadow: 0 1px 0 rgba(255, 228, 170, 0.45);
  transition: transform 0.12s var(--ease-out), filter 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out);
  user-select: none;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active {
  transform: translateY(3px);
  box-shadow:
    0 0 0 rgba(0, 0, 0, 0.22),
    inset 0 4px 10px rgba(90, 36, 8, 0.45);
}
.btn--ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  text-shadow: 0 1px 6px rgba(12, 36, 60, 0.5);
  box-shadow: 0 3px 0 rgba(20, 50, 80, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.24); }

/* ============================================================
   Main — the floating "codex" panel
   ============================================================ */
main {
  max-width: var(--max-w);
  margin: 0 auto clamp(2rem, 5vw, 3.5rem);
  padding: clamp(1.8rem, 4vw, 3rem) clamp(1.3rem, 4vw, 3rem) clamp(2.4rem, 5vw, 3.4rem);
  background: var(--panel-frost);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-top: 4px solid transparent;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  position: relative;
}
/* When a hero precedes main, tuck the panel up under it */
.hero + main {
  margin-top: -1.9rem;
  position: relative;
  z-index: 2;
}
/* Gold hairline at the very top of the codex */
main::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--orange-2), var(--gold-2), var(--orange-2));
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.12;
  margin-bottom: 0.4rem;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.28rem, 2.6vw, 1.55rem);
  font-weight: 700;
  color: var(--ink);
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--line);
  position: relative;
}
h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 3.2rem; height: 2px;
  background: linear-gradient(90deg, var(--orange-2), var(--gold-2));
}
h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink-2);
  margin: 1.5rem 0 0.45rem;
  letter-spacing: 0.01em;
}
h3 a { color: var(--ink-2); }
p { margin-bottom: 0.95rem; }
strong { color: var(--ink); font-weight: 700; }

.lead {
  color: var(--ink-soft);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1.6rem;
  max-width: 62ch;
}

ul, ol { margin: 0 0 1.05rem 1.3rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--orange-3); font-weight: 700; }

/* ============================================================
   Tables
   ============================================================ */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0 1.6rem;
  font-size: 0.93rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
th, td {
  padding: 0.62rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: linear-gradient(180deg, var(--panel-sub), var(--panel-sub2));
  color: var(--ink);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--line-strong);
}
tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td, tr:nth-child(even) td { background: rgba(78, 147, 198, 0.045); }

code, kbd {
  font-family: ui-monospace, Consolas, 'SF Mono', Menlo, monospace;
  font-size: 0.88em;
}
code {
  background: var(--panel-sub);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.08rem 0.4rem;
  color: var(--ink-2);
}
kbd {
  display: inline-block;
  background: linear-gradient(180deg, #fff, var(--panel-sub));
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.05rem 0.45rem;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  min-width: 1.2rem;
  text-align: center;
}

/* ============================================================
   Cards (home "Start here")
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.4rem 0;
}
.card {
  position: relative;
  background: linear-gradient(180deg, #fff, var(--panel-sub));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out), border-color 0.16s var(--ease-out);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange-2), var(--gold-2));
  opacity: 0;
  transition: opacity 0.16s var(--ease-out);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(14, 44, 74, 0.18);
  border-color: var(--line-strong);
}
.card:hover::before { opacity: 1; }
.card h3 { margin-top: 0; color: var(--ink); }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--orange-3); text-decoration: none; }
.card p { margin-bottom: 0; color: var(--ink-soft); font-size: 0.92rem; }

/* ============================================================
   Callouts
   ============================================================ */
.callout {
  position: relative;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  background: var(--panel-sub);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.9rem 1.1rem 0.9rem 2.5rem;
  margin: 1.2rem 0;
  font-size: 0.95rem;
  color: var(--ink-2);
  box-shadow: var(--shadow-soft);
}
.callout::before {
  content: "i";
  position: absolute;
  left: 0.75rem; top: 0.9rem;
  width: 1.25rem; height: 1.25rem;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  font-family: var(--font-display);
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.callout strong { color: var(--ink); }
.callout.warn { border-left-color: var(--red); background: var(--red-soft); border-color: var(--red-line); }
.callout.warn::before { content: "!"; background: var(--red); }
.callout.tip { border-left-color: var(--green); background: var(--green-soft); border-color: var(--green-line); }
.callout.tip::before { content: "\2713"; background: var(--green); }
.callout.gold { border-left-color: var(--gold); background: var(--gold-soft); border-color: var(--gold-line); }
.callout.gold::before { content: "\2605"; background: var(--gold); }

/* ============================================================
   Badges — game-style zone pills
   ============================================================ */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.14rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--panel-sub);
  margin-left: 0.5rem;
  vertical-align: middle;
}
.badge.safe { color: var(--green); border-color: var(--green-line); background: var(--green-soft); }
.badge.pvp { color: var(--red-deep); border-color: var(--red-line); background: var(--red-soft); }

/* ============================================================
   Calculators
   ============================================================ */
.calc {
  background: linear-gradient(180deg, #fff, var(--panel-sub));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.6rem 0;
  box-shadow: var(--shadow-soft);
}
.calc h2 {
  margin-top: 0;
  border: none;
  padding-left: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.calc h2::after { display: none; }
.calc h2::before {
  content: attr(data-n);
  flex: 0 0 auto;
  width: 2rem; height: 2rem;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--orange-1), var(--orange-3));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 236, 200, 0.6), 0 2px 5px rgba(110, 42, 10, 0.3);
  text-shadow: 0 1px 0 rgba(110, 42, 10, 0.4);
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
  margin: 1.1rem 0;
}
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}
.field input, .field select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  padding: 0.55rem 0.7rem;
  font-size: 1rem;
  font-family: var(--font-ui);
  transition: border-color 0.14s var(--ease-out), box-shadow 0.14s var(--ease-out);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 127, 191, 0.18);
}
.result {
  background: linear-gradient(180deg, #eaf3fb, #dfedf9);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-top: 1rem;
  font-size: 0.97rem;
  color: var(--ink-2);
  line-height: 1.7;
}
.result strong { color: var(--gold); }
.result .big {
  font-size: 1.45rem;
  color: var(--green);
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

/* ============================================================
   Donation panel — treasure chest
   ============================================================ */
.donate {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(232, 182, 76, 0.22), transparent 55%),
    linear-gradient(180deg, #fff, var(--gold-soft));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  margin: 2.8rem 0 0;
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.donate h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin-top: 0;
  font-size: 1.2rem;
}
.donate p { color: var(--ink-soft); max-width: 48ch; margin: 0.4rem auto 0.9rem; }
.donate .addr {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.88rem;
  color: var(--ink-2);
  margin: 0.3rem 0.4rem 0.3rem 0;
  word-break: break-all;
  max-width: 100%;
  vertical-align: middle;
}
button.copy {
  vertical-align: middle;
  color: var(--cta-text);
  background: linear-gradient(180deg, var(--orange-1) 0%, var(--orange-2) 48%, var(--orange-3) 100%);
  border: 1px solid var(--cta-rim);
  border-radius: 8px;
  padding: 0.5rem 1.1rem;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 236, 200, 0.55);
  text-shadow: 0 1px 0 rgba(255, 228, 170, 0.45);
  transition: transform 0.12s var(--ease-out), filter 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out);
}
button.copy:hover { filter: brightness(1.06); }
button.copy:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(0,0,0,0.2), inset 0 4px 10px rgba(90,36,8,0.45); }

/* Token contract-address chip — mirrors .donate .addr */
.donate .token-ca {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.88rem;
  color: var(--ink-2);
  margin: 0.3rem 0.4rem 0.3rem 0;
  word-break: break-all;
  max-width: 100%;
  vertical-align: middle;
}
.token-ca.is-empty { color: var(--ink-soft); font-style: italic; }

/* State toggling (soon vs live) hides non-matching blocks reliably */
[hidden] { display: none !important; }

/* ============================================================
   Footer
   ============================================================ */
footer.site {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.5rem 1.1rem 3rem;
  text-shadow: 0 1px 8px rgba(12, 36, 60, 0.4);
}
footer.site a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
footer.site p { max-width: 62ch; margin: 0 auto; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  nav.main { width: 100%; margin-left: 0; }
  nav.main a { padding: 0.3rem 0.55rem; font-size: 0.85rem; }
  .hero + main { margin-top: -1.2rem; }
}
