/* BPNY/ — "Paper & Ink" */

:root {
  --paper: #F2EDE2;
  --paper-raised: #E8E1D2;
  --ink: #17150F;
  --ink-muted: #5C5546;
  --rule: #CBC1AD;
  --oxblood: #7A1F2B;
  --field: #7A1F2B;
  --on-field: #F2EDE2;
  --highlight: #D9E85A;
  --on-highlight: #17150F;

  --ink-ground: #12110E;
  --ink-raised: #1C1A16;
  --ink-text: #EFE9DC;
  --ink-text-muted: #A69E8E;
  --ink-rule: #38342C;
  --ink-oxblood: #E8909A;

  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --s1: 8px;
  --s2: 16px;
  --s3: 32px;
  --s4: 64px;
  --section: clamp(80px, 11vw, 160px);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;

  --ease: cubic-bezier(.2, .7, .1, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, canvas { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--highlight); color: var(--on-highlight); }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  z-index: 100;
}
.skip:focus { left: 8px; }

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

/* ---------- Type ---------- */

.display-xl,
.display-l,
.headline {
  font-family: var(--display);
  font-weight: 400;
  margin: 0;
  text-wrap: balance;
}
.display-xl { font-size: clamp(50px, 6.6vw, 100px); line-height: .95; letter-spacing: -.015em; }
.display-l  { font-size: clamp(38px, 5vw, 64px); line-height: 1.02; letter-spacing: -.01em; }
.headline   { font-size: clamp(26px, 2.4vw, 32px); line-height: 1.1; }

.display-xl em,
.display-l em { font-style: italic; color: var(--oxblood); }

.body-l { font-size: clamp(17px, 1.4vw, 19px); line-height: 1.55; max-width: 40em; }
.muted { color: var(--ink-muted); }

.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0;
}

code {
  font-family: var(--mono);
  font-size: 13px;
}

/* Highlighter: drawn on when revealed */
.hl {
  color: var(--on-highlight);
  background: linear-gradient(var(--highlight), var(--highlight)) no-repeat 0 0 / 0% 100%;
  padding: 0 .12em;
  margin: 0 -.12em;
  transition: background-size .9s var(--ease) .35s;
}
.is-in .hl,
.hl.is-in { background-size: 100% 100%; }

/* ---------- Buttons & links ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font: 600 15px/1 var(--sans);
  padding: 16px 22px;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color .25s var(--ease);
}
.button::after {
  content: "/";
  font-family: var(--mono);
  font-weight: 400;
  transition: transform .25s var(--ease);
}
.button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paper);
  transform: translateY(101%);
  transition: transform .3s var(--ease);
  z-index: -1;
}
.button:hover { color: var(--ink); }
.button:hover::before { transform: translateY(0); }
.button:hover::after { transform: translateX(3px); }
.button.small { padding: 11px 16px; font-size: 14px; }

.link-arrow {
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
  transition: border-color .2s;
}
.link-arrow::after { content: " \2192"; display: inline-block; transition: transform .25s var(--ease); }
.link-arrow:hover { border-color: var(--ink); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-color: var(--rule); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  height: 72px;
}
.brand img { width: 104px; height: auto; }
.nav { display: flex; align-items: center; gap: var(--s3); }
.nav a:not(.button) {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-muted);
  transition: color .2s;
}
.nav a:not(.button):hover { color: var(--ink); }

/* ---------- Hero ---------- */

.hero { padding: clamp(40px, 7vw, 96px) 0 var(--section); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.hero-copy { display: grid; gap: var(--s3); }
.hero-copy .label { margin-bottom: -8px; }
.actions { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }

.hero-art { margin: 0; }
.hero-art canvas {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--paper);
}
.hero-art figcaption {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

/* Line-by-line headline reveal */
.lines .line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.lines .line > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform .9s var(--ease);
}
.lines.is-in .line > span { transform: none; }
.lines.is-in .line:nth-child(2) > span { transition-delay: .12s; }
.lines.is-in .line:nth-child(3) > span { transition-delay: .24s; }

/* ---------- Numbers ---------- */

.numbers { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: var(--s3) var(--s3) var(--s3) 0;
}
.stat + .stat { border-left: 1px solid var(--rule); padding-left: var(--s3); }
.stat-num {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 3.4vw, 44px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: 14px; color: var(--ink-muted); max-width: 22ch; }

/* ---------- Statement (oxblood field) ---------- */

.statement { background: var(--field); color: var(--on-field); }
.statement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1440px;
  margin: 0 auto;
  min-height: min(90vh, 760px);
}
.statement-copy {
  display: grid;
  align-content: center;
  gap: var(--s3);
  padding: var(--section) var(--gutter);
  padding-left: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}
.statement .label { color: var(--on-field); opacity: .8; }
.statement-art {
  background: url("assets/img/coil-line-field.png") 50% 0 / cover no-repeat var(--field);
  animation: pan 40s ease-in-out infinite alternate;
}
@keyframes pan { to { background-position: 50% 100%; } }

/* ---------- Sections ---------- */

.section { padding: var(--section) 0; }
.section-head {
  display: grid;
  gap: var(--s2);
  max-width: 820px;
  margin-bottom: var(--s4);
}
.section-head .label { margin-bottom: var(--s1); }

/* Services: editorial index */
.services { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.service {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: var(--s3);
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.service::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease);
}
.service:hover::before { transform: scaleX(1); }
.service-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-muted);
  transition: color .2s;
}
.service .headline { transition: transform .4s var(--ease); }
.service:hover .headline { transform: translateX(8px); }
.service p { margin: 0; color: var(--ink-muted); max-width: 36em; }

/* Ink section */
.ink {
  background: var(--ink-ground);
  color: var(--ink-text);
}
.ink .label { color: var(--ink-text-muted); }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink-rule);
  position: relative;
}
.steps::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  height: 1px;
  width: 100%;
  background: var(--ink-text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.6s var(--ease) .2s;
}
.steps.is-in::before { transform: scaleX(1); }
.step {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: var(--s2);
  padding: var(--s3) var(--s3) 0 0;
}
.step + .step { padding-left: var(--s3); border-left: 1px solid var(--ink-rule); }
.step-num { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--ink-text-muted); }
.step p { margin: 0; color: var(--ink-text-muted); }
.step code {
  display: block;
  font-size: 12px;
  background: var(--ink-raised);
  color: var(--ink-text);
  padding: 10px 12px;
  border: 1px solid var(--ink-rule);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Who */
.who-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.who {
  background: var(--paper);
  padding: var(--s3);
  display: grid;
  gap: var(--s2);
  align-content: start;
  transition: background .3s;
}
.who:hover { background: var(--paper-raised); }
.who p:last-child { margin: 0; color: var(--ink-muted); }

/* About */
.about { background: var(--paper-raised); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.about-grid {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.about-art { margin: 0; overflow: hidden; }
.about-art img { width: 100%; height: auto; }
.about-copy { display: grid; gap: var(--s3); }
.about-copy > p { margin: 0; max-width: 40em; }
.facts { margin: 0; border-top: 1px solid var(--rule); }
.facts div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--s2);
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.facts dd { margin: 0; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.contact-copy { display: grid; gap: var(--s3); position: sticky; top: 112px; }
.contact-copy > p { margin: 0; }
.direct { display: grid; gap: 8px; }
.direct a {
  font-family: var(--display);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
  color: var(--oxblood);
  text-decoration: none;
  width: fit-content;
  border-bottom: 1px solid currentColor;
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px var(--s3);
  border-top: 1px solid var(--ink);
  padding-top: var(--s3);
}
.field { display: grid; gap: 8px; min-width: 0; border: 0; margin: 0; padding: 0; }
.full { grid-column: 1 / -1; }
.field > label,
.field legend {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0;
  margin-bottom: 8px;
}
.field > label { margin-bottom: 0; }
input, select, textarea {
  font: 16px/1.4 var(--sans);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 10px 0;
  width: 100%;
  transition: border-color .2s;
  appearance: none;
}
select {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6' fill='%2317150F'/%3E%3C/svg%3E") right 4px center no-repeat;
  cursor: pointer;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
::placeholder { color: var(--ink-muted); opacity: .7; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { width: 100%; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span {
  display: inline-block;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  transition: background .2s, color .2s, border-color .2s;
}
.chips label:hover span { border-color: var(--ink); }
.chips input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chips input:focus-visible + span { outline: 2px solid var(--oxblood); outline-offset: 2px; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: var(--s3) 0; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s3);
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: var(--s3); align-items: center; }
.footer-links a { text-decoration: none; border-bottom: 1px solid var(--rule); }

/* ---------- Scroll reveal ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero-grid,
  .statement-grid,
  .about-grid,
  .contact-grid { grid-template-columns: 1fr; }
  .hero-art canvas { aspect-ratio: 1; }
  .statement-art { min-height: 320px; order: -1; }
  .statement-grid { min-height: 0; }
  .numbers-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .steps { grid-template-columns: 1fr 1fr; row-gap: var(--s3); }
  .step:nth-child(3) { border-left: 0; padding-left: 0; }
  .who-grid { grid-template-columns: 1fr; }
  .about-art { max-width: 420px; }
  .contact-copy { position: static; }
}

@media (max-width: 640px) {
  .nav a:not(.button) { display: none; }
  .brand img { width: 88px; }
  .service { grid-template-columns: 40px 1fr; gap: 8px var(--s2); }
  .service p { grid-column: 2; }
  .steps { grid-template-columns: 1fr; }
  .step, .step + .step { border-left: 0; padding-left: 0; }
  .step + .step { border-top: 1px solid var(--ink-rule); }
  .form { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: 4px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .lines .line > span { transform: none; }
  .hl { background-size: 100% 100%; }
}
