/* ===========================================================
   Dylan Sullivan — portfolio
   Colours:  bg #FAFAFA | orange #E85D3D | black #1A1A1A
   =========================================================== */

@font-face {
  font-family: "ReenieBeanie";
  src: url("ReenieBeanie-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FAFAFA;
  --orange: #E85D3D;
  --black: #1A1A1A;          /* doubles as the primary foreground/text token */
  --white: #ffffff;          /* kept literal — white text on orange must stay white */
  --muted: #555555;

  /* card surfaces — flipped in dark mode */
  --surface: #ffffff;
  --surface-border: rgba(0,0,0,.06);

  /* consistent vertical rhythm between sections */
  --section-y: clamp(64px, 8vw, 96px);

  --display: "Poppins", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --body: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;

  color-scheme: light;
}

/* ---------- DARK THEME ----------
   Only the semantic tokens flip. --white/--orange stay literal so the orange
   panels and their white text are identical in both themes. --black is the
   foreground token, so flipping it re-colours all body/heading text at once. */
[data-theme="dark"] {
  --bg: #16120f;             /* warm near-black to sit with the orange brand */
  --black: #f1ece7;          /* foreground/text → light */
  --muted: #a79e96;
  --surface: #221c18;        /* cards: a few shades lighter than --bg */
  --surface-border: rgba(255,255,255,.09);

  color-scheme: dark;
}

/* in dark mode: white button with dark-background-coloured text */
[data-theme="dark"] .btn--solid {
  background: var(--white);
  color: var(--bg);
}

/* smooth cross-fade when toggling (View Transitions API) */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .35s; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  width: 100%;
  max-width: 100%;
  color: var(--black);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* keyboard focus: crisp ring for keyboard users, suppressed for mouse/touch.
   The outline follows each element's own border-radius in modern browsers. */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }
/* white reads better than orange on the orange contact panel */
.contact__inner :focus-visible { outline-color: var(--white); }

/* ---------- THEME TOGGLE (bare sun + moon, sitting on the orange blob) ----------
   Absolutely placed inside the hero, so it scrolls away with the page rather
   than following the viewport. Both icons always show; the one matching the
   live theme is solid white, the other sits back — the blob stays orange in
   both themes, so these colours are literal. */
.theme-toggle {
  position: absolute;
  top: clamp(20px, 3vw, 34px);
  right: clamp(20px, 3.4vw, 44px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 6px 2px;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle__ic {
  width: 19px;
  height: 19px;
  color: rgba(255,255,255,.5);
  transition: color .3s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
/* light theme: the sun is live — dark theme: the moon takes over */
.theme-toggle__ic--sun { color: #fff; }
[data-theme="dark"] .theme-toggle__ic--sun { color: rgba(255,255,255,.5); }
[data-theme="dark"] .theme-toggle__ic--moon { color: #fff; }
/* only the icon actually under the cursor reacts — hovering the gap between
   them, or the button's padding, does nothing */
.theme-toggle__ic:hover {
  color: #fff;
  transform: scale(1.15);
}
.hero :focus-visible { outline-color: #fff; }

/* nothing is pinned over the page, so anchors just need breathing room */
:target,
section[id],
header[id] { scroll-margin-top: 24px; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  /* svh = the small viewport height, so phone browser chrome sliding in and
     out can't push the scroll cue off-screen or cause a jump */
  min-height: 100svh;
  padding: 0 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes blobPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}

.hero__blob {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(260px, 56vw, 820px);
  height: auto;
  max-width: 100%;
  z-index: 0;
  pointer-events: none;
  transform-origin: 100% 0;
  filter: drop-shadow(0 17px 3.1px rgba(26, 26, 26, 0.25));
  animation: blobPulse 4s ease-in-out infinite;
}

/* social circles — used in the contact panel */
.social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--white);
  transition: transform .2s ease;
}
.social img { display: block; width: 18px; height: 18px; filter: brightness(0) invert(1); }
.social:hover { transform: translateY(-2px); }

/* name block */
.hero__name { position: relative; z-index: 2; }
.name-line {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(72px, 15vw, 200px);
  line-height: .92;
  letter-spacing: -2px;
  color: var(--black);
}
.role {
  font-family: var(--body);
  font-weight: 400;
  font-size: clamp(18px, 2.8vw, 34px);
  margin: 10px 0 6px;
  padding-left: 4px;
  color: var(--black);
}
.role__accent { color: var(--orange); font-weight: 500; }

/* availability badge */
@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(232,93,61,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(232,93,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,93,61,0); }
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(232,93,61,.12);
  color: var(--orange);
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 7px 15px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero__badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  animation: dotPulse 1.8s ease-out infinite;
}

/* hero CTAs */
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  padding: 13px 28px;
  border-radius: 999px;
  transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn--solid {
  background: var(--black);
  color: var(--white);
}
.btn--cv {
  background: linear-gradient(160deg, #EF6E50 0%, var(--orange) 45%, #D94E2F 100%);
  color: var(--white);
}
/* hover: each button keeps its own colour and just pops out a touch */
.btn--solid:hover,
.btn--solid:focus-visible,
.btn--cv:hover,
.btn--cv:focus-visible { transform: scale(1.04); }
.btn--solid:active,
.btn--cv:active { transform: scale(1); }
.btn--ghost {
  border: 2px solid var(--black);
  color: var(--black);
}
.btn--ghost:hover {
  background: var(--black);
  color: var(--white);
  transform: translateY(-3px);
}

/* scroll cue */
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 3;
  transition: color .2s ease;
}
.hero__scroll:hover { color: var(--black); }
.hero__scroll-arrow {
  font-size: 16px;
  animation: scrollBounce 1.6s ease-in-out infinite;
}

/* ---------- ABOUT ---------- */
.about {
  padding: var(--section-y) 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
}
.about__head { text-align: center; margin-bottom: 4px; }
.about__head .section-title { font-size: clamp(34px, 5vw, 52px); }

/* ---------- ABOUT: alternating story rows on an orange spine ----------
   Each entry is a full-width row — photo on one side, copy on the other,
   sides swapping row to row — pinned to a vertical line that runs the
   height of the section with a node dot per entry. */
.story {
  position: relative;
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 8vw, 104px);
}
/* the spine: fades out at both ends so it never just stops mid-air */
.story::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(
    to bottom,
    transparent 0%, rgba(232,93,61,.45) 9%,
    rgba(232,93,61,.45) 91%, transparent 100%
  );
}

.story__row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 104px 1fr;
  align-items: center;
}
/* node dot, ringed in the page background so the spine appears to pass behind */
.story__row::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 6px var(--bg);
  z-index: 1;
}

/* odd rows: photo left, copy right — even rows swap */
.story__media { grid-column: 1; grid-row: 1; }
.story__body  { grid-column: 3; grid-row: 1; }
.story__row:nth-child(even) .story__media { grid-column: 3; }
.story__row:nth-child(even) .story__body  { grid-column: 1; }

.story__media {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  /* flat orange offset block + a soft lift, offset away from the spine */
  box-shadow: 18px 18px 0 var(--orange), 0 14px 30px rgba(0,0,0,.10);
  transition: transform .4s ease, box-shadow .4s ease;
}
.story__row:nth-child(even) .story__media {
  box-shadow: -18px 18px 0 var(--orange), 0 14px 30px rgba(0,0,0,.10);
}
.story__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s cubic-bezier(.22, 1, .36, 1);
}
.story__row:hover .story__media { transform: translateY(-5px); }
.story__row:hover .story__media img { transform: scale(1.05); }

/* oversized outlined numeral above each title */
.story__num {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(52px, 7vw, 88px);
  line-height: .78;
  letter-spacing: -3px;
  color: transparent;
  -webkit-text-stroke: 2px var(--orange);
  margin-bottom: 14px;
}
/* browsers without text-stroke get the numeral solid rather than invisible */
@supports not (-webkit-text-stroke: 1px red) {
  .story__num { color: var(--orange); }
}
.story__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 32px);
  color: var(--black);
  margin-bottom: 12px;
}
.story__text {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 46ch;
}
.story__lead { color: var(--black); font-weight: 600; }

/* entrance: each row drifts in from its own side */
.story__row.reveal          { transform: translate(-30px, 26px); }
.story__row:nth-child(even).reveal { transform: translate(30px, 26px); }
.story__row.reveal.in-view  { transform: none; }

/* ---------- SECTION TITLE ---------- */
.section-title {
  font-family: var(--display);
  font-weight: 700;
  text-align: center;
  color: var(--black);
}

/* ---------- MY STACK ---------- */
.stack { padding: var(--section-y) 64px; }
.stack .section-title { font-size: clamp(34px, 5vw, 52px); margin-bottom: 48px; }
.stack__cluster {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
}
.stack__item {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.stack__chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
  transition: transform .3s ease, box-shadow .3s ease;
}
.stack__icon {
  width: 52px;
  height: 52px;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  mix-blend-mode: multiply;
}
.stack__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color .3s ease;
}
.stack__item:hover .stack__chip {
  transform: translateY(-8px);
  box-shadow: 0 16px 30px rgba(0,0,0,.12);
}
.stack__item:hover .stack__label { color: var(--black); }
/* keep the tool logos on a light chip in dark mode — they use
   mix-blend-mode: multiply, which needs a light backdrop to stay legible */
[data-theme="dark"] .stack__chip {
  background: #f4efea;
  border-color: rgba(0,0,0,.08);
}

/* ---------- MARQUEE ---------- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  padding: 26px 0;
  border-top: 1px solid rgba(0,0,0,.07);
  border-bottom: 1px solid rgba(0,0,0,.07);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 26px;
  animation: marquee 30s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(20px, 3vw, 34px);
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--black);
}
.marquee__sep {
  color: var(--orange);
  font-size: clamp(14px, 1.8vw, 20px);
}

/* ---------- HOW I WORK (process) ---------- */
.process { max-width: 1040px; margin: 160px auto 0; }
.process__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  text-align: center;
  color: var(--black);
  margin-bottom: 40px;
}
.process__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.process__step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  padding: 26px 22px 24px;
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
  transition: transform .3s ease, box-shadow .3s ease;
}
.process__step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  width: 36px;
  height: 4px;
  background: var(--orange);
  border-radius: 0 0 4px 4px;
}
.process__num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  color: rgba(232,93,61,.35);
  letter-spacing: -1px;
}
.process__step-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  color: var(--black);
  margin: 6px 0 10px;
}
.process__step-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.process__step:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 34px rgba(0,0,0,.12);
}

/* ---------- WORK ---------- */
.work { padding: var(--section-y) 64px; }

/* eyebrow + accented heading (shared aesthetic) */
.eyebrow {
  display: inline-block;
  background: rgba(232,93,61,.12);
  color: var(--orange);
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.accent-script {
  font-family: "ReenieBeanie", cursive;
  color: var(--orange);
  font-weight: 400;
  font-size: 1.15em;
}
.work__head { text-align: center; margin-bottom: 52px; }
.work__head .section-title { font-size: clamp(34px, 6vw, 60px); }

.work__gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  max-width: 1040px;
  margin: 0 auto;
}
.work__card {
  margin: 0;
  background: var(--surface);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
  transition: transform .35s ease, box-shadow .35s ease;
}
.work__link { display: block; color: inherit; }
.work__thumb {
  position: relative;
  height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.work__shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
/* darken photo thumbs slightly so the number stays legible */
.work__thumb:has(.work__shot)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.45));
}
.work__num {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-weight: 800;
  font-size: 64px;
  color: rgba(255,255,255,.85);
  letter-spacing: -1px;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
  transition: transform .35s ease;
}
.work__thumb--dark  { background: #1d1b3a; }
.work__thumb--mid   { background: var(--orange); }
.work__thumb--light { background: #c9b8f0; }
.work__thumb--light .work__num { color: rgba(58,46,99,.55); }

.work__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* wrap rather than overflow: on narrow cards the tag drops onto its own
     line instead of colliding with the title and being clipped by the card */
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 18px 20px 22px;
}
.work__title {
  min-width: 0;                        /* lets the title shrink instead of forcing overflow */
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.25;
  color: var(--black);
}
.work__tag {
  flex: none;
  background: rgba(232,93,61,.12);
  color: var(--orange);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;                 /* the pill never breaks across lines */
  padding: 6px 12px;
  border-radius: 999px;
}

/* hover: lift card, gently scale the number */
.work__card:hover {
  transform: translateY(-8px);
}
.work__card:hover .work__num { transform: scale(1.12); }
.work__card:hover .work__shot { transform: scale(1.06); }

/* ---------- SERVICES ---------- */
.services { padding: var(--section-y) 64px; }
.services .work__head { margin-bottom: 52px; }
.services__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  max-width: 1040px;
  margin: 0 auto;
}
.service {
  background: var(--surface);
  border-radius: 22px;
  padding: 30px 26px 32px;
  box-shadow: 0 12px 30px rgba(0,0,0,.08);
  transition: transform .35s ease, box-shadow .35s ease;
}
.service__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(232,93,61,.12);
  color: var(--orange);
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 18px;
}
.service__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  color: var(--black);
  margin-bottom: 10px;
}
.service__text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.service:hover {
  transform: translateY(-8px);
}
.service:hover .service__num {
  background: var(--orange);
  color: var(--white);
}
.service__num { transition: background .3s ease, color .3s ease; }

/* ---------- CONTACT ---------- */
.contact { padding: var(--section-y) 64px; display: flex; flex-direction: column; align-items: center; }
.contact__inner {
  background: linear-gradient(160deg, #EF6E50 0%, var(--orange) 45%, #D94E2F 100%);
  border-radius: 34px;
  padding: 64px 40px;
  max-width: 1040px;
  width: 100%;
  text-align: center;
  color: var(--white);
  box-shadow: 0 18px 50px rgba(0,0,0,.22), 0 6px 18px rgba(0,0,0,.14);
}
.contact__eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.18);
  color: var(--white);
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.contact__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.05;
  color: var(--white);
}
.contact__title .accent-script { color: var(--black); }
.contact__text {
  max-width: 480px;
  margin: 16px auto 26px;
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.6;
  color: rgba(255,255,255,.92);
}
.contact__email {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--white);
  padding-bottom: 4px;
  border-bottom: 3px solid rgba(255,255,255,.45);
  transition: border-color .25s ease, transform .25s ease;
}
.contact__email:hover {
  border-color: var(--white);
  transform: translateY(-2px);
}
.contact__social {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
}

/* contact form */
.contact__form {
  max-width: 560px;
  margin: 30px auto 0;
  text-align: left;
}
.contact__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: block;
  margin-bottom: 16px;
}
.field__label {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .3px;
  color: var(--white);
  margin-bottom: 7px;
}
.contact__form input,
.contact__form textarea {
  width: 100%;
  font-family: var(--body);
  /* 16px minimum: iOS Safari zooms the whole page in on focus below this,
     and never zooms back out */
  font-size: 16px;
  color: var(--black);
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.contact__form textarea { resize: vertical; min-height: 110px; }
.contact__form input::placeholder,
.contact__form textarea::placeholder { color: #9a9a9a; }
.contact__form input:focus,
.contact__form textarea:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 4px rgba(26,26,26,.12);
}
.contact__form [aria-invalid="true"] { border-color: #7a1d0e; }
.field__error {
  display: block;
  min-height: 16px;
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: #3a0f06;
}
.contact__btn {
  display: inline-block;
  width: 100%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  color: var(--white);
  background: var(--black);
  border: none;
  border-radius: 12px;
  padding: 14px 22px;
  margin-top: 4px;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}
.contact__btn:hover { transform: translateY(-2px); }
.contact__btn:disabled { opacity: .6; cursor: default; transform: none; }
/* keep it a true black button in dark mode (--black flips to light otherwise) */
[data-theme="dark"] .contact__btn {
  background: #1a1a1a;
  color: #fff;
}
.contact__formmsg {
  margin-top: 14px;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
}
.contact__formmsg--ok { color: var(--white); }
.contact__formmsg--err { color: #3a0f06; }
.contact__or {
  margin-top: 26px;
  font-size: 14px;
  color: rgba(255,255,255,.92);
}
.contact__or .contact__email {
  font-family: var(--body);
  font-size: 14px;
  font-weight: 700;
  border-bottom-width: 2px;
}

/* ---------- SCROLL REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition-property: opacity, transform;
  transition-duration: .6s, .6s;
  transition-timing-function: ease, ease;
  transition-delay: 0s, 0s;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- FOOTER ---------- */
.footer {
  padding: clamp(48px, 6vw, 64px) 64px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .hero, .about, .stack, .work, .services, .contact, .footer { padding-left: 24px; padding-right: 24px; }
  .hero__name { margin-left: 0; }
  /* story rows stack full-width: the spine and its node dots are a two-column
     device, so they go rather than being stranded in a gutter. The numerals
     carry the sequence on their own. */
  .story { gap: 48px; }
  .story::before,
  .story__row::before { display: none; }
  .story__row {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-left: 0;
  }
  .story__media,
  .story__row:nth-child(even) .story__media { grid-column: 1; grid-row: 1; }
  .story__body,
  .story__row:nth-child(even) .story__body { grid-column: 1; grid-row: 2; }
  .story__media,
  .story__row:nth-child(even) .story__media {
    box-shadow: 12px 12px 0 var(--orange), 0 12px 26px rgba(0,0,0,.10);
  }
  .story__text { max-width: none; }
  /* one shared entrance direction once the rows no longer alternate */
  .story__row.reveal,
  .story__row:nth-child(even).reveal { transform: translate(0, 26px); }
  .work__gallery,
  .process__grid,
  .services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


@media (max-width: 640px) {
  .work__gallery,
  .process__grid,
  .services__grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .hero, .about, .stack, .work, .services, .contact, .footer { padding-left: 18px; padding-right: 18px; }
  .name-line { letter-spacing: -1px; font-size: clamp(46px, 16vw, 96px); }
  .role { font-size: clamp(14px, 4.4vw, 24px); }
  /* bigger tap target for the theme icons — 19px glyphs alone are too small
     to hit reliably with a thumb */
  .theme-toggle { padding: 12px 8px; gap: 20px; }
  .contact__fields { grid-template-columns: 1fr; }
  .contact__inner { padding: 44px 22px; }
  .process__step,
  .service { padding: 24px 20px; }
}

@media (max-width: 380px) {
  .name-line { letter-spacing: -1px; }
  .contact__email { font-size: 18px; word-break: break-all; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* quiet the entrance reveals (and never leave content hidden), but leave
     the marquee, hover effects and other animations running */
  .reveal,
  .story__row.reveal,
  .story__row:nth-child(even).reveal {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- PROJECT MODAL / LIGHTBOX ---------- */
body.modal-open { overflow: hidden; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, visibility .3s ease;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 12, .62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.modal__box {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100svh - 48px);     /* stays fully reachable on phones */
  overflow: auto;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  transform: translateY(12px) scale(.96);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.modal.is-open .modal__box { transform: translateY(0) scale(1); }
.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.modal__close:hover { background: rgba(0, 0, 0, .7); transform: scale(1.05); }

/* slideshow */
.slider { position: relative; overflow: hidden; background: #000; }
.slider__track { display: flex; transition: transform .45s ease; }
.slider__slide {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 1100 / 687;
  object-fit: cover;
  display: block;
}
.slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  color: var(--black);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s ease, transform .2s ease;
}
.slider__nav:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.slider__nav--prev { left: 12px; }
.slider__nav--next { right: 12px; }
.slider__dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.slider__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.slider__dot.is-active { background: #fff; transform: scale(1.25); }

/* info panel */
.modal__info { padding: 22px 26px 26px; }
.modal__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  color: var(--black);
  margin-bottom: 14px;
}
.modal__tagline {
  font-family: var(--body);
  font-weight: 400;
  font-size: 14px;
  color: rgba(26, 26, 26, .55);
}
.modal__sitelink {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--orange), var(--orange));
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size .25s ease, color .2s ease;
}
.modal__sitelink:hover { color: var(--orange); background-size: 100% 2px; }
.modal__meta { margin-bottom: 0; }
.modal__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid rgba(0, 0, 0, .08);
}
.modal__row dt {
  flex: none;
  width: 96px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, .55);
}
.modal__row dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 15px;
  color: var(--black);
}
.modal__chip {
  background: rgba(232, 93, 61, .12);
  color: var(--orange);
  font-weight: 600;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
}
