/* ============================================================
   KAMPUNG FYP - Landing Page (Patensify-inspired High-Contrast Editorial)
   Monochrome Obsidian / Pure White + single amber status accent
   4px grid · weights 400–600 · Big Type footer · Light & Dark toggle
   ============================================================ */

:root {
  color-scheme: dark light;
  --bg: light-dark(#ffffff, #09090b);
  --surface: light-dark(#f8f8f9, #111114);
  --raised: light-dark(#f0f0f2, #1a1a1f);
  --line: light-dark(rgba(9, 9, 11, 0.09), rgba(255, 255, 255, 0.09));
  --line-2: light-dark(rgba(9, 9, 11, 0.17), rgba(255, 255, 255, 0.16));

  --ink: light-dark(#09090b, #fafafa);
  --ink-2: light-dark(#52525b, #a1a1aa);
  --ink-3: light-dark(#71717a, #71717a);

  --pill-bg: light-dark(#09090b, #ffffff);
  --pill-ink: light-dark(#ffffff, #09090b);

  --accent: #f2b544;
  --accent-text: light-dark(#9a6309, #f2b544);
  --accent-soft: light-dark(rgba(242, 181, 68, 0.16), rgba(242, 181, 68, 0.14));

  --ok: light-dark(#15803d, #4ade80);
  --ok-soft: light-dark(rgba(21, 128, 61, 0.1), rgba(74, 222, 128, 0.14));
  --bad: light-dark(#dc2626, #f87171);
  --bad-soft: light-dark(rgba(220, 38, 38, 0.1), rgba(248, 113, 113, 0.14));

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  &:has(> head > meta[name="color-scheme"][content="dark"]) { color-scheme: dark; }
  &:has(> head > meta[name="color-scheme"][content="light"]) { color-scheme: light; }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(light-dark(rgba(9, 9, 11, 0.06), rgba(255, 255, 255, 0.045)) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  font: 400 15px/24px var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

svg.i {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.wrap {
  width: min(1140px, 100%);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navigation (Ultra-minimal Patensify top bar) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: light-dark(rgba(255, 255, 255, 0.88), rgba(9, 9, 11, 0.86));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.topbar-in {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 15px/1 var(--sans);
  letter-spacing: -0.01em;
}
.brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}
.navlinks {
  display: flex;
  align-items: center;
  gap: 24px;
}
.navlinks a {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.15s var(--ease);
}
.navlinks a:hover { color: var(--ink); }

.nav-actions, .nav-auth {
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon-toggle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-toggle:hover { background: var(--raised); color: var(--ink); }

.text-link {
  background: none;
  border: 0;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.15s var(--ease);
}
.text-link:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font: 500 13px/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.12s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--raised); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn.pill { border-radius: 999px; }
.btn.lg { min-height: 46px; padding: 0 24px; font-size: 14px; }
.btn.sm { min-height: 32px; padding: 0 14px; font-size: 12px; }
.btn.primary {
  background: var(--pill-bg);
  border-color: var(--pill-bg);
  color: var(--pill-ink);
  font-weight: 600;
}
.btn.primary:hover:not(:disabled) { opacity: 0.88; background: var(--pill-bg); }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn.full { width: 100%; min-height: 46px; font-size: 14px; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Dramatic Centered Hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 88px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
}
/* Bespoke 3D Kampung FYP atmospheric village diorama backdrop */
.hero-scene {
  position: absolute;
  inset: 0 0 auto;
  height: 860px;
  pointer-events: none;
  overflow: hidden;
}
.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 72%;
  opacity: 0.78;
  transform: scale(1.02);
  filter: saturate(0.96) contrast(1.06);
  transition: opacity 0.35s var(--ease), filter 0.35s var(--ease);
}
:root:has(> head > meta[name="color-scheme"][content="light"]) .hero-bg-img {
  opacity: 0.96;
  filter: brightness(1.22) contrast(1.08) saturate(1.16);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 40%, rgba(0, 0, 0, 0.72) 52%, #000 64%, #000 84%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, transparent 40%, rgba(0, 0, 0, 0.72) 52%, #000 64%, #000 84%, transparent 100%);
}
/* Seamless obsidian/white vignette & central readability veil */
.hero-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 44% 40% at 50% 42%, light-dark(rgba(255, 255, 255, 0.94), rgba(9, 9, 11, 0.72)) 0%, transparent 100%),
    linear-gradient(180deg,
      light-dark(rgba(255, 255, 255, 0.92), rgba(9, 9, 11, 0.55)) 0%,
      light-dark(rgba(255, 255, 255, 0.52), transparent) 32%,
      transparent 62%,
      light-dark(rgba(255, 255, 255, 0.78), rgba(9, 9, 11, 0.84)) 88%,
      var(--bg) 100%),
    linear-gradient(90deg, var(--bg) 0%, transparent 8%, transparent 92%, var(--bg) 100%);
}
/* Subtle floating amber fireflies (kunang-kunang) canvas */
.hero-fireflies {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 860px;
  pointer-events: none;
  opacity: 0.88;
}
:root:has(> head > meta[name="color-scheme"][content="light"]) .hero-fireflies {
  opacity: 0.65;
}
/* Quiet concentric radar rings inspired by Patensify */
.hero-rings {
  position: absolute;
  inset: -120px 0 auto;
  height: 760px;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 50% 42%, transparent 0 180px, var(--line) 180px 181px, transparent 181px 320px, var(--line) 320px 321px, transparent 321px 480px, var(--line) 480px 481px, transparent 481px);
  opacity: 0.65;
}
.hero-in {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.hero-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: var(--accent);
}
.hero-title {
  margin: 0;
  max-width: 24ch;
  font: 500 clamp(34px, 5.2vw, 62px)/1.06 var(--sans);
  letter-spacing: -0.035em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero-title .dim {
  color: var(--ink-3);
  font-weight: 400;
}
.hero-sub {
  margin: 0;
  max-width: 56ch;
  font-size: 16px;
  line-height: 26px;
  color: var(--ink-2);
}
.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.hero-cta .btn.ghost {
  background: light-dark(rgba(255, 255, 255, 0.72), rgba(9, 9, 11, 0.65));
  backdrop-filter: blur(8px);
}
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  border-radius: 16px;
  background: light-dark(rgba(255, 255, 255, 0.72), rgba(9, 9, 11, 0.52));
  backdrop-filter: blur(8px);
  width: min(640px, 100%);
}
.hero-meta > div { display: grid; gap: 2px; }
.hero-meta b { font: 500 22px/1.1 var(--sans); }
.hero-meta span { font-size: 12px; color: var(--ink-2); }

/* Product Stage Showcase */
.stage-card {
  width: 100%;
  margin-top: 56px;
  background: light-dark(rgba(248, 248, 249, 0.92), rgba(17, 17, 20, 0.86));
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  text-align: left;
}
.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: center;
}
.stage-visual {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  background: #171b24;
}
.stage-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.stage-badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(9, 9, 11, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  color: #fafafa;
  font: 500 12px/1 var(--sans);
}
.stage-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.stage-side {
  display: grid;
  gap: 16px;
  padding: 8px;
}
.stage-kicker {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
}
.stage-caption {
  margin: 0;
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-2);
}

.ktp-card {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--accent);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 12px;
}
.ktp-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.ktp-top b { display: block; font: 600 13px/18px var(--sans); }
.ktp-top span { font-size: 12px; color: var(--ink-3); }
.chip-ok {
  font-size: 11px;
  font-weight: 600;
  color: var(--ok);
  background: var(--ok-soft);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.ktp-mid { display: flex; align-items: center; gap: 12px; }
.ktp-av {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent);
  color: #141415;
  display: grid;
  place-items: center;
  font: 600 18px/1 var(--sans);
  flex: none;
}
.ktp-rows { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ktp-rows b { font: 600 14px/18px var(--sans); }
.ktp-rows span { font-size: 12px; color: var(--ink-2); }
.ktp-nik {
  font: 500 12px/1 var(--mono);
  color: var(--ink-2);
  background: var(--raised);
  padding: 4px 8px;
  border-radius: 6px;
  justify-self: start;
}
.ktp-socs { display: flex; flex-wrap: wrap; gap: 6px; }
.ktp-socs span {
  font-size: 12px;
  color: var(--ink-2);
  background: var(--raised);
  padding: 3px 8px;
  border-radius: 6px;
}

/* ---------- Sections & Per-Section 3D Backdrops ---------- */
.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--line);
}
.has-bg {
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.has-bg > .wrap {
  position: relative;
  z-index: 2;
}
.sec-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.sec-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.35s var(--ease), filter 0.35s var(--ease);
}

/* Diorama sections (Balai Warga, Stadion Kampung + Warung Kopi) */
.bg-diorama .sec-bg-img {
  object-position: center 78%;
  opacity: 0.62;
  filter: saturate(0.96) contrast(1.06);
}
.bg-diorama .sec-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--bg) 0%, transparent 24%, transparent 76%, var(--bg) 100%),
    linear-gradient(90deg, var(--bg) 0%, transparent 8%, transparent 92%, var(--bg) 100%);
}
:root:has(> head > meta[name="color-scheme"][content="light"]) .bg-diorama .sec-bg-img {
  opacity: 0.92;
  filter: brightness(1.2) contrast(1.08) saturate(1.16);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 26%, rgba(0, 0, 0, 0.76) 44%, #000 62%, #000 88%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, transparent 26%, rgba(0, 0, 0, 0.76) 44%, #000 62%, #000 88%, transparent 100%);
}
:root:has(> head > meta[name="color-scheme"][content="light"]) .bg-diorama .sec-bg::after {
  background:
    radial-gradient(ellipse 55% 42% at 32% 18%, rgba(255, 255, 255, 0.92) 0%, transparent 100%),
    linear-gradient(180deg, var(--bg) 0%, rgba(255, 255, 255, 0.36) 24%, transparent 58%, rgba(255, 255, 255, 0.65) 88%, var(--bg) 100%),
    linear-gradient(90deg, var(--bg) 0%, transparent 8%, transparent 92%, var(--bg) 100%);
}

/* Live 3D Map sections (Wilayah RT & FAQ Alun-Alun) */
.bg-map .sec-bg-img {
  object-position: center;
  opacity: 0.42;
  filter: brightness(0.46) contrast(1.16) saturate(0.84);
}
.bg-map .sec-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 58% at 50% 42%, rgba(9, 9, 11, 0.48) 0%, rgba(9, 9, 11, 0.78) 100%),
    linear-gradient(180deg, var(--bg) 0%, transparent 22%, transparent 78%, var(--bg) 100%);
}
:root:has(> head > meta[name="color-scheme"][content="light"]) .bg-map .sec-bg-img {
  opacity: 0.56;
  filter: brightness(1.02) contrast(1.12) saturate(1.12);
}
:root:has(> head > meta[name="color-scheme"][content="light"]) .bg-map .sec-bg::after {
  background:
    radial-gradient(ellipse 58% 48% at 30% 20%, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.35) 100%),
    linear-gradient(180deg, var(--bg) 0%, rgba(255, 255, 255, 0.25) 20%, rgba(255, 255, 255, 0.18) 76%, var(--bg) 100%),
    linear-gradient(90deg, var(--bg) 0%, transparent 8%, transparent 92%, var(--bg) 100%);
}

/* Big Footer 3D Pos Ronda floating island artwork */
.bg-footer .sec-bg-img {
  position: absolute;
  right: 4%;
  bottom: -14%;
  width: min(460px, 42vw);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  opacity: 0.56;
  filter: saturate(0.95) contrast(1.05);
  -webkit-mask-image: radial-gradient(circle at 50% 48%, #000 38%, rgba(0, 0, 0, 0.45) 50%, transparent 60%);
  mask-image: radial-gradient(circle at 50% 48%, #000 38%, rgba(0, 0, 0, 0.45) 50%, transparent 60%);
}
:root:has(> head > meta[name="color-scheme"][content="light"]) .bg-footer .sec-bg-img {
  opacity: 0.92;
  filter: brightness(1.06) contrast(1.08) saturate(1.12);
  -webkit-mask-image: radial-gradient(circle at 50% 48%, #000 36%, rgba(0, 0, 0, 0.5) 45%, transparent 50%);
  mask-image: radial-gradient(circle at 50% 48%, #000 36%, rgba(0, 0, 0, 0.5) 45%, transparent 50%);
}

.sec-head {
  display: grid;
  gap: 10px;
  max-width: 40rem;
  margin-bottom: 40px;
}
.sec-kicker {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.sec-head h2 {
  margin: 0;
  font: 500 clamp(28px, 3.4vw, 40px)/1.12 var(--sans);
  letter-spacing: -0.025em;
}
.sec-head p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

/* 3 Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: light-dark(rgba(255, 255, 255, 0.86), rgba(17, 17, 20, 0.80));
  backdrop-filter: blur(14px);
}
.step-item {
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 12px;
  align-content: start;
}
.step-item:last-child { border-right: 0; }
.step-no { font-size: 12px; color: var(--accent-text); }
.step-item h3 { margin: 0; font: 600 16px/22px var(--sans); }
.step-item p { margin: 0; font-size: 14px; line-height: 22px; color: var(--ink-2); }

/* RT Status Board */
.rt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: start;
}
.rt-featured {
  background: light-dark(rgba(255, 255, 255, 0.88), rgba(17, 17, 20, 0.82));
  backdrop-filter: blur(14px);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 24px;
  display: grid;
  gap: 16px;
}
.rt-feat-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rt-title { display: inline-flex; align-items: center; gap: 10px; font: 600 18px/24px var(--sans); }
.rt-dot { width: 9px; height: 9px; border-radius: 5px; background: var(--dc, var(--accent)); flex: none; }
.rt-count { font: 500 30px/1 var(--sans); }
.rt-count small { font-size: 14px; font-weight: 400; color: var(--ink-3); }
.prog-track { height: 6px; background: var(--raised); border-radius: 3px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.rt-note { margin: 0; font-size: 14px; color: var(--ink-2); }

.rt-list {
  background: light-dark(rgba(255, 255, 255, 0.88), rgba(17, 17, 20, 0.82));
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.rt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.rt-row:last-child { border-bottom: 0; }
.rt-row-left { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.rt-row-right { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.rt-row.open .rt-row-right { color: var(--ok); font-weight: 500; }

/* Facilities */
.fac-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.fac-card {
  background: light-dark(rgba(255, 255, 255, 0.88), rgba(17, 17, 20, 0.80));
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.fac-head { display: flex; align-items: center; gap: 10px; font: 600 15px/20px var(--sans); }
.fac-head svg.i { color: var(--ink-2); }
.fac-card p { margin: 0; font-size: 14px; line-height: 21px; color: var(--ink-2); }

/* FAQ */
.faq-wrap { max-width: 820px; }
.faq-list {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 24px;
  background: light-dark(rgba(255, 255, 255, 0.88), rgba(17, 17, 20, 0.82));
  backdrop-filter: blur(14px);
}
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 0; }
.faq-list summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 0;
  font: 500 16px/24px var(--sans);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font: 400 20px/1 var(--mono); color: var(--ink-3); }
.faq-list details[open] summary::after { content: "−"; color: var(--ink); }
.faq-list details p { margin: 0 0 20px; font-size: 14px; line-height: 22px; color: var(--ink-2); max-width: 64ch; }

/* ---------- Signature Big Type Footer (Patensify-style) ---------- */
.big-footer {
  padding: 56px 0 32px;
}
.foot-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 48px;
}
.foot-note { max-width: 34rem; display: grid; gap: 6px; }
.foot-note b { font: 600 14px/20px var(--sans); }
.foot-note p { margin: 0; font-size: 13px; line-height: 20px; color: var(--ink-3); }
.foot-links { display: flex; gap: 20px; font-size: 13px; color: var(--ink-2); }
.foot-links a:hover { color: var(--ink); }
.foot-wordmark {
  font: 600 clamp(56px, 13.5vw, 184px)/0.92 var(--sans);
  letter-spacing: -0.05em;
  color: var(--ink);
  opacity: 0.92;
  user-select: none;
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ---------- Native Auth Dialog ---------- */
html:has(dialog.auth-dialog[open]),
body:has(dialog.auth-dialog[open]) {
  overflow: hidden;
  overscroll-behavior: none;
}
dialog.auth-dialog {
  margin: auto;
  padding: 16px;
  border: 0;
  background: transparent;
  width: min(492px, 100%);
  max-width: 100%;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: contain;
}
dialog.auth-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
}
.auth-panel {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  max-height: min(90dvh, 840px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.auth-head {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 16px 24px;
  border-bottom: 1px solid var(--line);
}
.auth-head h2 { margin: 0; font: 600 17px/24px var(--sans); }
.icon-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-close:hover { background: var(--raised); color: var(--ink); }

.auth-tabs {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 16px 24px 0;
  background: var(--raised);
  border-radius: 10px;
}
.auth-tab {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font: 500 13px/1 var(--sans);
  cursor: pointer;
}
.auth-tab[aria-selected="true"] {
  background: var(--bg);
  color: var(--ink);
}
.auth-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-stack { display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font: 500 13px/18px var(--sans); }
.field .hint { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--ink);
  font-size: max(1rem, 14px);
}
.field input:is(:user-invalid, .user-invalid-fallback) { border-color: var(--bad); background: var(--bad-soft); }
.error-msg { display: none; font-size: 12px; color: var(--bad); margin-top: 2px; }
.field input:is(:user-invalid, .user-invalid-fallback) + .error-msg,
.pw-wrap:has(input:is(:user-invalid, .user-invalid-fallback)) + .error-msg { display: block; }

.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute;
  right: 4px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); background: var(--raised); }

.soc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.soc-field { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.soc-field legend { font: 500 13px/18px var(--sans); padding: 0; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 8px; border: 2px solid transparent; background: var(--c); cursor: pointer; }
.swatch.sel { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg) inset; }

.rt-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rt-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.rt-opt-l { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.rt-opt-r { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.rt-opt-r svg.i { width: 12px; height: 12px; }
.rt-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.rt-opt.sel .rt-opt-r { color: var(--ink); font-weight: 600; }
.rt-opt.locked { opacity: 0.5; cursor: not-allowed; background: var(--raised); border-style: dashed; }

.form-alert { padding: 12px; border-radius: 8px; font-size: 13px; background: var(--bad-soft); color: var(--bad); }
.form-note { padding: 12px; border-radius: 8px; font-size: 12px; background: var(--raised); color: var(--ink-2); }
.google-auth { display: grid; gap: 14px; margin-bottom: 18px; }
.google-host {
  display: flex;
  justify-content: center;
  width: min(340px, 100%);
  min-height: 40px;
  margin: 0 auto;
  color-scheme: light;
  border-radius: 999px;
  overflow: hidden;
  line-height: 0;
}
.google-host:empty { display: none; min-height: 0; }
.google-host iframe { color-scheme: light; display: block; margin: 0 !important; }
.google-btn { background: var(--bg); border-color: var(--line-2); color: var(--ink); font-weight: 500; }
.google-btn:hover { background: var(--raised); }
.auth-divider { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-3); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.reg-done { display: grid; gap: 16px; }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--raised); border: 1px solid var(--line-2); border-radius: 10px; }
.code-box code { font: 600 18px/1 var(--mono); }

/* ---------- Fixed Right-Side Patensify Chapter Scrollspy Rail ---------- */
section[id], .stage-card[id], footer[id] { scroll-margin-top: 84px; }

.chapter-rail {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  padding: 12px 0 12px 20px;
}
.chapter-rail a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.01em;
  color: var(--ink-3);
  transition: color 0.2s var(--ease), gap 0.22s var(--ease);
  white-space: nowrap;
}
.chapter-rail a span {
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.22s var(--ease), color 0.2s var(--ease);
}
.chapter-rail:hover a span,
.chapter-rail:focus-within a span {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.chapter-rail a i {
  display: inline-block;
  width: 16px;
  height: 1px;
  background: var(--line-2);
  transition: width 0.22s var(--ease), background-color 0.22s var(--ease);
}
.chapter-rail a:hover {
  color: var(--ink-2);
}
.chapter-rail a:hover i {
  background: var(--ink-3);
}
.chapter-rail a.is-active {
  color: var(--ink);
  font-weight: 600;
  gap: 18px;
}
.chapter-rail a.is-active i {
  width: 28px;
  height: 1.5px;
  background: var(--ink);
}

@media (max-width: 1320px) {
  .chapter-rail { display: none; }
}

@media (max-width: 900px) {
  .hero { padding: 64px 0 56px; }
  .stage-grid, .rt-grid, .steps-grid, .fac-grid { grid-template-columns: 1fr; }
  .step-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .step-item:last-child { border-bottom: 0; }
  .navlinks { display: none; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .soc-grid, .rt-picker { grid-template-columns: 1fr; }
  .hero-meta { gap: 20px; }
  .auth-body { padding: 16px; }
  .auth-tabs { margin: 16px 16px 0; }
}
