/* ==========================================================================
   TomoAid — shared site styles
   Tokens mirror the brand design system (colors, type, radii, shadows).
   ========================================================================== */

[hidden] { display: none !important; }

:root {
  /* Brand */
  --tomo-yellow: #FDC333;
  --tomo-yellow-deep: #EF800D;
  --tomo-yellow-soft: #FFBB34;
  --tomo-purple: #853CE1;
  --tomo-purple-deep: #5712AB;
  --tomo-purple-soft: #7F31E9;
  --tomo-teal: #03D5C8;
  --tomo-teal-deep: #0E9392;
  --tomo-teal-soft: #0BC8C2;
  --tomo-coral: #F76D63;
  --tomo-coral-deep: #E32519;
  --tomo-coral-soft: #F25E54;

  /* Gradients (lifted from Figma) */
  --grad-cta: linear-gradient(90deg, #F7D063 0%, #F76D63 100%);
  --grad-cta-v: linear-gradient(180deg, #F7D063 0%, #F76D63 100%);
  --grad-rainbow: linear-gradient(90deg,
    #BB9BE3 0%, #EC92CD 18%, #FF8F87 34%,
    #FFA962 52%, #FDC333 68%, #9EDF7C 85%, #8FD7D3 100%);
  --grad-disc: radial-gradient(circle at 50% 50%, #006F8C 55%, #17557F 100%);

  /* Neutrals */
  --ink-900: #000000;
  --ink-700: #333333;
  --ink-500: #50566C;
  --ink-400: #898989;
  --ink-300: #B2AEA3;
  --ink-200: #D0D0D0;
  --ink-100: #E9E9E9;
  --ink-75:  #F8F8F8;
  --cream:   #F7F5F0;
  --white:   #FFFFFF;

  /* Type */
  --font-display: 'Arial Rounded MT Bold', 'Arial Rounded MT', 'Nunito', 'Varela Round', system-ui, sans-serif;
  --font-body: 'Inter', 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  --font-nav:  'Fira Sans', 'Inter', sans-serif;

  /* Shape */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 20px;
  --r-pill: 30px;

  /* Shadow */
  --shadow-nav: 0 0 7.1px rgba(0,0,0,.10);
  --shadow-btn: 4px 4px 10px rgba(0,0,0,.05);
  --shadow-bar: 4px 4px 10px rgba(0,0,0,.05);
  --shadow-card: 0 8px 24px rgba(0,0,0,.06);
}

/* =========================================================================
   Reset
   ========================================================================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, textarea { font: inherit; }

/* =========================================================================
   Scroll progress bar (top of page)
   ========================================================================= */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad-rainbow);
  z-index: 200;
  transition: width .08s linear;
  pointer-events: none;
}

/* =========================================================================
   Navigation — floating white pill, 1220×100 @ desktop
   ========================================================================= */
.nav-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 60px 0 0;
  z-index: 100;
  pointer-events: none;
  transition: padding .35s ease;
}
.nav-wrap.is-stuck { padding-top: 20px; }

.nav {
  pointer-events: auto;
  max-width: 1220px;
  margin: 0 auto;
  height: 100px;
  border-radius: var(--r-pill);
  background: var(--white);
  box-shadow: var(--shadow-nav);
  display: flex;
  align-items: center;
  padding: 0 50px;
  gap: 32px;
  transition: height .35s ease, box-shadow .35s ease;
}
.nav-wrap.is-stuck .nav {
  height: 74px;
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav__brand img {
  height: 44px;
  width: auto;
  transition: height .35s ease;
}
.nav-wrap.is-stuck .nav__brand img { height: 34px; }

.nav__spacer { flex: 1; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 0;
}
.nav__link {
  font-family: var(--font-nav);
  font-size: 16px;
  color: var(--ink-700);
  padding: 12px 22px;
  border-radius: 999px;
  position: relative;
  transition: color .2s ease, background .2s ease;
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 22px; right: 22px; bottom: 8px;
  height: 2px;
  background: var(--grad-cta);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: 50% 50%;
  transition: transform .25s ease;
}
.nav__link:hover { color: var(--ink-900); }
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }

.nav__divider {
  width: 1px;
  height: 25px;
  background: var(--ink-200);
  margin: 0 14px;
}

/* ── Products dropdown ── */
.nav__dropdown { position: relative; display: flex; align-items: center; }
.nav__link--has-sub {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 22px;
  font-family: var(--font-nav); font-size: 16px;
  color: var(--ink-700);
  white-space: nowrap; cursor: pointer; user-select: none;
  border: none; background: none; outline: none;
}
.nav__link--has-sub:hover { color: var(--ink-900); }
.nav__dropdown.is-open .nav__link--has-sub { color: var(--ink-900); }
.nav__link--has-sub svg { width: 10px; height: 6px; flex-shrink: 0; transition: transform .2s ease; }
.nav__dropdown.is-open .nav__link--has-sub svg { transform: rotate(180deg); }

.nav__dropdown-menu {
  display: none;
  position: absolute; top: calc(100% + 6px); left: 0;
  background: #fff; border-radius: var(--r-md);
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  border: 1.5px solid var(--ink-200);
  padding: 6px 0; min-width: 200px; z-index: 200;
}
.nav__dropdown.is-open .nav__dropdown-menu { display: block; }

.nav__dropdown-menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; width: 100%;
  font-size: 15px; font-family: var(--font-nav);
  color: var(--ink-700); font-weight: 500; white-space: nowrap;
  border-left: 3px solid transparent;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.nav__dropdown-menu a:hover {
  background: var(--cream); color: var(--ink-900);
  border-left-color: var(--ink-400);
}
.prod-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.nav__dropdown-divider { border: none; border-top: 1px solid var(--ink-100); margin: 4px 0; }
.nav__dropdown-menu .nav__dropdown-all {
  font-size: 13px; color: var(--ink-400); font-weight: 400;
  padding: 10px 18px; border-left-color: transparent;
}
.nav__dropdown-menu .nav__dropdown-all:hover { color: var(--ink-700); }

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-md);
  background: var(--grad-cta);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-body);
  box-shadow: var(--shadow-btn);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.nav__cta:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 6px 6px 16px rgba(247,109,99,.24); }
.nav__cta:active { transform: translateY(0); }

.nav__burger {
  display: none;
  width: 42px; height: 42px;
  border-radius: 12px;
  align-items: center; justify-content: center;
  background: var(--ink-75);
}
.nav__burger svg { width: 20px; height: 14px; }

/* =========================================================================
   Buttons & inputs
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 50px;
  padding: 0 28px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  background: var(--grad-cta);
  box-shadow: var(--shadow-btn);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 6px 10px 20px rgba(247,109,99,.28); filter: brightness(1.04); }
.btn:active { transform: translateY(0); filter: brightness(.98); }
.btn:focus-visible { outline: 3px solid rgba(247,109,99,.35); outline-offset: 3px; }

.btn--ghost {
  background: transparent;
  color: var(--ink-700);
  border: 2px solid var(--ink-100);
  box-shadow: none;
}
.btn--ghost:hover { border-color: var(--ink-300); color: var(--ink-900); box-shadow: none; filter: none; }

.input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 20px;
  border-radius: var(--r-md);
  background: var(--ink-75);
  border: 2px solid var(--ink-100);
  color: var(--ink-700);
  font-family: var(--font-body);
  font-size: 16px;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.input::placeholder { color: var(--ink-500); }
.input:hover { border-color: var(--ink-200); }
.input:focus {
  outline: none;
  border-color: var(--tomo-coral);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(247,109,99,.12);
}

textarea.input {
  height: auto;
  min-height: 140px;
  padding: 16px 20px;
  line-height: 1.6;
  resize: vertical;
}

/* =========================================================================
   Rainbow divider (Figma motif)
   ========================================================================= */
.rainbow-bar {
  height: 7px;
  width: 291px;
  max-width: 100%;
  border-radius: var(--r-lg);
  background: var(--grad-rainbow);
  box-shadow: var(--shadow-bar);
}
.rainbow-bar--wide { width: 982px; max-width: 100%; }

/* =========================================================================
   Reveal-on-scroll
   ========================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .16s; }
.reveal.delay-3 { transition-delay: .24s; }
.reveal.delay-4 { transition-delay: .32s; }

/* =========================================================================
   Section structure
   ========================================================================= */
main { padding-top: 0; } /* nav is fixed over content; hero supplies top space */

.section {
  max-width: 1220px;
  margin: 0 auto;
  padding: 120px 40px;
}
.section--tight { padding: 80px 40px; }
.section-head { text-align: center; margin-bottom: 56px; }
.section-head .bar { margin: 0 auto 28px; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
.h-eyebrow {
  font-family: var(--font-nav);
  font-size: 13px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 18px;
}
.h-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 48px;
  line-height: 1.05;
  color: var(--ink-900);
}
.h-title--xl { font-size: 64px; }
.h-sub {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 20px;
  line-height: 2;
  color: var(--ink-700);
  max-width: 720px;
  margin: 24px auto 0;
}
.h-sub--left { margin-left: 0; margin-right: auto; }

/* =========================================================================
   Footer
   ========================================================================= */
.footer {
  max-width: 1220px;
  margin: 40px auto 0;
  padding: 80px 40px 40px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 64px;
  align-items: start;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer__brand img { height: 42px; width: auto; }
.footer__col h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink-900);
  margin-bottom: 18px;
}
.footer__col a {
  display: block;
  font-size: 16px;
  color: var(--ink-400);
  padding: 6px 0;
  transition: color .2s ease, transform .2s ease;
}
.footer__col a:hover { color: var(--ink-900); transform: translateX(2px); }

.footer__newsletter p {
  font-size: 14px;
  color: var(--ink-700);
  margin: 0 0 14px;
}
.footer__news-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 12px;
}
.footer__legal {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--ink-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-300);
  font-size: 16px;
}
.footer__legal a { color: var(--ink-300); margin-left: 18px; }
.footer__legal a:hover { color: var(--ink-700); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .nav-wrap { padding-top: 20px; }
  .nav { height: 68px; padding: 0 18px; gap: 12px; border-radius: 22px; }
  .nav__brand img { height: 32px; }
  .nav__links, .nav__divider, .nav__cta { display: none; }
  .nav__burger { display: flex; }

  .section { padding: 80px 24px; }
  .h-title { font-size: 34px; }
  .h-title--xl { font-size: 40px; }
  .h-sub { font-size: 16px; line-height: 1.9; }
  .rainbow-bar { width: 240px; }

  .footer { padding: 56px 24px 32px; }
  .footer__grid { grid-template-columns: 1fr; gap: 40px; }
  .footer__legal { flex-direction: column; gap: 14px; text-align: center; }
  .footer__legal a { margin: 0 10px; }
}

/* =========================================================================
   Mobile menu drawer (driven by JS)
   ========================================================================= */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(247,245,240,.96);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.mobile-drawer.is-open { opacity: 1; pointer-events: auto; }
.mobile-drawer a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--ink-900);
}
.mobile-drawer .btn { font-size: 18px; height: 56px; padding: 0 36px; }
