/* ---------------------------------------------------------------------------
   opticianos.com — public site
   Concept: "Acuity". An optical chart is a typographic system, so the page is
   built as one: a scale cascade from headline to detail, clinical annotations
   set in mono (the same DM Mono the product reserves for prescription values),
   teal used once as a signal rather than as decoration.

   Zero third-party requests. Fonts are self-hosted, there is no analytics and
   no cookie — which is what lets the privacy policy say so plainly.
   --------------------------------------------------------------------------- */

/* --- Fonts (latin subset, self-hosted) ----------------------------------- */
@font-face {
  font-family: 'DM Sans'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('fonts/dm-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('fonts/dm-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('fonts/dm-sans-700.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('fonts/dm-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('fonts/dm-mono-500.woff2') format('woff2');
}

/* --- Tokens --------------------------------------------------------------- */
:root {
  --ink:        #0A1413;
  --ink-2:      #22302E;
  --muted:      #52635E;
  --paper:      #FAFAF8;
  --paper-2:    #F1F3EF;
  --rule:       #DFE3DE;
  --teal:       #0D9488;
  --teal-ink:   #0F766E;   /* 4.9:1 on --paper — safe for text */
  --teal-deep:  #115E59;

  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 0.5rem + 3vw, 4rem);
  --maxw: 1180px;
}

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-2);
  background-color: var(--paper);
  /* Warm paper, not flat white: a faint teal wash off the top-right plus a
     grain layer so large empty areas still have some tooth. */
  background-image:
    radial-gradient(60rem 40rem at 92% -12%, rgba(13,148,136,0.07), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.028'/%3E%3C/svg%3E");
  background-repeat: no-repeat, repeat;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }

/* --- Type ----------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1.1em; }
a { color: var(--teal-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--teal-deep); }

/* Mono annotation — the clinical label voice used throughout. */
.mark {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- Focus (never removed, always visible) -------------------------------- */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.75rem 1rem; z-index: 100; font-weight: 500;
}
.skip:focus { left: 0; }

/* --- Shell ---------------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

.site-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  padding-block: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.25rem;
}
.wordmark {
  font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
/* The dot is the one piece of teal in the header — a fixation point. */
.wordmark::after {
  content: ''; display: inline-block;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--teal); margin-left: 3px; vertical-align: 0.36em;
}
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em;
  text-transform: uppercase; text-decoration: none; color: var(--muted);
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.site-nav a:hover, .site-nav a[aria-current='page'] {
  color: var(--ink); border-bottom-color: var(--teal);
}

/* --- Hero: the acuity cascade -------------------------------------------- */
.hero { padding-block: clamp(3.5rem, 2rem + 7vw, 7rem) clamp(2.5rem, 1rem + 5vw, 5rem); }

.acuity { display: flex; flex-direction: column; gap: clamp(1.5rem, 1rem + 2vw, 2.75rem); }
.acuity__row { display: grid; grid-template-columns: 1fr; gap: 0.4rem; }
@media (min-width: 60rem) {
  /* Acuity marks sit in their own margin column, like chart annotations. */
  .acuity__row { grid-template-columns: 5.5rem 1fr; gap: 1.5rem; align-items: baseline; }
}
.acuity__mark { padding-top: 0.55em; }
@media (max-width: 59.99rem) { .acuity__mark { display: none; } }

.acuity__text { margin: 0; color: var(--ink); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; }
.acuity__row--1 .acuity__text { font-size: clamp(2.6rem, 1.1rem + 6.6vw, 5.75rem); max-width: 16ch; }
.acuity__row--2 .acuity__text {
  font-size: clamp(1.25rem, 0.85rem + 1.7vw, 2.125rem);
  font-weight: 500; letter-spacing: -0.02em; line-height: 1.25;
  max-width: 28ch; color: var(--ink-2);
}
.acuity__row--3 .acuity__text {
  font-size: clamp(0.9375rem, 0.85rem + 0.4vw, 1.0625rem);
  font-weight: 400; letter-spacing: 0; line-height: 1.6;
  max-width: 52ch; color: var(--muted);
}
/* Emphasis stays ink, not teal: teal is reserved for links, and a teal word
   mid-sentence reads as one. Colour is never the only signal here. */
.acuity__text em { font-style: normal; font-weight: 500; color: var(--ink); }

/* --- Sections ------------------------------------------------------------- */
.section { padding-block: clamp(3rem, 1.5rem + 5vw, 5.5rem); border-top: 1px solid var(--rule); }
.section__head { margin-bottom: clamp(2rem, 1rem + 3vw, 3.25rem); }
.section__title {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  margin-top: 0.6rem; max-width: 20ch;
}

/* Capability list — asymmetric, no card grid. */
.caps { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.cap {
  display: grid; grid-template-columns: 1fr; gap: 0.25rem 1.5rem;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 48rem) {
  .cap { grid-template-columns: 3.5rem 13rem 1fr; align-items: baseline; }
}
.cap__n { padding-top: 0.15rem; }
.cap__t { font-weight: 700; color: var(--ink); font-size: 1.0625rem; letter-spacing: -0.01em; }
.cap__d { margin: 0; color: var(--muted); font-size: 0.9688rem; max-width: 54ch; }

/* Facts block — the data-handling summary. */
.facts { display: grid; gap: 1.75rem; }
@media (min-width: 48rem) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem 3rem; } }
.fact { border-left: 2px solid var(--teal); padding-left: 1.1rem; }
.fact__t { display: block; margin-bottom: 0.35rem; }
.fact__d { margin: 0; font-size: 0.9688rem; color: var(--ink-2); max-width: 46ch; }

/* --- Footer --------------------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 3.5rem;
  display: grid; gap: 1.5rem;
  font-size: 0.9062rem; color: var(--muted);
}
@media (min-width: 48rem) {
  .site-foot { grid-template-columns: 1fr auto; align-items: start; gap: 2rem 3rem; }
}
.site-foot p { margin: 0 0 0.4em; max-width: 46ch; }
.foot-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* --- Legal documents ------------------------------------------------------ */
.doc-head { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.doc-head h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); margin-bottom: 0.75rem; }
.doc-head .lede { font-size: 1.0938rem; color: var(--muted); max-width: var(--measure); margin-bottom: 0; }
.doc-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

.doc-layout { display: grid; gap: 2.5rem; padding-bottom: 4rem; }
@media (min-width: 64rem) {
  .doc-layout { grid-template-columns: 15rem minmax(0, 1fr); gap: 4rem; }
}

.toc { align-self: start; }
@media (min-width: 64rem) { .toc { position: sticky; top: 2rem; max-height: calc(100vh - 4rem); overflow-y: auto; } }
.toc ol { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.toc a {
  font-size: 0.875rem; text-decoration: none; color: var(--muted);
  display: block; padding: 0.15rem 0; line-height: 1.4;
}
.toc a:hover { color: var(--teal-ink); }

.doc { max-width: var(--measure); }
.doc h2 {
  font-size: 1.3125rem; margin-top: 2.75rem; margin-bottom: 0.85rem;
  scroll-margin-top: 2rem; letter-spacing: -0.02em;
}
.doc h2:first-of-type { margin-top: 0; }
.doc h2 .n { font-family: var(--mono); font-weight: 500; color: var(--teal-ink); font-size: 0.8125rem; letter-spacing: 0.08em; display: block; margin-bottom: 0.4rem; }
.doc h3 { font-size: 1.0312rem; margin-top: 1.75rem; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.doc ul, .doc ol.list { padding-left: 1.15rem; margin: 0 0 1.1em; }
.doc li { margin-bottom: 0.5em; }
.doc strong { color: var(--ink); font-weight: 700; }

/* Callout — used for the statements that carry real weight. */
.note {
  border-left: 2px solid var(--teal);
  background: var(--paper-2);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9688rem;
}
.note :last-child { margin-bottom: 0; }

/* No inline style attributes anywhere in the HTML — that is what lets the
   site ship a strict Content-Security-Policy with no 'unsafe-inline'. */
.section-note { margin-top: 2rem; font-size: 0.9688rem; }
.doc-next { margin-top: 2rem; }
.site-foot strong { color: var(--ink); }

/* Sub-processor table — scrolls on its own, never the page. */
.table-scroll { overflow-x: auto; margin: 1.25rem 0 1.5rem; border: 1px solid var(--rule); }
table caption { text-align: left; padding: 0.7rem 0.9rem; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.9062rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  background: var(--paper-2); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
td strong { white-space: nowrap; }

/* --- Motion --------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.62s cubic-bezier(0.2, 0.7, 0.25, 1) both; }
  .rise-1 { animation-delay: 0.04s; }
  .rise-2 { animation-delay: 0.13s; }
  .rise-3 { animation-delay: 0.22s; }
  .rise-4 { animation-delay: 0.31s; }
  @keyframes rise {
    from { opacity: 0; transform: translate3d(0, 14px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Print (legal pages get printed and filed) ---------------------------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-nav, .toc, .skip, .site-foot .foot-links { display: none; }
  .doc-layout { display: block; }
  .doc { max-width: none; }
  a { color: #000; text-decoration: underline; }
  .doc h2 { page-break-after: avoid; }
}
