/* ocucheck.app — site styles. Layered on top of tokens.css. */

/* ---------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  margin: 0 0 var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-primary-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--color-primary-darker);
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

strong {
  font-weight: 600;
}

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ------------------------------------------------------------ layout */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.band {
  padding-block: clamp(3.5rem, 8vw, var(--space-3xl));
  border-top: 1px solid var(--color-border);
}

.band--plain {
  border-top: 0;
}

.band__head {
  max-width: 46rem;
  margin-bottom: var(--space-xl);
}

.band__head h2 {
  font-size: var(--fs-h2);
}

.band__head p {
  margin-top: var(--space-md);
  font-size: var(--fs-lead);
  color: var(--color-text-muted);
  max-width: var(--measure);
}

.eyebrow {
  display: block;
  margin-bottom: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.skip {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-text);
  color: #fff;
  border-end-end-radius: var(--radius-sm);
}

.skip:focus {
  inset-inline-start: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------ header */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 250, 248, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text);
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-inline-end: auto;
}

.brand__mark {
  width: 30px;
  height: 20px;
  color: var(--color-primary);
  flex: none;
}

.nav {
  display: none;
  gap: var(--space-lg);
}

.nav a {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.nav a:hover {
  color: var(--color-primary-deep);
}

@media (min-width: 62rem) {
  .nav {
    display: flex;
  }
}

/* A disclosure rather than a script: it opens, lists every language in its
   own name, and each entry leads to the page being read, in that language. */
.lang {
  position: relative;
}

.lang__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.2;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.lang__toggle::-webkit-details-marker {
  display: none;
}

.lang__toggle::after {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.lang[open] > .lang__toggle::after {
  transform: translateY(1px) rotate(225deg);
}

.lang__toggle:hover,
.lang[open] > .lang__toggle {
  border-color: var(--color-rule);
  color: var(--color-primary-deep);
}

.lang__icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
}

.lang__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  inset-inline-end: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(2, minmax(8.5rem, 1fr));
  gap: 0.1rem 0.5rem;
  width: max-content;
  max-width: calc(100vw - 2 * var(--space-lg));
  max-height: min(70vh, 30rem);
  overflow-y: auto;
  padding: var(--space-xs);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.lang__menu a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}

.lang__menu a:hover {
  background: var(--color-primary-wash);
  color: var(--color-primary-deep);
}

.lang__menu a[aria-current="page"] {
  background: var(--color-primary-wash);
  color: var(--color-primary-deep);
  font-weight: 600;
}

/* On a phone the header holds the brand, the globe and Download, and nothing
   else fits: the language name stays in the accessible label only. */
@media (max-width: 35.99rem) {
  .masthead__inner {
    gap: var(--space-sm);
  }

  /* Hung from the sticky header rather than the globe, which sits too far in
     from the edge to hold a two-column menu. */
  .lang {
    position: static;
  }

  .lang__menu {
    top: 100%;
    inset-inline: var(--space-lg);
    width: auto;
    max-width: none;
  }

  .lang__current {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (min-width: 48rem) {
  .lang__menu {
    grid-template-columns: repeat(3, minmax(8.5rem, 1fr));
  }
}

/* -------------------------------------------------------------- links */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.15rem;
  background: var(--color-primary-deep);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--color-primary-darker);
  color: #fff;
}

.btn--sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.9375rem;
}

.btn--store {
  padding: 0.7rem 1.4rem 0.7rem 0.8rem;
}

.btn--store:hover {
  transform: translateY(-1px);
}

.btn__icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex: none;
}

.btn__label {
  display: grid;
  text-align: start;
  line-height: 1.15;
}

.btn__label small {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.btn__label span {
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.textlink {
  font-weight: 550;
}

/* --------------------------------------------------------------- hero */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(3rem, 7vw, 5rem);
  background:
    radial-gradient(120% 90% at 50% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 65%),
    var(--color-bg);
}

.hero__inner {
  position: relative;
  z-index: 1;
}

/* Faint linework of the same eye used in the brand mark: room atmosphere,
   not illustration. Hidden where it would crowd the headline. */
.hero__iris {
  display: none;
}

@media (min-width: 68rem) {
  .hero__iris {
    display: block;
    position: absolute;
    top: 50%;
    inset-inline-end: -6rem;
    width: 34rem;
    transform: translateY(-50%);
    color: var(--color-primary);
    opacity: 0.09;
    pointer-events: none;
    z-index: 0;
  }
}

.chart {
  position: relative;
  margin: 0;
}

/* A row may wrap: a translation that runs longer than the English would
   otherwise be clipped by the hero on a phone. */
.chart__row {
  display: block;
  position: relative;
  padding-block: 0.12em 0.18em;
  letter-spacing: -0.035em;
  line-height: 1;
  text-wrap: balance;
}

/* Full-bleed hairlines: the ruled rows of a chart on the far wall. */
.chart__row + .chart__row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  border-top: 1px solid var(--color-rule);
}

.chart__row:nth-child(1) {
  font-size: var(--fs-row-1);
}

.chart__row:nth-child(2) {
  font-size: var(--fs-row-2);
}

.chart__row:nth-child(3) {
  font-size: var(--fs-row-3);
  color: var(--color-primary-deep);
}

.hero__lead {
  margin-top: var(--space-xl);
  max-width: 36rem;
  font-size: var(--fs-lead);
  color: var(--color-text-muted);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-lg);
  margin-top: var(--space-lg);
}

.hero__fineprint {
  margin: 0;
  max-width: 18rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ------------------------------------------------------------- notice */

.notice {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  max-width: 52rem;
}

.band--notice .notice {
  margin-top: 0;
  margin-inline: auto;
}

.notice p {
  font-size: 1.0625rem;
}

.notice__statement {
  font-weight: 550;
}

.notice__aside {
  margin-top: var(--space-md);
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* ------------------------------------------------------------- checks */

.group {
  display: grid;
  gap: var(--space-md) var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.group + .group {
  margin-top: var(--space-xl);
}

.group__label {
  font-size: var(--fs-h3);
  letter-spacing: -0.015em;
}

.group__label span {
  display: block;
  margin-top: var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.checklist {
  display: grid;
  gap: 0;
}

.checklist dt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs) var(--space-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.checklist dd {
  margin: 0.15rem 0 0;
  color: var(--color-text-muted);
  max-width: 42rem;
}

.checklist dd + dt {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.notes {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.note-row {
  display: grid;
  gap: var(--space-2xs) var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.note-row__label {
  margin: 0;
  font-weight: 600;
  color: var(--color-text);
}

@media (min-width: 48rem) {
  .group {
    grid-template-columns: 15rem 1fr;
  }

  .note-row {
    grid-template-columns: 15rem 1fr;
  }
}

/* ---------------------------------------------------------- highlight */

.highlight {
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.highlight__badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.highlight__title {
  margin-top: var(--space-md);
  max-width: 34rem;
  font-size: clamp(1.375rem, 2.6vw, 1.75rem);
}

.highlight__body {
  margin-top: var(--space-md);
  max-width: 42rem;
  font-size: var(--fs-lead);
}

.highlight__body + p {
  margin-top: var(--space-sm);
  max-width: 42rem;
  color: var(--color-text-muted);
}

/* -------------------------------------------------------------- steps */

.steps {
  display: grid;
  gap: var(--space-lg);
  counter-reset: step;
}

.step {
  padding-top: var(--space-md);
  border-top: 2px solid var(--color-text);
}

.step__no {
  display: block;
  margin-bottom: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  color: var(--color-primary-deep);
}

.step h3 {
  font-size: var(--fs-h3);
  margin-bottom: var(--space-xs);
}

.step p {
  color: var(--color-text-muted);
}

.bands {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  margin-top: var(--space-md);
  padding: 0;
}

.bands li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--color-text);
}

.dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex: none;
}

.dot--green {
  background: var(--color-success);
}

.dot--orange {
  background: var(--color-caution);
}

.dot--red {
  background: var(--color-danger);
}

@media (min-width: 48rem) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl) var(--space-2xl);
  }
}

@media (min-width: 68rem) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
  }
}

/* ---------------------------------------------------------- languages */

.langs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.langs li {
  padding: 0.35rem 0.8rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  line-height: 1.4;
  white-space: nowrap;
}

/* ------------------------------------------------------------ privacy */

.privacy {
  display: grid;
  gap: var(--space-lg) var(--space-2xl);
  align-items: start;
}

.privacy__points {
  display: grid;
  gap: var(--space-md);
}

.privacy__points li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.privacy__points li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.privacy__points svg {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.28rem;
  flex: none;
  color: var(--color-primary);
}

@media (min-width: 56rem) {
  .privacy {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------------------------------------------------------------- faq */

.faq {
  display: grid;
  gap: var(--space-lg) var(--space-2xl);
}

.faq h3 {
  font-size: 1.0625rem;
  margin-bottom: var(--space-xs);
}

.faq p {
  color: var(--color-text-muted);
  max-width: 34rem;
}

.faq__item {
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

@media (min-width: 56rem) {
  .faq {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ------------------------------------------------------------- footer */

.footer {
  padding-block: var(--space-2xl);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.footer__grid {
  display: grid;
  gap: var(--space-lg) var(--space-2xl);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  font-size: 0.9375rem;
}

.footer__meta {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

@media (min-width: 56rem) {
  .footer__grid {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }

  .footer__links {
    justify-content: flex-end;
  }
}

/* --------------------------------------------------------- policy page */

.doc {
  padding-block: clamp(2.5rem, 6vw, 4rem) clamp(3rem, 7vw, 5rem);
}

.doc__layout {
  display: grid;
  gap: var(--space-xl) var(--space-2xl);
  align-items: start;
}

.doc__head {
  max-width: 46rem;
  margin-bottom: var(--space-xl);
}

.doc__head h1 {
  font-size: clamp(2.25rem, 5.5vw, 3.5rem);
  letter-spacing: -0.03em;
}

.doc__updated {
  margin-top: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.toc {
  display: none;
}

.toc__title {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.toc ol {
  display: grid;
  gap: var(--space-xs);
  counter-reset: toc;
}

.toc a {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.toc a:hover {
  color: var(--color-primary-deep);
}

@media (min-width: 62rem) {
  .doc__layout {
    grid-template-columns: 14rem minmax(0, 1fr);
  }

  .toc {
    display: block;
    position: sticky;
    top: 5.5rem;
    padding-inline-start: var(--space-md);
    border-inline-start: 1px solid var(--color-border);
  }
}

.prose {
  max-width: 38rem;
  font-size: 1.0625rem;
}

.prose h2 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  font-size: 1.5rem;
  scroll-margin-top: 6rem;
}

.prose h3 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-2xs);
  font-size: 1.125rem;
}

.prose > p:first-child {
  font-size: var(--fs-lead);
  color: var(--color-text-muted);
}

.prose ul {
  display: grid;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.prose ul li {
  position: relative;
  padding-inline-start: 1.1rem;
}

.prose ul li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary);
}

.prose .notice {
  margin-top: var(--space-lg);
  max-width: none;
}

.prose .notice + p {
  margin-top: var(--space-md);
}

/* ------------------------------------------------------------- scripts */

/* Tracking and capitals belong to the cased scripts. Spaced out, Arabic
   letters stop joining; CJK, Devanagari and Thai have no capitals, so
   uppercasing would only reach the Latin names inside them ("App Store"). */
:is(:lang(ar), :lang(hi), :lang(ja), :lang(ko), :lang(th), :lang(zh))
  :is(h1, h2, h3, h4, .chart__row, .eyebrow, .step__no, .highlight__badge,
      .doc__updated, .toc__title, .group__label span, .btn__label small,
      .btn__label span, .bands li) {
  letter-spacing: normal;
  text-transform: none;
}

/* The mono face carries none of these scripts, so its labels would fall back
   to whatever monospaced font the system finds; the sans face covers them. */
:is(:lang(ar), :lang(hi), :lang(ja), :lang(ko), :lang(th), :lang(zh))
  :is(.eyebrow, .step__no, .highlight__badge, .doc__updated, .toc__title,
      .group__label span, .btn__label small, .bands li) {
  font-family: var(--font-sans);
}

/* Break Japanese headlines between phrases, not inside a word. */
:lang(ja) :is(h1, h2, h3, .chart__row) {
  word-break: auto-phrase;
}

/* -------------------------------------------------------------- motion */

@media (prefers-reduced-motion: no-preference) {
  .chart__row,
  .hero__lead,
  .hero__cta {
    animation: settle 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }

  /* Read down the chart, one row at a time. */
  .chart__row:nth-child(1) { animation-delay: 0.04s; }
  .chart__row:nth-child(2) { animation-delay: 0.16s; }
  .chart__row:nth-child(3) { animation-delay: 0.28s; }
  .hero__lead { animation-delay: 0.4s; }
  .hero__cta { animation-delay: 0.48s; }

  .hero__iris {
    animation: focus-in 1.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes focus-in {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(1.06);
  }
  to {
    opacity: 0.09;
    transform: translateY(-50%) scale(1);
  }
}

@media print {
  .masthead,
  .hero__iris,
  .toc {
    display: none;
  }

  body {
    background: #fff;
  }
}
