/* NoteSeek shared UI — token consumers.
   Slice 1: .ns-btn variants applied on marketing CTAs.
   Per-page <style> still owns layout/reveal until later slices. */

html,
body {
  overflow-x: clip;
  max-width: 100%;
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

main,
#main-content {
  max-width: 100%;
  overflow-x: clip;
}

@supports not (overflow: clip) {
  main,
  #main-content {
    overflow-x: hidden;
  }
}

.ns-skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: var(--z-modal);
  padding: var(--space-2) var(--space-4);
  background: var(--skip-link-bg);
  color: var(--skip-link-fg);
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--button-radius);
  transform: translateY(-200%);
}

.ns-skip-link:focus,
.ns-skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid var(--button-focus-ring);
  outline-offset: 2px;
}

/* Button family — applied in Phase 3 slice 1. Spec from approved plan. */
.ns-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  box-sizing: border-box;
  height: var(--button-height-md);
  padding: 0 var(--button-padding-x);
  border-radius: var(--button-radius);
  border: 2px solid transparent;
  font-family: var(--font-display);
  font-size: var(--button-font-size);
  font-weight: var(--button-font-weight);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    filter var(--duration-fast) var(--ease-out);
}

.ns-btn:focus-visible {
  outline: 3px solid var(--button-focus-ring);
  outline-offset: 2px;
}

.ns-btn:disabled,
.ns-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.ns-btn--lg {
  height: var(--button-height-lg);
}

.ns-btn--solid {
  background: var(--button-bg);
  color: var(--button-fg);
  border-color: var(--button-bg);
}

.ns-btn--solid:hover {
  background: var(--button-hover-bg);
  border-color: var(--button-hover-bg);
}

.ns-btn--solid:active {
  background: var(--button-active-bg);
  border-color: var(--button-active-bg);
}

.ns-btn--ghost {
  background: transparent;
  color: var(--button-ghost-fg);
  border-color: var(--button-ghost-border);
}

.ns-btn--ghost:hover {
  background: var(--button-ghost-hover-bg);
}

.ns-btn--ghost:active {
  background: var(--button-ghost-active-bg);
}

.ns-btn--inverted {
  background: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-white);
}

.ns-btn--inverted:hover {
  background: var(--color-ns-lavender);
  border-color: var(--color-ns-lavender);
}

.ns-btn--inverted:active {
  background: var(--color-ns-purple);
  border-color: var(--color-ns-purple);
}

.ns-btn--inverted:focus-visible {
  outline-color: var(--button-focus-ring-on-primary);
}

.ns-btn--inverted-ghost {
  background: transparent;
  color: var(--color-white);
  border-color: rgb(255 255 255 / 0.35);
}

.ns-btn--inverted-ghost:hover {
  background: rgb(255 255 255 / 0.1);
}

.ns-btn--inverted-ghost:active {
  background: rgb(255 255 255 / 0.16);
}

.ns-btn--inverted-ghost:focus-visible {
  outline-color: var(--button-focus-ring-on-primary);
}

.ns-btn--full {
  width: 100%;
}

/* Nav + mobile sheet — height via --nav-height (64 mobile / 72 md+). */

.ns-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.ns-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-display);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  color: var(--color-ns-navy);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.ns-nav__link:hover,
.ns-nav__link[aria-current="page"] {
  color: var(--color-primary);
}

.ns-nav__link:focus-visible {
  outline: 3px solid var(--button-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.ns-nav__chevron {
  transition: transform var(--duration-fast) var(--ease-out);
}

.ns-nav-dropdown-parent.is-open .ns-nav__chevron {
  transform: rotate(180deg);
}

.ns-nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  z-index: var(--z-dropdown);
  width: 13rem;
  padding: var(--space-2) 0;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition:
    opacity var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.ns-nav-dropdown--wide {
  width: max-content;
  min-width: 14rem;
}

.ns-nav-dropdown--wide .ns-nav-dropdown__item {
  white-space: nowrap;
}

.ns-nav-dropdown-parent.is-open .ns-nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ns-nav-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.625rem var(--space-4);
  font-family: var(--font-display);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-ns-navy);
  transition:
    color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.ns-nav-dropdown__item:hover,
.ns-nav-dropdown__item[aria-current="page"] {
  color: var(--color-primary);
  background: var(--color-ns-lavender);
}

.ns-nav-dropdown__item:focus-visible {
  outline: 3px solid var(--button-focus-ring);
  outline-offset: -2px;
}

.ns-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-ns-dark);
  cursor: pointer;
}

.ns-hamburger:focus-visible {
  outline: 3px solid var(--button-focus-ring);
  outline-offset: 2px;
}

.ns-hamburger__icon {
  display: block;
}

.ns-mobile-sheet {
  position: fixed;
  inset-inline-end: 0;
  inset-inline-start: auto;
  top: 0;
  bottom: 0;
  width: min(16.5rem, 70vw);
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .ns-mobile-sheet {
    width: clamp(15rem, 18vw, 20rem);
  }
}

.ns-mobile-sheet[hidden],
.ns-mobile-sheet.is-closed {
  display: none;
}

html.ns-mobile-nav-open body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-dropdown) - 1);
  background: rgba(31, 26, 46, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html.ns-mobile-nav-open,
html.ns-mobile-nav-open body {
  overflow: hidden;
}

/* Shared hero title scale (matches index — no 64px leap on lg/xl) */
.hero-copy {
  --hero-title: 2.25rem; /* 36px */
  max-width: 100%;
  min-width: 0;
}

@media (min-width: 640px) {
  .hero-copy {
    --hero-title: 3rem; /* 48px */
  }
}

@media (min-width: 1280px) {
  .hero-copy {
    --hero-title: var(--font-size-h1); /* ~49px */
  }
}

.hero-copy__title-line {
  display: block;
  max-width: 100%;
  overflow-wrap: break-word;
  font-size: var(--hero-title);
  line-height: 1.15;
  letter-spacing: var(--tracking-display);
}

@media (min-width: 640px) {
  .hero-copy__title-line {
    line-height: 1.1;
  }
}

/* Short two-line heroes (index) — keep each line on one row from phone up */
.hero-copy--nowrap .hero-copy__title-line {
  white-space: normal;
}

@media (min-width: 375px) {
  .hero-copy--nowrap .hero-copy__title-line {
    white-space: nowrap;
    line-height: 1.111;
  }
}

@media (min-width: 640px) {
  .hero-copy--nowrap .hero-copy__title-line {
    line-height: 1;
  }
}

.hero-copy__actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: var(--space-2);
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (min-width: 640px) {
  .hero-copy__actions {
    gap: var(--space-4);
  }
}

@media (min-width: 1024px) {
  .hero-copy__actions {
    justify-content: flex-start;
  }
}

.hero-copy__actions .ns-btn {
  flex: 1 1 0;
  min-width: 0;
  height: auto;
  min-height: var(--button-height-md);
  padding: var(--space-2) var(--space-2);
  font-size: var(--font-size-caption);
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (min-width: 375px) {
  .hero-copy__actions .ns-btn {
    font-size: var(--font-size-sm);
    padding-inline: var(--space-3);
  }
}

@media (min-width: 640px) {
  .hero-copy__actions .ns-btn {
    flex: 0 1 auto;
    height: var(--button-height-lg);
    min-height: var(--button-height-lg);
    padding: 0 var(--button-padding-x);
    font-size: var(--font-size-base);
    line-height: 1;
    white-space: nowrap;
    overflow-wrap: normal;
  }
}

#hero {
  overflow-x: clip;
  max-width: 100%;
}

@supports not (overflow: clip) {
  #hero {
    overflow-x: hidden;
  }
}

.hero-copy > .inline-flex {
  max-width: 100%;
}

.hero-copy__trust {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: var(--space-2);
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
}

.hero-copy__trust::-webkit-scrollbar {
  display: none;
}

@media (min-width: 640px) {
  .hero-copy__trust {
    gap: var(--space-6);
    overflow-x: visible;
  }
}

@media (min-width: 1024px) {
  .hero-copy__trust {
    justify-content: flex-start;
  }
}

.hero-copy__trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
  white-space: nowrap;
}

.hero-copy__trust-item span {
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-semibold);
  color: var(--color-ns-ink);
}

@media (min-width: 640px) {
  .hero-copy__trust-item span {
    font-size: var(--font-size-sm);
  }
}

.ns-mobile-sheet__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--space-4) var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ns-mobile-sheet__label {
  margin: 0;
  padding: var(--space-1) var(--space-1) var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-ns-mid);
}

.ns-mobile-sheet__link {
  display: block;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-ns-navy);
  transition:
    color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.ns-mobile-sheet__link:hover,
.ns-mobile-sheet__link[aria-current="page"] {
  color: var(--color-primary);
  background: var(--color-ns-lavender);
}

.ns-mobile-sheet__link:focus-visible {
  outline: 3px solid var(--button-focus-ring);
  outline-offset: 2px;
}

.ns-mobile-sheet__divider {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-3) 0;
}

.ns-mobile-sheet__footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6) max(var(--space-6), env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
  background: var(--color-ns-lavender);
}

@media (prefers-reduced-motion: reduce) {
  .ns-nav-dropdown,
  .ns-nav__chevron {
    transition: none;
  }

  html.ns-mobile-nav-open body::before {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.ns-reveal {
  opacity: 0;
  transform: translateY(var(--reveal-offset));
  transition:
    opacity var(--duration-reveal) var(--ease-out),
    transform var(--duration-reveal) var(--ease-out);
}

.ns-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ns-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .animate-ping {
    animation: none !important;
  }
}

.ns-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--spacing-gutter);
}

.ns-measure {
  max-width: var(--measure);
}

/* Product mockup card lift (index showcase) */
.card-hover {
  transition: box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.gradient-bar {
  background: linear-gradient(90deg, var(--color-ns-violet) 0%, var(--color-ns-mid) 100%);
}

.ns-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
}

.ns-table {
  width: 100%;
  min-width: 280px;
  border-collapse: collapse;
  font-size: 1rem;
}

.ns-table th,
.ns-table td {
  border: 1px solid var(--color-border);
  padding: var(--table-cell-padding-y) var(--table-cell-padding-x);
  text-align: left;
  vertical-align: top;
  color: var(--color-ns-ink);
}

.ns-table th {
  background: var(--table-header-bg);
  color: var(--table-header-fg);
  font-family: var(--font-display);
  font-weight: 600;
}

/* FAQ accordion — shared open height so answers are not clipped */
.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-body {
  max-height: 800px;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-chevron {
  transition: transform 0.3s ease;
}

/* How-it-works dashed connectors (clinic steps) */
.step-dash::after {
  content: "";
  position: absolute;
  top: 28px;
  left: calc(50% + 36px);
  right: calc(-50% + 36px);
  height: 2px;
  border-top: 2px dashed var(--color-ns-border);
}

.step-dash:last-child::after {
  display: none;
}

/* Tutorial video frame — token radius (overrides injected player styles) */
.ns-tutorial-video__frame,
.ns-tutorial-video--hero .ns-tutorial-video__frame {
  border-radius: var(--radius-xl) !important; /* 24px ≈ rounded-3xl */
}

@media (max-width: 640px) {
  .ns-tutorial-video__frame,
  .ns-tutorial-video--hero .ns-tutorial-video__frame {
    border-radius: var(--radius-lg) !important; /* 16px ≈ rounded-2xl */
  }
}
