/* OwnTunnel — owntunnel.app
   One stylesheet, no framework, no JavaScript.
   Direction: quiet technical document. Hairlines, wide margins, one accent. */

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: light dark;

  /* Brand ink / paper (brand/README.md) */
  --paper: #f5f7f8;
  --surface: #ffffff;
  --ink: #212a30;
  --ink-2: #3c464c;
  --ink-3: #5d6970;
  --rule: #dce3e6;
  --rule-strong: #bcc7cd;
  --accent: #166b57;
  --accent-quiet: #e6efec;

  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --text-micro: 0.75rem;
  --text-small: 0.9375rem;
  --text-base: clamp(1.0625rem, 1.02rem + 0.22vw, 1.1875rem);
  --text-lede: clamp(1.1875rem, 1.06rem + 0.6vw, 1.5rem);
  --text-h2: clamp(1.375rem, 1.2rem + 0.8vw, 1.875rem);
  --text-hero: clamp(2.75rem, 1.7rem + 4.6vw, 5rem);
  --text-numeral: clamp(2rem, 1.5rem + 2vw, 3rem);

  --page: min(100% - 2.5rem, 66rem);
  --measure: 34rem;
  --space-section: clamp(3.5rem, 2.4rem + 4.6vw, 7rem);

  --duration: 180ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12171b;
    --surface: #1a2126;
    --ink: #edf1f2;
    --ink-2: #c3ccd1;
    --ink-3: #98a4ab;
    --rule: #28323a;
    --rule-strong: #3c4952;
    --accent: #63c9ac;
    --accent-quiet: #1c2b28;
  }
}

:root[data-theme="dark"] {
  --paper: #12171b;
  --surface: #1a2126;
  --ink: #edf1f2;
  --ink-2: #c3ccd1;
  --ink-3: #98a4ab;
  --rule: #28323a;
  --rule-strong: #3c4952;
  --accent: #63c9ac;
  --accent-quiet: #1c2b28;
}

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

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; margin: 0; }
p, ul, ol, table, figure, blockquote { margin: 0; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--duration) var(--ease);
}
a:hover { color: var(--ink); }

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

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--accent-quiet);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  overflow-wrap: anywhere;
}

strong { font-weight: 800; letter-spacing: -0.01em; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 1rem;
  z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

.wrap { width: var(--page); margin-inline: auto; }

/* ---------------------------------------------------------------- head */

.site-head {
  width: var(--page);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.75rem 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.wordmark b { font-weight: 800; }
.wordmark:hover { color: var(--accent); }
.wordmark .mark { width: 1.5rem; height: 1.5rem; flex: none; }

.lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-micro);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lang a { color: var(--ink-3); text-decoration: none; }
.lang a:hover { color: var(--accent); text-decoration: underline; }
.lang-current { color: var(--ink); }
.lang .sep { color: var(--rule-strong); }

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

.hero {
  width: var(--page);
  margin-inline: auto;
  padding-block: clamp(3rem, 2rem + 5vw, 6.5rem) var(--space-section);
  display: grid;
  gap: clamp(2.5rem, 1rem + 6vw, 5rem);
  align-items: center;
}

@media (min-width: 52rem) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 15rem); }
}

.eyebrow {
  font-size: var(--text-micro);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.25rem;
}

h1 {
  font-size: var(--text-hero);
  font-weight: 800;
  letter-spacing: -0.04em;
  max-width: 12ch;
}

.lede {
  font-size: var(--text-lede);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 32rem;
  margin-top: 1.5rem;
  font-weight: 400;
}
.lede em { font-style: normal; color: var(--ink); font-weight: 800; }

.hero-figure { color: var(--ink); justify-self: center; width: 100%; max-width: 15rem; }
.hero-figure svg { width: 100%; height: auto; display: block; }

.claim {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding-block: clamp(1.75rem, 1rem + 2vw, 2.75rem);
}
.claim p {
  font-size: var(--text-h2);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.3;
  max-width: 30ch;
}
.claim p span { color: var(--ink-3); }

/* ---------------------------------------------------------------- sections */

.section {
  width: var(--page);
  margin-inline: auto;
  padding-block: var(--space-section);
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: 0; }

@media (min-width: 60rem) {
  .section {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
  }
}

.section-label {
  font-size: var(--text-micro);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.5rem;
}
@media (min-width: 60rem) {
  .section-label { margin-bottom: 0; padding-top: 0.4rem; }
}

.section h2 {
  font-size: var(--text-h2);
  font-weight: 500;
  max-width: 22ch;
}

.section > div > * + * { margin-top: 1.25rem; }
.section p { max-width: var(--measure); color: var(--ink-2); }

/* steps */

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: step;
  margin-top: 2rem !important;
}
@media (min-width: 46rem) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 0 2rem; }
}

.steps li {
  border-top: 1px solid var(--rule-strong);
  padding-top: 1rem;
  padding-bottom: 1.75rem;
}
@media (min-width: 46rem) {
  .steps li { padding-bottom: 0; }
}

.steps .n {
  display: block;
  font-size: var(--text-numeral);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--rule-strong);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.75rem;
}
.steps h3 { font-size: 1.0625rem; font-weight: 800; margin-bottom: 0.5rem; }
.steps p { font-size: var(--text-small); color: var(--ink-3); max-width: 26rem; }

/* plain fact list */

.facts { list-style: none; padding: 0; }
.facts li {
  border-top: 1px solid var(--rule);
  padding-block: 0.9rem;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  color: var(--ink-2);
  font-size: var(--text-small);
}
.facts li b { color: var(--ink); font-weight: 800; flex: none; min-width: 8.5rem; }
.facts li:last-child { border-bottom: 1px solid var(--rule); }
.facts .num { font-variant-numeric: tabular-nums; }

/* Narrow screens: the label sits above its line rather than squeezing it. */
@media (max-width: 30rem) {
  .facts li { display: block; }
  .facts li b { display: block; min-width: 0; margin-bottom: 0.2rem; }
}

/* zero-log diagram */

.diagram {
  margin-top: 2.5rem !important;
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink);
}
.diagram svg { width: 100%; max-width: 20rem; height: auto; display: block; }
.diagram figcaption {
  margin-top: 1.25rem;
  font-size: var(--text-small);
  color: var(--ink-3);
  max-width: 34rem;
}

/* store placeholder */

.store {
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 100%;
  margin-top: 2rem;
  padding: 0.9rem 1.25rem;
  border: 1px dashed var(--rule-strong);
  border-radius: 6px;
  color: var(--ink-3);
  font-size: var(--text-small);
}
.store b { color: var(--ink); font-weight: 800; }

/* ---------------------------------------------------------------- documents */

.doc {
  width: var(--page);
  max-width: 42rem;
  margin-inline: auto;
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) var(--space-section);
}
.doc > * + * { margin-top: 1.25rem; }
.doc h1 {
  font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
  font-weight: 800;
  max-width: 20ch;
  letter-spacing: -0.03em;
}
.doc h2 {
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.doc h3 { font-size: 1.0625rem; font-weight: 800; margin-top: 1.75rem; }
.doc p, .doc li { color: var(--ink-2); }
.doc ul { padding-left: 1.15rem; }
.doc li + li { margin-top: 0.5rem; }
.doc li::marker { color: var(--ink-3); }
.doc hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2rem; }
.doc .meta {
  font-size: var(--text-small);
  color: var(--ink-3);
  border-left: 2px solid var(--rule-strong);
  padding-left: 1rem;
}
.doc .meta strong { color: var(--ink-2); }
.doc blockquote {
  font-size: var(--text-small);
  color: var(--ink-3);
  border-left: 2px solid var(--rule-strong);
  padding-left: 1rem;
  font-style: italic;
}
.doc .table-scroll { overflow-x: auto; margin-top: 1.5rem; }
.doc table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: var(--text-small);
}
.doc th, .doc td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 1rem 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
}
.doc th { color: var(--ink); font-weight: 800; border-bottom-color: var(--rule-strong); }

/* FAQ */

.faq { margin-top: 2rem !important; }
.faq h3 {
  font-size: 1.0625rem;
  font-weight: 800;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.faq h3:first-child { margin-top: 0; }
.faq p { margin-top: 0.6rem; font-size: var(--text-small); }

.contact {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.contact p { font-size: var(--text-small); }
.contact p + p { margin-top: 0.75rem; }

/* ---------------------------------------------------------------- foot */

.site-foot {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 3.5rem;
  margin-top: var(--space-section);
}
.site-foot .wrap > * + * { margin-top: 1.25rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.site-foot nav a {
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.site-foot nav a:hover { color: var(--accent); text-decoration: underline; }
.site-foot p { font-size: var(--text-micro); color: var(--ink-3); line-height: 1.7; max-width: 44rem; }
.site-foot p a { color: var(--ink-3); }
.site-foot p a:hover { color: var(--accent); }

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

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