/* MindWave site styles — v1 */

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── 1. Base ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.125rem;
  line-height: 1.65;
}

a {
  color: var(--link);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

img,
svg {
  max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── 2. .site-header ─────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: auto;
  height: 32px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}

.site-nav a:hover {
  color: var(--link);
}

/* Page sections as a smaller second row under the tabs (Sina 10-19: same tabs on every page) */
.sub-nav { display: flex; flex-wrap: wrap; gap: 0 1rem; flex-basis: 100%; font-size: .9rem; }
.sub-nav a { color: var(--ink-soft); text-decoration: none; padding: .3rem .1rem; }
.sub-nav a:hover { color: var(--link); }
@media (max-width: 40rem) {  /* phones: each row scrolls sideways instead of wrapping, so the header stays short */
  .site-nav, .sub-nav { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; flex-basis: 100%; }
  .site-nav a, .sub-nav a { white-space: nowrap; }
}

/* ── 3. .hero ────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-ink);
  padding: clamp(3rem, 10vw, 7rem) clamp(1rem, 6vw, 5rem) clamp(6rem, 16vw, 11rem);
}

.hero h1,
.hero .hero-title {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0.25em 0;
  max-width: 14ch;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--hero-soft);
}

.lede {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  color: var(--hero-soft);
  max-width: 34ch;
}

.button {
  display: inline-block;
  margin-top: 1.5rem;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.06);
}

.wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: clamp(4.5rem, 14vw, 9rem);
  pointer-events: none;
}

/* Text and the button sit above the waves; the waves stay in the bottom padding band. */
.hero > :not(.wave) {
  position: relative;
  z-index: 1;
}

.hero .hero-art {
  position: absolute;
  z-index: 0;
  right: clamp(1rem, 5vw, 5rem);
  top: 50%;
  transform: translateY(-50%);
  height: min(85%, 560px);
  width: auto;
  pointer-events: none;
}

.wave path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.wave-1 {
  stroke: var(--wave-1);
}

.wave-2 {
  stroke: var(--wave-2);
  opacity: 0.8;
  animation: drift 14s ease-in-out infinite alternate;
}

.wave-3 {
  stroke: var(--wave-3);
  opacity: 0.7;
  animation: drift 19s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-4%); }
}

/* ── 4. .band ────────────────────────────────────────────── */
.band {
  padding: clamp(3rem, 8vw, 5.5rem) clamp(1rem, 6vw, 5rem);
  max-width: 72rem;
  margin: 0 auto;
}

.band + .band {
  padding-top: 0;
}

.band h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}

.band > p {
  max-width: 60ch;
}

/* ── 5. .steps / .step ─────────────────────────────────── */
.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.5rem;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--on-accent);
  color: var(--on-accent);
  font-weight: 800;
}

.step h3 {
  margin: 0.75rem 0 0.25rem;
}

/* ── 6. .cards / .card ──────────────────────────────────── */
.cards {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.5rem;
}

/* ── 7. .draft / .placeholder ───────────────────────────── */
.draft {
  position: relative;
  outline: 2px dashed color-mix(in srgb, var(--ink-soft) 45%, transparent);
  outline-offset: 4px;
  border-radius: 0.25rem;
}

.draft::after {
  content: "Draft";
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  vertical-align: middle;
}

.placeholder {
  color: var(--ink-soft);
  font-style: italic;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}

/* video thumbnail slot (community.html); our own image goes here after consent */
.video .thumb {
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--line);
  border-radius: 0.75rem;
  background: var(--bg);
  margin-bottom: 1rem;
}

/* ── 8. .site-footer ─────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem clamp(1rem, 6vw, 5rem);
  color: var(--ink-soft);
  font-size: 1rem;
}

.disclaimer {
  font-weight: 600;
  color: var(--ink);
}

/* FCC 47 CFR 2.803 notice next to a price (demo page): small but conspicuous, never hidden. */
.fcc {
  font-size: 0.875rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* ── 9. palettes.html specific ───────────────────────────── */
.compare {
  margin: 0 0 2.5rem;
}

.compare-label {
  padding: 0.75rem clamp(1rem, 6vw, 5rem) 0.5rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
}

/* .palette-compare .hero-title already handled by .hero .hero-title (step 3) */

/* ── 10. Responsive ──────────────────────────────────────── */
@media (max-width: 40rem) {
  .site-nav a {
    font-size: 0.95rem;
  }

  .hero h1,
  .hero .hero-title {
    max-width: none;
  }
}

/* Keyboard + anchors (lead, after the mesh review 09-29) */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--focus);
  border-radius: .5rem;
  padding: .6rem 1rem;
  font-weight: 700;
}
.skip-link:focus {
  top: .75rem;
}
main [id] {
  scroll-margin-top: 6.5rem;
}
.site-nav a {
  display: inline-block;
  padding: .6rem .15rem;
}
/* Phones: the nav wraps to two rows, so the header scrolls away instead of covering a fifth of the screen. */
@media (max-width: 40rem) {
  .site-header {
    position: static;
  }
  main [id] {
    scroll-margin-top: 1rem;
  }
}

/* how.html diagram: sits close to the intro, full width of the band */
.band-diagram {
  padding-top: 0;
}
.diagram {
  margin: 0;
}
.diagram figcaption {
  margin-top: .75rem;
  display: inline-block;
}

/* Company-first home (Sina Q1, 09-29): the instrument as one section */
.kicker {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0 0 1.125rem;  /* = the paragraph's 1em below the title, so the gaps match (Sina 10-30) */
}
.instrument-title {
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -.015em;
  font-weight: 800;
  margin: 0 0 1rem;
  color: var(--link);
}
.band .disclaimer {
  font-weight: 600;
  margin-top: 2rem;
}
.band .steps + p,
.band .cards {
  margin-top: 1.5rem;
}
#building .steps {
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
}

/* About: partners and support as calm pills */
.support-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.support-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .6rem 1.1rem;
  font-weight: 600;
}
@media (max-width: 40rem) {
  .support-list { gap: .5rem; }
  .support-list li { padding: .45rem .8rem; font-size: .9rem; }
}

@media (max-width: 1180px) {
  .hero .hero-art {
    display: none;
  }
}

/* how.html diagram on phones: a stacked version, so the labels stay readable (UX pass 10-01) */
.diagram-tall {
  display: none;
  max-width: 340px;
}
@media (max-width: 600px) {
  .diagram .diagram-wide {
    display: none;
  }
  .diagram .diagram-tall {
    display: block;
  }
}

/* Ribbon band (Sina 10-01, card 3 Q3): faint brand ribbon behind the About/How intro. Decorative. */
.band-ribbon {
  position: relative;
  overflow: hidden;
}
.band-ribbon .ribbon {
  position: absolute;
  z-index: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: min(46%, 520px);
  height: auto;
  opacity: 0.35;
  pointer-events: none;
}
.band-ribbon > :not(.ribbon) {
  position: relative;
  z-index: 1;
}
@media (max-width: 600px) {
  .band-ribbon .ribbon {
    top: 0.5rem;
    transform: none;
    width: 70%;
    opacity: 0.22;
  }
}

/* Home: "Interest in our company" sign-up (listmonk form; not live until setup + Sina's go) */
.signup-form {
  display: grid;
  gap: .9rem;
  max-width: 34rem;
  margin-top: 1.25rem;
}
.signup-form .field {
  display: grid;
  gap: .35rem;
  margin: 0;
}
.signup-form label {
  font-weight: 600;
}
.signup-form input[type="email"],
.signup-form input[type="text"] {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--ink-soft);
  border-radius: .75rem;
  padding: .7rem .9rem;
}
.signup-form fieldset {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: .75rem 1rem 1rem;
  margin: 0;
}
.signup-form legend {
  font-weight: 700;
  padding: 0 .35rem;
}
.signup-form .check {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .4rem 0 0;
}
.signup-form .check label {
  font-weight: 500;
}
.signup-form input[type="checkbox"],
.signup-form input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--ink);
}
.signup-form :focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
.signup .privacy {
  max-width: 34rem;
  font-size: .9rem;
  color: var(--ink-soft);
}
.signup-form button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ── Worlds page: click-to-load video card (nothing loads from YouTube before the click) ── */
.jam-load, .video-load {
  position: relative;
  display: block;
  width: min(100%, 40rem);
  aspect-ratio: 16 / 9;
  margin-top: 1rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.video-load img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.jam-load span, .video-load span {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
}
.card video {  /* the jam video, played from our own site after the tap (Sina 10-19) */
  display: block;
  width: min(100%, 40rem);
  aspect-ratio: 16 / 9;
  margin-top: 1rem;
  border-radius: 1.25rem;
  background: var(--surface);
}
.world iframe {
  display: block;
  width: min(100%, 40rem);
  aspect-ratio: 16 / 9;
  margin-top: 1rem;
  border: 0;
  border-radius: 1.25rem;
}
.video-note {
  font-size: .9rem;
  color: var(--ink-soft);
}

/* ── Worlds page layout (Sina 10-18 polish 1, 2, 4): stills two per row on wide screens, tall shots capped,
   text-only cards compact. Layout only, existing tokens. ── */
.world > img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  margin-top: 1rem;
  border-radius: 1.25rem;
}
.world:not(:has(img, .video-load)) h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
}
.band.world:not(:has(img, .video-load)) {
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
/* Captioned views and the visible source line (Sina 10-27 via c08) */
.world > figure { margin: 1rem 0 0; }
.world > figure img { display: block; max-width: 100%; height: auto; max-height: 70vh; border-radius: 1.25rem; }
.world figcaption { margin-top: .4rem; font-size: .9rem; color: var(--ink-soft); }
.world-credit { margin-top: 1rem; font-size: .85rem; color: var(--ink-soft); }
@media (min-width: 900px) {
  .world { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; align-items: start; }
  .world > :not(img, figure) { grid-column: 1 / -1; }
}

/* Thank-you email line for Work with us (Sina 10-21): shown only when the form sends #apply. */
#apply {
  display: none;
}
#apply:target {
  display: block;
}

/* Work with us (Sina 10-22): one box under I'm interested; ticking it shows its options (also when the
   page opens at #join, the flyer QR, which only scrolls there). No script; a browser without :has() shows them always. */
.signup-form .work {
  margin: .2rem 0 0 1.85rem;
}
@supports selector(:has(a)) {
  .signup-form .work {
    display: none;
  }
  .signup-form:has(#su-work:checked) .work {
    display: block;
  }
}

/* Tab rows (Sina 10-27): each tab's page sections as rows under it, on hover, keyboard focus or the arrow (touch). */
.tab { position: relative; display: inline-flex; align-items: center; }
.tab-open { background: none; border: 0; color: var(--ink-soft); font: inherit; padding: .6rem .3rem; cursor: pointer; }
.tab-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 30; min-width: 11rem; margin: 0; padding: .35rem 0;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; }
.tab:hover .tab-menu,
.tab:focus-within .tab-menu,
.tab-open[aria-expanded="true"] + .tab-menu { display: block; }
.tab.hush .tab-menu { display: none; }  /* Escape closed it (WCAG 1.4.13) until the pointer or focus leaves */
.tab-menu a { display: block; padding: .45rem .9rem; font-weight: 400; white-space: nowrap; }
@media (max-width: 40rem) {
  .tab-open, .tab-menu { display: none !important; }  /* phones: the tabs scroll sideways; the sub row stays */
}
/* Sina 10-27 18:0x: on computers the current tab's rows replace the sub row. Phones (Sina 11-01, D): no lines; the tab
   you're on is a soft pill joined to a tray of its sections (nav.js places the bridge), and the section on screen darkens */
@media (min-width: 40.0625rem) { .sub-nav.in-tab, .nav-bridge { display: none; } }
@media (max-width: 40rem) {
  .site-header { position: relative; }
  .site-nav > a, .site-nav .tab > a { color: var(--ink-soft); font-weight: 500; }
  .site-nav a[aria-current] { display: inline-block; color: var(--ink); font-weight: 700; background: var(--tint);
    border-radius: .9rem .9rem 0 0; padding: .3rem .85rem; }
  .sub-nav.in-tab { width: fit-content; flex-basis: auto; gap: 0 .2rem; background: var(--tint); border-radius: .9rem;
    padding: .15rem .3rem; margin-top: -.55rem; position: relative; z-index: 1; }  /* a short join, no empty band */
  .sub-nav.in-tab.join-left { border-top-left-radius: 0; }  /* tab and tray share an edge: keep it straight */
  .sub-nav.in-tab.join-right { border-top-right-radius: 0; }
  .sub-nav.in-tab a { color: var(--tray-ink); border-radius: 999px; padding: .3rem .7rem; transition: color .25s, background-color .25s; }
  .sub-nav.in-tab a.in-view { color: var(--ink); font-weight: 700; background: var(--surface); }
  .nav-bridge { position: absolute; background: var(--tint); pointer-events: none; }
  .nav-bridge::before, .nav-bridge::after { content: ""; position: absolute; bottom: 0; width: .9rem; height: .9rem; }
  .nav-bridge::before { left: -.9rem; background: radial-gradient(circle at 0 0, transparent .9rem, var(--tint) calc(.9rem + .5px)); }
  .nav-bridge::after { right: -.9rem; background: radial-gradient(circle at 100% 0, transparent .9rem, var(--tint) calc(.9rem + .5px)); }
  .nav-bridge.flush-left::before, .nav-bridge.flush-right::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { .sub-nav.in-tab a { transition: none; } }
