/* ==========================================================================
   Luke Hattrup — site styles
   One stylesheet, one typeface. No build step.
   ========================================================================== */

:root{
  --paper:      #E8E9E7;
  --paper-up:   #F2F3F1;
  --ink:        #18231E;
  --ink-soft:   #6D7772;
  --rule:       #D3D6D1;
  --accent:     #2E4A3B;

  --measure:    64ch;
  --margin-col: 9rem;
  --gap:        3rem;
  --shell:      68rem;

  --ease:       cubic-bezier(.22,.61,.36,1);
  --radius:     12px;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:"Geist","Helvetica Neue",Arial,sans-serif;
  font-size:1.0625rem;
  line-height:1.68;
  letter-spacing:-0.005em;
  font-weight:400;
  -webkit-font-smoothing:antialiased;
}

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

h1,h2,h3,h4{ margin:0 0 .7em; line-height:1.02; text-wrap:balance; }

h1{ font-size:clamp(2.2rem,5.5vw,4rem); font-weight:300; letter-spacing:-0.035em; }
h2{ font-size:clamp(1.7rem,3.2vw,2.5rem); font-weight:300; letter-spacing:-0.03em; }
h3{ font-size:1.2rem;  font-weight:500; letter-spacing:-0.015em; }

p{ margin:0 0 1.2em; max-width:var(--measure); }
p:last-child{ margin-bottom:0; }

a{ color:inherit; text-decoration:none; border-bottom:1px solid var(--rule); transition:border-color .3s var(--ease); }
a:hover{ border-color:var(--ink); }

.meta{ font-size:.8125rem; font-weight:500; line-height:1.5; color:var(--ink-soft); letter-spacing:0; }
.lede{ font-size:clamp(1.1rem,1.7vw,1.35rem); font-weight:300; line-height:1.5; max-width:46ch; letter-spacing:-0.015em; }
.placeholder{ color:#96A09A; }

/* --- Shell and grid ---------------------------------------------------- */

.shell{ width:min(100% - 4rem,var(--shell)); margin-inline:auto; }

.row{ display:grid; grid-template-columns:var(--margin-col) minmax(0,1fr); gap:var(--gap); }
.row + .row{ margin-top:5rem; }

.band{ padding-block:6.5rem; }
.band--tight{ padding-block:4rem; }

.stitch{ height:1px; border:0; margin:0; background:var(--rule); }

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

.nav{
  display:flex; flex-wrap:wrap; gap:1.75rem; align-items:baseline;
  padding-block:2rem; font-size:.9375rem; font-weight:450;
}
.nav{ align-items:flex-end; }
.nav a{ border:0; }
.nav a:hover{ color:var(--ink-soft); }
.nav a[aria-current="page"]{ color:var(--ink-soft); }
.nav__home{ margin-right:auto; font-weight:500; letter-spacing:-0.015em; display:flex; flex-direction:column; line-height:1.25; }
.nav__hi{ color:var(--ink-soft); font-weight:450; }
.nav__home:hover .nav__hi{ color:var(--ink-soft); }

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

.hero{ padding-block:5rem 7rem; }

.hero__display{
  margin:0 0 3rem;
  font-size:clamp(2.2rem,7vw,5.5rem);
  font-weight:300;
  line-height:.96;
  letter-spacing:-0.045em;
}
/* overflow:hidden is the reveal mask — it also clips sideways, so keep each
   line short enough to fit. Long line + big offset = silently cropped text. */
.hero__line{ display:block; overflow:hidden; padding-bottom:.06em; }
.hero__line > span{ display:block; }
.hero__line--offset{ padding-left:16%; }

.hero__foot{ display:grid; grid-template-columns:var(--margin-col) minmax(0,1fr) 15rem; gap:var(--gap); align-items:start; }

.hero__links{ display:flex; flex-wrap:wrap; gap:1.5rem; margin:1.5rem 0 0; padding:0; list-style:none; font-size:.9375rem; font-weight:450; }

/* Portrait: a clean print. No tape, no tilt — the motion does the work. */
.portrait{ margin:0; }
.portrait img{ display:block; width:100%; height:auto; aspect-ratio:4/5; object-fit:cover; border-radius:var(--radius); }

/* --- Figures ----------------------------------------------------------- */

.figure{ margin:0; }
.figure img{ display:block; width:100%; height:auto; border-radius:var(--radius); }
.figure figcaption{ margin-top:.8rem; }
.figure--wide{ margin-top:4rem; }

.figure-pair{ display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; margin-top:2.5rem; }
@media (max-width:760px){ .figure-pair{ grid-template-columns:1fr; gap:2rem; } .figure--wide{ margin-top:2.5rem; } }

/* A small contact strip. Square crops so mixed orientations sit level. */
.strip{ display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; margin-top:1.75rem; max-width:34rem; }
.strip img{
  display:block; width:100%; aspect-ratio:1/1; object-fit:cover;
  border-radius:var(--radius); background:var(--paper-up);
}
.strip--4{ grid-template-columns:repeat(4,1fr); max-width:44rem; }
@media (max-width:760px){
  .strip{ grid-template-columns:repeat(2,1fr); gap:.55rem; max-width:none; }
  .strip--4{ grid-template-columns:repeat(2,1fr); max-width:none; }
}

/* Prose with a tall photo set beside it, rather than a slab across the column. */
.aside-figure{
  display:grid;
  grid-template-columns:minmax(0,1fr) 14rem;
  gap:2.75rem;
  align-items:start;
}
.aside-figure .figure{ margin-top:.45rem; }   /* small optical drop off the first line */
@media (max-width:760px){
  .aside-figure{ grid-template-columns:minmax(0,1fr); gap:1.75rem; }
  .aside-figure .figure{ max-width:13rem; margin-top:0; }
}

/* Notebook pages, as a slow reel. Auto-scrolls, but stays a normal scrollable
   strip underneath — hover, touch or reduced-motion all hand control back. */
.reel{ margin-top:3rem; }
.reel__viewport{
  overflow-x:auto; overflow-y:hidden;
  scrollbar-width:none; -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  /* Soften both edges so a card mid-scroll reads as a reel, not a clipped box. */
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 2.5rem,#000 calc(100% - 2.5rem),transparent 100%);
  mask-image:linear-gradient(90deg,transparent 0,#000 2.5rem,#000 calc(100% - 2.5rem),transparent 100%);
}
.reel__viewport::-webkit-scrollbar{ display:none; }

.reel__track{ display:flex; gap:1.25rem; width:max-content; padding-bottom:.25rem; }

.reel figure{ margin:0; flex:0 0 auto; width:14rem; }
.reel a{ display:block; border:0; border-radius:var(--radius); }
.reel img{
  display:block; width:100%; height:auto;
  border-radius:var(--radius);
  border:1px solid var(--rule);
  background:var(--paper-up);
  transition:opacity .3s var(--ease);
}
.reel a:hover img{ opacity:.82; }
.reel figcaption{ margin-top:.75rem; max-width:14rem; }

@media (max-width:760px){
  .reel figure{ width:11.5rem; }
  .reel figcaption{ max-width:11.5rem; }
  .reel__track{ gap:1rem; }
}

/* --- Metrics ----------------------------------------------------------- */

.metrics{ display:flex; flex-wrap:wrap; gap:3.5rem; margin:0 0 2.75rem; padding:0; list-style:none; }
.metrics li{ display:flex; flex-direction:column; gap:.2rem; }
.metrics__n{ font-size:clamp(2rem,4vw,3.1rem); font-weight:300; line-height:1; letter-spacing:-0.04em; }

/* --- Work entries ------------------------------------------------------ */

.entry{ padding-block:2.75rem; }
.entry:first-child{ padding-top:0; }
.entry + .entry{ border-top:1px solid var(--rule); }
.entry h3{ margin-bottom:.4rem; }
.entry h3 a{ border:0; }
.entry h3 a:hover{ color:var(--ink-soft); }
.entry__role{ margin:0 0 1rem; }

/* --- Essays ------------------------------------------------------------ */

.essays{ margin:0; padding:0; list-style:none; }
.essays li{ padding-block:2rem; }
.essays li:first-child{ padding-top:0; }
.essays li + li{ border-top:1px solid var(--rule); }
.essays h3{ margin-bottom:.35rem; font-size:1.35rem; font-weight:400; letter-spacing:-0.025em; }
.essays h3 a{ border:0; }
.essays h3 a:hover{ color:var(--ink-soft); }
.essays p{ margin:0; max-width:54ch; }

/* --- Essay body -------------------------------------------------------- */

.prose{ max-width:var(--measure); }
.prose h2{ margin-top:3rem; font-size:1.5rem; font-weight:500; letter-spacing:-0.02em; }
.prose blockquote{
  margin:2.25rem 0; padding-left:1.6rem;
  border-left:1px solid var(--rule);
  font-size:1.2rem; font-weight:300; line-height:1.5; color:var(--ink-soft);
}

/* --- Buttons and footer ------------------------------------------------ */

.btn{
  display:inline-block; padding:.7rem 1.4rem;
  border:1px solid var(--ink); border-radius:2rem;
  font-size:.9375rem; font-weight:450;
  transition:background-color .3s var(--ease), color .3s var(--ease);
}
.btn:hover{ background:var(--ink); color:var(--paper); }

.contact{ margin:0; padding:0; list-style:none; }
.contact li{ margin-bottom:.5rem; }
.foot{ padding-block:4rem 5rem; }

/* ==========================================================================
   Motion
   Hidden states live under html.js, so if JS never runs — or the visitor
   asked for reduced motion — everything is simply visible.
   ========================================================================== */

html.js [data-reveal]{ opacity:0; transform:translate3d(0,1.75rem,0); }
html.js [data-reveal].is-in{
  opacity:1; transform:none;
  transition:opacity 1s var(--ease) var(--d,0s), transform 1s var(--ease) var(--d,0s);
}

html.js .hero__line > span{ transform:translate3d(0,110%,0); }
html.js .hero__line.is-in > span{
  transform:none;
  transition:transform 1.15s var(--ease) var(--d,0s);
}

[data-parallax]{ will-change:transform; }

@media (prefers-reduced-motion:reduce){
  html.js [data-reveal],
  html.js .hero__line > span{ opacity:1 !important; transform:none !important; }
  *{ transition-duration:.01ms !important; animation-duration:.01ms !important; }
}

/* --- Accessibility floor ----------------------------------------------- */

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

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

@media (max-width:900px){
  .hero__foot{ grid-template-columns:minmax(0,1fr) 12rem; }
  .hero__foot > .row__meta{ display:none; }
}

@media (max-width:760px){
  .shell{ width:min(100% - 2.5rem,var(--shell)); }
  .row{ grid-template-columns:minmax(0,1fr); gap:.75rem; }
  .row + .row{ margin-top:3rem; }
  .band{ padding-block:4rem; }
  .band--tight{ padding-block:2.5rem; }
  .hero{ padding-block:2rem 4rem; }
  .hero__display{ margin-bottom:2.25rem; }
  .hero__line--offset{ padding-left:12%; }
  .hero__foot{ grid-template-columns:minmax(0,1fr); gap:2.5rem; }
  .hero__portrait{ max-width:11rem; }
  .metrics{ gap:2rem 2.5rem; }
  .row + .row{ margin-top:3rem; }
}
