:root {
  --ink: #2b1b10;
  --ink-soft: #5f4937;
  --brown: #3a210f;
  --brown-2: #563019;
  --cream: #fff8df;
  --paper: #f4e7b8;
  --gold: #d8a936;
  --gold-light: #ffe189;
  --green: #5d8d31;
  --green-bright: #8ed331;
  --teal: #3bb8a8;
  --red: #a33b2e;
  --shadow: 0 22px 64px rgba(42, 24, 9, 0.2);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background: #efe4c4;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f8f0d8; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 100; padding: .7rem 1rem; background: #fff; }
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 78px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  gap: 2rem;
  padding: 0 clamp(1rem, 4vw, 4rem);
  background: rgba(44, 25, 12, .96);
  color: var(--cream);
  border-bottom: 2px solid #8b5a1e;
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: .75rem; width: max-content; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font-size: 1.22rem; letter-spacing: .17em; color: #fff7da; }
.brand small { margin-top: .32rem; font-size: .57rem; letter-spacing: .2em; color: #e8b94e; }
.brand-mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: #405e2a;
  box-shadow: inset 0 0 0 4px #2c401e;
  transform: rotate(-10deg);
}
.brand-mark span { width: 25px; height: 10px; border: 4px solid var(--gold-light); border-width: 4px 0 0 4px; border-radius: 100% 0; transform: rotate(-35deg); }
.brand-mark::after { content: ""; position: absolute; width: 30px; height: 2px; background: var(--gold-light); transform: rotate(-42deg); }
.brand-mark.small { width: 37px; height: 37px; }

nav { display: flex; gap: clamp(1rem, 3vw, 2.6rem); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
nav a { position: relative; padding: 1.8rem 0; color: #e9dbc2; }
nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 1.2rem; height: 2px; background: var(--gold); transition: right .2s ease; }
nav a:hover::after, nav a:focus-visible::after { right: 0; }
.status-pill { justify-self: end; display: inline-flex; align-items: center; gap: .55rem; padding: .55rem .85rem; border: 1px solid #775326; border-radius: 99px; font-size: .75rem; color: #f3e7ce; background: #23150c; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #bd7439; box-shadow: 0 0 0 4px rgba(189,116,57,.15); }
.is-online .status-dot, .is-online.status-orb { background: var(--green-bright); box-shadow: 0 0 0 4px rgba(142,211,49,.16), 0 0 18px rgba(142,211,49,.7); }

.hero { position: relative; min-height: min(760px, calc(100vh - 78px)); overflow: hidden; background: #36522c; color: #fff8df; }
.hero-art { position: absolute; inset: 0; background: url('/assets/retro-valley-hero.png') center center / cover no-repeat; transform: scale(1.01); }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(34,19,8,.9) 0%, rgba(40,24,11,.68) 35%, rgba(34,20,8,.14) 70%), linear-gradient(0deg, rgba(26,17,8,.6), transparent 55%); }
.hero-copy { position: relative; z-index: 2; width: min(630px, calc(100% - 3rem)); padding: clamp(5rem, 10vh, 8.5rem) 0 9rem clamp(1.5rem, 8vw, 8rem); }
.eyebrow { margin: 0 0 1.2rem; color: var(--gold-light); font-size: .78rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.eyebrow::before { content: ""; display: inline-block; width: 2.5rem; height: 2px; margin-right: .8rem; vertical-align: middle; background: currentColor; }
.eyebrow.dark { color: #9a6820; }
.hero h1, .intro h2, .join-copy h2, .download-section h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 700; letter-spacing: -.035em; }
.hero h1 { max-width: 600px; font-size: clamp(3.7rem, 7vw, 6.6rem); line-height: .9; text-shadow: 0 4px 20px rgba(0,0,0,.3); }
.hero h1 em { color: var(--gold-light); font-style: normal; }
.hero-copy > p:not(.eyebrow) { max-width: 575px; margin: 2rem 0; color: #f5ead4; font-size: clamp(1rem, 1.7vw, 1.25rem); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: .85rem 1.45rem; border: 0; border-radius: 4px; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible, input:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.button-primary { color: #2e210d; background: linear-gradient(#ffe483, #dda934); box-shadow: 0 5px 0 #815817, 0 12px 26px rgba(0,0,0,.25); }
.button-ghost { color: #fff7df; border: 1px solid rgba(255,255,255,.55); background: rgba(36,21,11,.45); }
.hero-card { position: absolute; z-index: 3; right: clamp(1.5rem, 5vw, 5rem); bottom: 2.5rem; display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 1rem; min-width: 310px; padding: 1rem 1.2rem; border: 1px solid rgba(255,225,137,.38); background: rgba(43,25,12,.9); box-shadow: var(--shadow); }
.status-orb { width: 14px; height: 14px; border-radius: 50%; background: #be7739; }
.hero-card div { display: flex; flex-direction: column; }
.hero-card small { color: var(--gold-light); font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero-card strong { margin-top: .2rem; font-size: .88rem; }
.latency { justify-self: end; color: #e2cda1; font-size: .75rem; }

.intro { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(3rem, 8vw, 8rem); padding: clamp(5rem, 9vw, 9rem) clamp(1.5rem, 8vw, 8rem) 3rem; background: #fff9e8; }
.intro h2, .join-copy h2, .download-section h2 { font-size: clamp(2.7rem, 5vw, 4.7rem); line-height: 1.02; }
.intro > p { align-self: end; margin: 0 0 .7rem; max-width: 650px; color: var(--ink-soft); font-size: 1.1rem; line-height: 1.8; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3rem clamp(1.5rem, 8vw, 8rem) 8rem; background: #fff9e8; }
.feature-grid article { padding: 2.2rem; border: 1px solid #d8cba8; background: #f9efd2; }
.feature-grid article + article { border-left: 0; }
.feature-grid span { color: #ae7822; font-family: Georgia, serif; font-weight: 700; }
.feature-grid h3 { margin: 2rem 0 .7rem; font-family: Georgia, serif; font-size: 1.4rem; }
.feature-grid p { margin: 0; color: var(--ink-soft); line-height: 1.65; }

.join-section { display: grid; grid-template-columns: minmax(0, .85fr) minmax(520px, 1.15fr); gap: clamp(3rem, 8vw, 8rem); padding: clamp(5rem, 9vw, 9rem) clamp(1.5rem, 8vw, 8rem); background: radial-gradient(circle at 10% 10%, #634122 0, transparent 35%), #2c190d; color: #fff6db; }
.join-copy > p:not(.eyebrow) { max-width: 580px; color: #d9c8ac; line-height: 1.75; }
.join-copy ol { margin: 3rem 0 0; padding: 0; list-style: none; counter-reset: join; }
.join-copy li { position: relative; display: flex; flex-direction: column; margin: 0 0 1.7rem; padding-left: 3.6rem; counter-increment: join; }
.join-copy li::before { content: counter(join); position: absolute; left: 0; display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border: 1px solid #a7792c; border-radius: 50%; color: var(--gold-light); font-family: Georgia, serif; }
.join-copy li strong { color: #fff7df; font-family: Georgia, serif; font-size: 1.08rem; }
.join-copy li span { margin-top: .3rem; color: #bfae95; line-height: 1.5; }
.register-card { align-self: start; padding: clamp(1.5rem, 4vw, 3.2rem); border: 2px solid #b07b24; border-radius: 8px; color: var(--ink); background: linear-gradient(145deg, #fff9e8, #efdda5); box-shadow: 0 15px 0 #1b0d06, var(--shadow); }
.card-heading { display: flex; align-items: center; gap: 1rem; margin-bottom: 2.2rem; padding-bottom: 1.5rem; border-bottom: 1px solid #cdbb88; }
.card-heading p { margin: 0 0 .2rem; color: #9b6722; font-size: .68rem; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
.card-heading h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.rune { display: grid; place-items: center; flex: 0 0 52px; height: 52px; border: 3px double #9a681e; border-radius: 50%; color: #fff6d4; background: #537a31; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 700; }
.register-card > label, .field-row label { display: flex; flex-direction: column; color: #5f4027; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input[type="text"], input[type="email"], input[type="password"], input:not([type]) { width: 100%; height: 52px; margin-top: .5rem; padding: 0 .9rem; border: 1px solid #b9a77b; border-radius: 4px; color: var(--ink); background: rgba(255,255,255,.75); box-shadow: inset 0 2px 4px rgba(62,35,10,.08); text-transform: none; }
.register-card > label, .field-row { margin-bottom: 1rem; }
.field-error { min-height: 1.05rem; margin-top: .25rem; color: var(--red); font-size: .68rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.check-field { flex-direction: row !important; align-items: flex-start; gap: .7rem; margin: .4rem 0 0 !important; font-size: .76rem !important; font-weight: 600 !important; letter-spacing: 0 !important; line-height: 1.4; text-transform: none !important; }
.check-field input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.terms-error { display: block; }
.form-message { display: none; margin: .9rem 0; padding: .8rem; border: 1px solid #c8a760; background: rgba(255,250,218,.7); font-size: .85rem; line-height: 1.45; }
.form-message.visible { display: block; }
.form-message.success { border-color: #749a42; color: #355319; background: #edf6d5; }
.form-message.error { border-color: #b86453; color: #772b24; background: #f9ded3; }
.button-submit { justify-content: space-between; width: 100%; margin-top: .5rem; color: #27310e; background: linear-gradient(#9cdd3e, #5b971c); box-shadow: 0 5px 0 #315112; }
.button-submit:disabled { cursor: wait; opacity: .65; transform: none; }
.privacy-note { margin: 1.2rem 0 0; color: #756346; font-size: .68rem; text-align: center; }

.download-section { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(1.5rem, 4vw, 3rem); padding: clamp(4rem, 7vw, 7rem) clamp(1.5rem, 8vw, 8rem); color: var(--ink); background: linear-gradient(120deg, #e8c565, #f8e8ad 60%, #fff7d9); }
.download-badge { display: grid; place-items: center; width: 105px; height: 105px; border: 1px solid #a87724; border-radius: 50%; background: #fff2c7; box-shadow: inset 0 0 0 10px rgba(182,129,34,.12); }
.download-section h2 { font-size: clamp(2.1rem, 4vw, 3.7rem); }
.download-section p:not(.eyebrow) { max-width: 670px; color: #644b31; line-height: 1.7; }
.button-download { min-width: 250px; flex-direction: column; color: #fff7de; background: var(--brown); box-shadow: 0 5px 0 #a06d21; }
.button-download small { margin-top: .25rem; color: #ddc79c; font-size: .6rem; font-weight: 500; letter-spacing: .05em; text-transform: none; }

footer { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 2.4rem clamp(1.5rem, 8vw, 8rem); color: #c7b69c; background: #211208; font-size: .72rem; }
.footer-brand { color: #fff; }

@media (max-width: 950px) {
  .site-header { grid-template-columns: 1fr auto; }
  nav { display: none; }
  .intro, .join-section { grid-template-columns: 1fr; }
  .join-section { gap: 4rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article + article { border-left: 1px solid #d8cba8; border-top: 0; }
  .download-section { grid-template-columns: auto 1fr; }
  .button-download { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .site-header { height: 68px; }
  .brand strong { font-size: 1rem; }
  .brand-mark { width: 37px; height: 37px; }
  .status-pill { padding: .45rem; }
  .status-pill span:last-child { display: none; }
  .hero { min-height: 720px; }
  .hero-copy { padding-left: 1.5rem; padding-top: 5rem; }
  .hero h1 { font-size: clamp(3.3rem, 18vw, 4.6rem); }
  .hero-card { left: 1.5rem; right: 1.5rem; min-width: 0; }
  .intro { gap: 2rem; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .join-section { grid-template-columns: minmax(0, 1fr); }
  .register-card { padding: 1.3rem; }
  .card-heading { align-items: flex-start; }
  .download-section { grid-template-columns: 1fr; }
  .download-badge { width: 80px; height: 80px; }
  footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
