/*
   ML Portfolio v4 · Bento Modular
   Red · White · Black system, asymmetric tiles, soft shadows.
*/

:root {
  --paper: #f5f4ee;       /* off-white base */
  --canvas: #ffffff;      /* tile face */
  --ink: #0e0e0e;         /* jet */
  --ink-2: #1a1a1a;       /* dark tile */
  --pulse: #d62e16;       /* brand red, AA on white (4.93:1) */
  --pulse-2: #b8260f;     /* pressed */
  --pulse-light: #e8442a; /* brighter red for text on dark backgrounds (AA on ink) */
  --mist: #6c675e;        /* secondary text on light */
  --mist-2: #a8a39a;      /* secondary text on dark */
  --line: rgba(14,14,14,0.10);
  --line-ink: rgba(245,244,238,0.12);

  --radius: 22px;
  --radius-sm: 14px;
  --gap: 16px;

  --shadow-tile: 0 2px 8px rgba(14,14,14,0.04);
  --shadow-hover: 0 18px 36px -22px rgba(14,14,14,0.28), 0 4px 12px rgba(14,14,14,0.06);
  --shadow-red: 0 18px 40px -20px rgba(229,52,27,0.45);

  --sans: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);

  --header-h: 72px;
  --max: 1320px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
section[id], div[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
body {
  font-family: var(--sans); color: var(--ink); background: var(--paper);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
@media (max-width: 720px) { .wrap { padding: 0 18px; } }

::selection { background: var(--pulse); color: #fff; }

/* ---------- Intro loader ---------- */
.intro {
  position: fixed; inset: 0; z-index: 200;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  transition: opacity 600ms var(--ease-out), visibility 0s linear 700ms;
}
.intro.done { opacity: 0; visibility: hidden; pointer-events: none; }
.intro .mark {
  width: 80px; height: 80px;
  position: relative; overflow: hidden; border-radius: 16px;
  background: var(--ink-2);
  display: grid; place-items: center;
}
.intro .mark::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 4px;
  background: var(--pulse);
  width: 0; animation: intro-line 1100ms var(--ease-out) forwards;
}
.intro .m {
  font-family: var(--sans); font-weight: 900; font-size: 38px;
  letter-spacing: -0.04em; color: var(--paper);
}
@keyframes intro-line { to { width: 100%; } }

/* ---------- Header (black) ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid rgba(245,244,238,0.10);
  height: var(--header-h);
  display: flex; align-items: center;
  isolation: isolate;
  transition: background 280ms var(--ease-out), border-color 280ms var(--ease-out), color 280ms var(--ease-out);
}
.header-grid {
  width: 100%;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; }
.brand-text { line-height: 1.15; }
.brand-text .n { font-weight: 700; font-size: 14px; letter-spacing: -0.005em; color: var(--ink); }
.brand-text .r { font-weight: 500; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mist); }
/* Brand colors flip on the dark header */
.header .brand, .header .brand-text .n { color: var(--paper); }
.header .brand-text .r { color: #c8c5be; }

/* ---------- Mobile hamburger (44+ targets, inverted for black header) ---------- */
.menu-btn {
  justify-self: end;
  width: 48px; height: 48px;
  border: 1.5px solid var(--paper); border-radius: 50%;
  background: transparent; color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; z-index: 90;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 240ms var(--ease-out), color 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.menu-btn:hover { background: var(--paper); color: var(--ink); }
.menu-btn:focus-visible { outline: 2px solid var(--pulse); outline-offset: 3px; }
.menu-btn .bar { display: block; width: 20px; height: 1.75px; background: currentColor; position: relative; border-radius: 2px; transition: background 220ms var(--ease-out); }
.menu-btn .bar::before, .menu-btn .bar::after { content: ""; position: absolute; left: 0; right: 0; height: 1.75px; background: currentColor; border-radius: 2px; transition: transform 320ms var(--ease-out), top 220ms var(--ease-out) 100ms; }
.menu-btn .bar::before { top: -7px; }
.menu-btn .bar::after  { top: 7px; }
.menu-btn[aria-expanded="true"] .bar { background: transparent; }
.menu-btn[aria-expanded="true"] .bar::before { top: 0; transform: rotate(45deg); transition: top 220ms var(--ease-out), transform 320ms var(--ease-out) 120ms; }
.menu-btn[aria-expanded="true"] .bar::after  { top: 0; transform: rotate(-45deg); transition: top 220ms var(--ease-out), transform 320ms var(--ease-out) 120ms; }
@media (min-width: 1000px) { .menu-btn { display: none; } }

/* ---------- Nav ---------- */
.nav-scrim { position: fixed; inset: 0; background: rgba(14,14,14,0.55); opacity: 0; pointer-events: none; transition: opacity 280ms var(--ease-out); z-index: 70; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.nav-scrim.live { opacity: 1; pointer-events: auto; }
@media (min-width: 1000px) { .nav-scrim { display: none; } }

.nav {
  position: fixed; top: 72px; left: 0; right: 0;
  max-height: calc(100dvh - 72px); overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 8px 22px 32px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 24px 48px -28px rgba(14,14,14,0.4);
  z-index: 80;
  transform: translateY(-12px); opacity: 0; visibility: hidden;
  transition: transform 360ms var(--ease-out), opacity 240ms var(--ease-out), visibility 0s linear 360ms;
}
.nav.open { transform: translateY(0); opacity: 1; visibility: visible; transition: transform 420ms var(--ease-out), opacity 280ms var(--ease-out), visibility 0s linear 0s; }
@media (min-width: 1000px) {
  .nav { position: static; max-height: none; overflow: visible; padding: 0; border-top: none; background: transparent; box-shadow: none; transform: none; opacity: 1; visibility: visible; transition: none; flex-direction: row; gap: 28px; justify-self: center; }
}
.nav a {
  font-family: var(--sans); font-weight: 500;
  font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--paper);
  display: flex; align-items: center;
  min-height: 56px; padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  position: relative; line-height: 1.4;
  -webkit-tap-highlight-color: rgba(229,52,27,0.12);
  transition: color 220ms var(--ease-out), padding-left 240ms var(--ease-out);
}
@media (max-width: 999px) {
  .nav a { color: var(--ink); }
}
.nav a:last-child { border-bottom: none; }
.nav a:focus-visible { outline: 2px solid var(--pulse); outline-offset: 4px; border-radius: 4px; }
@media (min-width: 1000px) {
  .nav a { font-size: 12px; letter-spacing: 0.14em; min-height: 0; padding: 6px 0; border-bottom: 1px solid transparent; display: inline-block; }
}
.nav a:hover { color: var(--pulse-light); }
.nav a[aria-current="page"] { color: var(--pulse-light); }
@media (max-width: 999px) {
  .nav a:hover, .nav a[aria-current="page"] { color: var(--pulse); }
}
@media (max-width: 999px) {
  .nav a[aria-current="page"] { padding-left: 14px; border-left: 3px solid var(--pulse); }
  .nav a { opacity: 0; transform: translateY(-6px); transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out), color 220ms var(--ease-out), padding-left 240ms var(--ease-out); }
  .nav.open a { opacity: 1; transform: none; }
  .nav.open a:nth-child(1) { transition-delay: 80ms; }
  .nav.open a:nth-child(2) { transition-delay: 130ms; }
  .nav.open a:nth-child(3) { transition-delay: 180ms; }
  .nav.open a:nth-child(4) { transition-delay: 230ms; }
  .nav.open a:nth-child(5) { transition-delay: 280ms; }
}
body.nav-open { overflow: hidden; touch-action: none; }

/* ---------- CTA pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border: 1.5px solid var(--ink); border-radius: 999px;
  font-weight: 600; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  background: transparent; color: var(--ink);
  transition: background 220ms var(--ease-out), color 220ms var(--ease-out), border-color 220ms var(--ease-out), transform 220ms var(--ease-out);
  cursor: pointer;
}
.pill:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
/* Inverted pill in the black header */
.header .pill { border-color: var(--paper); color: var(--paper); }
.header .pill:hover { background: var(--paper); color: var(--ink); }
.header .pill.pill-red { border-color: var(--pulse); }
.header .pill.pill-red:hover { background: var(--pulse-2); border-color: var(--pulse-2); color: #fff; }
/* Hide header CTA pill on mobile (menu drawer has Contact) */
@media (max-width: 999px) {
  .header .pill { display: none; }
}
.pill.pill-red { background: var(--pulse); border-color: var(--pulse); color: #fff; }
.pill.pill-red:hover { background: var(--pulse-2); border-color: var(--pulse-2); box-shadow: var(--shadow-red); }

/* ============================================================
   BENTO SYSTEM
   ============================================================ */

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  margin: 28px 0;
}
.bento.bento-tight { gap: 12px; }

/* Tile base */
.tile {
  position: relative; overflow: hidden;
  background: var(--canvas);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-tile);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 200px;
  transition: transform 360ms var(--ease-out), box-shadow 360ms var(--ease-out), border-color 360ms var(--ease-out);
}
a.tile { color: inherit; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(14,14,14,0.16); }

/* Tile variants */
.tile.dark { background: var(--ink); color: var(--paper); border-color: rgba(245,244,238,0.06); }
.tile.dark .tile-meta, .tile.dark .tile-body { color: var(--mist-2); }
.tile.red { background: var(--pulse); color: #fff; border-color: rgba(255,255,255,0.16); }
.tile.red:hover { box-shadow: var(--shadow-red), var(--shadow-hover); }
.tile.outline { background: transparent; box-shadow: none; }
.tile.flat { box-shadow: none; }

/* Tile content elements */
.tile-eyebrow {
  font-family: var(--sans); font-weight: 700;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--pulse);
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 18px;
}
.tile.red .tile-eyebrow { color: #fff; opacity: 0.85; }
.tile.dark .tile-eyebrow { color: var(--pulse-light); }
.tile-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tile-title {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  line-height: 1.15; letter-spacing: -0.018em;
  margin: 0 0 12px;
}
.tile-title.lg { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }

.tile-body {
  font-size: 14.5px; color: var(--mist); line-height: 1.55; margin: 0;
}
.tile.dark .tile-body { color: var(--mist-2); }
.tile.red .tile-body { color: rgba(255,255,255,0.92); }

.tile-foot { margin-top: auto; padding-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tile-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink);
}
.tile.dark .tile-link { color: var(--paper); }
.tile.red .tile-link { color: #fff; }
.tile-link .arrow { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); display: inline-grid; place-items: center; font-size: 11px; transition: transform 320ms var(--ease-out); }
.tile.dark .tile-link .arrow { background: var(--paper); color: var(--ink); }
.tile.red .tile-link .arrow { background: #fff; color: var(--pulse); }
.tile:hover .tile-link .arrow { transform: translateX(3px); }

/* Spans */
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }
.row-2 { grid-row: span 2; }

@media (max-width: 1000px) {
  .col-3, .col-4 { grid-column: span 6; }
  .col-5, .col-7, .col-8, .col-9 { grid-column: span 12; }
  .col-6 { grid-column: span 12; }
  .row-2 { grid-row: auto; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; gap: 12px; }
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-12 { grid-column: 1 / -1; }
  .tile { padding: 22px; min-height: 0; border-radius: 18px; }
}

/* ---------- Specialty tile content ---------- */

/* Hero tile */
.tile-hero {
  padding: 40px;
  background:
    radial-gradient(circle at 90% 10%, rgba(214,46,22,0.20), transparent 55%),
    var(--canvas);
}
.tile-hero h1 {
  font-family: var(--sans); font-weight: 900;
  font-size: clamp(2.2rem, 5.4vw, 4.4rem);
  line-height: 0.98; letter-spacing: -0.03em;
  margin: 0 0 20px;
}
.tile-hero h1 .red { color: var(--pulse); }
.tile-hero .lede { font-size: 16px; max-width: 46ch; color: var(--mist); margin: 0 0 28px; }
.tile-hero .cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Image tile */
.tile-img { padding: 0; aspect-ratio: 4/3; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.tile-img:hover img { transform: scale(1.04); }
.tile-img .badge {
  position: absolute; top: 16px; left: 16px;
  background: var(--ink); color: var(--paper);
  padding: 7px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
}
.tile-img .badge.red { background: var(--pulse); }
.tile-img .img-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 22px;
  background: linear-gradient(180deg, transparent, rgba(14,14,14,0.78));
  color: #fff;
  display: flex; align-items: flex-end; justify-content: space-between;
  font-weight: 600;
}
.tile-img .img-caption .label { font-size: 13px; letter-spacing: 0.04em; }
.tile-img .img-caption .sub { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.85; }

/* KPI tile */
.tile-kpi { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.tile-kpi .num {
  font-family: var(--sans); font-weight: 900;
  font-size: clamp(2.6rem, 5vw, 4rem); line-height: 1; letter-spacing: -0.025em;
  color: var(--ink);
}
.tile.dark.tile-kpi .num,
.tile.dark .tile-kpi .num { color: var(--paper) !important; }
.tile.red.tile-kpi .num,
.tile.red .tile-kpi .num { color: #ffffff !important; }
.tile-kpi .label { font-size: 13px; color: var(--mist); line-height: 1.5; }
.tile.dark.tile-kpi .label,
.tile.dark .tile-kpi .label { color: #d6d2c8 !important; }
.tile.red.tile-kpi .label,
.tile.red .tile-kpi .label { color: rgba(255,255,255,0.95) !important; }

/* Quote tile */
.tile-quote .quote {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem); line-height: 1.4; letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.tile-quote .attribution { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mist); }
.tile.dark .tile-quote .attribution { color: var(--mist-2); }

/* List tile */
.tile-list ul { list-style: none; padding: 0; margin: 0; }
.tile-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  font-size: 14.5px;
}
.tile.dark .tile-list li { border-bottom-color: var(--line-ink); }
.tile-list li:last-child { border-bottom: none; }
.tile-list li .dash { width: 16px; height: 1px; background: var(--pulse); flex: none; }

/* Marquee tile (low-profile band, vertically centered) */
.tile-marquee {
  padding: 0;
  min-height: 0;
  height: 64px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
}
.tile-marquee .track {
  display: flex; gap: 48px; white-space: nowrap; align-items: center;
  animation: marquee 40s linear infinite;
  line-height: 1;
}
.tile-marquee .track span {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(0.95rem, 1.3vw, 1.15rem); letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 48px;
  text-transform: uppercase;
  line-height: 1;
}
.tile-marquee .track span::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pulse); flex: none; }
@media (max-width: 720px) {
  .tile-marquee { height: 52px; }
  .tile-marquee .track { gap: 32px; }
  .tile-marquee .track span { gap: 32px; font-size: 0.92rem; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* Live web work paired layout: image and text tiles stretch to equal heights per row */
.bento-live { grid-auto-flow: row; align-items: stretch; }
.bento-live .tile { min-height: 100%; height: 100%; }
.bento-live .tile-img { aspect-ratio: auto; min-height: 360px; }
.bento-live .tile-img img { height: 100%; min-height: 360px; }
@media (max-width: 1000px) {
  .bento-live .tile-img { min-height: 280px; }
  .bento-live .tile-img img { min-height: 280px; }
}
@media (max-width: 640px) {
  .bento-live .tile-img { min-height: 220px; aspect-ratio: 4/3; }
}

/* Tag chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(14,14,14,0.06); color: var(--ink);
}
.tile.dark .chip { background: rgba(245,244,238,0.08); color: var(--paper); }
.tile.red .chip { background: rgba(255,255,255,0.18); color: #fff; }
.chip.red { background: var(--pulse); color: #fff; }

/* Avatar tile */
.tile-avatar { padding: 0; aspect-ratio: 1/1; }
.tile-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Logo tile */
.tile-logo {
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  min-height: 200px; padding: 32px;
}
.tile-logo .big-m {
  font-family: var(--sans); font-weight: 900; font-size: clamp(4rem, 8vw, 7rem); line-height: 0.85; letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff 60%, var(--pulse) 60%); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Resume highlight tile ---------- */
.tile-resume {
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  padding: 32px;
  text-align: left;
  font-family: inherit;
}
.tile-resume::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(214,46,22,0.62), transparent 60%),
    radial-gradient(circle at 0% 100%, rgba(214,46,22,0.32), transparent 55%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 360ms var(--ease-out);
}
.tile-resume > * { position: relative; z-index: 1; }
.tile-resume .tile-eyebrow { color: var(--pulse-light); }
.tile-resume .tile-title { color: #fff; }
.tile-resume .tile-body { color: rgba(255,255,255,0.85); }
.tile-resume .doc-strip {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  margin: 18px 0 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
}
.tile-resume .doc-strip .doc-icon {
  width: 36px; height: 44px;
  border-radius: 4px;
  background: #fff;
  position: relative; flex: none;
  display: grid; place-items: center;
  color: var(--ink); font-weight: 900; font-size: 10px; letter-spacing: 0.04em;
}
.tile-resume .doc-strip .doc-icon::after {
  content: "";
  position: absolute; top: 0; right: 0;
  width: 10px; height: 10px;
  background: var(--pulse);
  clip-path: polygon(0 0, 100% 100%, 100% 0);
}
.tile-resume .doc-strip .doc-meta { display: grid; gap: 2px; line-height: 1.3; }
.tile-resume .doc-strip .doc-meta .name { color: #fff; font-size: 13px; letter-spacing: 0.02em; text-transform: none; }
.tile-resume .doc-strip .doc-meta .info { color: rgba(255,255,255,0.6); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.tile-resume .tile-foot {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 18px; margin-top: 18px;
}
.tile-resume .tile-link { color: #fff; }
.tile-resume .tile-link .arrow { background: var(--pulse); color: #fff; }
.tile-resume:hover { transform: translateY(-3px); box-shadow: var(--shadow-red), var(--shadow-hover); }
.tile-resume:hover::before { opacity: 1.2; }

/* ---------- Spotlight tile: light face with red corner glow + accent border ---------- */
.tile-spotlight {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-tile);
}
.tile-spotlight::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(60% 80% at 100% 0%, rgba(214,46,22,0.20), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.tile-spotlight::after {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--pulse), transparent);
  z-index: 1;
}
.tile-spotlight > * { position: relative; z-index: 2; }
.tile-spotlight:hover { transform: translateY(-3px); box-shadow: 0 24px 44px -22px rgba(229,52,27,0.30), var(--shadow-hover); }
.tile-spotlight .tile-link { color: var(--ink); }
.tile-spotlight .tile-link .arrow { background: var(--ink); color: var(--paper); }

/* ---------- Engraved tile: dark with faint paper noise + watermark M ---------- */
.tile-engraved {
  position: relative;
  overflow: hidden;
  background-color: #0e0e0e;
  background-image: linear-gradient(160deg, #141414 0%, #0a0a0a 100%);
  color: var(--paper);
  border: 1px solid rgba(245,244,238,0.06);
}
.tile-engraved::before {
  /* visible diagonal stripes + stronger red glow at bottom-left */
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(245,244,238,0.045) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 0% 100%, rgba(214,46,22,0.42), transparent 60%),
    radial-gradient(circle at 100% 0%, rgba(214,46,22,0.18), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
.tile-engraved::after {
  content: "M";
  position: absolute;
  right: -28px; bottom: -52px;
  font-family: var(--sans); font-weight: 900;
  font-size: clamp(8rem, 14vw, 13rem);
  line-height: 0.85;
  color: rgba(232,68,42,0.16);
  letter-spacing: -0.06em;
  pointer-events: none;
  z-index: 0;
}
.tile-engraved > * { position: relative; z-index: 1; }
.tile-engraved .tile-eyebrow { color: var(--pulse-light); }
.tile-engraved .tile-body, .tile-engraved p { color: rgba(245,244,238,0.78); }
.tile-engraved .tile-title { color: #fff; }
.tile-engraved .tile-kpi .num,
.tile-engraved.tile-kpi .num { color: #fff !important; }
.tile-engraved .tile-kpi .label,
.tile-engraved.tile-kpi .label { color: rgba(245,244,238,0.78) !important; }
.tile-engraved:hover { transform: translateY(-3px); box-shadow: 0 24px 44px -22px rgba(0,0,0,0.5); }
.tile-engraved.tile-kpi::after { display: none; }
.tile-engraved .tile-link { color: var(--paper); }
.tile-engraved .tile-link .arrow { background: var(--paper); color: var(--ink); }
.tile-engraved .tile-link:hover { color: var(--pulse); }

/* ---------- Pulse tile: red with diagonal light streak ---------- */
.tile-pulse {
  position: relative;
  overflow: hidden;
  background-color: var(--pulse);
  background-image: linear-gradient(135deg, var(--pulse) 0%, var(--pulse-2) 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
}
.tile-pulse::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,0.30), transparent 55%),
    linear-gradient(115deg, transparent 28%, rgba(255,255,255,0.18) 50%, transparent 72%);
  pointer-events: none;
  z-index: 0;
  transition: transform 600ms var(--ease-out);
}
.tile-pulse > * { position: relative; z-index: 1; }
.tile-pulse .tile-eyebrow { color: rgba(255,255,255,0.92); }
.tile-pulse .tile-title { color: #fff; }
.tile-pulse .tile-body { color: rgba(255,255,255,0.92); }
.tile-pulse .tile-link { color: #fff; }
.tile-pulse .tile-link .arrow { background: #fff; color: var(--pulse); }
.tile-pulse .tile-kpi .num,
.tile-pulse.tile-kpi .num { color: #fff !important; }
.tile-pulse .tile-kpi .label,
.tile-pulse.tile-kpi .label { color: rgba(255,255,255,0.95) !important; }
.tile-pulse:hover { transform: translateY(-3px); box-shadow: var(--shadow-red), var(--shadow-hover); }
.tile-pulse:hover::before { transform: translateX(8%); }

/* ---------- Coming Soon ribbon ---------- */
.tile-coming {
  position: relative;
  background: var(--canvas);
  border: 1px dashed rgba(14,14,14,0.18);
  box-shadow: none;
}
.tile-coming::before {
  content: "Coming soon";
  position: absolute; top: 16px; right: 16px;
  background: var(--ink); color: var(--paper);
  padding: 5px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  z-index: 2;
}
.tile-coming .tile-title { color: var(--ink); }
.tile-coming .tile-body { color: var(--mist); }

/* PDF preview button (kept compat with v3 modal) */
.pdf-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px; border-radius: 999px;
  background: var(--pulse); color: #fff;
  font-weight: 700; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  cursor: pointer; border: none;
  transition: background 220ms var(--ease-out), transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
.pdf-btn:hover { background: var(--pulse-2); transform: translateY(-1px); box-shadow: var(--shadow-red); }
.pdf-btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.pdf-btn.ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- Section heading ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 56px 0 18px; flex-wrap: wrap; }
.section-head .eyebrow {
  font-weight: 700; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--pulse); display: inline-flex; align-items: center; gap: 10px;
}
.section-head .eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pulse); }
.section-head h2 {
  font-family: var(--sans); font-weight: 800;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.02em;
  line-height: 1.1; margin: 8px 0 0;
}
.section-head .head-meta { color: var(--mist); font-size: 14px; max-width: 38ch; }

/* ---------- Page section divider ---------- */
.section { padding: 24px 0 8px; }
.section.dark { background: var(--ink); color: var(--paper); margin: 56px 0 0; padding: 56px 0; border-radius: 28px; }
.section.dark .section-head h2 { color: var(--paper); }
.section.dark .section-head .head-meta { color: var(--mist-2); }

/* ---------- Footer (bento style) ---------- */
.footer-bento { margin: 64px 0 32px; }
.footer-bento .tile-foot-meta { font-size: 12px; color: var(--mist); letter-spacing: 0.04em; }
.footer-base { display: flex; align-items: center; justify-content: space-between; padding: 24px 0 40px; border-top: 1px solid var(--line); margin-top: 24px; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mist); }
@media (max-width: 640px) { .footer-base { flex-direction: column; gap: 12px; align-items: flex-start; } }

/* ---------- PDF Modal (compat) ---------- */
.pdf-modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(14,14,14,0.78); padding: 4vh 4vw;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.pdf-modal.open { display: grid; place-items: stretch; }
.pdf-modal .panel { background: var(--paper); border-radius: 18px; overflow: hidden; display: grid; grid-template-rows: 56px 1fr; box-shadow: 0 40px 80px rgba(0,0,0,0.4); }
.pdf-modal .bar { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); gap: 16px; background: var(--canvas); }
.pdf-modal .bar .ttl { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }
.pdf-modal .bar .ttl::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pulse); }
.pdf-modal .bar .actions { display: inline-flex; gap: 8px; align-items: center; }
.pdf-modal .bar .x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.pdf-modal iframe { width: 100%; height: 100%; border: 0; background: var(--paper); }
@media (max-width: 720px) { .pdf-modal { padding: 0; } .pdf-modal .panel { border-radius: 0; } }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.stagger > * { opacity: 0; transform: translateY(12px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(1) { transition-delay: 60ms; }
.stagger.in > *:nth-child(2) { transition-delay: 120ms; }
.stagger.in > *:nth-child(3) { transition-delay: 180ms; }
.stagger.in > *:nth-child(4) { transition-delay: 240ms; }
.stagger.in > *:nth-child(5) { transition-delay: 300ms; }
.stagger.in > *:nth-child(6) { transition-delay: 360ms; }
.stagger.in > *:nth-child(7) { transition-delay: 420ms; }
.stagger.in > *:nth-child(8) { transition-delay: 480ms; }
.stagger.in > *:nth-child(9) { transition-delay: 540ms; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; } }

/* ---------- Resume / case-study specific ---------- */
.timeline { display: grid; gap: 12px; }
.timeline .row { display: grid; grid-template-columns: 140px 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.timeline .row:last-child { border-bottom: none; }
.timeline .row .when { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mist); }
.timeline .row .what h4 { font-size: 16px; margin: 0 0 4px; }
.timeline .row .what .where { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mist); margin-bottom: 8px; }
.timeline .row .what ul { margin: 0; padding-left: 18px; color: var(--mist); font-size: 14px; }
@media (max-width: 640px) { .timeline .row { grid-template-columns: 1fr; gap: 6px; } }

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mist); }
.field input, .field textarea {
  font-family: var(--sans); font-size: 15px;
  border: 1px solid var(--line); background: var(--canvas); color: var(--ink);
  padding: 14px 16px; border-radius: 12px;
  transition: border-color 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--pulse); box-shadow: 0 0 0 4px rgba(229,52,27,0.12); }

/* Scroll progress */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: transparent; z-index: 110; }
.scroll-progress .fill { height: 100%; width: 0%; background: var(--pulse); transition: width 80ms linear; }
