/* =========================================================================
   PEAKBRIDGER — Design System
   Concept: an alpine PvP network. You spawn on one peak, the other player
   spawns on another, and the only way across is the bridge you place
   yourself. The visual language borrows from that: jagged summit lines,
   plank dividers, rope rails, and a "beacon" that reads the server's pulse.
   ========================================================================= */

:root{
  /* ---- color: night sky above the range, warmed by ember light ---- */
  --bg:            #0a0e1a;
  --bg-elevated:   #0d1220;
  --surface:       #131a2b;
  --surface-2:     #1a2338;
  --surface-3:     #212c46;
  --border:        rgba(148, 168, 210, 0.14);
  --border-strong: rgba(148, 168, 210, 0.28);

  --text:          #e9edf6;
  --text-muted:    #94a0bd;
  --text-dim:      #5b6580;

  --ice:           #4fd9d6;
  --ice-strong:    #7fe9e6;
  --ice-dim:       rgba(79, 217, 214, 0.14);

  --ember:         #fcae4b;
  --ember-strong:  #ffc574;
  --ember-dim:     rgba(252, 174, 75, 0.14);

  --success:       #4ade80;
  --success-dim:   rgba(74, 222, 128, 0.14);
  --danger:        #f77066;
  --danger-dim:    rgba(247, 112, 102, 0.14);

  /* ---- type ---- */
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body:    "Inter", "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* ---- rhythm ---- */
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --edge: 22px; /* clipped "cut stone" corner size */
  --max: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body{
  margin: 0;
  background:
    radial-gradient(1200px 620px at 82% -10%, rgba(79,217,214,0.10), transparent 60%),
    radial-gradient(900px 500px at 8% 0%, rgba(252,174,75,0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }

::selection{ background: var(--ice); color: #04201f; }

:focus-visible{
  outline: 2px solid var(--ice-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

/* scrollbar, kept quiet */
::-webkit-scrollbar{ width: 11px; }
::-webkit-scrollbar-track{ background: var(--bg); }
::-webkit-scrollbar-thumb{ background: var(--surface-3); border-radius: 8px; border: 3px solid var(--bg); }

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section{ padding: clamp(56px, 9vw, 108px) 0; }
.section-tight{ padding: clamp(36px, 6vw, 64px) 0; }

h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--text);
}
h1{ font-size: clamp(2.6rem, 5.4vw, 4.6rem); line-height: 1.03; letter-spacing: -0.02em; }
h2{ font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.1; }
h3{ font-size: clamp(1.15rem, 1.6vw, 1.4rem); }
p{ margin: 0 0 1em; color: var(--text-muted); }
strong{ color: var(--text); }

.lede{ font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-muted); max-width: 56ch; }

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember-strong);
  margin-bottom: 14px;
}
.eyebrow::before{
  content: "";
  width: 18px; height: 1px;
  background: var(--ember-strong);
  display: inline-block;
}
.eyebrow.ice{ color: var(--ice-strong); }
.eyebrow.ice::before{ background: var(--ice-strong); }

/* =========================================================================
   NAV
   ========================================================================= */
.site-nav{
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 14, 26, 0.72);
  border-bottom: 1px solid var(--border);
}
.site-nav .container{
  display: flex; align-items: center; justify-content: space-between;
  height: 74px;
}
.brand{ display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand svg{ width: 30px; height: 30px; flex-shrink: 0; }
.brand span.rest{ color: var(--text-muted); font-weight: 500; }

.nav-links{ display: flex; align-items: center; gap: 2px; }
.nav-links a{
  padding: 9px 16px; border-radius: 999px; font-size: 0.92rem; color: var(--text-muted);
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover{ color: var(--text); background: var(--surface-2); }
.nav-links a.current{ color: var(--ice-strong); }

.nav-cta{ display: flex; align-items: center; gap: 10px; }

.nav-toggle{
  display: none;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after{
  content: ""; display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; position: relative;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle span::before{ position: absolute; top: -6px; }
.nav-toggle span::after{ position: absolute; top: 6px; }

@media (max-width: 860px){
  .nav-links{
    position: absolute; top: 74px; left: 0; right: 0;
    background: var(--bg-elevated); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch; padding: 10px var(--gutter) 16px;
    display: none;
  }
  .site-nav.open .nav-links{ display: flex; }
  .nav-links a{ padding: 12px 8px; border-radius: 8px; }
  .nav-toggle{ display: flex; }
  .nav-cta .btn-label{ display: none; }
}

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn{
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.94rem;
  padding: 12px 20px; border-radius: 10px; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: linear-gradient(135deg, var(--ember), var(--ember-strong));
  color: #241304;
  box-shadow: 0 8px 24px -10px rgba(252,174,75,0.55);
}
.btn-primary:hover{ box-shadow: 0 10px 30px -8px rgba(252,174,75,0.7); transform: translateY(-1px); }
.btn-ghost{
  background: var(--surface-2); color: var(--text); border-color: var(--border-strong);
}
.btn-ghost:hover{ border-color: var(--ice); color: var(--ice-strong); }
.btn-ice{
  background: var(--ice-dim); color: var(--ice-strong); border-color: rgba(79,217,214,0.35);
}
.btn-ice:hover{ background: rgba(79,217,214,0.22); }
.btn-sm{ padding: 8px 14px; font-size: 0.85rem; }
.btn svg{ width: 16px; height: 16px; }

/* =========================================================================
   HERO
   ========================================================================= */
.hero{ position: relative; overflow: hidden; padding-top: clamp(60px, 9vw, 100px); }
.hero-grid{
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(30px, 5vw, 60px);
  align-items: center;
}
@media (max-width: 980px){ .hero-grid{ grid-template-columns: 1fr; } }

.hero-actions{ display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.brand-logo{
  width: 38px; height: 38px; border-radius: 9px; object-fit: cover;
  box-shadow: 0 0 0 1px var(--border-strong);
}

.hero-showcase{
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(22px, 4vw, 48px);
  align-items: center; margin-top: clamp(36px, 6vw, 56px);
}
@media (max-width: 900px){ .hero-showcase{ grid-template-columns: 1fr; } }

.logo-stage{
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 260px;
}
.logo-glow{
  position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,217,214,0.20), rgba(252,174,75,0.10) 55%, transparent 72%);
  filter: blur(6px);
}
.logo-stage img{
  position: relative; width: min(280px, 78%); border-radius: 26px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6), 0 0 0 1px var(--border-strong);
  animation: floatIsland 6.5s ease-in-out infinite;
}
@keyframes floatIsland{
  0%, 100%{ transform: translateY(0) rotate(-1.2deg); }
  50%{ transform: translateY(-16px) rotate(1.2deg); }
}

.hero-peaks{
  position: absolute; left: 0; right: 0; bottom: 0; height: 220px;
  pointer-events: none; opacity: 0.55;
}
.hero-peaks svg{ width: 100%; height: 100%; }

/* ---- IP / join capsule ---- */
.ip-capsule{
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 26px; padding: 10px 10px 10px 18px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px;
}
.ip-capsule .ip-text{ font-family: var(--font-mono); font-size: 0.98rem; color: var(--ice-strong); letter-spacing: 0.02em; }
.ip-capsule button{
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; display:flex; align-items:center; gap:6px;
  transition: background .15s ease, color .15s ease;
}
.ip-capsule button:hover{ background: var(--ice-dim); color: var(--ice-strong); }
.ip-capsule button svg{ width: 14px; height: 14px; }

/* =========================================================================
   BEACON — the signature live-status widget
   ========================================================================= */
.beacon{
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--bg-elevated));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px 26px 22px;
  clip-path: polygon(0 0, calc(100% - var(--edge)) 0, 100% var(--edge), 100% 100%, 0 100%);
}
.beacon::before{
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(140deg, rgba(79,217,214,0.35), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.beacon-top{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.beacon-title{ font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }

.beacon-dot{
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 0 0 0 transparent;
}
.beacon-dot.online{
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-dim);
  animation: pulse 2.2s ease-in-out infinite;
}
.beacon-dot.offline{ background: var(--danger); box-shadow: 0 0 0 4px var(--danger-dim); }
.beacon-dot.loading{ background: var(--text-dim); animation: blink 1.1s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{ box-shadow: 0 0 0 4px var(--success-dim);} 50%{ box-shadow: 0 0 0 9px transparent;} }
@keyframes blink{ 0%,100%{ opacity: 1;} 50%{ opacity: 0.25;} }

.beacon-status-row{ display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.beacon-status-text{ font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.beacon-status-text.online{ color: var(--success); }
.beacon-status-text.offline{ color: var(--danger); }

.beacon-players{ font-family: var(--font-mono); color: var(--text-muted); font-size: 0.94rem; margin-bottom: 18px; }
.beacon-players b{ color: var(--ice-strong); font-weight: 600; }

.beacon-bar{
  height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-bottom: 18px;
}
.beacon-bar-fill{
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--ice), var(--ember));
  width: 0%; transition: width .6s ease;
}

.beacon-meta{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; font-size: 0.84rem; }
.beacon-meta div{ display: flex; flex-direction: column; gap: 2px; }
.beacon-meta .k{ color: var(--text-dim); font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; }
.beacon-meta .v{ color: var(--text); font-family: var(--font-mono); font-size: 0.86rem; word-break: break-word; }

.beacon-note{ font-size: 0.78rem; color: var(--text-dim); margin-top: 16px; margin-bottom: 0; }
.beacon-note button{ background: none; border: none; color: var(--ice-strong); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

/* =========================================================================
   BRIDGE DIVIDER — planks + rope rails between sections
   ========================================================================= */
.bridge-divider{
  display: flex; align-items: center; gap: 6px;
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  position: relative;
}
.bridge-divider::before, .bridge-divider::after{
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 30%, var(--border-strong) 70%, transparent);
}
.bridge-divider .planks{ display: flex; gap: 5px; }
.bridge-divider .plank{
  width: 20px; height: 8px; border-radius: 2px;
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--border-strong);
}
.bridge-divider .plank:nth-child(odd){ background: linear-gradient(180deg, var(--surface-2), var(--surface)); }

/* =========================================================================
   CARDS — angled "cut stone" corner
   ========================================================================= */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  clip-path: polygon(0 0, calc(100% - var(--edge)) 0, 100% var(--edge), 100% 100%, 0 100%);
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.card:hover{ border-color: var(--border-strong); transform: translateY(-3px); }

.card-icon{
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ice-dim); color: var(--ice-strong); margin-bottom: 16px;
}
.card-icon svg{ width: 22px; height: 22px; }
.card-icon.ember{ background: var(--ember-dim); color: var(--ember-strong); }

.grid{ display: grid; gap: 18px; }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px){ .grid-3{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px){ .grid-3, .grid-2{ grid-template-columns: 1fr; } }

/* =========================================================================
   ROLE / RANK CHIPS (index teaser + apply tabs)
   ========================================================================= */
.role-chips{ display: flex; flex-wrap: wrap; gap: 10px; }
.role-chip{
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.9rem; color: var(--text-muted);
  cursor: pointer; transition: all .15s ease;
}
.role-chip svg{ width: 16px; height: 16px; }
.role-chip:hover{ color: var(--text); border-color: var(--border-strong); }
.role-chip.active{ background: var(--ice-dim); border-color: rgba(79,217,214,0.4); color: var(--ice-strong); }

/* =========================================================================
   APPLY PAGE — role detail card
   ========================================================================= */
.role-panel{ display: none; }
.role-panel.active{ display: block; animation: fadeUp .35s ease; }
@keyframes fadeUp{ from{ opacity: 0; transform: translateY(8px);} to{ opacity: 1; transform: translateY(0);} }

.role-head{ display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.role-head-icon{
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--ember-dim); color: var(--ember-strong);
}
.role-head-icon svg{ width: 26px; height: 26px; }
.role-badge{
  display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-dim); background: var(--surface-2);
  border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; margin-bottom: 6px;
}

.req-list{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.req-list li{
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.req-list li:last-child{ border-bottom: none; }
.req-check{
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0; margin-top: 1px;
  background: var(--success-dim); color: var(--success);
  display: flex; align-items: center; justify-content: center;
}
.req-check svg{ width: 12px; height: 12px; }
.req-list p{ margin: 0; color: var(--text); }
.req-list .req-sub{ color: var(--text-muted); font-size: 0.88rem; margin-top: 2px; }

.notice{
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 8px;
  border: 1px solid; font-size: 0.9rem;
}
.notice svg{ width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.notice p{ margin: 0; }
.notice-ember{ background: var(--ember-dim); border-color: rgba(252,174,75,0.3); color: var(--ember-strong); }
.notice-danger{ background: var(--danger-dim); border-color: rgba(247,112,102,0.3); color: var(--danger); }
.notice-ice{ background: var(--ice-dim); border-color: rgba(79,217,214,0.3); color: var(--ice-strong); }

.steps{ list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 16px; }
.steps li{
  counter-increment: step;
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start;
}
.steps li::before{
  content: counter(step);
  font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--ice-strong); display: flex; align-items: center; justify-content: center;
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer{ border-top: 1px solid var(--border); padding: 48px 0 32px; }
.footer-grid{ display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 36px; }
@media (max-width: 720px){ .footer-grid{ grid-template-columns: 1fr; } }
.footer-col h4{ font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 14px; }
.footer-col a{ display: block; color: var(--text-muted); padding: 6px 0; font-size: 0.92rem; transition: color .15s ease; }
.footer-col a:hover{ color: var(--ice-strong); }
.footer-bottom{ display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 24px; border-top: 1px solid var(--border); }
.footer-bottom small{ color: var(--text-dim); font-size: 0.82rem; }
.footer-disclaimer{ color: var(--text-dim); font-size: 0.8rem; max-width: 60ch; }

/* =========================================================================
   LEGAL PAGES (tos / privacy)
   ========================================================================= */
.legal-wrap{ display: grid; grid-template-columns: 260px 1fr; gap: 48px; align-items: start; }
@media (max-width: 900px){ .legal-wrap{ grid-template-columns: 1fr; } }
.legal-toc{
  position: sticky; top: 96px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px;
}
.legal-toc .k{ font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 10px; display: block; }
.legal-toc a{ display: block; padding: 7px 0; font-size: 0.87rem; color: var(--text-muted); border-left: 2px solid transparent; padding-left: 10px; margin-left: -10px; }
.legal-toc a:hover{ color: var(--text); }

.legal-body h2{ font-size: 1.35rem; margin-top: 2.2em; scroll-margin-top: 96px; }
.legal-body h2:first-child{ margin-top: 0; }
.legal-body h3{ font-size: 1.05rem; margin-top: 1.6em; color: var(--text); }
.legal-body p, .legal-body li{ color: var(--text-muted); }
.legal-body ul, .legal-body ol{ padding-left: 1.3em; }
.legal-body li{ margin-bottom: 0.5em; }
.legal-body a.inline{ color: var(--ice-strong); text-decoration: underline; text-underline-offset: 2px; }
.legal-meta{ font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-dim); margin-bottom: 8px; }

.callout{
  background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--ice);
  border-radius: var(--radius-sm); padding: 16px 18px; margin: 1.4em 0;
}
.callout p:last-child{ margin-bottom: 0; }

/* =========================================================================
   MISC / REDIRECT PAGE
   ========================================================================= */
.redirect-screen{
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 22px; padding: 40px;
}
.spinner{
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--surface-3); border-top-color: var(--ice-strong);
  animation: spin 0.9s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

.center-text{ text-align: center; }
.mt-0{ margin-top: 0; }
