/* ==========================================================================
   George Mihic — design system
   1. Tokens  2. Base  3. Layout  4. Components  5. Sections  6. Pages  7. Motion
   ========================================================================== */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* colour */
  /* Brand: charcoal #404040, mint #84C7B6, white (sampled from the GM emblem) */
  --charcoal: #404040;
  --ink-deep: #343434;
  --ink-950: #404040;
  --ink-900: #484848;
  --ink-850: #505050;
  --ink-800: #5a5a5a;
  --ink-700: #6e6e6e;
  --mint-600: #2e7867;
  --mint-500: #6db3a1;
  --mint-400: #84c7b6;
  --mint-300: #abdbcf;
  --on-mint: #2f2f2f;
  --paper: #ffffff;
  --paper-200: #e8e8e8;
  --text: #ffffff;
  --muted: #cbcbcb;
  --muted-dark: #575757;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --accent-text: var(--mint-400);      /* mint used as text (links, labels); darker on white */
  --prose: #e6e6e6;
  --chip-bg: rgba(255, 255, 255, 0.09);
  /* Rollovers go white on charcoal (and charcoal on white sections): a crisp invert that keeps mint for 'selected' */
  --hover-bg: #fff; --hover-fg: var(--charcoal); --hover-muted: #5c5c5c;
  --surface: var(--ink-900); --field-bg: var(--ink-deep); --error: #ffab9f;

  /* brand shapes: pointy-top hexagon (the emblem) and hex-ended bar (buttons, tags, chips) */
  --hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  --hex-bar: polygon(0.9em 0, calc(100% - 0.9em) 0, 100% 50%, calc(100% - 0.9em) 100%, 0.9em 100%, 0 50%);
  --hex-ratio: 0.866;
  --pattern: url("../img/pattern.svg");
  --pattern-dark: url("../img/pattern-dark.svg");
  --pattern-size: 216px 198px;

  /* type */
  --font-display: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.4rem, 1.25rem + 0.75vw, 1.85rem);
  --step-3: clamp(1.8rem, 1.5rem + 1.5vw, 2.75rem);
  --step-4: clamp(2.3rem, 1.8rem + 2.6vw, 4rem);
  --step-5: clamp(2.8rem, 2rem + 4.2vw, 5.6rem);

  /* spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --section: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 2.5rem);

  /* shape */
  --radius-sm: 2px;
  --radius: 4px;
  --radius-lg: 6px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.25), 0 30px 60px -30px rgba(0, 0, 0, 0.7);

  /* layout */
  --max: 1320px;
  --max-text: 68ch;
  --header-h: 76px;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.5s;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  background: var(--ink-950);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.7;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 0.5em; }
h1 { font-size: var(--step-5); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }
h2 { font-size: var(--step-4); letter-spacing: -0.035em; }
h3 { font-size: var(--step-2); font-weight: 700; letter-spacing: -0.02em; }
h4 { font-size: var(--step-1); }
ul, ol { margin: 0; padding: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--mint-400); color: var(--on-mint); }
:focus-visible { outline: 2px solid var(--mint-400); outline-offset: 3px; border-radius: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: var(--space-4); top: -100px; z-index: 200;
  background: var(--mint-400); color: var(--on-mint); padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; transition: top 0.2s;
}
.skip-link:focus { top: var(--space-4); }

/* 3. Layout ---------------------------------------------------------------- */
.container { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.6); }
.section--paper {
  /* White sections: same components, re-themed through tokens (grey text, deep-mint text accents) */
  --text: var(--charcoal); --muted: #5c5c5c; --prose: #4a4a4a; --accent-text: var(--mint-600);
  --line: rgba(0, 0, 0, 0.1); --line-strong: rgba(0, 0, 0, 0.16); --chip-bg: rgba(0, 0, 0, 0.06);
  --hover-bg: var(--charcoal); --hover-fg: #fff; --hover-muted: #cbcbcb;
  --surface: #f4f4f4; --field-bg: #fff; --error: #b3261e;
  background: var(--paper); color: var(--text);
}
.section--raised { background: var(--ink-900); }
.section + .section--raised, .section--raised + .section { border-top: 1px solid var(--line); }
.stack > * + * { margin-top: var(--space-5); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: var(--space-5);
}
.eyebrow::before { content: ""; width: 0.72em; height: 0.83em; background: currentColor; clip-path: var(--hex); flex: none; }
.lead { font-size: var(--step-1); color: var(--muted); line-height: 1.6; max-width: 60ch; }
.muted { color: var(--muted); }
.accent { color: var(--accent-text); }

.section-head { display: grid; gap: var(--space-5); margin-bottom: var(--space-8); }
@media (min-width: 900px) {
  .section-head--split { grid-template-columns: 1.1fr 1fr; align-items: end; gap: var(--space-8); }
  .section-head--split .lead { justify-self: end; }
}
.section-head h2 { margin: 0; max-width: 18ch; }

/* 4. Components ------------------------------------------------------------ */

/* Buttons */
.btn {
  --btn-bg: var(--mint-400); --btn-fg: var(--on-mint);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 52px; padding: 0.85em 1.9em; border-radius: 0;
  background: none; color: var(--btn-fg); border: 0;
  font-weight: 600; font-size: 0.98rem; line-height: 1; text-decoration: none; cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
  white-space: nowrap;
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--btn-bg); clip-path: var(--hex-bar); transition: background 0.25s var(--ease); }
.btn:hover { --btn-bg: var(--hover-bg); --btn-fg: var(--hover-fg); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 1.1em; height: 1.1em; transition: transform 0.3s var(--ease); }
.btn:hover .icon--arrow { transform: translateX(3px); }
.btn--ghost { --btn-bg: rgba(255, 255, 255, 0.1); --btn-fg: var(--text); }
.btn--ghost:hover { --btn-bg: var(--hover-bg); --btn-fg: var(--hover-fg); }
.section--paper .btn--ghost { --btn-bg: rgba(0, 0, 0, 0.07); --btn-fg: var(--charcoal); }
.btn--sm { min-height: 42px; padding: 0.6em 1.45em; font-size: 0.9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-4); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5em; font-weight: 600; text-decoration: none;
  color: var(--accent-text); border-bottom: 1px solid transparent; transition: border-color 0.2s, gap 0.3s var(--ease);
}
.link-arrow:hover { border-color: currentColor; gap: 0.75em; }
.link-arrow svg { width: 1em; height: 1em; }

.icon { width: 1.25em; height: 1.25em; flex: none; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; }
.tag {
  display: inline-block; padding: 0.3em 1.05em; clip-path: var(--hex-bar);
  background: var(--chip-bg); font-size: 0.78rem; font-weight: 500; color: var(--muted); line-height: 1.4;
}

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
  transition: background 0.35s var(--ease), border-color 0.35s, height 0.35s var(--ease), transform 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  --header-h: 64px;
  background: rgba(52, 52, 52, 0.88);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-color: var(--line);
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.025em; }
.brand img { width: 44px; height: 44px; transition: transform 0.6s var(--ease); }
.brand:hover img { transform: rotate(-60deg); }
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav__list { display: flex; gap: var(--space-2); list-style: none; }
.nav__link {
  position: relative; display: inline-block; padding: 0.55em 0.9em; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 500; font-size: 0.95rem; color: var(--muted); transition: color 0.2s, background 0.2s;
}
.nav__link:hover { color: var(--text); }
.nav__link:not([aria-current]):hover::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 7px; height: 8px; clip-path: var(--hex);
  background: #fff; transform: translateX(-50%);
}
.nav__link[aria-current="page"] { color: var(--text); }
.nav__link[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 7px; height: 8px; clip-path: var(--hex);
  background: var(--mint-400); transform: translateX(-50%);
}
.nav-toggle {
  display: none; width: 46px; height: 53px; border: 0; padding: 0;
  background: none; cursor: pointer; position: relative; z-index: 120; isolation: isolate;
}
.nav-toggle::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--mint-400); clip-path: var(--hex); transition: background 0.25s; }
.nav-toggle:hover::before { background: var(--mint-300); }
.nav-toggle span { position: absolute; left: 13px; right: 13px; height: 2px; background: var(--on-mint); border-radius: 1px; transition: transform 0.35s var(--ease), opacity 0.2s; }
.nav-toggle span:nth-child(1) { top: 20px; }
.nav-toggle span:nth-child(2) { top: 26px; }
.nav-toggle span:nth-child(3) { top: 32px; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav {
    position: fixed; inset: 0; z-index: 110; flex-direction: column; align-items: stretch; justify-content: center;
    gap: var(--space-7); padding: calc(var(--header-h) + var(--space-6)) var(--gutter) var(--space-7);
    background: var(--ink-deep); opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease), visibility 0.35s; isolation: isolate;
  }
  .nav-open .nav { opacity: 1; visibility: visible; }
  .nav__list { flex-direction: column; gap: 0; }
  .nav__link { display: block; font-family: var(--font-display); font-size: clamp(2rem, 9vw, 3rem); font-weight: 700; color: var(--text); padding: 0.2em 0; border-radius: 0; letter-spacing: -0.03em; }
  .nav__link:hover { background: none; color: var(--accent-text); }
  .nav__link[aria-current="page"] { color: var(--accent-text); }
  .nav__link[aria-current="page"]::after, .nav__link:hover::after { display: none; }
  .nav .btn { align-self: flex-start; }
  .nav__meta { display: grid !important; gap: var(--space-2); color: var(--muted); font-size: 0.95rem; }
  .nav__meta a { text-decoration: none; }
  .nav-open { overflow: hidden; }
}
.nav__meta { display: none; }

/* Footer */
.site-footer { position: relative; isolation: isolate; background: var(--ink-deep); border-top: 1px solid var(--line); padding-top: var(--space-9); }
.footer-cta { display: grid; gap: var(--space-6); padding-bottom: var(--space-9); border-bottom: 1px solid var(--line); }
.footer-cta h2 { font-size: var(--step-5); margin: 0; max-width: 14ch; }
.footer-cta h2 a { text-decoration: none; background: linear-gradient(var(--mint-400), var(--mint-400)) 0 100% / 0 3px no-repeat; transition: background-size 0.6s var(--ease); }
.footer-cta h2 a:hover { background-size: 100% 3px; }
@media (min-width: 900px) { .footer-cta { grid-template-columns: 1.4fr 1fr; align-items: end; } .footer-cta .btn-row { justify-content: flex-end; } }
.footer-grid { display: grid; gap: var(--space-7); padding-block: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.footer-grid .h-foot { font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-4); }
.footer-grid ul { list-style: none; display: grid; gap: var(--space-2); }
.footer-grid a { text-decoration: none; color: var(--text); opacity: 0.85; transition: color 0.2s, opacity 0.2s; }
.footer-grid a:hover { color: var(--accent-text); opacity: 1; }
.footer-brand p { color: var(--muted); max-width: 32ch; margin-top: var(--space-4); font-size: 0.95rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-5); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.footer-bottom a { color: inherit; }
.social { display: flex; gap: var(--space-3); list-style: none; }
.social a {
  position: relative; isolation: isolate; display: grid; place-items: center; width: 44px; height: 51px;
  color: var(--on-mint) !important; opacity: 1 !important; transition: transform 0.3s var(--ease);
}
.social a::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--mint-400); clip-path: var(--hex); transition: background 0.25s; }
.social a:hover { transform: translateY(-3px); }
.social a:hover::before { background: #fff; }
.social svg { width: 18px; height: 18px; }

/* Project card */
.work-grid { display: grid; gap: var(--space-7) var(--space-6); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.work-grid--feature { grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .work-grid--feature { grid-template-columns: repeat(12, 1fr); }
  .work-grid--feature > :nth-child(4n + 1) { grid-column: span 7; }
  .work-grid--feature > :nth-child(4n + 2) { grid-column: span 5; }
  .work-grid--feature > :nth-child(4n + 3) { grid-column: span 5; }
  .work-grid--feature > :nth-child(4n + 4) { grid-column: span 7; }
}
.card { position: relative; display: grid; gap: var(--space-4); text-decoration: none; color: inherit; }
.card__media {
  position: relative; overflow: hidden; border-radius: var(--radius); background: var(--ink-850); aspect-ratio: 1 / 1;
  isolation: isolate;
}
.work-grid--feature .card__media { aspect-ratio: 4 / 3; }
.card__media picture { display: contents; }
.card__media img, .card__media video { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease), filter 0.6s; }
.card__media::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); pointer-events: none;
}
.card__badge {
  position: absolute; top: var(--space-4); left: var(--space-4); z-index: 2;
  display: inline-flex; align-items: center; gap: 0.4em; padding: 0.35em 1.1em; clip-path: var(--hex-bar);
  background: rgba(40, 40, 40, 0.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 0.75rem; font-weight: 600; color: var(--text);
}
.card__badge svg { width: 0.9em; height: 0.9em; color: var(--accent-text); }
.card__go {
  position: absolute; right: var(--space-4); bottom: var(--space-4); z-index: 2; width: 52px; height: 60px; clip-path: var(--hex);
  display: grid; place-items: center; background: var(--mint-400); color: var(--on-mint);
  transform: scale(0.6) translateY(12px); opacity: 0; transition: transform 0.5s var(--ease), opacity 0.3s;
}
.card__go svg { width: 22px; height: 22px; }
.card:hover .card__media img, .card:focus-visible .card__media img, .card:hover .card__media video, .card:focus-visible .card__media video { transform: scale(1.045); }
.card:hover .card__go, .card:focus-visible .card__go { transform: none; opacity: 1; }
.card__body { display: grid; gap: var(--space-2); }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em 0.9em; font-size: 0.85rem; color: var(--muted); }
.card__meta span + span::before { content: "·"; margin-right: 0.9em; color: var(--ink-700); }
.card__title { font-size: var(--step-2); margin: 0; transition: color 0.2s; }
.card:hover .card__title { color: var(--accent-text); }
.card__summary { margin: 0; color: var(--muted); font-size: 0.98rem; max-width: 52ch; }
.card:focus-visible { outline-offset: 6px; border-radius: var(--radius); }

/* Portfolio: an editorial rhythm instead of a uniform grid. Feature row (big artwork + charcoal story panel,
   alternating sides), then a pair, then a trio. Covers are square artwork, so they are never cropped. */
.portfolio-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8) var(--space-6); }
.tile .card__media { aspect-ratio: 1 / 1; }
.tile__client { margin: 0; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.tile .card__summary, .tile__more { display: none; }
.tile .card__meta { gap: 0.35em 1.1em; }
.tile .card__meta span::before, .tile .card__meta span + span::before {
  content: ""; display: inline-block; width: 0.5em; height: 0.58em; margin-right: 0.5em; clip-path: var(--hex); background: var(--mint-400);
}
.tile__more { align-items: center; gap: 0.5em; font-weight: 600; color: var(--accent-text); }
.tile__more .icon { width: 1.1em; height: 1.1em; transition: transform 0.3s var(--ease); }
.tile:hover .tile__more .icon { transform: translateX(4px); }
.tile[data-size="feature"] .card__summary { display: block; }
.tile[data-size="feature"] .tile__more { display: inline-flex; }
.tile[data-size="feature"] .card__title { font-size: var(--step-3); letter-spacing: -0.03em; }
.tile[data-size="half"] .card__title { font-size: var(--step-2); }
.tile[data-size="third"] .card__title { font-size: var(--step-1); }
@media (min-width: 760px) {
  .portfolio-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); row-gap: var(--space-9); }
  .tile[data-size="half"] { grid-column: span 6; }
  .tile[data-size="third"] { grid-column: span 4; }
  .tile[data-size="feature"] { grid-column: 1 / -1; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0; }
  .tile[data-size="feature"] .card__media { grid-column: 1 / span 7; grid-row: 1; border-radius: var(--radius) 0 0 var(--radius); }
  .tile[data-size="feature"] .card__body {
    grid-column: 8 / -1; grid-row: 1; position: relative; isolation: isolate; overflow: hidden; align-content: center; gap: var(--space-4);
    padding: clamp(1.75rem, 1rem + 3vw, 4rem); border-radius: 0 var(--radius) var(--radius) 0;
    --text: #fff; --muted: #cbcbcb; --accent-text: var(--mint-400); --line-strong: rgba(255, 255, 255, 0.24);
    background: var(--charcoal); color: var(--text);
  }
  .tile[data-size="feature"][data-flip] .card__media { grid-column: 6 / -1; border-radius: 0 var(--radius) var(--radius) 0; }
  .tile[data-size="feature"][data-flip] .card__body { grid-column: 1 / span 5; border-radius: var(--radius) 0 0 var(--radius); }
  /* the emblem pattern, faint, in the panel corner */
  .tile[data-size="feature"] .card__body::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--pattern) right bottom / var(--pattern-size) repeat; opacity: 0.12;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 100% 100%, #000, transparent 70%); mask-image: radial-gradient(ellipse 80% 70% at 100% 100%, #000, transparent 70%);
  }
  .tile[data-size="feature"] .card__go { display: none; }
}
/* University projects: their own group beneath the main work, as trio tiles */
.portfolio-group { margin-top: var(--space-10, 8rem); padding-top: var(--space-8); border-top: 1px solid var(--line); }
.portfolio-group[hidden] { display: none; }
.portfolio-group__head { margin-bottom: var(--space-7); }
.portfolio-group__head h2 { margin: 0; font-size: var(--step-3); }
/* One row of four on desktop, two by two on tablet, stacked on phones */
@media (min-width: 760px) { .portfolio-grid--row > .tile[data-size] { grid-column: span 6; } }
@media (min-width: 1024px) { .portfolio-grid--row > .tile[data-size] { grid-column: span 3; } }
/* Tablet: trios become a little too small, so the third tile in a trio row is still a third but titles stay compact */
@media (min-width: 760px) and (max-width: 1023px) {
  .tile[data-size="third"] .card__meta { display: none; }
}

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-7); }
.filter {
  --f-bg: var(--chip-bg);
  position: relative; isolation: isolate; min-height: 44px; padding: 0.5em 1.4em; border-radius: 0; border: 0;
  background: none; color: var(--muted); font-weight: 500; font-size: 0.92rem; cursor: pointer; transition: color 0.25s var(--ease);
}
.filter::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--f-bg); clip-path: var(--hex-bar); transition: background 0.25s var(--ease); }
.filter:hover { color: var(--hover-fg); --f-bg: var(--hover-bg); }
.filter[aria-pressed="true"] { --f-bg: var(--mint-400); color: var(--on-mint); font-weight: 600; }
.filter .count { opacity: 0.6; margin-left: 0.35em; font-variant-numeric: tabular-nums; }
.card.is-hidden { display: none; }
.filter-status { min-height: 1.5em; color: var(--muted); font-size: 0.9rem; margin-top: calc(var(--space-6) * -1); margin-bottom: var(--space-6); }

/* Logo wall */
.logo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: rgba(0, 0, 0, 0.08); border: 1px solid rgba(0, 0, 0, 0.08); border-radius: var(--radius); overflow: hidden; list-style: none; }
.logo-wall li { background: #fff; }
.logo-wall a, .logo-wall div { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; padding: var(--space-4); text-decoration: none; color: var(--ink-950); }
.logo-wall img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; filter: grayscale(1) contrast(1.1); opacity: 0.7; transition: filter 0.4s, opacity 0.4s, transform 0.5s var(--ease); }
.logo-wall li:hover img, .logo-wall a:focus-visible img { filter: none; opacity: 1; transform: scale(1.04); }
.logo-wall .logo-link {
  position: absolute; inset: auto var(--space-3) var(--space-3) auto; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--mint-600); opacity: 0; transform: translateY(4px); transition: all 0.3s var(--ease);
}
.logo-wall a:hover .logo-link, .logo-wall a:focus-visible .logo-link { opacity: 1; transform: none; }
@media (hover: none) { .logo-wall img { filter: none; opacity: 1; } .logo-wall .logo-link { opacity: 1; transform: none; } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
/* separate mint tiles with charcoal type */
.stat { background: var(--mint-400); color: var(--on-mint); padding: var(--space-6) var(--space-5); border-radius: var(--radius); }
.stat__value { font-family: var(--font-display); font-size: var(--step-5); font-weight: 800; line-height: 1; letter-spacing: -0.05em; }
.stat__value small { font-size: 0.45em; color: inherit; opacity: 0.75; margin-left: 0.1em; letter-spacing: 0; }
.stat__label { color: var(--on-mint); opacity: 0.85; margin-top: var(--space-3); font-size: 0.95rem; font-weight: 500; }

/* Services */
.services { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); list-style: none; }
.service {
  position: relative; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); border-radius: var(--radius);
  background: var(--ink-900); border: 1px solid var(--line); transition: border-color 0.3s, transform 0.4s var(--ease), background 0.3s;
  overflow: hidden;
}
.service::before {
  content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(132, 199, 182, 0.12), transparent 60%);
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.service:hover { border-color: rgba(132, 199, 182, 0.45); transform: translateY(-4px); }
.service:hover::before { opacity: 1; }
.service__num { display: grid; place-items: center; width: 40px; height: 46px; clip-path: var(--hex); background: var(--mint-400); font-family: var(--font-display); color: var(--on-mint); font-weight: 700; font-size: 0.9rem; }
.service h3 { margin: 0; font-size: var(--step-2); }
.service p { color: var(--muted); margin: 0; }
.service ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; padding-top: var(--space-3); }
.service .link-arrow { margin-top: var(--space-2); }
.service .link-arrow::after { content: ""; position: absolute; inset: 0; }

/* Process */
.process { list-style: none; display: grid; gap: var(--space-5); counter-reset: step; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.process li { counter-increment: step; position: relative; padding-top: calc(var(--space-6) + 12px); border-top: 1px solid var(--line-strong); }
.process li::before {
  content: "0" counter(step); position: absolute; top: -23px; left: 0; width: 40px; height: 46px; display: grid; place-items: center;
  background: var(--mint-400); clip-path: var(--hex);
  font-family: var(--font-display); font-weight: 700; color: var(--on-mint); font-size: 0.95rem;
}
.process h3 { font-size: var(--step-1); margin-bottom: var(--space-3); }
.process p { color: var(--muted); margin: 0; font-size: 0.97rem; }

/* Reasons */
.reasons { list-style: none; display: grid; gap: var(--space-6) var(--space-7); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.reasons li { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); }
.reasons .icon-badge { width: 48px; height: 55px; clip-path: var(--hex); display: grid; place-items: center; background: var(--mint-400); color: var(--on-mint); }
.reasons .icon-badge svg { width: 22px; height: 22px; }
.reasons h3 { font-size: var(--step-1); margin: 0.35em 0 0.4em; }
.reasons p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* CTA band */
.cta-band {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: clamp(2.5rem, 2rem + 4vw, 5.5rem);
  background: var(--mint-400); color: var(--on-mint); display: grid; gap: var(--space-6); isolation: isolate;
}
.cta-band h2 { margin: 0; max-width: 16ch; }
.cta-band p { max-width: 52ch; font-size: var(--step-1); margin: 0; color: rgba(30, 30, 30, 0.85); }
.cta-band .btn { --btn-bg: var(--charcoal); --btn-fg: #fff; }
.cta-band .btn:hover, .cta-band .btn--ghost:hover { --btn-bg: #fff; --btn-fg: var(--charcoal); }
.cta-band .btn--ghost { --btn-bg: rgba(0, 0, 0, 0.1); --btn-fg: var(--on-mint); }
.cta-band :focus-visible { outline-color: var(--on-mint); }

/* Page hero (inner pages) */
.page-hero { padding-top: calc(var(--header-h) + var(--space-9)); padding-bottom: var(--space-8); position: relative; }
.page-hero h1 { max-width: 16ch; margin-bottom: var(--space-5); }
.page-hero .lead { max-width: 56ch; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 0.5em; list-style: none; font-size: 0.88rem; color: var(--muted); margin-bottom: var(--space-6); }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.5em; color: var(--ink-700); }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-text); }

/* 5. Portrait (About) ---------------------------------------------------- */
.intro__portrait { position: relative; aspect-ratio: 1 / 1; max-width: 520px; width: 100%; -webkit-mask-image: radial-gradient(circle closest-side, #000 82%, transparent 100%); mask-image: radial-gradient(circle closest-side, #000 82%, transparent 100%); }
.intro__portrait img { width: 100%; height: 100%; object-fit: cover; }

/* 6. Project page ---------------------------------------------------------- */
.project-hero { padding-top: calc(var(--header-h) + var(--space-8)); padding-bottom: var(--space-7); }
.project-hero h1 { font-size: clamp(2.4rem, 1.6rem + 4vw, 4.8rem); max-width: 18ch; margin-bottom: var(--space-5); }
.project-hero .lead { max-width: 58ch; }
.factsheet { display: grid; gap: var(--space-5); padding-block: var(--space-6); margin-top: var(--space-7); border-block: 1px solid var(--line); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.factsheet dt { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-2); font-weight: 600; }
.factsheet dd { margin: 0; font-weight: 500; }
.factsheet dd a { color: var(--accent-text); }

.project-cover { border-radius: var(--radius-lg); overflow: hidden; background: var(--ink-850); }
.project-cover img, .project-cover video { width: 100%; height: auto; max-height: 82vh; object-fit: contain; margin-inline: auto; }
/* thumbnail strip under the hero: every image and video at a glance, each opens the viewer */
.strip { margin-top: var(--space-5); }
.strip__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-5); margin-bottom: var(--space-3); }
.strip__label { margin: 0; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.strip__label span { margin-left: 0.6em; letter-spacing: 0.02em; text-transform: none; font-weight: 500; }
.strip__jump { display: inline-flex; align-items: center; gap: 0.4em; font-size: 0.88rem; font-weight: 600; color: var(--accent-text); text-decoration: none; }
.strip__jump .icon { width: 1em; height: 1em; transform: rotate(90deg); transition: transform 0.25s var(--ease); }
.strip__jump:hover { color: #fff; }
.strip__jump:hover .icon { transform: rotate(90deg) translateX(3px); }
.strip__list { list-style: none; margin: 0; padding: 4px 2px 10px; display: flex; gap: var(--space-3); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.strip__list li { flex: 0 0 auto; scroll-snap-align: start; }
.strip__thumb { position: relative; display: block; width: clamp(68px, 9vw, 112px); aspect-ratio: 1; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--ink-850); cursor: zoom-in; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.strip__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease), opacity 0.3s; opacity: 0.82; }
.strip__thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow 0.25s; }
.strip__thumb:hover img, .strip__thumb:focus-visible img { opacity: 1; transform: scale(1.06); }
.strip__thumb:hover::after { box-shadow: inset 0 0 0 2px #fff; }
.strip__thumb:focus-visible { outline: none; }
.strip__thumb:focus-visible::after { box-shadow: inset 0 0 0 3px var(--mint-400); }
.strip__play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.strip__play::before { content: ""; position: absolute; width: 34px; height: 38px; background: var(--mint-400); clip-path: var(--hex); }
.strip__play .icon { position: relative; width: 14px; height: 14px; color: var(--on-mint); margin-left: 2px; }

.project-layout { display: grid; gap: var(--space-8); }
@media (min-width: 1000px) { .project-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.85fr); gap: var(--space-9); } .project-aside { position: sticky; top: calc(var(--header-h) + var(--space-6)); align-self: start; } }
.prose { max-width: var(--max-text); }
.prose p, .prose li { color: var(--prose); font-size: 1.06rem; }
.prose h2 { font-size: var(--step-2); margin: var(--space-7) 0 var(--space-4); }
.prose h2:first-child { margin-top: 0; }
.prose ul { list-style: none; display: grid; gap: var(--space-2); margin: 0 0 var(--space-5); }
.prose ul li { position: relative; padding-left: 1.6em; }
.prose ul li::before { content: ""; position: absolute; left: 0.1em; top: 0.5em; width: 0.6em; height: 0.69em; clip-path: var(--hex); background: var(--mint-400); }
.prose a { color: var(--accent-text); }
.project-aside h2 { font-size: 0.78rem; font-family: var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-4); }
.aside-block + .aside-block { margin-top: var(--space-7); }
.doc-list { list-style: none; display: grid; gap: var(--space-3); }
.doc {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4); border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; transition: border-color 0.25s, background 0.25s, color 0.25s, transform 0.3s var(--ease);
}
.doc:hover { transform: translateX(4px); }
.doc__icon { width: 44px; height: 51px; clip-path: var(--hex); display: grid; place-items: center; background: var(--mint-400); color: var(--on-mint); flex: none; }
.doc__icon svg { width: 20px; height: 20px; }
.doc strong { display: block; font-weight: 600; font-size: 0.97rem; line-height: 1.3; }
.doc small { color: var(--muted); font-size: 0.82rem; }

.gallery { display: grid; gap: var(--space-4); grid-template-columns: repeat(12, 1fr); align-items: start; }
.gallery__item { grid-column: span 12; position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--ink-850); }
@media (min-width: 700px) {
  .gallery__item--half { grid-column: span 6; }
  .gallery__item--third { grid-column: span 4; }
}
.gallery__item img, .gallery__item video { width: 100%; height: auto; }
.gallery__item--portrait { background: #000; }
.gallery__item--portrait video { max-height: 85vh; width: auto; margin-inline: auto; }
/* portrait videos: side by side inside phone frames; click pops the video out full size */
.gallery__reel { grid-column: 1 / -1; display: flex; justify-content: center; align-items: flex-start; gap: clamp(0.75rem, 3vw, 3rem); padding-block: var(--space-6); }
.phone { margin: 0; flex: 0 1 calc(min(62vh, 580px) * 0.5625 + 2rem); min-width: 0; container-type: inline-size; }
.phone__btn { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: zoom-in; text-align: center; }
.phone__body { position: relative; display: block; padding: 4cqi; border-radius: 15cqi; background: linear-gradient(150deg, #2a2a2a, #121212 60%, #1f1f1f); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 0 0 2.2cqi #0b0b0b, 0 40px 70px -30px rgba(0, 0, 0, 0.75); transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
/* side buttons */
.phone__body::before, .phone__body::after { content: ""; position: absolute; width: 1.4cqi; border-radius: 1cqi; background: #2c2c2c; }
.phone__body::before { left: -1cqi; top: 22%; height: 16%; box-shadow: 0 -12cqi 0 -0.2cqi #2c2c2c; }
.phone__body::after { right: -1cqi; top: 28%; height: 22%; }
.phone__screen { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: 11cqi; overflow: hidden; background: #000; isolation: isolate; }
/* camera pill */
.phone__screen::after { content: ""; position: absolute; top: 3cqi; left: 50%; width: 27cqi; height: 7.5cqi; translate: -50% 0; border-radius: 99px; background: #000; z-index: 1; }
.phone__screen video { width: 100%; height: 100%; object-fit: contain; display: block; }
.phone__screen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone__hint { display: inline-flex; align-items: center; gap: 0.5em; margin-top: var(--space-4); font-size: 0.85rem; font-weight: 600; color: var(--muted); transition: color 0.2s; }
.phone__hint .icon { width: 0.9em; height: 0.9em; color: var(--accent-text, var(--mint-400)); }
.phone__btn:hover .phone__body, .phone__btn:focus-visible .phone__body { transform: translateY(-8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), inset 0 0 0 2.2cqi #0b0b0b, 0 50px 80px -30px rgba(0, 0, 0, 0.85); }
.phone__btn:hover .phone__hint, .phone__btn:focus-visible .phone__hint { color: #fff; }
.phone__btn:focus-visible { outline: none; }
.phone__btn:focus-visible .phone__screen { outline: 3px solid var(--mint-400); outline-offset: 3px; }
@media (max-width: 599px) { .phone__hint span { display: none; } .phone__hint { margin-top: var(--space-3); } }
/* video pop-out */
.lightbox__stage { width: 100%; height: 100%; display: grid; place-items: center; min-height: 0; }
.lightbox__stage video { max-height: 100%; max-width: min(100%, 1600px); width: auto; height: auto; border-radius: var(--radius-sm); background: #000; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8); }
.lightbox__stage video.is-portrait { height: min(100%, 1000px); }
.lightbox__stage img { max-width: min(1600px, 100%); max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: var(--radius-sm); }
/* percentages don't resolve inside the grid stage, so cap by the screen height too (tall pages and portrait images fit) */
.lightbox__stage img, .lightbox__stage video { max-height: calc(100vh - 2 * var(--space-8)); max-height: calc(100dvh - 2 * var(--space-8)); }
.gallery__item--contain img { object-fit: contain; }
.gallery__btn { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gallery__btn img { transition: transform 0.9s var(--ease); }
.gallery__btn:hover img { transform: scale(1.025); }
.gallery__item video { background: #000; }

.project-nav { display: grid; gap: var(--space-4); }
@media (min-width: 760px) { .project-nav { grid-template-columns: 1fr 1fr; } }
.project-nav a {
  display: grid; grid-template-columns: 96px 1fr; gap: var(--space-5); align-items: center; padding: var(--space-4); border-radius: var(--radius);
  border: 1px solid var(--line); text-decoration: none; transition: border-color 0.3s, background 0.3s;
}
.project-nav img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-sm); }
.project-nav small { display: block; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: var(--space-1); }
.project-nav strong { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.15; }
.project-nav .next { text-align: right; grid-template-columns: 1fr 96px; }
.project-nav .next img { order: 2; }
@media (max-width: 759px) { .project-nav .next { text-align: left; grid-template-columns: 96px 1fr; } .project-nav .next img { order: 0; } }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(38, 38, 38, 0.96); padding: var(--space-8) var(--space-4); opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.lightbox[open], .lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox button { position: absolute; isolation: isolate; width: 52px; height: 60px; border: 0; background: none; color: var(--on-mint); cursor: pointer; display: grid; place-items: center; }
.lightbox button::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--mint-400); clip-path: var(--hex); transition: background 0.2s; }
.lightbox button:hover::before { background: #fff; }
.lightbox button svg { width: 22px; height: 22px; }
.lightbox__close { top: var(--space-4); right: var(--space-4); }
.lightbox__prev { left: var(--space-4); top: 50%; transform: translateY(-50%); }
.lightbox__next { right: var(--space-4); top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; bottom: var(--space-4); left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* About */
.about-hero { display: grid; gap: var(--space-8); align-items: center; padding-top: calc(var(--header-h) + var(--space-8)); padding-bottom: var(--space-8); }
@media (min-width: 960px) { .about-hero { grid-template-columns: 1.3fr 1fr; } }
.about-hero h1 { max-width: 14ch; }
.timeline { list-style: none; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 140px 1fr; gap: var(--space-5); padding: var(--space-5) 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.timeline .years { font-family: var(--font-display); font-weight: 600; color: var(--accent-text); }
.timeline .role { font-size: var(--step-1); font-weight: 500; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: var(--space-1); } }
.split { display: grid; gap: var(--space-8); }
@media (min-width: 960px) { .split { grid-template-columns: 1fr 1.3fr; gap: var(--space-9); } }
.tool-list { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; }

/* Contact */
.contact-grid { display: grid; gap: var(--space-8); }
@media (min-width: 980px) { .contact-grid { grid-template-columns: 1fr 1.35fr; gap: var(--space-9); } }
.contact-cards { list-style: none; display: grid; gap: var(--space-3); }
.contact-card {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5); border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; transition: border-color 0.25s, background 0.25s, color 0.25s, transform 0.3s var(--ease);
}
a.contact-card:hover { transform: translateY(-2px); }
/* Linked cards invert on hover, like the buttons; the mint hexagon icon stays */
.doc:hover, a.contact-card:hover, .project-nav a:hover {
  --text: var(--hover-fg); --muted: var(--hover-muted); background: var(--hover-bg); color: var(--hover-fg); border-color: var(--hover-bg);
}
.contact-card .doc__icon { width: 48px; height: 55px; }
.contact-card small { display: block; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.contact-card strong { font-weight: 600; font-size: 1.05rem; word-break: break-word; }

.form { display: grid; gap: var(--space-5); padding: clamp(1.5rem, 1rem + 2vw, 2.75rem); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.form__row { display: grid; gap: var(--space-5); }
@media (min-width: 640px) { .form__row--2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: var(--space-2); }
.field label, .field legend { font-weight: 500; font-size: 0.92rem; }
.field .req { color: var(--accent-text); }
.field .hint { color: var(--muted); font-size: 0.82rem; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 52px; padding: 0.8em 1em; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background-color: var(--field-bg); color: var(--text); transition: border-color 0.2s, box-shadow 0.2s; font-size: 1rem;
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbcbcb' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1em center; background-size: 18px; padding-right: 2.8em; }
.section--paper .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6e6e' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.section--paper .card__media::after { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.field textarea { min-height: 160px; resize: vertical; line-height: 1.55; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--muted); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--mint-400); box-shadow: 0 0 0 3px rgba(132, 199, 182, 0.2); }
.field [aria-invalid="true"] { border-color: #ff8a80; }
.field .error { color: var(--error); font-size: 0.85rem; min-height: 0; }
.field input[type="file"] { padding: 0.7em; cursor: pointer; }
.field input[type="file"]::file-selector-button { margin-right: 1em; padding: 0.5em 1em; border-radius: 0; clip-path: var(--hex-bar); padding-inline: 1.4em; border: 0; background: var(--mint-400); color: var(--on-mint); cursor: pointer; font-weight: 600; }
.chip-group { min-width: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); border: 0; padding: 0; margin: 0; }
.chip-group legend { margin-bottom: var(--space-3); }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 0.6em 1.4em; clip-path: var(--hex-bar); background: var(--chip-bg); color: var(--muted); font-size: 0.9rem; cursor: pointer; transition: all 0.2s; user-select: none; }
.chip:hover span { color: var(--hover-fg); background: var(--hover-bg); }
.chip input:checked + span { background: var(--mint-400); color: var(--on-mint); font-weight: 600; }
.chip:has(input:focus-visible) { outline: 2px solid var(--mint-400); outline-offset: 3px; }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.form__foot p { margin: 0; color: var(--muted); font-size: 0.85rem; max-width: 40ch; }
.form__status { padding: var(--space-4) var(--space-5); border-radius: var(--radius-sm); font-weight: 500; }
.form__status[hidden] { display: none; }
.form__status--ok { background: rgba(132, 199, 182, 0.14); color: var(--accent-text); border: 1px solid rgba(132, 199, 182, 0.4); }
.form__status--err { background: rgba(255, 138, 128, 0.1); color: var(--error); border: 1px solid rgba(255, 138, 128, 0.35); }
.hp { position: absolute; left: -9999px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* 404 */
.not-found { min-height: 80vh; display: grid; place-items: center; text-align: center; padding-top: var(--header-h); }
.not-found img { width: 120px; margin: 0 auto var(--space-6); }

/* 7. Motion ---------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

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

@media print {
  .site-header, .site-footer, .nav-toggle, .lightbox { display: none !important; }
  body { background: #fff; color: #000; }
}

.project-hero .eyebrow .tag { margin-left: 0.5em; letter-spacing: 0; text-transform: none; color: var(--muted); }
.timeline { margin-top: var(--space-4); }

/* Grid balancing (avoid orphaned cards) */
@media (min-width: 760px) {
  .reasons { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); }
  .services { grid-template-columns: repeat(2, 1fr); }
  .services > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .process { grid-template-columns: repeat(4, 1fr); }
  .services { grid-template-columns: repeat(6, 1fr); }
  .services > * { grid-column: span 2; }
  .services > :nth-child(4), .services > :nth-child(5) { grid-column: span 3; }
  .services > :nth-child(5):last-child { grid-column: span 3; }
}
/* Feature grid: equal row heights for 7/5 column pairs */
@media (min-width: 760px) {
  .work-grid--feature > :nth-child(4n + 2) .card__media,
  .work-grid--feature > :nth-child(4n + 3) .card__media { aspect-ratio: 0.93 / 1; }
}
/* Footer */
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.2fr 0.7fr 0.9fr minmax(230px, 1.3fr); } }
.footer-grid a { overflow-wrap: anywhere; }
.footer-grid .social { display: flex; }
@media (max-width: 600px) {
  .btn-row .btn { flex: 1 1 auto; }
}
/* Prevent grid children from expanding past the viewport */
.contact-grid > *, .project-layout > *, .split > *, .about-hero > *, .form__row > *, .footer-grid > * { min-width: 0; }
.field input, .field textarea, .field select { min-width: 0; max-width: 100%; }
.prose, .lead, .card__summary { overflow-wrap: break-word; }
.prose a { overflow-wrap: anywhere; }

/* 8. Brand pattern & emblem details ----------------------------------------
   The GM emblem repeated on an offset grid (static/img/pattern.svg), faded
   towards the edges like the brand background artwork. */
.page-hero, .project-hero, .about-hero, .not-found, .site-footer { position: relative; isolation: isolate; }
.page-hero::before, .project-hero::before, .about-hero::before, .not-found::before, .site-footer::before, .nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--pattern) center top / var(--pattern-size) repeat;
  opacity: 0.075;
  -webkit-mask-image: radial-gradient(ellipse 60% 75% at 50% 35%, #000 15%, transparent 80%);
  mask-image: radial-gradient(ellipse 60% 75% at 50% 35%, #000 15%, transparent 80%);
}
.site-footer::before { opacity: 0.07; -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 0%, #000 10%, transparent 80%); mask-image: radial-gradient(ellipse 65% 55% at 50% 0%, #000 10%, transparent 80%); }
.nav::before { display: none; }
@media (max-width: 860px) { .nav::before { display: block; opacity: 0.07; } }
.cta-band::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: var(--pattern-dark) center / var(--pattern-size) repeat; opacity: 0.12;
  -webkit-mask-image: linear-gradient(100deg, transparent 25%, #000 90%); mask-image: linear-gradient(100deg, transparent 25%, #000 90%);
}

/* Stats: mint hexagon marker */
.stat { position: relative; }
.stat::before { content: ""; display: block; width: 14px; height: 16px; margin-bottom: var(--space-4); background: var(--on-mint); clip-path: var(--hex); }

/* Timeline: hexagon markers */
.timeline .years { display: inline-flex; align-items: center; gap: 0.6em; }
.timeline .years::before { content: ""; width: 10px; height: 12px; flex: none; background: var(--mint-400); clip-path: var(--hex); }

.logo-wall li { background: #fff; }

/* Media containers: crisp, angular corners to echo the emblem */
.card__media::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07); }
.project-cover, .gallery__item { box-shadow: 0 30px 60px -35px rgba(0, 0, 0, 0.6); }

/* 9. Landing page -----------------------------------------------------------
   Full-screen moving emblem pattern with the animated logo centre stage.
   The whole logo is the link into the Selected Portfolio. */
.landing-page { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; overflow: hidden; background: var(--charcoal); }
.landing-page::before {
  content: ""; position: fixed; inset: -198px -216px 0 0; z-index: -1; pointer-events: none;
  background: var(--pattern) 0 0 / var(--pattern-size) repeat; opacity: 0.16;
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at 50% 50%, #000 25%, transparent 85%);
  mask-image: radial-gradient(ellipse 70% 75% at 50% 50%, #000 25%, transparent 85%);
}
.landing { position: relative; display: grid; place-items: center; padding: var(--space-6) var(--gutter); }
.landing__enter { position: relative; display: grid; justify-items: center; gap: var(--space-6); text-decoration: none; color: var(--text); cursor: pointer; border-radius: var(--radius); }
.landing__logo { position: relative; display: grid; place-items: center; width: min(88vw, calc(100svh - 240px), 860px); min-width: 260px; aspect-ratio: 1; }
.landing__logo::before, .landing__logo::after {
  content: ""; position: absolute; inset: var(--ring-inset, 4% 9%); z-index: -1; pointer-events: none; opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 115' preserveAspectRatio='none'%3E%3Cpolygon points='50,1.5 98.5,29.25 98.5,85.75 50,113.5 1.5,85.75 1.5,29.25' fill='none' stroke='%2384c7b6' stroke-width='1.2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.landing__enter:hover .landing__logo::before, .landing__enter:focus-visible .landing__logo::before { opacity: 0.9; transform: scale(1.08); transition: opacity 0.4s, transform 0.6s var(--ease); }
.landing__video, .landing__svg { width: 100%; height: 100%; object-fit: contain; transition: transform 0.6s var(--ease), filter 0.5s var(--ease); }
.landing__svg { filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.35)); }
/* The animation has a transparent background in the master file. H.264 can't carry alpha, so it's encoded
   on black and blended with "lighten": black drops out and the charcoal and pattern show through. */
.landing__video { object-fit: cover; mix-blend-mode: lighten; filter: none; }
/* Video frame. The animation (boxes expanding at full size) spans the middle 1200 x 1080 px of the 1920 x 1080
   master, so the frame is shown 1.15x as wide as it is tall: only the empty outer sides are cropped. Its height is
   as much as the screen allows, and on narrow screens it shrinks so that the full width still fits.
   The finished logo sits in the middle ~40% of the frame height, so the prompt floats just beneath it. */
.landing__enter:has(.landing__video) {
  --h: min(calc(100svh - 170px), 900px, calc((100vw - var(--gutter) * 2) / 1.15));
  gap: 0;
}
.landing__logo:has(.landing__video) {
  width: calc(var(--h) * 1.15); height: var(--h); min-width: 0; aspect-ratio: auto;
  --ring-inset: 26% calc(50% - var(--h) * 0.208);
}
.landing__enter:has(.landing__video) .landing__cta { position: absolute; left: 50%; top: calc(var(--h) * 0.77); translate: -50% 0; white-space: nowrap; }
/* Portrait screens have room to spare below the frame: the prompt sits under the animation instead of over it */
@media (max-aspect-ratio: 1/1) {
  .landing__enter:has(.landing__video) .landing__cta { position: relative; left: auto; top: auto; translate: none; margin-top: var(--space-4); }
}
/* Effects go on the video itself: transforming/filtering an ancestor would isolate it and break the blend */
.landing__enter:hover :is(.landing__video, .landing__svg), .landing__enter:focus-visible :is(.landing__video, .landing__svg) { transform: scale(1.04); }
.landing__cta {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 0.7em; padding: 0.85em 2em;
  font-weight: 600; letter-spacing: 0.02em; color: var(--on-mint);
}
.landing__cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--mint-400); clip-path: var(--hex-bar); transition: background 0.25s; }
.landing__cta .icon { width: 1.1em; height: 1.1em; transition: transform 0.3s var(--ease); }
/* The callout only turns white when the pointer is on the callout itself (or the link has keyboard focus) */
.landing__cta:hover::before, .landing__enter:focus-visible .landing__cta::before { background: #fff; }
.landing__cta:hover .icon, .landing__enter:focus-visible .landing__cta .icon { transform: translateX(4px); }
.landing__foot { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3) var(--space-6); padding: var(--space-5) var(--gutter); color: var(--muted); font-size: 0.85rem; }
.landing__foot p { margin: 0; }
.landing__foot nav { display: flex; gap: var(--space-5); }
.landing__foot a { text-decoration: none; color: var(--muted); transition: color 0.2s; }
.landing__foot a:hover { color: var(--accent-text); }
@media (max-width: 600px) { .landing__foot { justify-content: center; text-align: center; } .landing__logo { width: min(88vw, calc(100svh - 260px)); } }

/* Vector fallback: the emblem pieces assemble (used until the logo animation file is added) */
.landing__svg path { transform-box: fill-box; transform-origin: center; animation: piece-in 1.1s var(--ease) both; }
.landing__svg path:nth-of-type(1) { --from: 0, -40%; animation-delay: 0.15s; }
.landing__svg path:nth-of-type(2) { --from: 0, 0; animation-delay: 0.35s; }
.landing__svg path:nth-of-type(3) { --from: 0, 40%; animation-delay: 0.55s; }
@keyframes piece-in { from { opacity: 0; transform: translate(var(--from)) scale(0.92); } }

@media (prefers-reduced-motion: no-preference) {
  .landing-page::before { animation: pattern-drift 40s linear infinite; }
  @keyframes pattern-drift { to { transform: translate(216px, 198px); } }
  .landing__cta { animation: cta-in 0.8s 3.8s var(--ease) both; }
  @keyframes cta-in { from { opacity: 0; transform: translateY(12px); } }
  .landing__logo::after { animation: ring 2.8s 4s ease-out infinite; }
  @keyframes ring { 0% { opacity: 0; transform: scale(0.95); } 25% { opacity: 0.7; } 100% { opacity: 0; transform: scale(1.22); } }
}
.landing__enter.is-leaving :is(.landing__video, .landing__svg) { transform: scale(1.12); }
/* Exit: fade a charcoal overlay in (fading the page itself would break the video blend) */
.landing-page::after { content: ""; position: fixed; inset: 0; z-index: 10; background: var(--charcoal); opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease); }
.landing-page.is-leaving::after { opacity: 1; }

/* White sections: the mint hexagon pattern, very faint, in one corner for continuity */
.section--paper { position: relative; isolation: isolate; }
.section--paper::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--pattern-dark) right top / var(--pattern-size) repeat; opacity: 0.05;
  -webkit-mask-image: radial-gradient(ellipse 45% 70% at 100% 0%, #000, transparent 70%); mask-image: radial-gradient(ellipse 45% 70% at 100% 0%, #000, transparent 70%);
}
.section--paper + .section--paper { border-top: 1px solid var(--line); }

/* Discourage saving the artwork: no dragging, no iOS long-press save sheet, no accidental selection highlight */
img, video, picture { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* Project documents: a page thumbnail that opens the document in the viewer */
.doc--view { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.doc__thumb { flex: 0 0 auto; width: 56px; aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; background: var(--paper, #f4f4f4); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.doc__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
