/* ==========================================================================
   UTC NEXT — public website (utc.liveder.tv)
   Design language mirrors the app tokens (SPEC section 8 / 16.5).
   Sections:
     01 tokens        02 reset/base     03 layout helpers
     04 top nav       05 buttons        06 hero
     07 hero mock     08 features       09 quick start
     10 download      11 footer         12 404 page
     13 responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   01 · Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #101418;
  --surface: #1a2026;
  --surface2: #232b33;
  --surface3: #2b3540;
  --border: #313c46;
  --text: #e8edf2;
  --text-dim: #93a1ad;
  --accent: #2fa6ff;
  --accent-soft: rgba(47, 166, 255, 0.14);
  --good: #37ad5f;
  --warn: #e0a63c;
  --bad: #e0483c;
  --radius: 8px;
  --radius-lg: 16px;
  --field-bg: #0d1114;

  --font: 'IBM Plex Sans Thai', 'Leelawadee UI', 'Segoe UI Variable Text',
          'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Cascadia Mono', 'Consolas', 'SF Mono', monospace;

  --nav-h: 64px;
  --container: 1140px;

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   02 · Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 78% -220px, rgba(47, 166, 255, 0.09), transparent 62%),
    radial-gradient(900px 560px at 8% 12%, rgba(47, 166, 255, 0.04), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  /* Thai upper vowels + lower descenders need the taller line box. */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.35; margin: 0; }

::selection { background: rgba(47, 166, 255, 0.35); }

/* --------------------------------------------------------------------------
   03 · Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

.section {
  padding: 104px 0;
}

.section-head {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}

.section-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(47, 166, 255, 0.3);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 18px;
}

.section-title {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-sub {
  margin: 14px 0 0;
  color: var(--text-dim);
  font-size: 17px;
}

/* --------------------------------------------------------------------------
   04 · Top nav
   -------------------------------------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(16, 20, 24, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(49, 60, 70, 0.65);
}

.site-nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex: none;
  background: linear-gradient(135deg, #4db6ff, #1877d1);
  box-shadow: 0 0 18px rgba(47, 166, 255, 0.45);
  display: grid;
  place-items: center;
  color: #0a1a26;
  font-size: 15px;
  font-weight: 800;
}
/* Real icon image replaces the drawn "U" square; the text "UTC NEXT" stays. */
.brand-mark-img {
  background: none;
  box-shadow: none;
  object-fit: contain;
}

.brand em {
  font-style: normal;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: color 0.18s ease, background 0.18s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

/* CTA in the nav: higher specificity than ".nav-links a" so the button's own
   white text + solid fill win (otherwise the dim link color bleeds through and
   the label goes grey-on-blue = invisible). */
.nav-links a.nav-cta {
  margin-left: 10px;
  color: #ffffff;
  font-weight: 700;
  background: linear-gradient(160deg, #2b8fe8, #0f6fce);
  border: 1px solid rgba(255, 255, 255, 0.22);
  text-shadow: 0 1px 2px rgba(0, 20, 40, 0.35);
  box-shadow: 0 3px 14px rgba(31, 122, 214, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.nav-links a.nav-cta:hover {
  color: #ffffff;
  background: linear-gradient(160deg, #3f9df0, #1a7cd9);
  box-shadow: 0 5px 20px rgba(31, 122, 214, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease;
}
.nav-toggle:hover { background: var(--surface2); }
.nav-toggle svg { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   05 · Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 26px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease,
              background 0.16s ease, border-color 0.16s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary {
  background: linear-gradient(160deg, #2b8fe8, #0f6fce);
  color: #ffffff;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.18);
  text-shadow: 0 1px 2px rgba(0, 20, 40, 0.35);
  box-shadow: 0 4px 18px rgba(31, 122, 214, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover {
  background: linear-gradient(160deg, #3f9df0, #1a7cd9);
  box-shadow: 0 8px 26px rgba(31, 122, 214, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Outline: clearly visible secondary action on the dark hero */
.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(122, 187, 255, 0.55);
  color: #dceaff;
  font-weight: 700;
}
.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(47, 166, 255, 0.12);
  color: #ffffff;
}

.btn-lg {
  padding: 16px 38px;
  font-size: 18px;
  border-radius: 12px;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   06 · Hero
   -------------------------------------------------------------------------- */
.hero {
  padding: 96px 0 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 26px;
  animation: rise 0.6s ease both;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 10px rgba(55, 173, 95, 0.9);
}

.hero h1 {
  font-size: clamp(42px, 7.5vw, 76px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  animation: rise 0.6s 0.06s ease both;
}

.hero h1 .grad {
  background: linear-gradient(100deg, #6cc4ff 10%, #2fa6ff 45%, #9ad8ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 620px;
  margin: 22px auto 0;
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--text-dim);
  animation: rise 0.6s 0.12s ease both;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 40px;
  animation: rise 0.6s 0.18s ease both;
}

.hero-note {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--text-dim);
  opacity: 0.85;
  animation: rise 0.6s 0.22s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   07 · Hero mock (SVG panel)
   -------------------------------------------------------------------------- */
.hero-mock {
  position: relative;
  max-width: 980px;
  margin: 72px auto 0;
  animation: rise 0.7s 0.28s ease both;
}

.hero-mock::before {
  content: '';
  position: absolute;
  inset: 10% 6% -4%;
  background: radial-gradient(closest-side, rgba(47, 166, 255, 0.22), transparent 72%);
  filter: blur(30px);
  z-index: 0;
  pointer-events: none;
}

.hero-mock svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(49, 60, 70, 0.9);
}

.hero-mock text {
  font-family: var(--font);
  user-select: none;
}
.hero-mock .mono { font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   08 · Features
   -------------------------------------------------------------------------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.feature-card {
  background: linear-gradient(180deg, rgba(35, 43, 51, 0.55), rgba(26, 32, 38, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 166, 255, 0.55);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.4), 0 0 24px rgba(47, 166, 255, 0.10);
}

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(47, 166, 255, 0.35);
  color: var(--accent);
  margin-bottom: 20px;
}
.feature-icon svg { width: 24px; height: 24px; }

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  margin: 0;
  font-size: 15px;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   09 · Quick start
   -------------------------------------------------------------------------- */
.quickstart {
  background: linear-gradient(180deg, rgba(26, 32, 38, 0.0), rgba(26, 32, 38, 0.5) 18%, rgba(26, 32, 38, 0.5) 82%, rgba(26, 32, 38, 0.0));
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 40px;
}

.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px 26px;
  transition: border-color 0.22s ease, transform 0.22s ease;
}
.step:hover { border-color: rgba(47, 166, 255, 0.45); transform: translateY(-3px); }

.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  color: #071522;
  background: linear-gradient(135deg, #45b1ff, #1f8fe6);
  box-shadow: 0 0 18px rgba(47, 166, 255, 0.4);
  margin-bottom: 18px;
}

.step h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.step p  { margin: 0; font-size: 14.5px; color: var(--text-dim); }
.step p code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
  color: #9ad8ff;
  white-space: nowrap;
}

/* terminal-style code block */
.terminal {
  max-width: 680px;
  margin: 0 auto;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.terminal-bar .tdot {
  width: 11px; height: 11px; border-radius: 50%;
}
.tdot-r { background: #e0483c; }
.tdot-y { background: #e0a63c; }
.tdot-g { background: #37ad5f; }

.terminal-bar span:last-child {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.terminal pre {
  margin: 0;
  padding: 22px 24px;
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.9;
  overflow-x: auto;
  color: var(--text);
}

.terminal .prompt { color: var(--good); }
.terminal .cmd    { color: #9ad8ff; }
.terminal .out    { color: var(--text-dim); }

/* --------------------------------------------------------------------------
   10 · Download
   -------------------------------------------------------------------------- */
.download-card {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  background: linear-gradient(180deg, rgba(35, 43, 51, 0.6), rgba(20, 25, 31, 0.95));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 64px 40px 56px;
  overflow: hidden;
}

.download-card::before {
  content: '';
  position: absolute;
  inset: -40% 20% auto;
  height: 70%;
  background: radial-gradient(closest-side, rgba(47, 166, 255, 0.16), transparent 75%);
  pointer-events: none;
}

.download-card > * { position: relative; }

.download-card h2 {
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 800;
}

.download-card .dl-sub {
  color: var(--text-dim);
  max-width: 520px;
  margin: 14px auto 34px;
  font-size: 16px;
}

.dl-meta {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.requirements {
  margin: 44px auto 0;
  max-width: 560px;
  text-align: left;
  background: rgba(13, 17, 20, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
}

.requirements h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.requirements ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.requirements li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 15px;
  color: var(--text);
}

.requirements li::before {
  content: '✓';
  color: var(--good);
  font-weight: 700;
  flex: none;
}

.requirements li small {
  color: var(--text-dim);
  font-size: 13.5px;
}

/* --------------------------------------------------------------------------
   11 · Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 48px;
  margin-top: 40px;
}

.site-footer .container {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
}
.footer-brand .brand-mark { width: 26px; height: 26px; font-size: 13px; border-radius: 7px; }

.footer-copy {
  color: var(--text-dim);
  font-size: 14px;
}

.footer-links {
  margin-left: auto;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-dim);
  font-size: 14px;
  transition: color 0.18s ease;
}
.footer-links a:hover { color: var(--accent); text-decoration: none; }

/* --------------------------------------------------------------------------
   12 · 404 page
   -------------------------------------------------------------------------- */
.page-404 {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 60px 24px;
}

.page-404 .code {
  font-size: clamp(96px, 18vw, 170px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #6cc4ff, #2fa6ff 50%, #1a5f96);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 34px rgba(47, 166, 255, 0.28));
}

.page-404 h1 {
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 700;
  margin-top: 10px;
}

.page-404 p {
  color: var(--text-dim);
  max-width: 440px;
  margin: 14px auto 34px;
}

.page-404 .actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   13 · Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .section { padding: 80px 0; }

  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }

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

  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 24px 20px;
    background: #101418;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.5);
  }
  .site-nav.open .nav-links { display: flex; }

  .nav-links a { padding: 12px 14px; font-size: 16px; }
  .nav-cta { margin: 8px 0 0; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 36px); }
  .section { padding: 64px 0; }
  .hero { padding: 72px 0 56px; }
  .hero-cta .btn { width: 100%; }
  .features-grid { grid-template-columns: 1fr; }
  .download-card { padding: 48px 22px 40px; }
  .requirements { padding: 20px 20px; }
  .footer-links { margin-left: 0; }
}
