/* ==========================================================================
   Ablatehub — site styles
   Layout: tokens → base → nav → hero → sections → cards → footer →
           animation & a11y → responsive
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* palette */
  --bg: #0A101E;
  --bg-alt: #0D1526;
  --card: #111B30;
  --card-hover: #14203A;
  --border: rgba(146, 180, 255, 0.12);
  --border-strong: rgba(146, 180, 255, 0.26);
  --text: #E9EFFA;
  --muted: #8FA0BC;
  --accent: #4C8DFF;
  --accent-2: #38D9C0;
  --accent-soft: rgba(76, 141, 255, 0.12);
  --grad: linear-gradient(120deg, #3E7BFA 0%, #7FB5FF 100%);
  --green: #3DDBA4;
  --amber: #F5B84B;

  /* shape & depth */
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-card: 0 10px 30px rgba(3, 8, 20, 0.35);
  --shadow-card-hover: 0 18px 44px rgba(3, 8, 20, 0.5);
  --shadow-cta: 0 8px 26px rgba(62, 123, 250, 0.35);
  --shadow-cta-hover: 0 14px 34px rgba(62, 123, 250, 0.5);

  /* rhythm */
  --nav-h: 72px;
  --section-pad: 104px;
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  color-scheme: dark;
  scroll-behavior: smooth;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(76, 141, 255, 0.35); }
a { color: inherit; text-decoration: none; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
section[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* Dark, unobtrusive scrollbar (WebKit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #22314F; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2E4066; }

/* Skip link — hidden until keyboard-focused */
.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 100;
  background: var(--accent); color: #071022;
  padding: 10px 18px; border-radius: 10px; font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(10, 16, 30, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.site-nav.scrolled {
  background: rgba(10, 16, 30, 0.88);
  border-bottom-color: var(--border);
  box-shadow: 0 10px 32px rgba(3, 8, 20, 0.4);
}
.nav-inner { height: var(--nav-h); display: flex; align-items: center; gap: 32px; }
.brand { font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; white-space: nowrap; }
.brand-accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a {
  color: var(--muted); font-size: 0.95rem; position: relative;
  transition: color 0.2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -6px;
  height: 2px; border-radius: 2px; background: var(--grad);
  transition: right 0.25s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { right: 0; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.lang-toggle {
  background: transparent; border: 1px solid var(--border-strong); color: var(--text);
  border-radius: 999px; padding: 7px 16px; font-size: 0.85rem; cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s; white-space: nowrap;
  font-family: inherit;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
html:not(.js) .lang-toggle, html:not(.js) .burger { display: none; }

.burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: transparent;
  border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; padding: 0 9px;
}
.burger span { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
body.nav-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .burger span:nth-child(2) { opacity: 0; }
body.nav-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: calc(var(--nav-h) + 110px) 0 96px; overflow: hidden; text-align: center; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(126, 166, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 166, 255, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 38%, #000 25%, transparent 72%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 38%, #000 25%, transparent 72%);
}
/* primary blue glow + secondary teal wash, both above the fold only */
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(560px 380px at 50% -8%, rgba(62, 123, 250, 0.28), transparent 70%),
    radial-gradient(420px 300px at 12% 30%, rgba(56, 217, 192, 0.07), transparent 70%),
    radial-gradient(420px 300px at 88% 30%, rgba(62, 123, 250, 0.1), transparent 70%);
}
.hero-inner { position: relative; }
.badge {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 8px 18px;
  font-size: 0.85rem; color: var(--muted);
  background: rgba(17, 27, 48, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.badge-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 219, 164, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(61, 219, 164, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 219, 164, 0); }
}
.hero h1 {
  margin: 30px auto 24px; max-width: 1000px;
  font-size: clamp(2.4rem, 5.6vw, 3.8rem); line-height: 1.14;
  font-weight: 800; letter-spacing: -0.03em;
  text-wrap: balance;
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 680px; margin: 0 auto; color: var(--muted); font-size: 1.08rem; }
.hero-cta { display: flex; gap: 14px; justify-content: center; margin-top: 38px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); padding: 14px 34px; font-weight: 600; font-size: 0.98rem;
  transition: transform 0.2s, box-shadow 0.2s; font-family: inherit;
}
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary { background: var(--grad); color: #071022; box-shadow: var(--shadow-cta); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-cta-hover); }

/* ---------- Sections ---------- */
.section { padding: var(--section-pad) 0; }
.section-tinted { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.section-tag {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--accent); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px;
}
.section-tag::before, .section-tag::after { content: ""; width: 22px; height: 1px; background: var(--accent); opacity: 0.5; }
.section-head h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); letter-spacing: -0.02em; line-height: 1.2; }
.section-sub { margin-top: 14px; color: var(--muted); }

/* ---------- Model & partner cards ---------- */
.models-grid, .partners-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px;
}
.model-card, .partner-card {
  position: relative;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s, border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
/* gradient accent line that fades in on hover */
.model-card::before, .partner-card::before {
  content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 2px;
  border-radius: 2px; background: var(--grad);
  opacity: 0; transition: opacity 0.25s;
}
.model-card:hover, .partner-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--card-hover);
  box-shadow: var(--shadow-card-hover);
}
.model-card:hover::before, .partner-card:hover::before { opacity: 1; }

.model-top, .partner-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.model-top h3 { font-size: 1.3rem; letter-spacing: -0.01em; }
.partner-top h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
.status {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  border-radius: 999px; padding: 6px 14px; font-size: 0.8rem; font-weight: 600;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-live { color: var(--green); background: rgba(61, 219, 164, 0.1); border: 1px solid rgba(61, 219, 164, 0.3); }
.status-live .status-dot { background: var(--green); }
.status-dev { color: var(--amber); background: rgba(245, 184, 75, 0.1); border: 1px solid rgba(245, 184, 75, 0.3); }
.status-dev .status-dot { background: var(--amber); }
.model-desc, .partner-desc { color: var(--muted); font-size: 0.97rem; flex: 1; }
.partner-link {
  color: var(--accent); font-weight: 600; font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
}
.partner-link::after { content: "↗"; transition: transform 0.2s; }
.partner-link:hover::after { transform: translate(3px, -3px); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 64px 0 36px;
}
/* gradient hairline above the footer */
.site-footer::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(76, 141, 255, 0.45), transparent);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.footer-tagline { margin-top: 12px; color: var(--muted); max-width: 380px; }
.site-footer h4 { font-size: 0.95rem; margin-bottom: 12px; }
.footer-link { color: var(--accent); }
.footer-link:hover { text-decoration: underline; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.footer-disclaimer { color: var(--muted); font-size: 0.82rem; max-width: 820px; }
.footer-rights { color: var(--muted); font-size: 0.82rem; opacity: 0.8; }

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.js .reveal.visible { opacity: 1; transform: none; }
.d1 { transition-delay: 0.07s; }
.d2 { transition-delay: 0.14s; }
.d3 { transition-delay: 0.21s; }
.d4 { transition-delay: 0.28s; }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

@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;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .burger { display: flex; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; margin-left: 0; display: none;
    background: rgba(10, 16, 30, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px;
  }
  body.nav-open .nav-links { display: flex; }
  .nav-links a { padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .nav-links a::after { display: none; }
  .nav-links a:last-child { border-bottom: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 600px) {
  :root { --section-pad: 80px; }
  .hero { padding-bottom: 72px; }
  .model-top { flex-direction: column; align-items: flex-start; }
}
