/* ==========================================================================
   HDC Suite - Base CSS (CONTRACT v2)
   Design System & Core Layout for HDC Suite & Product Pages
   ========================================================================== */

:root {
  /* HDC Brand Tokens */
  --bg: #0F172A;
  --bg-deep: #050914;
  --border: #334155;
  --input-border: #475569;
  --text: #F1F5F9;
  --text-2: #CBD5E1;
  --text-3: #94A3B8;
  --cyan: #38BDF8;
  --cyan-2: #00D2FF;
  --blue: #0284C7;
  --grad: linear-gradient(135deg, #38BDF8, #00D2FF);
  --focus: #60A5FA;
  --success: #22C55E;
  --danger: #EF4444;

  /* Aliases & Backward Compatibility */
  --accent: var(--cyan);
  --btn: transparent;
  --btn-border: var(--cyan);
  --btn-hover: rgba(56, 189, 248, 0.12);
  --btn-press: rgba(56, 189, 248, 0.2);
  --radius-btn: 8px;
  --radius-card: 14px;
  --warning: #FBBF24;
  --selected: #172554;
  --font-sans: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-mono: Consolas, "Courier New", monospace;
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  background-image: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  line-height: 1.25;
  font-weight: 700;
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.875rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

.section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-btn);
  background: var(--btn);
  border: 1px solid var(--btn-border);
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  background: var(--btn-hover);
  border-color: var(--cyan);
  color: var(--text);
  text-decoration: none;
}

.btn:active {
  background: var(--btn-press);
}

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

.btn-primary {
  background: var(--grad);
  border: 1px solid transparent;
  color: #04121F;
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--grad);
  border-color: transparent;
  color: #04121F;
  opacity: 0.92;
  text-decoration: none;
}

.btn-primary:active {
  opacity: 0.85;
}

.btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: 16px;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9999px;
  color: var(--text-2);
}

.badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
}

.badge.live {
  color: var(--success);
}

.badge.live::before {
  background: var(--success);
}

.badge.die {
  color: var(--danger);
}

.badge.die::before {
  background: var(--danger);
}

.badge-soon {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-3);
  border: 1px solid var(--border);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  height: 36px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav a {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 4px;
  transition: color 0.15s ease;
}

.nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav a.active {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--cyan);
  text-underline-offset: 6px;
}

.nav-list { display: flex; align-items: center; gap: 20px; list-style: none; margin: 0; padding: 0; }
.nav-list > li { list-style: none; margin: 0; padding: 0; }
.dropdown-arrow { display: none; }

/* Dropdown */
.has-dropdown {
  position: relative;
  list-style: none;
}

.dropdown-toggle {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.dropdown-toggle:hover {
  color: var(--text);
}

.dropdown-toggle::after {
  content: "▾";
  font-size: 11px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.has-dropdown.open .dropdown-toggle::after {
  transform: rotate(180deg);
}

ul.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  min-width: 200px;
  list-style: none;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 110;
}

.has-dropdown:hover > ul.dropdown,
.has-dropdown:focus-within > ul.dropdown,
.has-dropdown.open > ul.dropdown {
  display: block;
}

ul.dropdown li {
  list-style: none;
}

ul.dropdown a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

ul.dropdown a:hover {
  background: rgba(56, 189, 248, 0.08);
  color: var(--cyan);
  text-decoration: none;
}

/* Nav Toggle Button */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-btn);
  color: var(--text);
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--focus);
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

@media (max-width: 820px) {
  .site-header .container {
    position: relative;
    flex-wrap: wrap;
    min-height: 64px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
  }

  .nav.open {
    display: flex;
  }

  .nav-list { flex-direction: column; align-items: flex-start; gap: 12px; width: 100%; }

  .has-dropdown {
    width: 100%;
  }

  .has-dropdown > ul.dropdown {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    padding: 6px 0 6px 14px;
    min-width: 0;
    width: 100%;
    background: transparent;
  }

  .has-dropdown:hover > ul.dropdown,
  .has-dropdown:focus-within > ul.dropdown {
    display: none;
  }

  .has-dropdown.open > ul.dropdown {
    display: block;
  }
}

/* ==========================================================================
   Subnav (Product Page Sticky Bar)
   ========================================================================== */

.subnav {
  position: sticky;
  top: 68px;
  z-index: 90;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
}

.subnav .container {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.subnav a {
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.subnav a:hover {
  color: var(--text);
  text-decoration: none;
}

.subnav a.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  text-decoration: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  padding: 88px 0;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 48px;
  row-gap: 0;
  align-items: center;
}

.hero .container > :not(.mock):not(.hero-visual) {
  grid-column: 1;
}

.hero .container > .mock,
.hero .container > .hero-visual {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: center;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
  margin-bottom: 12px;
}

.product-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.product-hero img {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: block;
}

.lead,
.hero .lead {
  color: var(--text-2);
  font-size: 1.125rem;
  line-height: 1.6;
  margin: 16px 0 28px;
}

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

/* Hero Center (Homepage) */
.hero--center {
  text-align: center;
}

.hero--center .container {
  display: block;
  max-width: 820px;
  margin: 0 auto;
}

.hero--center .container > * {
  grid-column: auto;
}

.hero--center .hero-actions {
  justify-content: center;
}

.hero--center .lead {
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 900px) {
  .hero {
    padding: 56px 0;
  }

  .hero .container {
    grid-template-columns: 1fr;
    row-gap: 28px;
    column-gap: 0;
  }

  .hero .container > :not(.mock):not(.hero-visual) {
    grid-column: auto;
  }

  .hero .container > .mock,
  .hero .container > .hero-visual {
    grid-column: auto;
    grid-row: auto;
  }
}

/* ==========================================================================
   Reveal Animations
   ========================================================================== */

.reveal {
  /* Visible by default without JS */
}

html.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 14px;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer a {
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-footer img,
.site-footer .brand img {
  height: 32px;
  width: auto;
  display: block;
}
