/* ============================================================
   TheOneFX — Landing Page
   Design tokens synced from docs/untitled.pen
   ============================================================ */

:root {
  /* Colors */
  --accent: #2E7DD1;
  --accent-2: #0EA5C4;
  --accent-soft: #EAF2FB;
  --surface-primary: #FFFFFF;
  --surface-secondary: #F7F8FA;
  --surface-dark: #121417;
  --text-primary: #1A1A1A;
  --text-secondary: #525A64;
  --text-muted: #6B7280;
  --text-on-dark: #FFFFFF;
  --text-on-dark-muted: #9AA3AD;
  --border-subtle: #C9CFD7;
  --border-on-dark: #2A2E34;

  /* Type */
  --font-heading: "Space Grotesk", "Noto Sans SC", -apple-system, sans-serif;
  --font-body: "Inter", "Noto Sans SC", -apple-system, sans-serif;
  --font-mono: "Geist Mono", "Noto Sans SC", ui-monospace, monospace;

  /* Layout */
  --container: 1200px;
  --nav-h: 67px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--surface-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
a { text-decoration: none; color: inherit; }
img, svg { display: block; }

.container {
  width: min(var(--container), 100% - 48px);
  margin-inline: auto;
}

/* Offset anchored sections so they clear the sticky nav */
section[id] { scroll-margin-top: var(--nav-h); }

/* ---------- Icons ---------- */
.icon {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--lg { width: 26px; height: 26px; }
.icon--sm { width: 16px; height: 16px; }
.icon--accent { color: var(--accent); }
.icon--muted { color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  padding: 13px 24px;
  cursor: pointer;
  border: 0;
  transition: transform .15s ease, background .2s ease, opacity .2s ease, box-shadow .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--accent); color: var(--text-on-dark); }
.btn--accent:hover { background: #2870bd; }
.btn--accent .icon { width: 17px; height: 17px; }
.btn--ghost {
  background: var(--surface-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn--ghost:hover { border-color: var(--text-primary); }
.btn--dark {
  background: var(--text-primary);
  color: var(--text-on-dark);
  font-size: 14px;
  padding: 10px 18px;
}
.btn--dark:hover { background: #000; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow--center { justify-content: center; }
.eyebrow__tick {
  width: 24px; height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}
.eyebrow__text {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .3px;
  color: var(--accent);
}

/* ---------- Section header ---------- */
.section-head { display: flex; flex-direction: column; gap: 18px; }
.section-head__title {
  max-width: 680px;
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -.8px;
  line-height: 1.2;
  color: var(--text-primary);
}
.section-head__sub {
  max-width: 560px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface-primary);
  transition: box-shadow .2s ease, border-color .2s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
  border-bottom-color: #eceef1;
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 20px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo__word {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -.3px;
  color: var(--text-primary);
}
.logo--dark .logo__word { color: var(--text-on-dark); }

.nav__links { display: flex; align-items: center; gap: 36px; }
.nav__links a {
  font-size: 15px;
  color: var(--text-secondary);
  transition: color .15s ease;
}
.nav__links a:hover { color: var(--text-primary); }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav__toggle span {
  width: 22px; height: 2px;
  background: var(--text-primary);
  transition: transform .25s ease, opacity .2s ease;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
.hero { background: var(--surface-primary); }
.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 100px 0 108px;
}
.hero__inner > * { max-width: 680px; }

.hero__headline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 48px;
  letter-spacing: -1px;
  line-height: 1.1;
}
.hero__line { display: flex; }
.accent-box {
  display: inline-block;
  background: var(--accent);
  color: var(--text-on-dark);
  padding: 4px 12px;
}
.hero__line2 { color: var(--text-primary); }

.hero__subhead {
  margin-top: 28px;
  max-width: 600px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.hero__cta {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.stats {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 48px;
}
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat__num {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.5px;
  color: var(--text-primary);
}
.stat__lbl { font-size: 14px; color: var(--text-muted); }
.stat__divider { width: 1px; height: 34px; background: var(--border-subtle); }

/* ============================================================
   Advantages
   ============================================================ */
.advantages {
  background: var(--surface-secondary);
  padding: 96px 0;
}
.advantages .section-head { margin-bottom: 52px; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px;
}
.card { display: flex; flex-direction: column; }
.card__rule { height: 1px; background: var(--border-subtle); }
.card__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 28px;
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card__index {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
}
.card__title {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -.2px;
  color: var(--text-primary);
}
.card__desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.platforms { display: flex; gap: 18px; padding-top: 6px; }
.platform {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============================================================
   About
   ============================================================ */
.about {
  background: var(--surface-dark);
  padding: 104px 0;
}
.about__inner {
  display: flex;
  gap: 80px;
  align-items: flex-start;
}
.about__left {
  flex: 0 0 496px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.about__title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -.8px;
  line-height: 1.25;
  color: var(--text-on-dark);
}
.about__para {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-on-dark-muted);
}

.tech {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-width: 0;
}
.tech__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tech__label {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.tech__count {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-on-dark-muted);
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 14px;
  row-gap: 18px;
}
.lang {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.lang__tile {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lang__glyph {
  width: 17px; height: 17px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  background-color: #fff;
}
.lang__name {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-on-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Contact
   ============================================================ */
.contact {
  background: var(--surface-primary);
  padding: 100px 0;
}
.contact__inner {
  display: flex;
  gap: 88px;
  align-items: flex-start;
}
.contact__left {
  flex: 0 0 460px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.contact__title {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -.8px;
  line-height: 1.2;
  color: var(--text-primary);
}
.contact__sub {
  max-width: 400px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.resp-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

.methods { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.methods > .method { border-bottom: 1px solid var(--border-subtle); }
.methods > .method:first-child { border-top: 1px solid var(--border-subtle); }
.method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 2px;
  transition: background .15s ease;
}
a.method:hover { background: #fafbfc; }
a.method:hover .method__arrow { color: var(--accent); transform: translate(2px, -2px); }
.method__left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.method__text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.method__label { font-size: 14px; color: var(--text-muted); }
.method__val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -.2px;
  color: var(--text-primary);
}
.method__arrow { transition: transform .15s ease, color .15s ease; flex-shrink: 0; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--surface-dark);
  padding: 56px 0 40px;
}
.footer__top {
  display: flex;
  justify-content: space-between;
  gap: 60px;
}
.footer__brand {
  flex: 0 0 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer__tagline {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-on-dark-muted);
}
.footer__links { display: flex; gap: 72px; }
.footer__col { display: flex; flex-direction: column; gap: 14px; }
.footer__head {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.footer__col a {
  font-size: 14px;
  color: var(--text-on-dark-muted);
  transition: color .15s ease;
}
.footer__col a:hover { color: var(--text-on-dark); }

.footer__divider {
  height: 1px;
  background: var(--border-on-dark);
  margin: 36px 0;
}
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer__legal { display: inline-flex; align-items: center; gap: 18px; }
.footer__copy { font-size: 14px; color: var(--text-muted); }
.footer__privacy {
  position: relative;
  font-size: 14px;
  color: var(--text-on-dark-muted);
  transition: color .15s ease;
}
.footer__privacy::before {
  content: "";
  position: absolute;
  left: -9px; top: 50%;
  width: 1px; height: 12px;
  transform: translateY(-50%);
  background: var(--border-on-dark);
}
.footer__privacy:hover { color: var(--text-on-dark); }
.footer__note {
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: .3px;
  color: var(--text-muted);
}

/* ============================================================
   Micro-interactions
   ============================================================ */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }

/* ---- Scroll reveal (progressive enhancement) ---- */
.has-js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s var(--ease-out);
}
.has-js .reveal.is-visible { opacity: 1; transform: none; }

/* Eyebrow tick draws in when its section reveals */
.has-js .reveal .eyebrow__tick {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease-out) .15s;
}
.has-js .reveal.is-visible .eyebrow__tick { transform: scaleX(1); }

/* ---- Hero entrance (staggered rise on load) ---- */
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
.has-js .hero__inner > * { opacity: 0; animation: rise .8s var(--ease-out) both; }
.has-js .hero__inner > *:nth-child(1) { animation-delay: .08s; }
.has-js .hero__inner > *:nth-child(2) { animation-delay: .18s; }
.has-js .hero__inner > *:nth-child(3) { animation-delay: .28s; }
.has-js .hero__inner > *:nth-child(4) { animation-delay: .40s; }
.has-js .hero__inner > *:nth-child(5) { animation-delay: .52s; }

@keyframes box-pop {
  0%   { transform: scale(.9); }
  60%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.has-js .accent-box { animation: box-pop .7s var(--ease-out) both; animation-delay: .34s; }

/* ---- Nav: animated underline + logo mark ---- */
.nav__links a { position: relative; }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -5px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease-out);
}
.nav__links a:hover::after { transform: scaleX(1); }

/* ---- Buttons ---- */
.btn--accent { box-shadow: 0 1px 2px rgba(46, 125, 209, .18); }
.btn--accent:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(46, 125, 209, .30); }
.btn--accent .icon { transition: transform .2s var(--ease-out); }
.btn--accent:hover .icon { transform: translateX(4px); }
.btn--ghost:hover { transform: translateY(-2px); }
.btn--dark:hover { transform: translateY(-1px); }

/* ---- Advantage cards ---- */
.card__rule { position: relative; overflow: hidden; }
.card__rule::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease-out);
}
.card:hover .card__rule::after { transform: scaleX(1); }
.card .icon--accent { transition: transform .3s var(--ease-out); }
.card:hover .icon--accent { transform: translateY(-3px); }
.card__index { transition: color .3s ease; }
.card:hover .card__index { color: var(--accent); }
.platform .icon { transition: transform .2s var(--ease-out); }
.platform:hover .icon { transform: translateY(-2px); }

/* ---- Language tiles: staggered entrance + hover lift ---- */
.has-js .lang {
  opacity: 0;
  transform: translateY(12px) scale(.96);
  transition: opacity .5s ease, transform .5s var(--ease-out);
}
.has-js .lang.is-in { opacity: 1; transform: none; }
.lang__tile { transition: transform .25s var(--ease-out), box-shadow .25s ease; }
.lang__name { transition: color .25s ease; }
.lang:hover .lang__tile { transform: translateY(-3px) scale(1.08); box-shadow: 0 8px 18px rgba(0, 0, 0, .28); }
.lang:hover .lang__name { color: var(--text-on-dark); }

/* ---- Contact rows ---- */
.method__left .icon { transition: transform .2s var(--ease-out); }
.method__val { transition: color .2s ease; }
a.method:hover .method__left .icon--accent { transform: scale(1.12); }
a.method:hover .method__val { color: var(--accent); }

/* ---- Footer links ---- */
.footer__col a { transition: color .15s ease, transform .15s var(--ease-out); }
.footer__col a:hover { transform: translateX(3px); }

/* ---- Respect reduced-motion globally ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
  .has-js .reveal,
  .has-js .hero__inner > *,
  .has-js .lang { opacity: 1 !important; transform: none !important; }
  .has-js .reveal .eyebrow__tick { transform: scaleX(1) !important; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .about__inner, .contact__inner { flex-direction: column; }
  .about__left, .contact__left { flex: 1 1 auto; width: 100%; }
  .tech, .methods { width: 100%; }
  .cards { grid-template-columns: 1fr 1fr; gap: 36px; }
}

@media (max-width: 760px) {
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface-primary);
    border-bottom: 1px solid #eceef1;
    box-shadow: 0 12px 24px rgba(0,0,0,.06);
    padding: 8px 24px 16px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links a { padding: 12px 0; font-size: 16px; }
  .nav__cta { display: none; }
  .nav__toggle { display: flex; }

  .hero__inner { padding: 64px 0 72px; }
  .hero__headline { font-size: 34px; }
  .hero__subhead { font-size: 16px; }
  .stats { flex-wrap: wrap; gap: 18px 24px; justify-content: center; }

  .advantages, .about, .contact { padding: 64px 0; }
  .cards { grid-template-columns: 1fr; gap: 0; }
  .card__body { padding-bottom: 32px; }
  .section-head__title { font-size: 27px; }
  .about__title { font-size: 26px; }
  .contact__title { font-size: 27px; }

  .lang-grid { grid-template-columns: 1fr 1fr; }

  .footer__top { flex-direction: column; gap: 40px; }
  .footer__brand { flex: 1 1 auto; }
  .footer__links { gap: 48px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 380px) {
  .lang-grid { grid-template-columns: 1fr; }
}
