/* ===========================================================
   Matt Stubbs: design tokens + base system
   Dark theme: ink & bone. One accent (clay/amber), used sparingly.
   =========================================================== */

:root {
  --bg-page: #f4f3ef;
  --bg-raised: #ffffff;
  --ink-100: #1b1810;
  --ink-300: #3d382f;
  --ink-500: #726b5e;
  --line: #e4e0d6;
  --line-strong: #d3cdbf;

  /* no color accent, emphasis comes from ink weight/darkness only */
  --accent: var(--ink-100);
  --accent-hover: var(--ink-300);
  --accent-tint: rgba(27, 24, 16, 0.06);
  --accent-em: #3f6a4c;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Public Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --container: 1180px;
  --tap: 48px;
  --radius: 3px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  position: relative;
  background: var(--bg-page);
  color: var(--ink-100);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film-grain texture, sits behind all content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.site-header, main, .site-footer { position: relative; z-index: 1; }

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

/* ---------- scroll progress + header shrink ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; width: 100%; height: 2px; z-index: 50; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; width: 0%; background: var(--accent); transition: width 0.1s linear; }
.site-header .wrap { transition: height 0.3s var(--ease); }
.site-header.is-scrolled .wrap { height: 52px; }

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}
@media (min-width: 640px) { .wrap { padding-inline: 32px; } }
@media (min-width: 900px) { .wrap { padding-inline: 48px; } }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.section-head { max-width: 42rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.8rem); }
.section-head p { margin-top: 0.9rem; color: var(--ink-500); font-size: 1.05rem; }

section { position: relative; }

/* ---------- reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

.reveal-group .reveal-item {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal-group.is-visible .reveal-item { opacity: 1; transform: none; }
.reveal-group.is-visible .reveal-item:nth-child(1) { transition-delay: 0ms; }
.reveal-group.is-visible .reveal-item:nth-child(2) { transition-delay: 90ms; }
.reveal-group.is-visible .reveal-item:nth-child(3) { transition-delay: 180ms; }
.reveal-group.is-visible .reveal-item:nth-child(4) { transition-delay: 270ms; }
.reveal-group.is-visible .reveal-item:nth-child(5) { transition-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-group .reveal-item { opacity: 1; transform: none; }
}

/* ---------- custom cursor ---------- */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 999;
  border-radius: 50%;
  will-change: transform;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--accent);
}
.cursor-ring {
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 1px solid var(--line-strong);
  transition: border-color 0.25s var(--ease);
}
.cursor-ring.is-hovering { border-color: var(--accent); }
html.has-custom-cursor, html.has-custom-cursor a, html.has-custom-cursor button { cursor: none; }
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ===========================================================
   Header
   =========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(244, 243, 239, 0.86);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.logomark { flex: none; }
.logomark circle { fill: var(--accent); }
.logomark line { stroke: var(--accent); stroke-width: 1.4; opacity: 0.6; }
.site-nav { display: none; align-items: center; gap: 2rem; }
.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  transition: color 0.2s var(--ease);
}
.site-nav a:hover { color: var(--ink-100); }
@media (min-width: 900px) { .site-nav { display: flex; } }
.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 1.1rem;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
  flex: none;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: var(--ink-100);
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.nav-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink-100);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav-cta:hover::before { transform: scaleX(1); }
.nav-cta:hover { color: var(--bg-page); border-color: var(--ink-100); }

/* ===========================================================
   Hero
   =========================================================== */
.hero { padding-block: 5rem 3.5rem; overflow: hidden; }
@media (min-width: 900px) { .hero { padding-block: 8rem 6rem; } }
.hero-intro { max-width: 46rem; margin-inline: auto; text-align: center; animation: hero-fade 1s var(--ease) both; }
@keyframes hero-fade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.hero h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.8rem); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lede { margin-top: 1.4rem; max-width: 40rem; margin-inline: auto; font-size: 1.15rem; color: var(--ink-300); }
.hero-actions { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: var(--tap);
  padding: 0 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.btn:hover::before { transform: scaleX(1); }

.btn-primary { background: var(--accent); color: var(--bg-page); border: 1px solid var(--accent); }
.btn-primary::before { background: var(--bg-page); }
.btn-primary:hover { color: var(--accent); }

.btn-ghost { border: 1px solid var(--line-strong); color: var(--ink-100); }
.btn-ghost::before { background: var(--ink-100); }
.btn-ghost:hover { color: var(--bg-page); border-color: var(--ink-100); }

/* ---------- build log panel (signature motif) ---------- */
.log { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-family: var(--font-mono); }
.log-head { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line); font-size: 0.72rem; letter-spacing: 0.02em; color: var(--ink-500); }
.log-head .live { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink-100); }
.log-head .live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .log-head .live .dot { animation: none; } }
.log-body { padding: 0.5rem 0.25rem; }
.log-entry { padding: 0.85rem 1.1rem; border-left: 2px solid transparent; opacity: 0.45; transition: opacity 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease); }
.log-entry.is-active { opacity: 1; border-left-color: var(--accent); background: var(--accent-tint); }
.log-entry .line { font-size: 0.82rem; color: var(--ink-100); }
.log-entry .line b { color: var(--ink-100); font-weight: 600; }
.log-entry .sub { margin-top: 0.3rem; font-size: 0.72rem; color: var(--ink-500); }


/* ===========================================================
   What I offer
   =========================================================== */
.services-scroll { position: relative; height: 400vh; }
.services-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; align-items: center; }
.services-inner { display: grid; grid-template-columns: 1fr; gap: 2.5rem; width: 100%; align-items: center; }
@media (min-width: 900px) { .services-inner { grid-template-columns: 0.8fr 1.2fr; gap: clamp(3rem, 5vw, 5rem); } }
.services-head h2 { font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem); }
.services-head > p { margin-top: 1rem; color: var(--ink-500); max-width: 34ch; }
.services-progress { margin-top: 2rem; display: flex; align-items: center; gap: 1rem; }
.services-count { font-size: 0.82rem; letter-spacing: 0.08em; color: var(--ink-500); }
.services-count b { color: var(--accent); font-weight: 600; }
.services-bar { position: relative; flex: 1; max-width: 220px; height: 2px; background: var(--line); }
.services-bar i { position: absolute; inset: 0 auto 0 0; width: 0%; background: var(--accent); transition: width 0.2s linear; }
.services-steps { display: grid; gap: clamp(0.55rem, 1.2vw, 0.95rem); }
.svc { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; opacity: 0.28; transform: translateY(4px); transition: opacity 0.45s var(--ease), transform 0.45s var(--ease); }
.svc.is-active { opacity: 1; transform: none; }
.svc-index { font-size: 1.2rem; font-weight: 600; line-height: 1.1; color: var(--line-strong); transition: color 0.4s var(--ease); }
.svc.is-active .svc-index { color: var(--accent); }
.svc .tag { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); }
.svc-body h3 { margin-top: 0.15rem; font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.3rem); line-height: 1.15; }
.svc-body p { margin-top: 0.3rem; max-width: 50ch; color: var(--ink-300); font-size: 0.86rem; line-height: 1.5; }
@media (min-width: 640px) { .svc { grid-template-columns: 3rem 1fr; gap: 1.4rem; } .svc-index { font-size: 1.55rem; } }
@media (prefers-reduced-motion: reduce) {
  .services-scroll { height: auto; }
  .services-sticky { position: static; height: auto; padding-block: 4rem; }
  .svc { opacity: 1; transform: none; }
  .services-progress { display: none; }
}

/* ===========================================================
   How I work
   =========================================================== */
.how-i-work { padding-block: 5rem; }
.how-scroll { position: relative; height: 260vh; }
.how-sticky { position: sticky; top: 84px; padding-block: 1rem 3rem; }
.steps-layout { display: grid; gap: 3rem; margin-top: 2rem; }
@media (min-width: 900px) { .steps-layout { grid-template-columns: 0.9fr 1.1fr; gap: 3.5rem; align-items: center; } }
.steps { display: grid; gap: 2.2rem; }
.step {
  border-left: 2px solid var(--line-strong);
  padding-left: 1.2rem;
  opacity: 0.4;
  transition: border-color 0.4s var(--ease), opacity 0.4s var(--ease);
}
.step.is-active { border-color: var(--accent); opacity: 1; }
.step .tag { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--ink-500); text-transform: uppercase; transition: color 0.4s var(--ease); }
.step.is-active .tag { color: var(--accent); }
.step h3 { margin-top: 0.5rem; font-size: 1.2rem; }
.step p { margin-top: 0.5rem; color: var(--ink-300); font-size: 0.96rem; }
.how-i-work .log { align-self: center; }
@media (prefers-reduced-motion: reduce) {
  .how-scroll { height: auto; }
  .how-sticky { position: relative; top: 0; padding-block: 1rem 0; }
  .step { opacity: 1; }
}

/* ===========================================================
   Mobile: neutralise the scroll-scrub sections
   -----------------------------------------------------------
   The pinned 100vh scrub (What I offer) and the 260vh pinned
   step-cycle (How I work) are desktop-only affordances (enabled
   at >=900px, where the two-column layout fits one viewport).
   Below that they clip content (the "What I offer" title and the
   last line of item 4 were cut off by the 100vh overflow:hidden
   panel), so on small screens we let both sections flow naturally
   with every item visible. Mirrors the reduced-motion fallback.
   =========================================================== */
@media (max-width: 899px) {
  /* What I offer — no pinned clip; show all four services stacked */
  .services-scroll { height: auto; }
  .services-sticky { position: static; height: auto; overflow: visible; display: block; padding-block: 4rem; }
  .services-inner { align-items: start; }
  .svc { opacity: 1; transform: none; }
  .services-progress { display: none; }

  /* How I work — no pinned scrub; hide the decorative build-log panel */
  .how-scroll { height: auto; }
  .how-sticky { position: static; top: 0; }
  .step { opacity: 1; }
  .how-i-work .log { display: none; }
}

/* ===========================================================
   Work
   =========================================================== */
.work { padding-block: 5rem; }
.work-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
.work-tile {
  border: 1px solid var(--line);
  background: var(--bg-raised);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
@media (min-width: 640px) { .work-tile.feature { grid-column: span 2; } }
.work-tile:hover { transform: translateY(-4px); border-color: var(--accent); }
.work-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-page); }
@media (min-width: 640px) { .work-tile.feature .work-media { aspect-ratio: 21 / 9; } }
.work-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); }
.work-tile:hover .work-media img { transform: scale(1.03); }
.work-media-ph { display: flex; align-items: center; justify-content: center; }
.work-media-ph::after { content: attr(data-monogram); font-family: var(--font-display); font-weight: 600; font-size: clamp(2.5rem, 6vw, 4rem); color: var(--line-strong); }
.work-media .status {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-100);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: 0.32rem 0.6rem;
  border-radius: var(--radius);
}
.work-body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.work-body .meta { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-500); }
.work-body h3 { font-size: 1.35rem; }
.work-body p { color: var(--ink-300); font-size: 0.95rem; }
.work-body .note { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-500); margin-top: 0.2rem; }

/* ===========================================================
   About
   =========================================================== */
.about-runway { position: relative; height: 340vh; }
.about-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; align-items: center; }
.about-track { display: flex; align-items: center; gap: clamp(1.2rem, 2.6vw, 2.4rem); padding-inline: clamp(20px, 7vw, 130px); will-change: transform; }
.about-intro { flex: 0 0 auto; width: min(78vw, 400px); }
.about-intro h2 { font-family: var(--font-display); font-size: clamp(2.6rem, 1.8rem + 4vw, 5rem); line-height: 0.98; letter-spacing: -0.01em; }
.about-intro p { margin-top: 1.3rem; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-500); }
.about-card {
  position: relative; flex: 0 0 auto; width: min(82vw, 430px); min-height: min(60vh, 380px);
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.8rem, 3vw, 2.8rem); display: flex; align-items: center;
}
.about-card::before { content: attr(data-n); position: absolute; top: 1.5rem; left: clamp(1.8rem, 3vw, 2.8rem); font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); }
.about-card p { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.35rem, 1.05rem + 1vw, 1.85rem); line-height: 1.32; color: var(--ink-300); }
.about-card p strong { color: var(--accent-em); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .about-runway { height: auto; }
  .about-sticky { position: static; height: auto; padding-block: 4rem; }
  .about-track { flex-wrap: wrap; transform: none !important; padding-inline: 0; }
  .about-intro, .about-card { width: 100%; }
  .about-card { min-height: 0; }
}

/* ===========================================================
   Contact
   =========================================================== */
/* ===========================================================
   FAQ
   =========================================================== */
.faq { padding-block: 5rem; }
.faq-list { display: grid; }
.faq-item { border-top: 1px solid var(--line); padding-block: 1.3rem; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink-100);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--ink-500);
  transition: transform 0.25s var(--ease);
}
.faq-item[open] summary::after { content: "+"; transform: rotate(45deg); }
.faq-item p { margin-top: 0.8rem; max-width: 40rem; color: var(--ink-300); font-size: 0.96rem; }

.contact { padding-block: 5rem; }
.contact-panel { border: 1px solid var(--line); background: var(--bg-raised); padding: clamp(1.4rem, 1rem + 2vw, 2.6rem); display: flex; flex-direction: column; align-items: stretch; gap: 1.6rem; }
.contact-note { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-500); border: 1px dashed var(--line-strong); padding: 0.7rem 0.9rem; align-self: start; }
.contact-note a { color: var(--ink-100); text-decoration: underline; text-underline-offset: 2px; }

/* Contact form */
.contact-form { display: grid; grid-template-columns: 1fr; gap: 1.1rem; width: 100%; }
@media (min-width: 640px) {
  .contact-form { grid-template-columns: 1fr 1fr; }
  .contact-form .field-full, .contact-form button { grid-column: 1 / -1; }
}
.hidden-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-500); }
.field .opt { text-transform: none; letter-spacing: 0; opacity: 0.7; }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: 0.7rem 0.85rem;
  background: var(--bg-page); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--ink-100); font-family: var(--font-body); font-size: 0.95rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { min-height: 7rem; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-500); opacity: 0.6; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint);
}
.contact-form button { justify-self: start; }

/* ===========================================================
   Footer
   =========================================================== */
.site-footer { padding-block: 3rem; }
.site-footer .wrap { display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 640px) { .site-footer .wrap { flex-direction: row; justify-content: space-between; align-items: center; } }
.site-footer .foot-nav { display: flex; flex-wrap: wrap; gap: 1.4rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-500); }
.site-footer .foot-nav a:hover { color: var(--ink-100); }
.site-footer small { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-500); }
