/* Algobron — stylesheet. Dark theme. Self-hosted fonts, no external requests. */

/* Computer Modern Unicode (SIL Open Font License, see fonts/cmu/OFL.txt) */
@font-face {
  font-family: "CMU Serif";
  src: url("../fonts/cmu/cmunrm.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CMU Bright";
  src: url("../fonts/cmu/cmunbmr.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CMU Bright";
  src: url("../fonts/cmu/cmunbsr.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CMU Typewriter";
  src: url("../fonts/cmu/cmuntt.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Alegreya (SIL Open Font License, see fonts/alegreya/OFL-Alegreya.txt): only for the name next to the logo */
@font-face {
  font-family: "Alegreya";
  src: url("../fonts/alegreya/Alegreya-variable.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000;
  --fg: rgba(255, 255, 255, 0.8);
  --fg-strong: #fff;
  --fg-soft: rgba(255, 255, 255, 0.6);
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.42);
  --guide: rgba(255, 255, 255, 0.07);
  --plum: #e08fd2;
  --paper: #fff;
  --ink: #000;
  --ink-soft: #464b51;

  --serif: "CMU Serif", "Latin Modern Roman", Georgia, serif;
  --sans: "CMU Bright", "Helvetica Neue", Arial, sans-serif;
  --mono: "CMU Typewriter", "Latin Modern Mono", "Courier New", monospace;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --wrap: 78rem;
  --measure: 62ch;
  --edge: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Two faint guide lines along the content edges, behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--guide), var(--guide)) left var(--edge) top 0 / 1px 100% no-repeat,
    linear-gradient(var(--guide), var(--guide)) right var(--edge) top 0 / 1px 100% no-repeat;
}
main, .site-footer { position: relative; z-index: 1; }

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

a { color: var(--plum); text-underline-offset: 0.18em; }
a:hover { color: var(--fg-strong); }

:focus-visible { outline: 2px solid var(--fg-strong); outline-offset: 3px; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  background: var(--paper);
  color: var(--ink);
  padding: 0.6rem 1rem;
}
.skip:focus { top: 0.5rem; }

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

/* Type */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--fg-strong);
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.2vw, 4.2rem); }
h2 { font-size: clamp(2rem, 3.8vw, 3.1rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.6rem); }
h2 .sec { color: var(--fg-soft); margin-right: 0.45em; }
p { margin: 0 0 1rem; max-width: var(--measure); }
strong { font-weight: 600; color: var(--fg-strong); }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.3;
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--fg-strong);
  background: var(--fg-strong);
  color: var(--ink);
  transition: background-color 0.15s, color 0.15s;
}
.btn:hover { background: transparent; color: var(--fg-strong); }
.btn--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--ink:hover { background: transparent; color: var(--ink); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--fg-strong); text-decoration: none; font-family: "Alegreya", Georgia, serif; font-weight: 500; font-size: 1.6rem; }
.brand:hover { color: var(--fg-strong); }
.brand img { width: auto; height: 1.9rem; }
.nav { display: flex; align-items: center; gap: 1.8rem; }
.nav a { color: var(--fg); text-decoration: none; font-family: var(--mono); font-size: 0.98rem; }
.nav a:hover { color: var(--fg-strong); }
.nav .btn { font-family: var(--sans); font-size: 1rem; padding: 0.55rem 1rem; color: var(--ink); }
.nav .btn:hover { color: var(--fg-strong); }
.menu-toggle { display: none; }

/* Phones and small tablets */
@media (max-width: 51.99rem) {
  .site-header .wrap { flex-wrap: wrap; row-gap: 0.2rem; }
  /* Without JavaScript: the links wrap in a row next to or under the logo */
  .nav { flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: 0 1.2rem; }
  .nav a { display: inline-flex; align-items: center; min-height: 44px; }
  /* With JavaScript: a Menu button that opens a full-width list */
  .has-js .menu-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 1rem;
    font-family: var(--mono);
    font-size: 1rem;
    color: var(--fg-strong);
    background: transparent;
    border: 1px solid var(--line-strong);
    cursor: pointer;
  }
  .has-js .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.4rem var(--gutter) 1.5rem;
    background: #000;
    border-bottom: 1px solid var(--line);
  }
  .has-js .nav.is-open { display: flex; }
  .has-js .nav a { font-family: var(--serif); font-size: 1.5rem; color: var(--fg-strong); padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
  .has-js .nav .btn { justify-content: center; margin-top: 1.2rem; padding: 0.9rem 1rem; font-family: var(--sans); font-size: 1.1rem; color: var(--ink); border: 1px solid var(--fg-strong); }
  .has-js .nav .btn:hover { color: var(--fg-strong); }
}

/* ASCII panels */
.ascii { position: relative; overflow: hidden; background: #000; border: 1px solid var(--line); }
.ascii-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ascii-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.ascii.is-ready .ascii-fallback { display: none; }
.ascii-src { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.figure { margin: 0; }
.panel { width: 100%; aspect-ratio: 4 / 5; }
.panel--wide { aspect-ratio: 16 / 10; }
.figure figcaption {
  margin-top: 0.85rem;
  max-width: 48ch;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--fg-soft);
}
.figure figcaption b { font-weight: 400; color: var(--fg-strong); }

/* Hero: full-width ASCII stage, white panel overlapping its lower edge */
.hero { padding-top: 0; padding-bottom: 0; }
.hero-stage {
  height: clamp(26rem, 80vh, 50rem);
  height: clamp(26rem, 80svh, 50rem);
  margin: clamp(0.6rem, 1.6vw, 1.5rem) clamp(0.6rem, 1.6vw, 1.5rem) 0;
}
.hero .wrap { position: relative; z-index: 3; }
.hero-panel {
  max-width: 50rem;
  margin-top: calc(-1 * clamp(7rem, 24vh, 15rem));
  padding: clamp(1.6rem, 4vw, 3.2rem);
  background: var(--paper);
  color: var(--ink);
}
.hero-panel h1 { color: var(--ink); margin-bottom: 1.3rem; }
.hero-panel .lede { font-size: clamp(1.15rem, 1.6vw, 1.3rem); color: var(--ink); max-width: 40rem; }
.hero-panel a:not(.btn) { color: var(--ink); }
.hero-cta a:not(.btn) { display: inline-block; padding: 0.6rem 0; }
.hero-panel :focus-visible { outline-color: var(--ink); }
@media (max-width: 40rem) {
  .hero-stage { height: clamp(24rem, 68vh, 34rem); height: clamp(24rem, 68svh, 34rem); }
  .hero-panel { margin-top: -4.5rem; }
  .hero-cta .btn, .contact-line .btn { display: block; width: 100%; text-align: center; }
}
/* Short screens (phones held sideways): keep the headline in view */
@media (max-height: 30rem) {
  .hero-stage { height: max(14rem, 60vh); height: max(14rem, 60svh); }
  .hero-panel { margin-top: -3rem; }
}
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.5rem; margin-top: 1.8rem; }
.hero-note { margin: 1.2rem 0 0; font-size: 0.98rem; color: var(--ink-soft); }

/* Sections */
section { padding-block: clamp(4rem, 9vw, 7.5rem); }
section[id] { scroll-margin-top: 4.4rem; }
section + section { border-top: 1px solid var(--line); }
.hero + section { border-top: 0; }
.section-head { margin-bottom: 2.4rem; }
.section-head h2 { margin-bottom: 1rem; max-width: 22ch; }
.lead { color: var(--fg); }

.split { display: grid; grid-template-columns: 1fr; gap: clamp(2.4rem, 5vw, 5rem); align-items: start; }
.split > * { min-width: 0; }
.split h2 { margin-bottom: 1rem; }
@media (min-width: 60rem) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--flip > .figure { order: -1; }
}

/* Problems */
.problems { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.4rem; }
.problems li { border-top: 1px solid var(--line-strong); padding-top: 1rem; }
.problems strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.4rem; margin-bottom: 0.25rem; }
.problems span { color: var(--fg-soft); }

/* Offer */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line-strong); }
.step { display: flex; flex-direction: column; padding: 1.6rem 0 1.8rem; }
.step + .step { border-top: 1px solid var(--line); }
@media (min-width: 62rem) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { padding: 1.8rem 2rem 2rem; }
  .step:first-child { padding-left: 0; }
  .step:last-child { padding-right: 0; }
  .step + .step { border-top: 0; border-left: 1px solid var(--line); }
}
.step .when { font-family: var(--mono); font-size: 0.9rem; color: var(--fg-soft); margin: 0 0 0.4rem; }
.step h3 { margin-bottom: 1rem; }
.price { font-family: var(--mono); font-size: clamp(2.4rem, 4vw, 3rem); line-height: 1; color: var(--fg-strong); margin: 0; }
.price small { font-size: 1rem; color: var(--fg-soft); }
.was { font-family: var(--mono); font-size: 0.95rem; color: var(--fg-soft); margin: 0.5rem 0 1.2rem; }
.was s { text-decoration-thickness: 1px; }
.step ul { margin: 0 0 1.2rem; padding-left: 1.1rem; }
.step li { margin-bottom: 0.4rem; }
.step li::marker { color: var(--plum); }
.step .stop { margin-top: auto; padding-top: 0.9rem; border-top: 1px solid var(--line); font-size: 0.98rem; color: var(--fg-soft); max-width: none; }

.intro-price { margin-top: 2.6rem; max-width: 48rem; padding: 1.3rem 1.5rem; background: var(--paper); color: var(--ink); }
.intro-price p { margin: 0; }
.intro-price strong { color: var(--ink); }
.offer-notes { margin-top: 2.4rem; display: grid; gap: 1.4rem 3rem; grid-template-columns: 1fr; }
@media (min-width: 46rem) { .offer-notes { grid-template-columns: 1fr 1fr; } }
.offer-notes p { margin: 0; font-size: 1rem; color: var(--fg-soft); }

/* Method */
.method { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.8rem; counter-reset: m; }
.method li { counter-increment: m; display: grid; grid-template-columns: 2.4rem 1fr; column-gap: 1.1rem; }
.method li::before {
  content: counter(m);
  grid-row: span 2;
  width: 2.2rem;
  height: 2.2rem;
  line-height: 2.1rem;
  text-align: center;
  font-family: var(--mono);
  color: var(--plum);
  border: 1px solid var(--plum);
}
.method h3 { margin-bottom: 0.35rem; }
.method p { margin: 0; color: var(--fg-soft); }

/* Right-tool table */
.table-wrap { overflow-x: auto; margin-top: 1.6rem; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 0.9rem 1rem 0.9rem 0; border-bottom: 1px solid var(--line); }
thead th { font-family: var(--mono); font-weight: 400; font-size: 0.92rem; color: var(--fg-soft); border-bottom: 1px solid var(--line-strong); }
tbody th { font-weight: 400; color: var(--fg-strong); }
caption { caption-side: bottom; text-align: left; padding-top: 0.8rem; font-family: var(--mono); font-size: 0.85rem; color: var(--fg-soft); }

/* On phones the two-column table becomes stacked rows: problem, then what fits */
@media (max-width: 40rem) {
  table, tbody, tr, th, td, caption { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  caption { padding: 0 0 0.6rem; }
  tbody tr { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
  tbody tr:first-child { border-top: 1px solid var(--line-strong); }
  tbody th, tbody td { padding: 0; border: 0; }
  tbody th { margin-bottom: 0.3rem; }
  tbody td { color: var(--fg-soft); }
}

/* Promises */
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem 3rem; grid-template-columns: 1fr; }
@media (min-width: 46rem) { .promises { grid-template-columns: 1fr 1fr; } }
.promises li { position: relative; padding-left: 1.5rem; }
.promises li::before { content: ""; position: absolute; left: 0; top: 0.6rem; width: 0.6rem; height: 0.6rem; background: var(--plum); }
.promises strong { display: block; }
.promises span { color: var(--fg-soft); }

/* About: small portrait beside the text */
.about { display: grid; grid-template-columns: 1fr; gap: 1.4rem 2.6rem; align-items: start; }
.about p { max-width: none; }
@media (min-width: 46rem) { .about { grid-template-columns: 11rem 1fr; } }
.portrait { margin: 0; max-width: 9rem; }
@media (min-width: 46rem) { .portrait { max-width: none; } }
.portrait img { width: 100%; height: auto; }
.portrait figcaption { margin-top: 0.75rem; font-family: var(--mono); font-size: 0.9rem; color: var(--fg-soft); }

/* FAQ */
.faq { max-width: 50rem; border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative;
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 2.4rem 1.15rem 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--fg-strong);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 1.05rem; font-family: var(--mono); font-size: 1.4rem; color: var(--plum); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0; padding-bottom: 1.2rem; color: var(--fg-soft); }

/* Contact: ASCII band with a white box over it */
.contact { padding-top: 0; }
.contact-stage { height: clamp(18rem, 50vh, 30rem); margin-inline: clamp(0.6rem, 1.6vw, 1.5rem); border-top: 0; }
.contact .wrap { position: relative; z-index: 3; }
.contact-box {
  margin-top: calc(-1 * clamp(6rem, 16vh, 10rem));
  padding: clamp(1.6rem, 4vw, 3.2rem);
  background: var(--paper);
  color: var(--ink);
}
.contact-box h2 { color: var(--ink); max-width: 22ch; margin-bottom: 1rem; }
.contact-box p { color: var(--ink-soft); }
.contact-box a:not(.btn) { color: var(--ink); }
.contact-box :focus-visible { outline-color: var(--ink); }
.contact-line { margin: 1.6rem 0 1rem; }
/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.4rem; font-family: var(--mono); font-size: 0.9rem; color: var(--fg-soft); }
.site-footer .wrap { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
@media (min-width: 46rem) { .site-footer .wrap { grid-template-columns: 1.4fr 1fr; } }
.site-footer p { margin: 0 0 0.3rem; }
.site-footer a { color: var(--fg); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { display: inline-block; padding: 0.4rem 0; }

/* Legal pages */
.legal { padding-block: clamp(3rem, 7vw, 5rem); }
.legal h1 { font-size: clamp(2.2rem, 4.4vw, 3.2rem); margin-bottom: 1rem; }
.legal h2 { font-size: 1.5rem; margin: 2.2rem 0 0.6rem; }
.legal p, .legal li { max-width: 70ch; }
.legal ul { padding-left: 1.2rem; }
.legal .meta { font-family: var(--mono); font-size: 0.92rem; color: var(--fg-soft); }
