/* deltabydelta.com — graph-paper editorial.
   Cream paper + faint engineering grid, ink navy, teacher's-pen red.
   Fraunces (display serif) / IBM Plex Sans (body) / IBM Plex Mono (labels). */

:root {
  --paper: #f6f2e9;
  --paper-card: #fffdf6;
  --paper-note: #fbf7ec;
  --ink: #20283a;
  --ink-soft: #59627a;
  --blue: #2b4a7d;
  --red: #c34a33;
  --grid: rgba(43, 74, 125, 0.09);
  --rule-blue: rgba(43, 74, 125, 0.14);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}

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

a { color: inherit; }

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

.wrap {
  max-width: 66rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

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

.site-header {
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 0.8rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 640;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.28em 0.45em;
  border: 2px solid var(--ink);
  background: var(--paper-card);
  box-shadow: 3px 3px 0 var(--red);
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
}

.site-nav {
  display: flex;
  gap: 1.4rem;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  text-decoration: none;
  padding-block: 0.3rem;
  border-bottom: 3px solid transparent;
}

.nav-link:hover { border-bottom-color: var(--ink); }
.nav-link.is-active { border-bottom-color: var(--red); }

/* ---------- type & shared ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 640;
  line-height: 1.12;
  margin: 0 0 0.5rem;
}

h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--red);
  margin: 0 0 0.6rem;
}

.section { padding-block: 2.6rem 1.2rem; }

.section-head {
  display: flex;
  align-items: flex-end;
  gap: 1.4rem;
  margin-bottom: 1.8rem;
}

.section-head h2 { margin-bottom: 0; }

.section-head .rule {
  flex: 1;
  height: 2px;
  background: var(--ink);
  opacity: 0.18;
  margin-bottom: 0.55em;
}

.section-lede {
  max-width: 44rem;
  color: var(--ink-soft);
  margin: 0 0 1.8rem;
}

.section-more { margin-top: 1.6rem; }

.text-link {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  padding-bottom: 1px;
}

.text-link:hover { color: var(--red); }

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--paper-card);
  background: var(--ink);
  border: 2px solid var(--ink);
  padding: 0.7em 1.15em;
  box-shadow: 4px 4px 0 var(--red);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--red);
}

.btn--ghost {
  color: var(--ink);
  background: transparent;
  box-shadow: 4px 4px 0 var(--ink);
}

.btn--ghost:hover { box-shadow: 2px 2px 0 var(--ink); }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 3rem;
  padding-block: 4.2rem 2rem;
}

.hero-copy > * { animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.hero-copy > *:nth-child(2) { animation-delay: 60ms; }
.hero-copy > *:nth-child(3) { animation-delay: 120ms; }
.hero-copy > *:nth-child(4) { animation-delay: 180ms; }
.hero-copy > *:nth-child(5) { animation-delay: 240ms; }

.hero-title { margin-bottom: 0.3rem; }

.hero-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  color: var(--red);
  margin: 0 0 1.1rem;
}

.hero-intro {
  max-width: 34rem;
  color: var(--ink-soft);
  margin: 0 0 1.8rem;
}

.hero-actions {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}

/* the "name as a limit" margin note */

.margin-note {
  justify-self: center;
  border: 2px dashed var(--blue);
  background: var(--paper-card);
  padding: 1.6rem 2rem 1.2rem;
  transform: rotate(1.6deg);
  text-align: center;
  animation: rise 0.55s 300ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.note-math {
  font-family: var(--font-display);
  font-size: 1.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 0 0.4rem;
}

.frac {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.25;
}

.frac .den { border-top: 2px solid var(--ink); }

.note-math .arrow { color: var(--red); }

.note-cond {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
}

.note-caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--red);
  border-top: 1px solid var(--rule-blue);
  padding-top: 0.7rem;
  margin: 0;
}

/* ---------- cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 2rem;
}

.channel-card {
  border: 2px solid var(--ink);
  background: var(--paper-card);
  padding: 1.6rem 1.7rem 1.5rem;
  transition: transform 160ms ease;
}

.channel-card--delta {
  transform: rotate(-0.6deg);
  box-shadow: 6px 6px 0 rgba(43, 74, 125, 0.25);
}

.channel-card:hover { transform: rotate(0deg); }

/* a lone channel card shouldn't stretch across the full page */
.card-grid > .channel-card:only-child { max-width: 34rem; }

.channel-mark {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 640;
  line-height: 1;
  margin: 0 0 0.9rem;
}

.channel-card--delta .channel-mark { color: var(--blue); }

.channel-name { font-size: 1.35rem; margin-bottom: 0.2rem; }

.channel-audience {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
}

.channel-blurb { margin: 0 0 1.2rem; }

/* worksheet cards — loose-leaf notebook paper */

.ws-card {
  position: relative;
  border: 2px solid var(--ink);
  background-color: var(--paper-card);
  background-image: repeating-linear-gradient(
    transparent 0 27px,
    var(--rule-blue) 27px 28px
  );
  box-shadow: 6px 6px 0 rgba(32, 40, 58, 0.16);
}

.ws-card::before {
  content: "";
  position: absolute;
  left: 2rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(195, 74, 51, 0.5);
}

.ws-card-inner { padding: 1.5rem 1.5rem 1.5rem 2.9rem; }

.ws-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red);
  margin: 0 0 0.5rem;
}

.ws-title { font-size: 1.45rem; margin-bottom: 0.5rem; }

.ws-blurb { margin: 0 0 1.3rem; }

/* ---------- page head / notes / about ---------- */

.page-head { padding-block: 3.2rem 0.4rem; }

.paper-note {
  border: 2px dashed var(--ink);
  background: var(--paper-note);
  padding: 1.4rem 1.7rem;
  max-width: 44rem;
}

.paper-note .note-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--red);
  margin: 0 0 0.7rem;
}

.paper-note ul { margin: 0; padding-left: 1.2rem; }
.paper-note li { margin-bottom: 0.5rem; }
.paper-note li:last-child { margin-bottom: 0; }

.about-body { max-width: 44rem; }
.about-body p { margin: 0 0 1.2rem; }
.about-links { line-height: 2.2; }

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

.site-footer {
  border-top: 2px solid var(--ink);
  margin-top: 4rem;
  background: var(--paper);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem 2rem;
  flex-wrap: wrap;
  padding-block: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.footer-row p { margin: 0; }
.footer-row a { color: var(--blue); text-decoration: none; border-bottom: 1px solid currentColor; }
.footer-row a:hover { color: var(--red); }
.footer-row .sep { margin-inline: 0.5rem; color: var(--ink-soft); }
.footer-note { color: var(--ink-soft); }

/* ---------- motion & responsive ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

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

@media (max-width: 47.5rem) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.4rem;
    padding-block: 2.8rem 1.2rem;
  }
  .margin-note { justify-self: start; }
  .section-head .rule { display: none; }
}
