/* ============================================================
   MESDATA — "Coming soon"
   Aesthetic: technical editorial. Ink on warm paper, hairline
   rules, metrology ticks, a single petrol-blue accent.
   No frameworks, no JS, no decorative motion.
   ============================================================ */

:root {
  --paper:      #F4F3EF;
  --paper-raise:#FAF9F6;
  --ink:        #171A1C;
  --ink-2:      #565C62;
  --ink-3:      #8B9198;
  --rule:       #DEDBD3;
  --rule-soft:  #E8E5DE;
  --accent:     #0B4F6C;

  --font-display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-body:    'IBM Plex Sans', 'Helvetica Neue', Helvetica, sans-serif;
  --font-mono:    'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  --gutter: clamp(1.25rem, 5vw, 5.5rem);
  --measure: 74rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background-color: var(--paper); }

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Atmosphere: faint engineering grid + paper grain ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(23,26,28,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(23,26,28,.045) 1px, transparent 1px);
  background-size: 88px 88px, 88px 88px;
  -webkit-mask-image: radial-gradient(120% 90% at 22% 8%, #000 5%, transparent 78%);
          mask-image: radial-gradient(120% 90% at 22% 8%, #000 5%, transparent 78%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

main, header.site, footer.site { position: relative; z-index: 1; }

::selection { background: var(--accent); color: var(--paper); }

a { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---- Metrology tick rule across the very top ---- */
.ticks {
  height: 11px;
  border-bottom: 1px solid var(--rule);
  background-image:
    repeating-linear-gradient(to right, var(--rule) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(to right, var(--ink-3) 0 1px, transparent 1px 60px);
  background-size: 100% 5px, 100% 11px;
  background-repeat: no-repeat;
  background-position: 0 100%, 0 100%;
  position: relative;
  z-index: 1;
}

/* ---- Header ---- */
header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem var(--gutter) 0;
  max-width: var(--measure);
  margin: 0 auto;
  width: 100%;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

.wordmark .mark {
  width: 9px; height: 9px;
  background: var(--ink);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--rule);
  flex: none;
}

.masthead-right {
  display: flex;
  align-items: baseline;
  gap: 1.75rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.masthead-right a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: border-color .18s ease, color .18s ease;
}

.masthead-right a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Layout shell ---- */
main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- Hero ---- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  padding: clamp(3.25rem, 10vh, 6rem) 0 clamp(2.5rem, 6vh, 4rem);
}

.eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .625rem;
  margin: 0 0 clamp(1.5rem, 4vh, 2.25rem);
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  flex: none;
}

.eyebrow .sep { color: var(--ink-3); letter-spacing: .2em; }

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.75rem, 1.6rem + 5.4vw, 5.5rem);
  line-height: .98;
  letter-spacing: -.018em;
  text-wrap: balance;
}

h1 em {
  font-style: italic;
  color: var(--accent);
}

.lede {
  margin: clamp(1.5rem, 3.5vh, 2rem) 0 0;
  max-width: 38rem;
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  line-height: 1.62;
  color: var(--ink-2);
  text-wrap: pretty;
}

.lede strong { color: var(--ink); font-weight: 500; }

/* ---- Actions ---- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin-top: clamp(2rem, 5vh, 3rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  padding: .95rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 6px 18px -10px rgba(11,79,108,.65);
}

.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.link-quiet {
  font-family: var(--font-mono);
  font-size: .8125rem;
  letter-spacing: .06em;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color .18s ease, border-color .18s ease;
}

.link-quiet:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Hero aside: specification sheet ---- */
.spec {
  border-top: 1px solid var(--ink);
  padding-top: .9rem;
}

.spec h2 {
  margin: 0 0 1.4rem;
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.spec dl { margin: 0; }

.spec .row {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  gap: 1rem;
  padding: .6rem 0;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--font-mono);
  font-size: .75rem;
  line-height: 1.5;
}

.spec dt { color: var(--ink-3); letter-spacing: .06em; }
.spec dd { margin: 0; color: var(--ink); }

/* ---- Principles ---- */
.principles {
  border-top: 1px solid var(--ink);
  padding: clamp(2rem, 4.5vh, 2.75rem) 0 clamp(2.25rem, 5vh, 3rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.principle {
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
  border-left: 1px solid var(--rule);
}

.principle:first-child { padding-left: 0; border-left: 0; }
.principle:last-child { padding-right: 0; }

.principle .num {
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .16em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.principle h3 {
  margin: .85rem 0 .6rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.25rem + .8vw, 1.875rem);
  line-height: 1.12;
  letter-spacing: -.01em;
}

.principle p {
  margin: 0;
  font-size: .9375rem;
  line-height: 1.65;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---- AI statement ---- */
.ai {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(2.5rem, 7vh, 4rem) 0 clamp(2.5rem, 6vh, 3.75rem);
  border-top: 1px solid var(--rule);
}

.ai h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.625rem);
  line-height: 1.08;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.ai h2 em { font-style: italic; color: var(--accent); }

.ai .body p {
  margin: 0 0 1rem;
  color: var(--ink-2);
  font-size: clamp(1rem, .97rem + .2vw, 1.0625rem);
  text-wrap: pretty;
}

.ai .body p:last-child { margin-bottom: 0; }

.ai .body strong { color: var(--ink); font-weight: 500; }

/* ---- Footer ---- */
footer.site {
  flex: none;
  border-top: 1px solid var(--rule);
  background: var(--paper-raise);
  padding: 1.35rem var(--gutter);
}

footer.site .inner {
  max-width: var(--measure);
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  color: var(--ink-3);
}

footer.site nav { display: flex; gap: 1.5rem; }

footer.site a {
  text-decoration: none;
  color: var(--ink-3);
  transition: color .18s ease;
}

footer.site a:hover { color: var(--accent); }

footer.site a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}

/* ---- Single load-in reveal. No looping motion. ---- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: rise .62s cubic-bezier(.22,.61,.36,1) backwards;
    animation-delay: calc(var(--i, 0) * 70ms);
  }
}

/* ---- Responsive ---- */
@media (max-width: 62rem) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  .spec { max-width: 26rem; }
}

@media (max-width: 46rem) {
  .principles { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .principle {
    padding: 1.5rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
  .principle:first-child { padding-top: 0; border-top: 0; }
  .ai { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .actions { gap: 1rem; }
  .eyebrow { letter-spacing: .16em; }
  .btn { width: 100%; justify-content: space-between; }
}

/* ---- Print ---- */
@media print {
  body { background: #fff; }
  body::before, body::after, .ticks { display: none; }
  .btn { background: #fff; color: #000; border-color: #000; }
  .reveal { animation: none !important; }
}

/* ============================================================
   Legal pages (privacy.html, terms.html)
   ============================================================ */

.legal-head {
  padding: clamp(2.75rem, 8vh, 4.5rem) 0 clamp(2rem, 4vh, 2.75rem);
  border-bottom: 1px solid var(--rule);
}

.legal-head h1 {
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);
  line-height: 1.02;
}

.legal-head .standfirst {
  margin: 1.35rem 0 0;
  max-width: 44rem;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
  text-wrap: pretty;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem clamp(1.5rem, 4vw, 3rem);
  margin-top: 1.75rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--ink-3);
}

.legal-meta span { display: inline-flex; gap: .5rem; align-items: baseline; }
.legal-meta b {
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---- Two-column: contents + article ---- */
.legal-grid {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  padding: clamp(2.25rem, 6vh, 3.5rem) 0 clamp(3rem, 8vh, 5rem);
}

.toc { position: sticky; top: 2.5rem; }

.toc h2 {
  margin: 0 0 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li { counter-increment: toc; }

.toc a {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: .5rem;
  padding: .4rem 0;
  font-family: var(--font-mono);
  font-size: .75rem;
  line-height: 1.45;
  letter-spacing: .02em;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .18s ease;
}

.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--accent); }
.toc a:hover { color: var(--accent); }

/* ---- Prose ---- */
.prose { max-width: 46rem; }

.prose section { scroll-margin-top: 2rem; }

.prose section + section {
  margin-top: clamp(2rem, 5vh, 2.75rem);
  padding-top: clamp(2rem, 5vh, 2.75rem);
  border-top: 1px solid var(--rule);
}

.prose h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.375rem, 1.2rem + .6vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.prose h2 .num {
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .16em;
  color: var(--accent);
  vertical-align: .65em;
  margin-right: .6rem;
  font-variant-numeric: tabular-nums;
}

.prose h3 {
  margin: 1.75rem 0 .5rem;
  font-family: var(--font-body);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
}

.prose p { margin: 0 0 1rem; color: var(--ink-2); text-wrap: pretty; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 500; }

.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.15rem; color: var(--ink-2); }
.prose li { margin-bottom: .4rem; padding-left: .25rem; text-wrap: pretty; }
.prose li::marker { color: var(--ink-3); }
.prose ul { list-style: square; }

.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  transition: border-color .18s ease;
}

.prose a:hover { border-bottom-color: var(--accent); }

.prose .note {
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  background: var(--paper-raise);
  border-left: 2px solid var(--accent);
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.prose .note strong { color: var(--ink); }

/* Placeholder markers for text to be completed before publication */
.ph {
  font-family: var(--font-mono);
  font-size: .9em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  padding: .05em .3em;
}

@media (max-width: 62rem) {
  .legal-grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }

  /* Contents becomes a contained panel rather than a list competing with the body copy. */
  .toc {
    position: static;
    background: var(--paper-raise);
    border: 1px solid var(--rule);
    padding: 1.1rem 1.35rem 1.25rem;
  }
  .toc h2 { border-bottom-color: var(--rule); }
  .toc ol { columns: 2; column-gap: 2rem; }
  .toc a { padding: .3rem 0; }
}

@media (max-width: 34rem) {
  .toc ol { columns: 1; }
}
