/* Layout: a dark editing-suite canvas — huge expanded name, green-lit duotone portrait,
   then a dense bento of work. Colors come straight from Mohamed's palette. */
:root {
  --ink: #050d0f;        /* page ground */
  --deep: #0b2228;       /* raised surfaces */
  --teal: #11504f;       /* lines, hovers */
  --green: #2a845e;      /* brand green */
  --sage: #8bbb8f;       /* secondary text tint */
  --leaf: #66bb6a;       /* the one bright accent */
  --mist: #e8f5e9;       /* primary text */
  --ice: #e8f2f5;

  --text: var(--mist);
  --muted: color-mix(in srgb, var(--mist) 62%, var(--ink));
  --line: color-mix(in srgb, var(--sage) 18%, transparent);

  --f-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1360px;
  --radius: 14px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
h2 {
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
p { margin: 0; }
.mono { font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--leaf); color: var(--ink); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--leaf);
  display: inline-flex; align-items: center; gap: 10px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); box-shadow: 0 0 0 0 var(--leaf); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--leaf) 60%, transparent); } 70%,100% { box-shadow: 0 0 0 10px transparent; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--leaf);
  color: var(--ink);
  font: 600 0.95rem/1 var(--f-body);
  text-decoration: none;
  border: 1px solid var(--leaf);
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--mist); border-color: var(--mist); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--deep); color: var(--text); border-color: var(--sage); }
.btn-light { background: var(--mist); border-color: var(--mist); }
.btn-light:hover { background: var(--leaf); border-color: var(--leaf); }
.btn-small { padding: 10px 16px; font-size: 0.85rem; }

/* Top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gutter) 14px;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.topbar.scrolled { border-color: var(--line); }
.mark { font: 900 1.25rem/1 var(--f-display); font-stretch: 120%; text-decoration: none; letter-spacing: -0.02em; }
.mark span { color: var(--leaf); }
.nav { display: flex; gap: 28px; }
.nav a { text-decoration: none; font-size: 0.92rem; color: var(--muted); transition: color .2s; }
.nav a:hover { color: var(--text); }

main { overflow-x: clip; }
main > section { padding-inline: var(--gutter); }
.section { max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-block: clamp(72px, 10vw, 140px); }
.section-head { display: grid; gap: 18px; margin-bottom: 40px; max-width: 900px; }
.section-sub { color: var(--muted); max-width: 62ch; }

@keyframes heroImg { from { opacity: 0; transform: scale(1.06); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.char { display: inline-block; animation: charRise .9s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 45ms + 250ms); }
@keyframes charRise { from { transform: translateY(110%) rotate(6deg); opacity: 0; } to { transform: none; opacity: 1; } }

.hero-role .role { animation: fadeUp .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 140ms + 750ms); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Words in section headings rise in when they scroll into view */
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.word > span { display: inline-block; }
.split-pending .word > span { transform: translateY(105%); }
.split-in .word > span { animation: wordRise .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 55ms); }
@keyframes wordRise { from { transform: translateY(105%); } to { transform: none; } }
/* Hero option B: poster layout. Photo fills the frame, roles sit on the empty green
   on the left, and the name runs as one huge line across the dark shirt at the bottom. */
.hero-b {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(620px, 94svh, 900px);
  display: grid; grid-template-rows: 1fr auto auto; gap: 18px;
  padding-block: 112px 28px;
  padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2)) !important;
}
.hb-media { position: absolute; inset: 0; z-index: -1; margin: 0; animation: heroImg 1.8s cubic-bezier(.2,.8,.2,1) both; }
.hb-media img { width: 100%; height: 100%; object-fit: cover; object-position: 16% 18%; }
.hb-media::after {   /* darken the bottom for the name, and the far left for the roles */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--ink) 0%, color-mix(in srgb, var(--ink) 55%, transparent) 30%, transparent 58%),
    linear-gradient(to right, color-mix(in srgb, var(--ink) 55%, transparent), transparent 42%);
}

.hb-top { align-self: center; display: grid; gap: 22px; max-width: min(30%, 400px); min-width: 0; }
.hero-b .eyebrow { animation: fadeUp .7s .1s both; }
.hb-roles { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.hb-roles .role {
  font: 600 clamp(1.15rem, 1.8vw, 1.6rem)/1.15 var(--f-display); letter-spacing: -0.01em;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.hb-roles .role::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--leaf); flex-shrink: 0; }
.hb-lede { color: var(--muted); font-size: 0.98rem; max-width: 38ch; animation: fadeUp .9s 1.2s cubic-bezier(.2,.8,.2,1) both; }

.hb-name {
  font-size: clamp(3.2rem, 10.6vw, 12.5rem);
  font-weight: 800; line-height: 0.86; letter-spacing: -0.04em; text-transform: uppercase;
  white-space: nowrap; margin-left: -0.04em;
}
.hb-name .line { display: inline-block; overflow: hidden; padding: 0.03em 0 0.07em; vertical-align: bottom; }
.hb-name .accent { color: var(--leaf); }

.hb-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  padding-top: 18px; border-top: 1px solid var(--line);
  animation: fadeUp .9s 1.35s cubic-bezier(.2,.8,.2,1) both;
}
.hb-loc { color: var(--sage); }
.hb-ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.hb-scroll { color: var(--sage); text-decoration: none; display: inline-flex; gap: 8px; }
.hb-scroll span { display: inline-block; animation: nudge 1.8s ease-in-out infinite; }
.hb-scroll:hover { color: var(--leaf); }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(5px); } }

/* Clients marquee */
.clients { padding-block: 26px; border-block: 1px solid var(--line); background: var(--deep); }
.marquee { display: flex; overflow: hidden; mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { list-style: none; margin: 0; padding: 0; display: flex; flex-shrink: 0; gap: 56px; padding-right: 56px; animation: scroll 38s linear infinite; }
.marquee-track li { font: 800 clamp(1.4rem, 2.6vw, 2.1rem)/1 var(--f-display); font-stretch: 110%; white-space: nowrap; color: var(--sage); letter-spacing: -0.01em; }
.marquee-track li:nth-child(even) { color: var(--leaf); } /* alternate two greens: sage / leaf */
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-100%); } }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip {
  font: 500 0.88rem/1 var(--f-body); color: var(--muted);
  padding: 11px 18px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line); cursor: pointer;
  transition: all .2s;
}
.chip:hover { color: var(--text); border-color: var(--sage); }
.chip.is-active { background: var(--mist); color: var(--ink); border-color: var(--mist); }

/* Work grid */
.grid { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-flow: dense; gap: 16px; }
.card {
  grid-column: span 2; position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--deep); cursor: pointer; border: 0; padding: 0; text-align: left; color: inherit;
  aspect-ratio: 4 / 5; font: inherit;
}
.card.wide { grid-column: span 4; aspect-ratio: auto; min-height: 320px; } /* stretches to its row partner */
.card.half { grid-column: span 3; aspect-ratio: 4 / 3; }
.card-media { position: absolute; inset: 0; }
.card-media img {   /* stacked shots cross-fade; the active one drifts slowly (Ken Burns) */
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.0);
  transition: opacity 1.2s ease, transform 6s cubic-bezier(.2,.6,.3,1);
}
.card-media img.is-active { opacity: 1; transform: scale(1.06); }
.card-bars { position: absolute; z-index: 2; top: 14px; left: 16px; right: 16px; display: flex; gap: 5px; pointer-events: none; }
.card-bars i { flex: 1; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--mist) 28%, transparent); transition: background .4s; }
.card-bars i.is-active { background: var(--leaf); }
.card-info {
  position: absolute; inset: auto 0 0 0; padding: 60px 20px 18px;
  background: linear-gradient(to top, color-mix(in srgb, var(--ink) 92%, transparent), transparent);
  display: flex; justify-content: space-between; align-items: end; gap: 12px;
}
.card-title { font: 800 1.35rem/1.1 var(--f-display); font-stretch: 110%; letter-spacing: -0.01em; }
.card-meta { color: var(--sage); margin-top: 6px; display: block; }
.card-count {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: var(--leaf); color: var(--ink);
  font: 600 0.8rem/1 var(--f-mono); transform: scale(.85); opacity: .9; transition: transform .3s;
}
.card:hover .card-count { transform: scale(1); opacity: 1; }
.card.is-hidden { display: none; }

/* Process / compare */
.process { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.process-copy { display: grid; gap: 18px; min-width: 0; }
.process-copy > p:not(.eyebrow) { max-width: 52ch; }
.spec { margin: 10px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.spec div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.spec dt { color: var(--sage); }
.spec dd { margin: 0; text-align: right; }

.compare { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 949 / 663; user-select: none; background: var(--deep); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: var(--mist); transform: translateX(-1px); pointer-events: none;
}
.compare-handle::after {
  content: "◂ ▸"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%; background: var(--mist); color: var(--ink);
  display: grid; place-items: center; font-size: 0.8rem; letter-spacing: 2px; box-shadow: 0 8px 30px rgb(0 0 0 / .4);
}
.compare-tag { position: absolute; top: 14px; padding: 6px 10px; border-radius: 6px; background: color-mix(in srgb, var(--ink) 70%, transparent); color: var(--mist); pointer-events: none; }
.tag-l { left: 14px; } .tag-r { right: 14px; }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare:has(input:focus-visible) { outline: 2px solid var(--leaf); outline-offset: 4px; }

/* Manipulation */
.manip { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.manip-item { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--deep); cursor: pointer; }
.manip-item:nth-child(2) { grid-row: span 2; }
.manip-item:nth-child(4) { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
.manip-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.manip-item:hover img { transform: scale(1.04); }
.manip-item figcaption {
  position: absolute; inset: auto 0 0 0; padding: 60px 20px 18px; display: grid; gap: 2px;
  background: linear-gradient(to top, color-mix(in srgb, var(--ink) 90%, transparent), transparent);
}
.manip-item strong { font: 800 1.3rem/1.1 var(--f-display); font-stretch: 110%; }
.manip-item span { color: var(--muted); font-size: 0.92rem; }

/* Videos: column widths follow each video's aspect ratio, so every card shares one height */
.video-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; } /* four reels in a row, the wide film underneath */
.video {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden; text-decoration: none;
  background: radial-gradient(120% 90% at 30% 20%, var(--green), var(--teal) 50%, var(--deep));
  aspect-ratio: 9 / 16;
}
.video.landscape { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
.video.landscape img { object-position: center 22%; }
.video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2,.8,.2,1), opacity .4s; }
.video:hover img { transform: scale(1.05); }
.video img.failed { opacity: 0; }
.video::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--ink) 92%, transparent), transparent 45%);
}
.play {
  position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.92);
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--mist) 22%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--mist) 45%, transparent);
  transition: transform .3s, background .3s;
}
.play::before { content: ""; margin-left: 5px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent var(--mist); }
.video:hover .play { transform: translate(-50%, -50%) scale(1); background: var(--leaf); border-color: var(--leaf); }
.video:hover .play::before { border-left-color: var(--ink); }
.video-info { position: absolute; z-index: 2; inset: auto 0 0 0; padding: 22px; display: grid; gap: 6px; }
.video-title { font: 800 clamp(1.2rem, 1.8vw, 1.6rem)/1.1 var(--f-display); color: var(--mist); }
.video-tag { color: var(--leaf); font-size: 0.72rem; }

/* About */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.about-intro { display: grid; gap: 22px; position: sticky; top: 110px; min-width: 0; }
.about-intro h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); }
.about-intro p:not(.eyebrow) { color: var(--muted); max-width: 58ch; }
.skills { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.skills li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap;
  padding: 22px 0; border-bottom: 1px solid var(--line); transition: padding .3s, color .3s;
}
.skills li:hover { padding-left: 12px; }
.skills li:hover .skill-name { color: var(--leaf); }
.skill-name { font: 700 clamp(1.2rem, 2vw, 1.55rem)/1.15 var(--f-display); font-stretch: 108%; transition: color .3s; }
.skill-desc { color: var(--muted); font-size: 0.92rem; }

/* Tools */
.tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.tool {
  display: grid; gap: 6px; align-content: start; padding: 26px 22px 24px; border-radius: var(--radius);
  background: linear-gradient(160deg, color-mix(in srgb, var(--deep) 100%, transparent), color-mix(in srgb, var(--teal) 30%, var(--ink)));
  border: 1px solid var(--line); transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .35s;
}
.tool:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--leaf) 55%, transparent); }
.tool img { width: 56px; height: 56px; object-fit: contain; margin-bottom: 14px; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.tool:hover img { transform: rotate(-6deg) scale(1.08); }
.tool-name { font: 700 1.2rem/1.15 var(--f-display); }
.tool-use { color: var(--muted); font-size: 0.88rem; line-height: 1.45; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.timeline li {
  display: grid; grid-template-columns: 90px 1.2fr 1fr 110px; align-items: center; gap: 20px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.t-year { color: var(--leaf); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.t-co { font: 800 clamp(1.3rem, 2.6vw, 2rem)/1.1 var(--f-display); font-stretch: 112%; letter-spacing: -0.01em; }
.t-role { color: var(--muted); }
.t-loc { color: var(--sage); text-align: right; }

/* Contact */
.contact { max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-block: clamp(80px, 12vw, 160px); display: grid; gap: 28px; }
.contact h2 { font-size: clamp(2.6rem, 8vw, 7rem); font-weight: 900; font-stretch: 122%; line-height: 0.92; letter-spacing: -0.04em; }
.contact h2 em { font-style: normal; color: var(--leaf); }
.contact-rows { display: grid; border-top: 1px solid var(--line); margin-top: 20px; }
.contact-row {
  display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 20px;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.contact-row .mono { color: var(--sage); }
.contact-row a { font: 600 clamp(1.05rem, 2.4vw, 1.6rem)/1.2 var(--f-body); text-decoration: none; overflow-wrap: anywhere; min-width: 0; }
.contact-row a:hover { color: var(--leaf); }
/* Contact: form on the left, direct channels on the right */
.contact-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(28px, 5vw, 72px); align-items: start; margin-top: 20px; }
.contact-grid .contact-rows { margin-top: 0; }
.contact-grid .contact-row { grid-template-columns: 96px minmax(0, 1fr) auto; }
.contact-grid .contact-row a { font-size: clamp(0.95rem, 1.25vw, 1.15rem); }

.contact-form {
  display: grid; gap: 18px; padding: clamp(20px, 3vw, 32px); border-radius: calc(var(--radius) * 1.2);
  background: linear-gradient(160deg, var(--deep), color-mix(in srgb, var(--teal) 28%, var(--ink)));
  border: 1px solid var(--line); min-width: 0;
}
.form-title { font: 700 1.35rem/1.2 var(--f-display); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field label, .field .label { font: 500 0.78rem/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sage); }
.field input, .field textarea {
  width: 100%; font: 400 1rem/1.5 var(--f-body); color: var(--text);
  background: color-mix(in srgb, var(--ink) 70%, transparent); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 14px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--mist) 35%, transparent); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px color-mix(in srgb, var(--leaf) 22%, transparent); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #e0795f; }

.type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.type-chips label { position: relative; cursor: pointer; }
.type-chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.type-chips span {
  display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line);
  font: 500 0.85rem/1 var(--f-body); color: var(--muted); transition: all .2s;
}
.type-chips label:hover span { color: var(--text); border-color: var(--sage); }
.type-chips input:checked + span { background: var(--leaf); border-color: var(--leaf); color: var(--ink); }
.type-chips input:focus-visible + span { outline: 2px solid var(--leaf); outline-offset: 2px; }

.form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-foot .btn { border: 0; cursor: pointer; }
.form-foot .btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.form-status { font-size: 0.92rem; color: var(--muted); }
.form-status.ok { color: var(--leaf); }
.form-status.err { color: #e0795f; }
.copy {
  font: 500 0.8rem/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase;
  background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; cursor: pointer;
}
.copy:hover { border-color: var(--leaf); color: var(--leaf); }

.footer {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem;
}
.footer a { text-decoration: none; }
.socials { display: flex; flex-wrap: wrap; gap: 18px; }
.footer a:hover { color: var(--leaf); }

/* Project viewer: full-screen gallery — big stage, arrows, thumbnails */
.viewer {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: color-mix(in srgb, var(--ink) 97%, transparent); color: var(--text); overflow: hidden;
}
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: vwIn .35s ease both; }
.viewer::backdrop { background: rgb(2 8 9 / .7); }
@keyframes vwIn { from { opacity: 0; } to { opacity: 1; } }

.vw-top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) var(--gutter) 14px;
}
.vw-heading { min-width: 0; }
.vw-meta { color: var(--leaf); margin-bottom: 4px; }
.vw-top h3 { font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-actions { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.vw-count { color: var(--sage); font-variant-numeric: tabular-nums; }
.viewer-close {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--deep); color: var(--text);
  font-size: 1rem; cursor: pointer; transition: border-color .2s, color .2s, transform .3s;
}
.viewer-close:hover { border-color: var(--leaf); color: var(--leaf); transform: rotate(90deg); }

.vw-stage { --px: clamp(16px, 7vw, 110px); position: relative; min-height: 0; overflow: hidden; }
.vw-stage img {   /* fills the stage; drop-shadow follows the visible picture, not the letterbox */
  position: absolute; top: 8px; left: var(--px); width: calc(100% - 2 * var(--px)); height: calc(100% - 16px); object-fit: contain;
  filter: drop-shadow(0 30px 60px rgb(0 0 0 / .55)); user-select: none;
}
.vw-stage img.enter-next { animation: slideInR .55s cubic-bezier(.2,.8,.2,1) both; }
.vw-stage img.enter-prev { animation: slideInL .55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes slideInR { from { opacity: 0; transform: translateX(40px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slideInL { from { opacity: 0; transform: translateX(-40px) scale(.98); } to { opacity: 1; transform: none; } }
.vw-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: color-mix(in srgb, var(--deep) 85%, transparent); color: var(--mist);
  border: 1px solid var(--line); backdrop-filter: blur(8px); transition: background .2s, color .2s, border-color .2s;
}
.vw-nav:hover { background: var(--leaf); border-color: var(--leaf); color: var(--ink); }
.vw-prev { left: clamp(10px, 2vw, 32px); }
.vw-next { right: clamp(10px, 2vw, 32px); }

.vw-bottom {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "thumbs thumbs" "desc next";
  gap: 14px 24px; align-items: center;
  padding: 10px var(--gutter) calc(18px + env(safe-area-inset-bottom, 0px));
}
.vw-thumbs { grid-area: thumbs; display: flex; gap: 8px; justify-content: center; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
.vw-thumbs::-webkit-scrollbar { display: none; }
.vw-thumbs button {
  flex: 0 0 auto; height: 58px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  background: var(--deep); cursor: pointer; opacity: .45; transition: opacity .25s, border-color .25s, transform .25s;
}
.vw-thumbs button:hover { opacity: .85; }
.vw-thumbs button.is-active { opacity: 1; border-color: var(--leaf); transform: translateY(-2px); }
.vw-thumbs img { height: 100%; width: auto; display: block; }
.vw-desc { grid-area: desc; color: var(--muted); font-size: 0.95rem; max-width: 80ch; }
.vw-nextproj {
  grid-area: next; background: transparent; border: 0; color: var(--sage); cursor: pointer;
  font: 500 0.9rem/1.2 var(--f-body); white-space: nowrap; padding: 8px 0;
}
.vw-nextproj span { color: var(--mist); font-weight: 600; }
.vw-nextproj:hover, .vw-nextproj:hover span { color: var(--leaf); }
.viewer.single .vw-nav, .viewer.single .vw-thumbs, .viewer.single .vw-count { display: none; }
body.locked { overflow: hidden; }

/* Scroll reveal (only applied to elements that start below the fold) */
.pending { opacity: 0; transform: translateY(28px); }
.revealed { opacity: 1; transform: none; transition: opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1); }

/* Responsive */
@media (max-width: 1024px) {
  .contact-grid { grid-template-columns: 1fr; }
  .tool { padding: 22px 16px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .card, .card.half { grid-column: span 2; aspect-ratio: 4 / 5; }
  .card.wide { grid-column: span 4; aspect-ratio: 16 / 9; }
  .process, .about { grid-template-columns: 1fr; }
  /* swipeable strip on tablets and phones */
  .video-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; scrollbar-width: thin; }
  .video { flex: 0 0 auto; height: 520px; aspect-ratio: 9 / 16; scroll-snap-align: start; }
  .video.landscape { aspect-ratio: 16 / 9; }
  .about-intro { position: static; }
}
@media (max-width: 820px) {
  .contact-grid .contact-row { grid-template-columns: minmax(0, 1fr) auto; }
  .nav { display: none; }
  .hero-b { min-height: 0; padding-top: 62px; display: flex; flex-direction: column; gap: 22px; }
  .hb-media { position: relative; order: -1; margin: 0 calc(-1 * var(--gutter)); aspect-ratio: 4 / 3.6; }
  .hb-media img { object-position: 58% 15%; }
  .hb-media::after { background: linear-gradient(to top, var(--ink) 0%, transparent 45%); }
  .hb-name { order: 0; margin-top: -26%; white-space: normal; font-size: clamp(3.2rem, 17vw, 6rem); }
  .hb-name .line { display: block; }
  .hb-top { order: 1; max-width: none; }
  .hb-top .eyebrow { order: -1; }
  .hb-bottom { order: 2; }
  .hb-scroll { display: none; }
  .tools { grid-template-columns: repeat(2, 1fr); }
  .tool:last-child { grid-column: 1 / -1; }
  .manip { grid-template-columns: 1fr; }
  .manip-item:nth-child(2) { grid-row: auto; }
  .timeline li { grid-template-columns: 64px 1fr auto; }
  .t-role { grid-column: 2 / 4; grid-row: 2; margin-top: -12px; }
  .contact-row { grid-template-columns: 1fr auto; }
  .contact-row .mono { grid-column: 1 / -1; }
  .vw-stage { --px: 12px; }
  .vw-nav { width: 44px; height: 44px; top: auto; bottom: 14px; transform: none; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .card, .card.half, .card.wide { grid-column: auto; aspect-ratio: 4 / 4.4; }
  .card.wide { aspect-ratio: 4 / 3; }
  .vw-bottom { grid-template-columns: 1fr; grid-template-areas: "thumbs" "desc" "next"; gap: 10px; }
  .vw-desc { font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .vw-thumbs { justify-content: flex-start; }
  .vw-thumbs button { height: 48px; }
  .vw-behance { display: none; }
  .video { height: 470px; }
  .video.landscape { height: 470px; aspect-ratio: 4 / 5; } /* landscape gets cropped to fit the strip on phones */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .split-pending .word > span { transform: none; }
  html { scroll-behavior: auto; }
  .pending { opacity: 1; transform: none; }
}