:root {
  --paper: #f5f0e6;
  --paper-2: #ece5d6;
  --ink: #1f1c18;
  --ink-soft: #5a534a;
  --rule: #d6ccb8;
  --accent: #b0441e;
  --accent-ink: #8f3516;
  --display: "Fraunces", Georgia, serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --measure: 40rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
/* faint paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .35;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.22 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem clamp(1rem, 5vw, 3rem);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}
.mark {
  font-family: var(--display); font-weight: 600; font-size: 1.15rem;
  color: var(--ink); text-decoration: none; letter-spacing: .02em;
}
.top nav { display: flex; gap: clamp(.8rem, 2.5vw, 1.8rem); }
.top nav a {
  color: var(--ink-soft); text-decoration: none; font-size: .9rem;
}
.top nav a:hover { color: var(--accent); }

main { padding: 0 clamp(1rem, 5vw, 3rem); }
section { max-width: 68rem; margin: 0 auto; padding: clamp(4rem, 10vw, 7rem) 0; }
section + section { border-top: 1px solid var(--rule); }

/* ---------- hero ---------- */
.hero {
  padding-top: clamp(3rem, 9vw, 6.5rem);
  display: grid; gap: 3rem; align-items: center;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }

/* ---------- portrait ---------- */
.portrait { margin: 0; position: relative; max-width: 26rem; justify-self: center; width: 100%; }
.portrait img {
  display: block; width: 100%; height: auto;
  border-radius: 6px;
  box-shadow: 0 24px 50px -28px rgba(60, 40, 20, .55);
}
.portrait::before {
  content: ""; position: absolute; inset: 1.1rem -1.1rem -1.1rem 1.1rem;
  border: 1.5px solid var(--accent); border-radius: 6px; z-index: -1;
}
@media (max-width: 899px) {
  .hero { gap: 2.2rem; }
  .portrait { order: -1; max-width: 15rem; justify-self: start; margin-right: 1.1rem; }
}

/* ---------- section 01 intro with the aligner ---------- */
.pattern-intro { display: grid; gap: 2rem; align-items: center; margin-bottom: 3.5rem; grid-template-columns: minmax(0, 1fr); }
.pattern-intro .section-lede { margin-bottom: 0; }
@media (min-width: 900px) { .pattern-intro { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; } }

/* ---------- the aligner (hero slider) ---------- */
.aligner {
  margin: 0; padding: 1.6rem 1.6rem 1.3rem;
  background: color-mix(in srgb, var(--paper-2) 75%, transparent);
  border: 1px solid var(--rule); border-radius: 8px;
  --t: 0;
}
.field { position: relative; height: 230px; overflow: hidden; }
.strand {
  position: absolute; left: 6%; right: 6%; top: 50%;
  height: 0; border-top: 3px solid var(--ink); border-radius: 2px;
  transform:
    translateY(calc(var(--y) * (1 - var(--t)) + (var(--k) * 26px - 78px) * var(--t)))
    rotate(calc(var(--r) * (1 - var(--t))));
  transition: border-color .4s;
}
.strand span {
  position: absolute; left: 0; top: -1.55rem;
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); background: transparent; white-space: nowrap;
  opacity: calc(.35 + var(--t) * .65);
}
.strand:nth-child(1){--k:0} .strand:nth-child(2){--k:1} .strand:nth-child(3){--k:2}
.strand:nth-child(4){--k:3} .strand:nth-child(5){--k:4} .strand:nth-child(6){--k:5} .strand:nth-child(7){--k:6}
.strand:nth-child(odd) span { left: auto; right: 0; }
.strand.accent { border-color: var(--accent); }
.aligner.done .strand { border-color: var(--accent); }

.slider { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.slider-label { font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--ink-soft); }
.slider input { flex: 1; accent-color: var(--accent); height: 2rem; cursor: grab; }
.slider input:active { cursor: grabbing; }
.aligner figcaption {
  margin-top: .5rem; min-height: 3.2em;
  font-family: var(--display); font-style: italic; font-size: 1.08rem; color: var(--ink);
}

.kicker {
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 1rem;
}
h1 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(3.2rem, 11vw, 7.5rem);
  line-height: .95; letter-spacing: -.02em; margin: 0;
  font-variation-settings: "opsz" 144;
}
.tagline {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(1.4rem, 3.6vw, 2.3rem);
  color: var(--accent-ink); margin: .6rem 0 1.6rem;
}
.lede { max-width: var(--measure); font-size: clamp(1.08rem, 2vw, 1.22rem); color: var(--ink); margin: 0 0 2.2rem; }

.rise { opacity: 0; transform: translateY(14px); animation: rise .9s ease forwards; animation-delay: calc(.9s + var(--i) * .09s); }
@keyframes rise { to { opacity: 1; transform: none; } }

.actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.btn {
  display: inline-block; padding: .72rem 1.15rem;
  border: 1.5px solid var(--ink); border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem;
  transition: background .2s, color .2s, transform .2s;
}
.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* ---------- section headings ---------- */
h2 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.1;
  letter-spacing: -.01em; margin: 0 0 1.2rem;
}
.num {
  display: block; font-family: var(--body); font-size: .8rem; font-weight: 700;
  letter-spacing: .18em; color: var(--accent); margin-bottom: .5rem;
}
.section-lede { max-width: var(--measure); color: var(--ink-soft); margin: 0 0 3rem; font-size: 1.1rem; }
h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 5.1rem; top: .6rem; bottom: .6rem;
  width: 1px; background: var(--rule);
}
.timeline li { display: grid; grid-template-columns: 4.2rem 1fr; gap: 2rem; padding: 0 0 2.2rem; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: calc(5.1rem - 5px); top: .55rem;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--accent);
}
.year { font-family: var(--display); font-size: 1.25rem; font-weight: 500; color: var(--ink-soft); padding-top: .1rem; }
.timeline h3 { font-size: 1.3rem; margin: 0 0 .3rem; }
.timeline h3 small { display: block; font-family: var(--body); font-weight: 400; font-size: .88rem; color: var(--ink-soft); margin-top: .2rem; }
.timeline p { margin: 0; max-width: var(--measure); }

/* ---------- stories ---------- */
.work h2 { margin-bottom: 2.5rem; }
.story {
  background: color-mix(in srgb, var(--paper-2) 70%, transparent);
  border: 1px solid var(--rule); border-radius: 6px;
  padding: clamp(1.4rem, 4vw, 2.6rem);
  margin-bottom: 1.6rem;
  display: grid; grid-template-columns: 1fr; gap: 0 3rem;
}
@media (min-width: 900px) {
  .story { grid-template-columns: 1.6fr 1fr; }
  .story .label, .story h3, .story .story-body { grid-column: 1; }
  .story .stats { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
}
.label { font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 .6rem; font-weight: 700; }
.story h3 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin: 0 0 1rem; }
.story-body p { margin: 0 0 .9rem; max-width: var(--measure); }
.story-body strong { color: var(--ink); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 1.2rem 0 0; }
.stats div { border-top: 2px solid var(--ink); padding-top: .5rem; }
.stats dt { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 500; line-height: 1; }
.stats dd { margin: .3rem 0 0; font-size: .85rem; color: var(--ink-soft); }

/* ---------- principles ---------- */
.principles { list-style: none; padding: 0; margin: 2rem 0 0; counter-reset: p; display: grid; gap: 2.2rem 3rem; }
@media (min-width: 800px) { .principles { grid-template-columns: 1fr 1fr; } }
.principles li { counter-increment: p; padding-left: 3.2rem; position: relative; }
.principles li::before {
  content: counter(p); position: absolute; left: 0; top: -.15rem;
  font-family: var(--display); font-style: italic; font-size: 2.2rem; color: var(--accent); line-height: 1;
}
.principles h3 { font-size: 1.35rem; margin: 0 0 .4rem; }
.principles p { margin: 0; color: var(--ink-soft); }

/* ---------- now ---------- */
.now-card { border-left: 3px solid var(--accent); padding: .3rem 0 .3rem 1.6rem; max-width: 46rem; }
.now-card h3 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0 0 .6rem; }
.now-card h3 a { color: var(--ink); }
.now-card h3 a:hover { color: var(--accent); }
.tags { list-style: none; padding: 0; margin: 1.4rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tags li { font-size: .82rem; padding: .3rem .75rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); }

/* ---------- contact ---------- */
.contact h2 { font-size: clamp(2.6rem, 8vw, 5rem); }
.contact p { max-width: var(--measure); font-size: 1.15rem; margin: 0 0 2rem; }

footer { text-align: center; padding: 2.5rem 1rem 3rem; color: var(--ink-soft); font-size: .85rem; border-top: 1px solid var(--rule); }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  .top nav a:not([href="#contact"]):not([href="#work"]) { display: none; }
  .timeline::before { left: .3rem; }
  .timeline li { grid-template-columns: 1fr; gap: .2rem; padding-left: 1.6rem; }
  .timeline li::before { left: -.05rem; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; transform: none; opacity: 1; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
