/* ==========================================================================
   Frame & Flow by Sharon: main stylesheet
   Desktop-first, responsive down to 320px.
   Edit the colours / glass look in the :root block below; everything uses it.
   ========================================================================== */

:root {
  /* Palette taken from the reference (near-black, deep navy glow, red accent) */
  --bg: #04060a;
  --bg-2: #070b12;
  --navy: #0a2a4a;
  --blue: #1b8bd6;
  --blue-glow: rgba(27, 139, 214, 0.55);
  --pill: #bfe3f7;          /* pale-blue pill (active nav, tags) */
  --pill-ink: #07131f;
  --red: #b3122b;           /* accent, the red shape behind the portrait */
  --red-soft: rgba(179, 18, 43, 0.35);
  --text: #d8dde2;          /* light grey headline type */
  --text-dim: #9aa5b1;
  --text-faint: #66707c;
  --violet: #b14cff;        /* gradient CTA */
  --pink: #ff4fa3;

  /* Black glass */
  --glass: rgba(10, 14, 20, 0.55);
  --glass-strong: rgba(6, 9, 14, 0.78);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-highlight: rgba(255, 255, 255, 0.06);
  --blur: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);

  --radius: 22px;
  --radius-sm: 14px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;

  --font-display: "Archivo", "Archivo Black", "Arial Black", Impact, sans-serif;
  --font-title: "Bebas Neue", "Oswald", Impact, sans-serif;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--pill); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Page background: soft navy glows like the reference */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 50% at 100% 0%, rgba(10, 74, 128, 0.45), transparent 70%),
    radial-gradient(50% 45% at 0% 100%, rgba(10, 42, 74, 0.55), transparent 70%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
.cursor-glow {
  position: fixed; left: 0; top: 0; z-index: -1; pointer-events: none;
  width: 520px; height: 520px; margin: -260px 0 0 -260px;
  background: radial-gradient(circle, rgba(27, 139, 214, 0.16), transparent 65%);
  opacity: 0; transition: opacity 0.4s;
  will-change: transform;
}
.cursor-glow.on { opacity: 1; }

/* ---------- Glass ---------- */
.glass {
  background: linear-gradient(145deg, var(--glass-highlight), transparent 40%), var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-strong); }
}

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
section { position: relative; padding-block: clamp(72px, 10vw, 140px); scroll-margin-top: 20px; }

.section-title {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text);
}
.section-sub { color: var(--text-dim); margin-top: 10px; max-width: 56ch; }
.eyebrow {
  display: inline-block; font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--pill); margin-bottom: 14px;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 30px; border-radius: 999px;
  font-weight: 700; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, filter 0.3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-grad {
  position: relative; color: #fff; isolation: isolate;
  background: linear-gradient(#05070c, #05070c) padding-box, linear-gradient(100deg, #4b3bff, var(--violet) 50%, var(--pink)) border-box;
  border: 2px solid transparent;
}
.btn-grad::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: linear-gradient(100deg, rgba(75, 59, 255, 0.0), rgba(177, 76, 255, 0.55) 60%, rgba(255, 79, 163, 0.75));
  opacity: 0.9; transition: opacity 0.3s;
}
.btn-grad:hover { box-shadow: 0 10px 40px rgba(177, 76, 255, 0.4); }
.btn-pill { background: var(--pill); color: var(--pill-ink); }
.btn-pill:hover { box-shadow: 0 10px 34px rgba(191, 227, 247, 0.28); }
.btn-ghost { border: 1px solid var(--glass-border); background: var(--glass); }

/* ==========================================================================
   Splash
   ========================================================================== */
#splash {
  position: fixed; inset: 0; z-index: 1000; overflow: hidden;
  background: #020306;
  display: grid; place-items: center; text-align: center;
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s var(--ease), opacity 0.6s ease 0.6s;
}
#splash.leave { clip-path: inset(0 0 100% 0); opacity: 0; pointer-events: none; }
.splash-glow {
  position: absolute; inset: -20%; z-index: 0;
  background:
    radial-gradient(40% 40% at 50% 46%, rgba(27, 139, 214, 0.35), transparent 70%),
    radial-gradient(30% 30% at 85% 10%, rgba(179, 18, 43, 0.22), transparent 70%),
    radial-gradient(35% 35% at 10% 90%, rgba(10, 74, 128, 0.35), transparent 70%);
  animation: glowDrift 9s ease-in-out infinite alternate;
}
@keyframes glowDrift { to { transform: translate3d(2%, -3%, 0) scale(1.08); } }

.film { position: absolute; top: 0; bottom: 0; width: clamp(34px, 6vw, 64px); z-index: 1; overflow: hidden; opacity: 0; animation: fadeIn 1.2s ease 0.3s forwards; }
.film.l { left: clamp(8px, 3vw, 40px); } .film.r { right: clamp(8px, 3vw, 40px); }
.film::before {
  content: ""; position: absolute; left: 0; right: 0; top: -200px; bottom: -200px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    repeating-linear-gradient(180deg, transparent 0 18px, rgba(255,255,255,0.16) 18px 34px);
  -webkit-mask: linear-gradient(90deg, #000 0 22%, transparent 22% 78%, #000 78%);
  mask: linear-gradient(90deg, #000 0 22%, transparent 22% 78%, #000 78%);
  animation: filmRoll 4s linear infinite;
}
.film.r::before { animation-direction: reverse; }
@keyframes filmRoll { to { transform: translateY(52px); } }

.splash-stage { position: relative; z-index: 2; display: grid; justify-items: center; gap: 18px; padding: 24px; }
@keyframes logoIn { to { opacity: 1; transform: none; } }
.splash-brand {
  font-family: var(--font-display); text-transform: uppercase; line-height: 0.95;
  font-size: clamp(2.2rem, 8vw, 5.6rem); color: var(--text); letter-spacing: 0.01em;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0 0.25em;
}
.splash-brand .ch { display: inline-block; opacity: 0; transform: translateY(0.6em); filter: blur(8px); animation: chIn 0.9s var(--ease) forwards; animation-delay: calc(1.6s + var(--i) * 0.06s); }
@keyframes chIn { to { opacity: 1; transform: none; filter: blur(0); } }
.splash-by { font-family: var(--font-title); font-size: clamp(1.3rem, 3vw, 2rem); letter-spacing: 0.3em; text-transform: uppercase; color: var(--pill); opacity: 0; animation: fadeUp 0.9s var(--ease) 3.1s forwards; }
.splash-tag { display: flex; align-items: center; gap: 12px; font-size: clamp(0.62rem, 1.6vw, 0.78rem); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); opacity: 0; animation: fadeUp 0.9s var(--ease) 3.8s forwards; }
.splash-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--red); animation: rec 1.2s steps(2, jump-none) infinite; }
@keyframes rec { 50% { opacity: 0.2; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { to { opacity: 1; } }

.splash-meter { margin-top: 18px; width: min(360px, 78vw); display: grid; gap: 10px; opacity: 0; animation: fadeIn 0.8s ease 1s forwards; transition: opacity 0.5s, transform 0.5s; }
.splash-meter.done { opacity: 0 !important; transform: translateY(-8px); height: 0; margin: 0; overflow: hidden; }
.meter-row { display: flex; justify-content: space-between; font-size: 0.68rem; letter-spacing: 0.2em; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.meter-bar { height: 2px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; overflow: hidden; }
.meter-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--pill)); box-shadow: 0 0 14px var(--blue); }

.splash-start { margin-top: 6px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.splash-start.ready { opacity: 1; pointer-events: auto; transform: none; }
.splash-start .btn { min-width: 190px; }
.splash-start .btn::after { content: ""; width: 0; height: 0; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.splash-skip { position: absolute; top: 18px; right: 22px; z-index: 3; font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint); opacity: 0; animation: fadeIn 0.6s ease 1.2s forwards; padding: 10px 6px; }
.splash-skip:hover { color: var(--text); }

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header { position: fixed; inset: 18px 0 auto 0; z-index: 90; pointer-events: none; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-inner > * { pointer-events: auto; }
.brand-mark { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; }
.brand-mark .memoji { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 30%, #12395e, #060b12); }
.nav-pill { display: flex; gap: 4px; padding: 6px; border-radius: 999px; }
.nav-pill a { padding: 9px 20px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); transition: color 0.25s, background 0.25s; }
.nav-pill a:hover { color: var(--text); }
.nav-pill a.active { background: var(--pill); color: var(--pill-ink); }
.header-cta { padding: 0 22px; min-height: 44px; font-size: 0.72rem; }
.menu-btn { display: none; width: 52px; height: 52px; border-radius: 16px; place-items: center; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s, background 0.3s; content: ""; position: relative; }
.menu-btn span::before { position: absolute; top: -6px; } .menu-btn span::after { position: absolute; top: 6px; }
.menu-btn[aria-expanded="true"] span { background: transparent; }
.menu-btn[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { min-height: 100svh; padding: 110px 0 0; display: flex; align-items: stretch; overflow: hidden; }
.hero .container { position: relative; display: flex; flex-direction: column; flex: 1; }
.hero-title {
  position: relative; z-index: 1;
  font-family: var(--font-display); font-weight: 900; font-stretch: 125%; text-transform: uppercase; color: var(--text);
  font-size: clamp(2.9rem, 8.4vw, 7.2rem); line-height: 0.92; letter-spacing: -0.01em;
  text-align: center; margin-top: clamp(10px, 4vh, 40px);
  background: linear-gradient(180deg, #eef1f4 10%, #b9c0c8 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .word { display: inline-block; transform: translateY(105%); transition: transform 1.2s var(--ease); transition-delay: var(--d, 0s); }
.loaded .hero-title .word { transform: none; }
@media (min-width: 761px) { .hero-title { white-space: nowrap; } .hero-title .line { display: inline-block; } .hero-title .line + .line { margin-left: 0.22em; } }

.hero-stage { position: relative; flex: 1; display: grid; grid-template-columns: 1fr minmax(260px, 420px) 1fr; align-items: end; gap: 24px; margin-top: -4vw; }
.hero-copy { align-self: center; padding-bottom: 8vh; max-width: 330px; position: relative; z-index: 3; }
.hero-role { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text); line-height: 1.8; }
.hero-intro { margin-top: 14px; color: var(--text-dim); font-size: 0.94rem; }
.hero-cta { align-self: center; justify-self: end; padding-bottom: 8vh; position: relative; z-index: 3; }

.hero-portrait { position: relative; z-index: 2; align-self: end; display: grid; place-items: end center; min-height: 52vh; }
.hero-portrait .cutout { display: none; width: 100%; max-height: 74vh; object-fit: contain; object-position: bottom; }
/* Fallback until a transparent cut-out exists: arch frame with the red shape behind it */
.hero-portrait .arch-wrap { position: relative; width: min(100%, 380px); margin-bottom: 0; }
.hero-portrait .arch-red { position: absolute; inset: 6% -10% 0 10%; background: var(--red); border-radius: 999px 999px 0 0; transform: translateX(8%); opacity: 0.92; }
.hero-portrait .arch { position: relative; aspect-ratio: 4 / 5; border-radius: 999px 999px 0 0; overflow: hidden; border: 1px solid var(--glass-border); background: #1a0f0b; }
.hero-portrait .arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.hero-portrait .arch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(4, 6, 10, 0.9)); }
.hero-portrait.has-cutout .cutout { display: block; }
.hero-portrait.has-cutout .arch-wrap { display: none; }
.hero-portrait .shadow-glow { position: absolute; inset: auto -20% -10% -20%; height: 60%; background: radial-gradient(50% 60% at 50% 100%, var(--blue-glow), transparent 70%); z-index: -1; }
.hero-portrait { transform: translateY(40px); opacity: 0; transition: transform 1.4s var(--ease) 0.5s, opacity 1.2s ease 0.5s; }
.loaded .hero-portrait { transform: translate3d(var(--px, 0), 0, 0); opacity: 1; }

.hero-copy, .hero-cta { opacity: 0; transform: translateY(18px); transition: opacity 1s ease 0.9s, transform 1s var(--ease) 0.9s; }
.loaded .hero-copy, .loaded .hero-cta { opacity: 1; transform: none; }
.scroll-hint { position: absolute; left: var(--gutter); bottom: 18px; z-index: 4; font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--text-faint); display: grid; justify-items: center; gap: 8px; }
.scroll-hint::after { content: ""; width: 1px; height: 28px; background: linear-gradient(var(--pill), transparent); animation: drip 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ==========================================================================
   About / Specialities / Software
   ========================================================================== */
.about-grid { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.about-photo { position: sticky; top: 90px; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; isolation: isolate; border: 1px solid var(--glass-border); }
.about-photo::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(70% 55% at 50% 60%, rgba(27, 139, 214, 0.55), transparent 70%); mix-blend-mode: screen; pointer-events: none; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.about-photo .hello { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 16px; padding: 14px 18px; border-radius: 16px; font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); }
.about-photo .hello b { display: block; font-family: var(--font-title); font-weight: 400; letter-spacing: 0.06em; font-size: 1.6rem; color: var(--text); line-height: 1.1; }
.about-copy { display: grid; gap: 38px; }
.about-text p { color: var(--text-dim); font-size: 1.02rem; margin-top: 16px; max-width: 64ch; }
.about-text p:last-child { color: var(--text); font-weight: 600; }

.spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.spec-card { padding: 26px 26px 22px; }
.spec-card h3 { font-family: var(--font-title); font-weight: 400; letter-spacing: 0.05em; font-size: 1.7rem; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.spec-card h3 em { font-style: normal; font-size: 0.78rem; color: var(--pill-ink); background: var(--pill); border-radius: 999px; padding: 2px 10px; letter-spacing: 0.1em; font-family: var(--font-body); font-weight: 700; }
.spec-card ul { margin-top: 12px; display: grid; gap: 8px; }
.spec-card li { position: relative; padding-left: 18px; color: var(--text-dim); font-size: 0.94rem; }
.spec-card li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 10px var(--blue); }

/* Software skills: icon row styled like the reference (rounded tiles, tight gap) */
.skills-title { font-family: var(--font-title); font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: 0.04em; text-transform: uppercase; }
.skills-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.skill { position: relative; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; overflow: visible; transition: transform 0.35s var(--ease); cursor: default; }
.skill:hover, .skill:focus-visible, .skill.open { transform: translateY(-6px) scale(1.06); }
.skill > svg, .skill > img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.skill .tip { position: absolute; left: 50%; bottom: calc(100% + 12px); translate: -50% 6px; width: max-content; max-width: 230px; padding: 10px 14px; border-radius: 12px; font-size: 0.74rem; line-height: 1.4; text-align: center; color: var(--text-dim); opacity: 0; pointer-events: none; transition: opacity 0.25s, translate 0.25s var(--ease); z-index: 5; }
.skill .tip b { display: block; color: var(--text); font-size: 0.8rem; margin-bottom: 2px; }
.skill:hover .tip, .skill:focus-visible .tip, .skill.open .tip { opacity: 1; translate: -50% 0; }

/* ==========================================================================
   Customers
   ========================================================================== */
.customers-wrap { padding: clamp(28px, 4vw, 56px); text-align: center; }
.customers-wrap .section-title { text-align: center; }
.customers-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 34px; }
.customer { display: flex; align-items: center; justify-content: center; height: 76px; min-width: 168px; padding: 0 28px; border-radius: 18px; transition: transform 0.35s var(--ease), border-color 0.3s; }
.customer:hover { transform: translateY(-4px); border-color: rgba(191, 227, 247, 0.35); }
.customer img { max-height: 38px; max-width: 150px; width: auto; object-fit: contain; filter: grayscale(1) brightness(1.6); opacity: 0.85; transition: filter 0.3s, opacity 0.3s; }
.customer:hover img { filter: none; opacity: 1; }
.customer .wordmark { font-family: var(--font-display); text-transform: uppercase; font-size: 0.92rem; letter-spacing: 0.08em; color: var(--text-dim); white-space: nowrap; }
.customer:hover .wordmark { color: var(--text); }

/* ==========================================================================
   Projects
   ========================================================================== */
.projects-head { text-align: center; margin-bottom: clamp(32px, 5vw, 60px); }
.projects-head .section-sub { margin-inline: auto; }
.projects-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(120px, 14vw, 190px); grid-auto-flow: dense; gap: 14px; }
.tile { position: relative; grid-column: span 2; grid-row: span 2; border-radius: 18px; overflow: hidden; isolation: isolate; text-align: left; background: #0a0f16; border: 1px solid var(--glass-border); cursor: pointer; transition: transform 0.5s var(--ease), border-color 0.3s, box-shadow 0.5s; }
.tile.portrait { grid-column: span 1; grid-row: span 3; }
.tile.wide { grid-column: span 2; grid-row: span 2; }
.tile:hover, .tile:focus-visible { transform: translateY(-6px) scale(1.012); border-color: rgba(191, 227, 247, 0.4); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(27, 139, 214, 0.18); }
.tile video, .tile .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transition: transform 0.8s var(--ease), opacity 0.5s; }
.tile .poster { background: radial-gradient(80% 80% at 30% 20%, rgba(27, 139, 214, 0.35), transparent 70%), radial-gradient(60% 60% at 90% 100%, var(--red-soft), transparent 70%), #0a0f16; }
.tile:hover video, .tile:hover .poster { transform: scale(1.06); }
.tile::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, transparent 45%, rgba(2, 4, 8, 0.92)); }
.tile .meta { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 16px 18px 16px; display: grid; gap: 6px; }
.tile .brand { justify-self: start; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--pill); color: var(--pill-ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .name { font-family: var(--font-title); font-size: clamp(1.15rem, 2vw, 1.55rem); line-height: 1.05; letter-spacing: 0.03em; text-transform: uppercase; }
.tile .play { position: absolute; z-index: 2; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; opacity: 0; transform: scale(0.8); transition: opacity 0.3s, transform 0.4s var(--ease); background: rgba(6, 9, 14, 0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); }
.tile .play::before { content: ""; margin-left: 3px; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.tile:hover .play, .tile:focus-visible .play { opacity: 1; transform: none; }
.tile .soon { position: absolute; z-index: 2; top: 14px; left: 14px; font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); border: 1px dashed var(--glass-border); padding: 3px 10px; border-radius: 999px; }
.empty-note { grid-column: 1 / -1; text-align: center; color: var(--text-dim); padding: 60px 0; }

/* Full-screen player */
.player { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: clamp(10px, 3vw, 40px); background: rgba(2, 3, 6, 0.82); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0.35s; }
.player.open { opacity: 1; visibility: visible; }
.player-card { width: min(1180px, 100%); max-height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; transform: scale(0.96) translateY(10px); transition: transform 0.5s var(--ease); }
.player.open .player-card { transform: none; }
.player-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.player-top h3 { font-family: var(--font-title); font-weight: 400; font-size: clamp(1.4rem, 3vw, 2.2rem); letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.05; }
.player-top .brand { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pill); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; transition: background 0.25s, transform 0.25s; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); transform: scale(1.06); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg .fill { fill: currentColor; stroke: none; }
.video-box { position: relative; background: #000; border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center; min-height: 0; max-height: 64vh; }
.video-box video { width: 100%; height: 100%; max-height: 64vh; background: #000; object-fit: contain; }
.video-box.is-portrait { width: min(100%, calc(64vh * 0.5625)); justify-self: center; }
.player-big-play { position: absolute; inset: 0; display: grid; place-items: center; background: transparent; transition: opacity 0.3s; }
.player-big-play span { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: rgba(6, 9, 14, 0.55); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.player-big-play span::before { content: ""; margin-left: 5px; border-left: 20px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.video-box.playing .player-big-play { opacity: 0; pointer-events: none; }
.video-loading { position: absolute; inset: 0; display: none; place-items: center; pointer-events: none; }
.video-box.loading .video-loading { display: grid; }
.video-loading::after { content: ""; width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--pill); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.video-error { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 24px; color: var(--text-dim); }
.video-box.error .video-error { display: grid; }

.controls { padding: 10px 14px; display: grid; gap: 4px; border-radius: 18px; }
.seek { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.seek-track { position: relative; width: 100%; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.14); transition: height 0.2s; }
.seek:hover .seek-track, .seek.drag .seek-track { height: 8px; }
.seek-buf, .seek-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; width: 0; }
.seek-buf { background: rgba(255, 255, 255, 0.22); }
.seek-fill { background: linear-gradient(90deg, var(--blue), var(--pill)); }
.seek-thumb { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px var(--blue); transform: scale(0); transition: transform 0.2s; }
.seek:hover .seek-thumb, .seek.drag .seek-thumb, .seek:focus-visible .seek-thumb { transform: scale(1); }
.seek-time-tip { position: absolute; bottom: 24px; padding: 3px 8px; border-radius: 8px; font-size: 0.7rem; background: rgba(0, 0, 0, 0.8); transform: translateX(-50%); opacity: 0; pointer-events: none; font-variant-numeric: tabular-nums; }
.seek:hover .seek-time-tip { opacity: 1; }
.ctrl-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ctrl-row .spacer { flex: 1; }
.time { font-size: 0.78rem; color: var(--text-dim); font-variant-numeric: tabular-nums; padding: 0 8px; white-space: nowrap; }
.vol { display: flex; align-items: center; }
.vol input[type=range] { width: 0; opacity: 0; transition: width 0.3s var(--ease), opacity 0.3s; accent-color: var(--pill); height: 4px; cursor: pointer; }
.vol:hover input[type=range], .vol:focus-within input[type=range] { width: 84px; opacity: 1; margin-right: 8px; }
.speed-wrap { position: relative; }
.chip-btn { min-width: 52px; height: 36px; padding: 0 12px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; transition: background 0.25s; }
.chip-btn:hover { background: rgba(255, 255, 255, 0.1); }
.speed-menu { position: absolute; bottom: calc(100% + 10px); right: 0; padding: 6px; border-radius: 14px; display: none; min-width: 90px; z-index: 5; }
.speed-menu.open { display: block; }
.speed-menu button { display: block; width: 100%; padding: 7px 12px; border-radius: 8px; font-size: 0.78rem; text-align: left; color: var(--text-dim); }
.speed-menu button:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.speed-menu button.on { color: var(--pill); font-weight: 700; }
.player-desc { color: var(--text-dim); font-size: 0.9rem; max-width: 80ch; padding: 0 4px; }
.player-card .desc-row { display: grid; gap: 4px; }
/* Fullscreen: the whole player card goes fullscreen so the controls stay available */
.player-card:fullscreen, .player-card.is-fs { width: 100vw; height: 100vh; max-width: none; border-radius: 0; background: #000; padding: 14px; border: 0; }
.player-card.is-fs .video-box { max-height: none; height: 100%; border-radius: 0; }
.player-card.is-fs .video-box video { max-height: none; height: 100%; }
.player-card.is-fs .player-desc { display: none; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 60px); padding: clamp(28px, 5vw, 64px); align-items: center; overflow: hidden; position: relative; }
.contact-wrap::before { content: ""; position: absolute; inset: auto -10% -40% auto; width: 70%; aspect-ratio: 1; background: radial-gradient(circle, rgba(27, 139, 214, 0.28), transparent 65%); pointer-events: none; }
.contact-info { display: grid; gap: 20px; position: relative; }
.contact-info p { color: var(--text-dim); max-width: 42ch; }
.contact-email { font-weight: 700; font-size: clamp(0.95rem, 2.4vw, 1.15rem); word-break: break-all; border-bottom: 1px solid var(--pill); justify-self: start; padding-bottom: 2px; }
.socials { display: grid; gap: 12px; }
.social { display: flex; align-items: center; gap: 14px; width: max-content; max-width: 100%; }
.social .ico { width: 42px; height: 42px; border-radius: 50%; background: #05070b; border: 1px solid var(--glass-border); display: grid; place-items: center; flex: none; transition: transform 0.3s var(--ease), background 0.3s; }
.social .ico svg { width: 20px; height: 20px; }
.social:hover .ico { transform: scale(1.1) rotate(-6deg); background: #101620; }
.social .handle { font-size: 0.84rem; font-weight: 600; letter-spacing: 0.06em; color: var(--text-dim); text-transform: uppercase; }
.social.empty { opacity: 0.55; pointer-events: none; }
.thanks { text-align: center; position: relative; }
.thanks b { display: block; font-family: var(--font-display); text-transform: uppercase; font-size: clamp(2.4rem, 6.4vw, 5.2rem); line-height: 0.95; color: var(--text-faint); background: linear-gradient(180deg, #aab3bd, #4c5662); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.thanks .memoji { display: block; width: clamp(150px, 22vw, 250px); aspect-ratio: 640 / 682; margin: 0 auto 0; position: relative; top: clamp(-44px, -3vw, -22px); }
.thanks b { margin-top: clamp(0px, 1vw, 10px); }
.site-footer { padding: 26px 0 40px; text-align: center; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }

/* Contact modal */
.modal { position: fixed; inset: 0; z-index: 600; display: grid; place-items: center; padding: 16px; background: rgba(2, 3, 6, 0.75); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; overflow-y: auto; }
.modal.open { opacity: 1; visibility: visible; }
.modal-card { width: min(520px, 100%); padding: clamp(22px, 4vw, 36px); display: grid; gap: 16px; transform: translateY(16px) scale(0.98); transition: transform 0.45s var(--ease); position: relative; }
.modal.open .modal-card { transform: none; }
.modal-card h3 { font-family: var(--font-title); font-weight: 400; font-size: 2.2rem; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1; }
.modal-card .icon-btn { position: absolute; top: 14px; right: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); }
.field input, .field textarea, .field select { width: 100%; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--glass-border); background: rgba(2, 4, 8, 0.6); color: var(--text); font: inherit; font-size: 0.95rem; transition: border-color 0.25s, box-shadow 0.25s; }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27, 139, 214, 0.2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-msg { font-size: 0.86rem; min-height: 1.3em; }
.form-msg.ok { color: #7fe3a5; } .form-msg.err { color: #ff8a9a; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .projects-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile, .tile.wide { grid-column: span 2; }
}
@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { position: relative; top: 0; max-width: 420px; }
  .contact-wrap { grid-template-columns: 1fr; }
  .hero-stage { grid-template-columns: 1fr; justify-items: center; text-align: center; margin-top: 12px; }
  .hero-portrait { order: 1; width: min(78%, 360px); min-height: 0; }
  .hero-copy { order: 2; max-width: 460px; padding: 0; }
  .hero-cta { order: 3; justify-self: center; padding: 0 0 56px; }
  .hero-copy, .hero-cta { margin-top: 0; }
  .hero-portrait { margin-bottom: -2px; }
  /* Mobile: copy above the portrait so the portrait sits at the bottom of the hero */
  .hero-copy { order: 1; } .hero-portrait { order: 2; } .hero-cta { order: 3; padding-top: 18px; }
  .scroll-hint { display: none; }
}
@media (max-width: 860px) {
  .nav-pill { display: none; }
  .header-cta { display: none; }
  .menu-btn { display: grid; }
  .nav-pill.open { display: flex; flex-direction: column; position: fixed; top: 82px; left: var(--gutter); right: var(--gutter); padding: 12px; border-radius: 24px; align-items: stretch; text-align: center; }
  .nav-pill.open a { padding: 14px; font-size: 0.82rem; }
}
@media (max-width: 760px) {
  .hero-title { font-size: 16vw; }
  .hero-title .line { display: block; }
  .spec-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 96px; gap: 10px; }
  .tile, .tile.wide { grid-column: span 2; grid-row: span 2; }
  .tile.portrait { grid-column: span 1; grid-row: span 3; }
  .film { display: none; }
  .player-card { gap: 10px; }
  .vol input[type=range] { display: none; }
  .ctrl-row { gap: 0; }
  .time { padding: 0 4px; font-size: 0.7rem; }
  .icon-btn { width: 40px; height: 40px; }
}
@media (max-width: 420px) {
  .customer { min-width: 140px; height: 64px; padding: 0 18px; }
  .btn { padding: 0 22px; min-height: 48px; }
  .splash-start .btn { min-width: 160px; }
  .skills-row { gap: 10px; } .skill { width: 50px; height: 50px; border-radius: 14px; }
  .projects-grid { grid-auto-rows: 84px; }
  .tile .name { font-size: 1rem; } .tile .meta { padding: 12px; }
}
@media (max-width: 340px) {
  :root { --gutter: 14px; }
  .nav-pill.open { left: 14px; right: 14px; }
  .projects-grid { grid-template-columns: 1fr; grid-auto-rows: 150px; }
  .tile, .tile.wide, .tile.portrait { grid-column: span 1; grid-row: span 1; }
  .tile.portrait { grid-row: span 2; }
  .time .dur { display: none; }
  .contact-wrap { padding: 22px 16px; }
}
@media (hover: none) { .cursor-glow { display: none; } .tile .play { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-title .word { transform: none; }
}

/* Preview videos fade in over the poster once they are actually playing */
.tile video { opacity: 0; }
.tile video.on { opacity: 1; }
[hidden] { display: none !important; }

/* ---- Bolder home page type (requested) ---- */
.hero-title .word.name { font-style: italic; font-weight: 900; padding-right: 0.1em; margin-right: -0.1em; }
.hero-role { font-weight: 800; font-size: 0.82rem; color: #fff; }
.hero-intro { font-weight: 600; color: #c4ccd4; font-size: 0.98rem; }
.nav-pill a { font-weight: 800; color: #b6c0ca; }
.nav-pill a.active { color: var(--pill-ink); }
.btn { font-weight: 800; }
.splash-brand { font-weight: 900; font-stretch: 125%; }

/* Portrait rises over the headline like the reference */
@media (min-width: 961px) {
  .hero-stage { grid-template-columns: 1fr minmax(300px, 580px) 1fr; margin-top: calc(-1 * clamp(70px, 9vw, 150px)); }
  .hero-portrait .cutout { max-height: none; width: 100%; height: auto; }
  .hero-title { z-index: 1; }
  .hero-portrait { z-index: 2; }
}


/* ==========================================================================
   Soft edges: the cropped shoulders / sleeves dissolve into the background
   instead of ending in a flat line (splash, hero, thank-you).
   Tweak the percentages to fade sooner or later.
   ========================================================================== */
.memoji-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-mark .memoji-img { object-fit: cover; object-position: 50% 8%; transform-origin: 50% 30%; }

.splash-logo .memoji-img,
.thanks .memoji-img {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 52%, rgba(0,0,0,.55) 74%, transparent 97%);
          mask-image: linear-gradient(to bottom, #000 0, #000 52%, rgba(0,0,0,.55) 74%, transparent 97%);
}

/* Splash: big memoji, brand text sits over the dissolving shoulders */
.splash-logo { width: clamp(220px, min(34vw, 46vh), 430px); aspect-ratio: 640 / 682; opacity: 0; transform: translateY(20px) scale(0.94); animation: logoIn 1.4s var(--ease) 0.4s forwards; margin-bottom: calc(-1 * clamp(56px, 10vh, 120px)); position: relative; z-index: 1; }
.splash-logo::before { content: ""; position: absolute; inset: 8% -14% -4%; z-index: -1; background: radial-gradient(50% 55% at 50% 45%, rgba(27,139,214,.35), transparent 70%); filter: blur(8px); }
.splash-brand, .splash-by, .splash-tag { position: relative; z-index: 2; }
.splash-brand { text-shadow: 0 2px 28px rgba(2,3,6,.85); }

/* Hero cut-out: fade bottom + side edges */
.hero-portrait .cutout {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 56%, rgba(0,0,0,.6) 78%, transparent 99%),
                      linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to bottom, #000 0, #000 56%, rgba(0,0,0,.6) 78%, transparent 99%),
                      linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%);
          mask-composite: intersect;
}
@media (prefers-reduced-motion: reduce) { .splash-logo { opacity: 1; transform: none; } }

/* Form validation messages */
.field-err { color: #ff9aa8; font-size: 0.78rem; line-height: 1.4; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #ff6b81; box-shadow: 0 0 0 3px rgba(255, 107, 129, 0.15); }
