/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", "Noto Sans SC", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-body);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* ========== CSS VARIABLES ========== */
:root {
  /* Colors */
  --bg-primary: #071126;
  --bg-secondary: #0E1B33;
  --accent-green: #00E68A;
  --accent-orange: #FF6B35;
  --zone-wine: #5B1E4C;
  --zone-indigo: #1B214D;
  --zone-teal: #0B3C49;
  --text-title: #F4F7FF;
  --text-body: #A6B6E0;
  --text-muted: #5F6F96;
  --line-grid: #1E2A4A;

  /* Typography */
  --font-display: "Noto Sans SC", "Helvetica Neue", sans-serif;
  --font-body: "Inter", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", monospace;
  --text-hero: clamp(2.5rem, 6vw, 5rem);
  --text-section: clamp(2rem, 4vw, 3rem);
  --text-sub: 1.25rem;
  --text-caption: 0.875rem;

  /* Layout */
  --rail-w: 280px;
  --header-h: 72px;
  --container-max: 1440px;
  --space-section: clamp(4rem, 10vw, 8rem);
  --space-block: clamp(2rem, 5vw, 4rem);

  /* Effects */
  --shadow-panel: 0 20px 40px rgba(0, 0, 0, 0.3);
  --border-panel: 1px solid var(--line-grid);
}

/* ========== TYPOGRAPHY ========== */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--text-title);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-hero);
  text-transform: uppercase;
}

h2 {
  font-size: var(--text-section);
}

h3 {
  font-size: var(--text-sub);
}

p {
  color: var(--text-body);
}

small,
.text-caption {
  font-size: var(--text-caption);
  color: var(--text-muted);
}

.mono,
[data-mono] {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

::selection {
  background: var(--accent-green);
  color: var(--bg-primary);
}

/* ========== ACCESSIBILITY & FOCUS ========== */
:focus-visible {
  outline: 2px dashed var(--accent-green);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  background: var(--accent-green);
  color: var(--bg-primary);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  transform: translateY(-200%);
  transition: transform 0.3s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ========== LAYOUT & FRAME ========== */
.main-content {
  display: block;
  width: 100%;
}

/* Desktop frame: push content right */
@media (min-width: 1024px) {
  .main-content,
  .site-footer {
    margin-left: var(--rail-w);
  }

  .main-content {
    width: calc(100% - var(--rail-w));
  }
}

.container {
  width: 100%;
  max-width: calc(var(--container-max) - var(--rail-w));
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 4vw, 4rem);
}

/* ========== HEADER / LEFT TERMINAL RAIL ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--line-grid);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-inline: 1.25rem;
  height: var(--header-h);
}

.site-header__brand {
  flex-shrink: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-title);
}

.brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: linear-gradient(135deg, var(--accent-green), var(--zone-teal));
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--bg-primary);
  border-radius: 8px;
  transform: skewX(-8deg);
}

.brand__text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: 0.04em;
}

.brand__text small {
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--text-body);
}

/* Desktop nav: vertical rail list */
.nav-desktop {
  display: none;
}

/* Desktop left rail layout */
@media (min-width: 1024px) {
  .site-header {
    right: auto;
    bottom: 0;
    width: var(--rail-w);
    border-right: 1px solid var(--line-grid);
    border-bottom: none;
  }

  .site-header__inner {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 2rem 1.5rem;
    height: 100vh;
    gap: 2rem;
  }

  .nav-desktop {
    display: block;
    flex: 1;
  }

  .nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    color: var(--text-body);
    border-left: 2px solid transparent;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  }

  .nav-link:hover {
    color: var(--text-title);
    background: rgba(0, 230, 138, 0.08);
  }

  .nav-link[aria-current="page"] {
    color: var(--accent-green);
    border-left-color: var(--accent-green);
    background: linear-gradient(90deg, rgba(0, 230, 138, 0.12), transparent);
  }

  .site-header__status {
    border-top: 1px solid var(--line-grid);
    padding-top: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    color: var(--text-muted);
  }

  .status-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 12px rgba(0, 230, 138, 0.8);
    animation: status-pulse 2s infinite;
  }

  .status-label {
    color: var(--accent-green);
  }

  .nav-toggle {
    display: none;
  }
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}

/* ========== MOBILE NAV TOGGLE ========== */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--line-grid);
  border-radius: 8px;
  color: var(--text-title);
}

.nav-toggle__box {
  width: 1.25rem;
  height: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav-toggle__bar {
  height: 2px;
  width: 100%;
  background: var(--accent-green);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========== MOBILE NAV DRAWER ========== */
.nav-mobile {
  display: none;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--accent-green);
  box-shadow: var(--shadow-panel);
  padding: 1rem;
}

.nav-mobile[data-open="true"] {
  display: block;
}

.nav-mobile__list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-mobile__link {
  display: block;
  padding: 0.85rem 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-title);
  border-radius: 6px;
  border-left: 2px solid transparent;
}

.nav-mobile__link:hover,
.nav-mobile__link[aria-current="page"] {
  color: var(--accent-green);
  border-left-color: var(--accent-green);
  background: rgba(0, 230, 138, 0.08);
}

@media (min-width: 1024px) {
  .nav-mobile {
    display: none;
  }
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--line-grid);
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 4vw, 4rem) 2rem;
  color: var(--text-body);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: var(--container-max);
  margin-inline: auto;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.brand--footer .brand__logo {
  background: linear-gradient(135deg, var(--accent-orange), var(--zone-wine));
}

.site-footer__about {
  font-size: 0.9rem;
  max-width: 36ch;
  line-height: 1.7;
  color: var(--text-muted);
}

.site-footer__heading {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-title);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line-grid);
  padding-bottom: 0.5rem;
}

.site-footer__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer__list a {
  color: var(--text-body);
  transition: color 0.2s ease;
}

.site-footer__list a:hover {
  color: var(--accent-green);
}

.site-footer__contact .site-footer__list li {
  font-size: 0.9rem;
  line-height: 1.6;
}

.site-footer__note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-left: 2px solid var(--zone-wine);
  padding-left: 1rem;
}

.site-footer__bottom {
  margin-top: 3rem;
  border-top: 1px solid var(--line-grid);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer__trust {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 60ch;
}

.site-footer__legal {
  display: flex;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
  }

  .site-footer__bottom {
    flex-direction: row;
    align-items: center;
  }
}

/* ========== GENRAL CONTAINER & BLOCK ========== */
.section-zone {
  padding-block: var(--space-section);
  position: relative;
  overflow: hidden;
}

.section-zone--indigo {
  background: var(--zone-indigo);
}

.section-zone--wine {
  background: var(--zone-wine);
}

.section-zone--teal {
  background: var(--zone-teal);
}

.section-zone--border-top {
  border-top: 1px solid var(--line-grid);
}

.section-zone--border-bottom {
  border-bottom: 1px solid var(--line-grid);
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent-orange), #d94a1e);
  color: var(--text-title);
  box-shadow: 0 8px 20px rgba(255, 107, 53, 0.25);
}

.btn--primary:hover {
  box-shadow: 0 12px 28px rgba(255, 107, 53, 0.35);
}

.btn--ghost {
  background: transparent;
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
}

.btn--ghost:hover {
  background: rgba(0, 230, 138, 0.1);
  box-shadow: 0 0 20px rgba(0, 230, 138, 0.15);
}

.btn--sm {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-block: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-body);
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--accent-green);
}

.breadcrumb__sep {
  color: var(--text-muted);
  opacity: 0.6;
}

.breadcrumb [aria-current="page"] {
  color: var(--text-title);
  font-weight: 600;
}

/* ========== DATA COMPONENTS ========== */
.data-panel {
  background: var(--bg-secondary);
  border: var(--border-panel);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

.data-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: var(--border-panel);
  background: linear-gradient(180deg, rgba(0, 230, 138, 0.04), transparent);
}

.data-panel__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-title);
}

.data-panel__body {
  padding: 1.5rem;
}

.data-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: rgba(0, 230, 138, 0.12);
  border: 1px solid rgba(0, 230, 138, 0.3);
  color: var(--accent-green);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.data-chip--orange {
  background: rgba(255, 107, 53, 0.12);
  border-color: rgba(255, 107, 53, 0.4);
  color: var(--accent-orange);
}

.data-chip--live::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--accent-orange);
  animation: status-pulse 1.5s infinite;
}

.progress-bar {
  display: block;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-green), #00e6a0);
  border-radius: inherit;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== SCROLL PROGRESS ========== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-orange));
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0, 230, 138, 0.5);
}

/* ========== MOTION & REVEAL ========== */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .status-dot {
    animation: none;
  }
}

/* ========== RESPONSIVE HELPERS ========== */
.desktop-only {
  display: none !important;
}

@media (min-width: 1024px) {
  .desktop-only {
    display: inline-flex !important;
  }
}

.mobile-only {
  display: inline-flex !important;
}

@media (min-width: 1024px) {
  .mobile-only {
    display: none !important;
  }
}
