/* ==========================================================================
   elsonbaty.com (2026 redesign)
   One idea: the page can be read as the design or as its code (the switch in
   the menu). Everything else stays quiet.

   Color   white canvas, black ink (matches the wordmark), the logo's orange
           dot as the only accent. Code mode is a dark editor.
   Type    Geist for everything; Geist Mono only for code and measurements.
   Scale   Tailwind steps only. Spacing only from the --s-* tokens.
   ========================================================================== */

:root {
  /* design mode */
  --canvas: #FFFFFF;
  --surface: #F3F3F1;
  --line: #E4E4E0;
  --ink: #000000;
  --ink-2: #5F5F5A;          /* secondary text, 6.6:1 on white */
  --accent: #FF8A56;         /* the dot in the logo; lines and shapes only */
  --accent-ink: #C4531F;     /* accent when it has to be read as text, 4.6:1 */

  /* code mode */
  --code-bg: #181818;
  --code-panel: #1F1F1F;
  --code-line: #313131;
  --code-text: #E8E8E3;
  --code-muted: #8A8A85;
  --code-tag: #FF8A56;
  --code-attr: #8FB8FF;
  --code-string: #B5D99C;

  --font: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;

  /* spacing tokens */
  --s-25: 2px;  --s-50: 4px;   --s-75: 8px;   --s-100: 12px; --s-200: 16px;
  --s-300: 24px; --s-400: 32px; --s-500: 40px; --s-600: 48px; --s-700: 64px;
  --s-800: 80px; --s-900: 96px;

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

  /* layered buttons: four stacked shadows (primary = black) */
  --btn-primary: linear-gradient(180deg, #262626 0%, #000000 100%);
  --btn-primary-hover: linear-gradient(180deg, #2E2E2E 0%, #0A0A0A 100%);
  --btn-primary-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -2px 0 rgba(0, 0, 0, .4),
    0 1px 2px rgba(0, 0, 0, .35),
    0 8px 22px -6px rgba(0, 0, 0, .45);
  --btn-primary-shadow-hover:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    inset 0 -2px 0 rgba(0, 0, 0, .4),
    0 1px 2px rgba(0, 0, 0, .35),
    0 12px 28px -6px rgba(0, 0, 0, .5);
  --btn-pressed: inset 0 2px 4px rgba(0, 0, 0, .45);
  --btn-neutral: linear-gradient(180deg, #FFFFFF 0%, #F6F6F4 100%);
  --btn-neutral-shadow:
    inset 0 1px 0 #fff,
    inset 0 -2px 0 rgba(0, 0, 0, .06),
    0 1px 2px rgba(0, 0, 0, .12),
    0 6px 16px -8px rgba(0, 0, 0, .22);
  --btn-neutral-shadow-hover:
    inset 0 1px 0 #fff,
    inset 0 -2px 0 rgba(0, 0, 0, .06),
    0 1px 2px rgba(0, 0, 0, .12),
    0 10px 22px -8px rgba(255, 138, 86, .35);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--s-900); }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: var(--s-200); top: var(--s-200); z-index: 100;
  padding: var(--s-75) var(--s-100); background: var(--ink); color: var(--canvas);
  border-radius: 8px; transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- text styles (named, from the type scale) ---------- */
.heading-1 { font-size: 60px; line-height: 60px; font-weight: 600; letter-spacing: -0.03em; }
.heading-2 { font-size: 48px; line-height: 48px; font-weight: 600; letter-spacing: -0.025em; }
.heading-3 { font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -0.02em; }
.heading-5 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.title-1   { font-size: 20px; line-height: 28px; font-weight: 500; }
.title-2   { font-size: 18px; line-height: 28px; font-weight: 500; }
.body-3    { font-size: 16px; line-height: 24px; font-weight: 400; }
.body-5    { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-6    { font-size: 14px; line-height: 20px; font-weight: 400; }
.body-lead { font-size: 18px; line-height: 28px; font-weight: 400; }   /* "Body 7": text-lg regular */
.caption-1 { font-size: 14px; line-height: 20px; font-weight: 500; }
.caption-2 { font-size: 14px; line-height: 20px; font-weight: 400; }
.button-md { font-size: 16px; line-height: 24px; font-weight: 600; }
.button-sm { font-size: 14px; line-height: 20px; font-weight: 600; }

/* ---------- layout ---------- */
.container { width: min(1200px, 100% - 2 * var(--s-300)); margin-inline: auto; }
.section { padding-block: var(--s-900); }
.section + .section .design { border-top: 1px solid var(--line); padding-top: var(--s-900); }
.section + .section { padding-top: 0; }
.clients + .work .design { border-top: 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s-300); margin-bottom: var(--s-600); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap;
  padding: var(--s-75) var(--s-100);
  border-radius: 8px;
  font-size: 16px; line-height: 24px; font-weight: 600;   /* Button-md */
  text-decoration: none;
  transition: box-shadow .2s var(--ease), transform .12s var(--ease), background .2s var(--ease);
}
.btn-primary { background: var(--btn-primary); color: #fff; box-shadow: var(--btn-primary-shadow); }
.btn-primary:hover { background: var(--btn-primary-hover); box-shadow: var(--btn-primary-shadow-hover); }
.btn-secondary { background: var(--btn-neutral); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--btn-neutral-shadow); }
.btn-secondary:hover { box-shadow: var(--btn-neutral-shadow-hover); }
.btn:active { box-shadow: var(--btn-pressed); transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn-text {
  font-size: 16px; line-height: 24px; font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--line);
  text-decoration-thickness: 2px; text-underline-offset: 6px;
  transition: text-decoration-color .3s var(--ease);
}
.btn-text:hover { text-decoration-color: var(--accent); }

/* ---------- navigation: compact floating bar ---------- */
.nav-wrap { position: fixed; top: var(--s-200); left: 0; right: 0; z-index: 50; pointer-events: none; }
.nav {
  pointer-events: auto;
  width: max-content; max-width: calc(100% - 2 * var(--s-200));
  margin-inline: auto;
  display: flex; align-items: center; gap: var(--s-300);
  padding: var(--s-75) var(--s-75) var(--s-75) var(--s-200);
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(0, 0, 0, .06);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .18);
}
.nav-logo img { width: 150px; height: auto; }
.logo-light { display: none; }
.nav-links { display: flex; gap: var(--s-50); }
.nav-links a {
  display: block; padding: var(--s-75) var(--s-100); border-radius: 8px;
  font-size: 14px; line-height: 20px; font-weight: 500;   /* Title 4 */
  text-decoration: none; color: var(--ink-2);
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: var(--surface); }

/* Design / Code switch */
.mode-switch {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  padding: var(--s-25); border-radius: 10px; background: var(--surface);
}
.mode-switch button {
  position: relative; z-index: 1;
  min-width: 64px; padding: var(--s-50) var(--s-100);
  border: 0; border-radius: 8px; background: none; cursor: pointer;
  font-size: 14px; line-height: 20px; font-weight: 600;   /* Button-sm */
  color: var(--ink-2);
  transition: color .3s var(--ease);
}
.mode-switch button[aria-pressed="true"] { color: var(--ink); }
.mode-thumb {
  position: absolute; top: var(--s-25); bottom: var(--s-25); left: var(--s-25);
  width: calc(50% - var(--s-25)); border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 4px 10px -4px rgba(0, 0, 0, .2);
  transition: transform .5s var(--ease), background-color .3s var(--ease);
}

.menu-toggle {
  display: none; position: relative; width: 40px; height: 40px;
  border: 0; border-radius: 8px; background: none; cursor: pointer;
}
.menu-toggle span {
  position: absolute; left: 11px; width: 18px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform .5s var(--ease);
}
.menu-toggle span:first-child { transform: translateY(-4px); }
.menu-toggle span:last-child { transform: translateY(4px); }
.menu-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: -1; pointer-events: auto;
  padding: calc(var(--s-900) + var(--s-400)) var(--s-300) var(--s-300);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.mobile-menu a {
  display: block; padding-block: var(--s-100);
  font-size: 30px; line-height: 36px; font-weight: 600; text-decoration: none;   /* Heading 4 */
}
.mobile-menu li { opacity: 0; transform: translateY(var(--s-300)); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.mobile-menu.is-open li { opacity: 1; transform: none; }
.mobile-menu.is-open li:nth-child(2) { transition-delay: 60ms; }
.mobile-menu.is-open li:nth-child(3) { transition-delay: 120ms; }
.mobile-menu.is-open li:nth-child(4) { transition-delay: 180ms; }

/* ---------- hero ---------- */
.hero { padding-top: calc(var(--s-900) + var(--s-800)); }
.hero-heading { position: relative; display: inline-block; max-width: 680px; }
.hero-title {
  background: linear-gradient(90deg, #000000, #666666);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: var(--s-700); align-items: center; }
.hero-sub { max-width: 680px; margin-top: var(--s-700); color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-300); margin-top: var(--s-400); }

/* hero code peek: the headline, read live from the page */
.hero-peek { display: grid; gap: var(--s-75); }
.hero-peek-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-200); margin-top: var(--s-100); }
.hero-peek-foot .caption-2 { color: var(--ink-2); max-width: 240px; }
.hero-peek { transition: opacity .7s var(--ease) .3s, transform .7s var(--ease) .3s; }
.js:not(.is-ready) .hero-peek { opacity: 0; transform: translateY(var(--s-300)); }

/* redlines: designer's measurements around the headline (sizes filled in by JS) */
.redline { position: absolute; inset: 0; pointer-events: none; font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--accent-ink); }
.redline-width {
  position: absolute; left: 0; bottom: calc(-1 * var(--s-300)); height: var(--s-75);
  border-inline: 1px solid var(--accent);
  transform-origin: left; transform: scaleX(0);
  transition: transform .5s var(--ease) .35s;
}
.redline-width::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--accent); }
.redline-label {
  position: absolute; left: 50%; top: var(--s-100); transform: translateX(-50%);
  padding-inline: var(--s-50); background: var(--canvas); white-space: nowrap;
}
.redline-spec {
  position: absolute; left: calc(100% + var(--s-300)); top: var(--s-200);
  padding-left: var(--s-300); white-space: nowrap; opacity: 0;
  transition: opacity .5s var(--ease) .7s;
}
.redline-spec::before { content: ""; position: absolute; left: 0; top: 50%; width: var(--s-200); height: 1px; background: var(--accent); }
.is-ready .redline-width { transform: scaleX(1); }
.is-ready .redline-spec { opacity: 1; }

/* hero headline entrance: the one load animation */
.hero-title, .hero-sub, .hero-actions { transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js:not(.is-ready) .hero-title,
.js:not(.is-ready) .hero-sub,
.js:not(.is-ready) .hero-actions { opacity: 0; transform: translateY(var(--s-300)); }
.hero-sub { transition-delay: .08s; }
.hero-actions { transition-delay: .16s; }

/* ---------- clients ---------- */
.clients { padding-top: 0; }
.clients-label { color: var(--ink-2); margin-bottom: var(--s-300); }
.clients-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-300); align-items: center; }
.clients-list img { width: auto; max-width: 160px; max-height: 48px; filter: grayscale(1); mix-blend-mode: multiply; opacity: .8; }

/* ---------- work ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-600) var(--s-400); }
.work-grid:not(.projects-grid) .work-card:first-child { grid-column: 1 / -1; }
.work-link { display: block; text-decoration: none; }
/* each project sits whole on a white artboard: nothing is cropped */
.work-media { overflow: hidden; border-radius: 16px; background: #fff; border: 1px solid var(--line); aspect-ratio: 4 / 3; padding: var(--s-300); }
.work-grid:not(.projects-grid) .work-card:first-child .work-media { aspect-ratio: 16 / 7; }
.work-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .5s var(--ease); }
.work-link:hover .work-media img { transform: scale(1.03); }
.work-title { margin-top: var(--s-200); }
.work-meta { margin-top: var(--s-50); color: var(--ink-2); }
.work-link:focus-visible { outline-offset: var(--s-75); border-radius: 16px; }

/* ---------- statement (words light up on scroll) ---------- */
.statement-text { max-width: 880px; }
[data-reveal-words] .word { color: rgba(0, 0, 0, .25); transition: color .6s var(--ease); }
[data-reveal-words] .word.is-lit { color: var(--ink); }

/* ---------- crafts ---------- */
.crafts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-400); margin-top: var(--s-600); }
.craft { padding: var(--s-400); border: 1px solid var(--line); border-radius: 16px; }
.craft-list { margin-top: var(--s-300); }
.craft-list li { padding-block: var(--s-100); border-top: 1px solid var(--line); }
.craft-tools { margin-top: var(--s-300); color: var(--ink-2); }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-800); }
.about-intro .body-lead { margin-top: var(--s-300); color: var(--ink-2); max-width: 560px; }
.photo-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-300) var(--s-200); margin-top: var(--s-500); }
.photo { display: block; overflow: hidden; border-radius: 12px; aspect-ratio: 3 / 2; background: var(--surface); cursor: zoom-in; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.photo:hover img { transform: scale(1.03); }
.photo-name {
  display: flex; justify-content: space-between; gap: var(--s-75); margin-top: var(--s-75);
  font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--ink-2);
}
.photo-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline { margin-top: var(--s-300); }
.timeline li {
  display: grid; grid-template-columns: 112px 1fr; column-gap: var(--s-300);
  padding-block: var(--s-200); border-top: 1px solid var(--line);
}
.timeline-years { grid-row: span 2; color: var(--ink-2); padding-top: var(--s-50); }
.timeline .body-6 { color: var(--ink-2); }
.timeline-sub { margin-top: var(--s-600); }
.education a { text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 2px; text-underline-offset: 4px; transition: text-decoration-color .3s var(--ease); }
.education a:hover { text-decoration-color: var(--accent); }
.about-education { grid-column: 1 / -1; }
.about-education .education { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s-800); }
.education-note { margin-top: var(--s-200); color: var(--ink-2); }

/* ---------- contact ---------- */
.contact-cta .body-lead { margin-top: var(--s-300); color: var(--ink-2); }

/* ---------- footer ---------- */
.footer { padding-block: var(--s-400) var(--s-600); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-200) var(--s-400); padding-top: var(--s-400); border-top: 1px solid var(--line); }
.footer-logo img { width: 130px; }
.footer-inner .caption-2 { color: var(--ink-2); }
.footer-links { display: flex; gap: var(--s-300); margin-left: auto; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-copy { width: 100%; }

/* ---------- inner page heroes ---------- */
.page-hero, .project-hero { padding-bottom: var(--s-500); }
.page-hero + .section .design,
.project-hero + .section .design { border-top: 0; padding-top: var(--s-700); }
.back-link {
  display: block; width: max-content; margin-bottom: var(--s-300); color: var(--ink-2);
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px;
}
.back-link:hover { color: var(--ink); text-decoration-color: var(--accent); }

/* ---------- projects page ---------- */
.projects-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-200); margin-bottom: var(--s-600); }
.projects-bar .statement-spec { margin-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: var(--s-25); padding: var(--s-25); border-radius: 10px; background: var(--surface); }
.filters:empty { display: none; }
.filters button {
  padding: var(--s-50) var(--s-100); border: 0; border-radius: 8px; background: none; cursor: pointer;
  font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-2);   /* Button-sm */
  transition: color .3s var(--ease), background-color .3s var(--ease), box-shadow .3s var(--ease);
}
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 4px 10px -4px rgba(0, 0, 0, .2); }
.filters button span { margin-left: var(--s-50); font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--ink-2); }
.projects-grid { grid-template-columns: repeat(3, 1fr); }
.filter-empty { color: var(--ink-2); }

/* ---------- project page ---------- */
.project-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-700); align-items: end; }
.props { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.props-head { padding: var(--s-100) var(--s-200); border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; font-weight: 500; }
.props-list > div { display: grid; grid-template-columns: 96px 1fr; gap: var(--s-200); padding: var(--s-100) var(--s-200); }
.props-list > div + div { border-top: 1px solid var(--line); }
.props-list dt { font-size: 14px; line-height: 20px; color: var(--ink-2); }
.props-list dd { margin: 0; font-size: 14px; line-height: 20px; }
.props-list a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.props-list a:hover { text-decoration-color: var(--accent); }
.mono { font-family: var(--mono); font-size: 12px; }

.cover-frame { position: relative; display: grid; place-items: center; padding: var(--s-400); border-radius: 16px; background: var(--surface); }
.cover-frame img { max-height: 80vh; width: auto; }
.cover-frame.is-selected { outline: 1px solid var(--accent); outline-offset: var(--s-75); }
.cover-frame > i { position: absolute; width: 7px; height: 7px; background: #fff; border: 1px solid var(--accent); }
.cover-frame > i:nth-of-type(1) { left: -12px; top: -12px; }
.cover-frame > i:nth-of-type(2) { right: -12px; top: -12px; }
.cover-frame > i:nth-of-type(3) { left: -12px; bottom: -12px; }
.cover-frame > i:nth-of-type(4) { right: -12px; bottom: -12px; }
.frame-badge {
  position: absolute; left: 50%; top: calc(100% + var(--s-200)); transform: translateX(-50%);
  padding: var(--s-25) var(--s-75); border-radius: 4px; background: var(--accent); color: #000;
  font-family: var(--mono); font-size: 12px; line-height: 16px; white-space: nowrap;
}
.frame-badge:empty { display: none; }
.cover { padding-bottom: var(--s-900); }

.story-inner { max-width: 1200px; }
.prose { max-width: 720px; font-size: 18px; line-height: 28px; color: var(--ink-2); }
.prose > * + * { margin-top: var(--s-200); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose h2, .prose h3, .prose h4 { margin-top: var(--s-500); color: var(--ink); font-size: 24px; line-height: 32px; font-weight: 600; }
.prose blockquote { margin: 0; color: var(--ink); font-size: 20px; line-height: 28px; font-weight: 500; }
.prose ul { padding-left: var(--s-300); list-style: disc; }
.prose li + li { margin-top: var(--s-50); }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 4px; }
.prose figure { width: min(1200px, 100vw - 2 * var(--s-300)); max-width: none !important; margin-block: var(--s-500); }
.prose figure img { width: 100%; border: 1px solid var(--line); border-radius: 12px; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; }

.next-inner { display: grid; justify-items: start; gap: var(--s-200); }
.next-label { color: var(--ink-2); }
.next-title { text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 2px; text-underline-offset: 8px; transition: text-decoration-color .3s var(--ease); }
.next-title:hover { text-decoration-color: var(--accent); }
.next-inner .btn { margin-top: var(--s-200); }

/* ---------- contact page ---------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-700); align-items: start; }
.form-wrap { position: relative; padding: var(--s-400); border: 1px solid var(--line); border-radius: 16px; }
.field { display: grid; gap: var(--s-75); }
.contact-form > .field, .field-row { margin-top: var(--s-300); }
.contact-form > .field-row:first-of-type { margin-top: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-200); }
.field input, .field select, .field textarea {
  width: 100%; padding: var(--s-75) var(--s-100);
  font: inherit; font-size: 16px; line-height: 24px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 144px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #C9C9C3; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 138, 86, .35); }
.field [aria-invalid="true"] { border-color: var(--accent-ink); }
.field-error { color: var(--accent-ink); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-200); margin-top: var(--s-400); }
.form-status { color: var(--ink-2); }
.form-status.is-error { color: var(--accent-ink); }
.btn[disabled] { opacity: .6; cursor: progress; }
.captcha:empty { display: none; }

/* a design tool comment pinned to the form */
.comment-pin { position: absolute; top: calc(-1 * var(--s-300)); right: var(--s-300); display: flex; align-items: start; gap: var(--s-75); pointer-events: none; }
.comment-avatar {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50% 50% 50% 0;
  background: var(--accent); color: #000; font-size: 12px; line-height: 16px; font-weight: 600;
}
.comment-bubble {
  padding: var(--s-75) var(--s-100); border: 1px solid var(--line); border-radius: 12px; background: #fff;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .25); font-size: 14px; line-height: 20px;
}
.comment-bubble b { display: block; font-size: 12px; line-height: 16px; font-weight: 600; }
.direct .props-list { margin-top: var(--s-300); border: 1px solid var(--line); border-radius: 12px; }

/* ---------- 404 ---------- */
.lost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-700); align-items: center; }
.empty-frame { position: relative; aspect-ratio: 4 / 3; border: 1px solid var(--line); background: #fff; }
.empty-frame-name {
  position: absolute; left: 0; bottom: calc(100% + var(--s-75)); display: flex; gap: var(--s-100);
  font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--ink-2);
}
.empty-frame-name b { font-weight: 500; color: var(--ink); }
.empty-frame-x { position: absolute; inset: 0; width: 100%; height: 100%; }
.empty-frame-x line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* ---------- image zoom ---------- */
.zoom { padding: 0; border: 0; background: none; max-width: min(1200px, 100vw - 2 * var(--s-300)); max-height: 100vh; overflow: visible; }
.zoom::backdrop { background: rgba(0, 0, 0, .8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.zoom img { max-height: calc(100vh - 2 * var(--s-900)); width: auto; margin-inline: auto; border-radius: 12px; }
.zoom-close { position: absolute; top: calc(-1 * var(--s-600)); right: 0; }
.zoom[open] { animation: zoom-in .4s var(--ease); }
@keyframes zoom-in { from { opacity: 0; transform: scale(.97); } }

/* ==========================================================================
   Design mode tooling: the page shown the way a design tool shows it
   ========================================================================== */
.design { position: relative; }

/* frame labels: section name and its live size, like a frame title */
.frame-label {
  position: absolute; top: var(--s-200); left: 0;
  display: flex; gap: var(--s-100);
  font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--ink-2);
  pointer-events: none;
}
.frame-label b { font-weight: 500; color: var(--ink); }
.hero .frame-label { top: calc(-1 * var(--s-600)); }
.footer .frame-label { display: none; }

/* hover inspect: selection box, corner handles and a size badge */
.inspect {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  border: 1px solid var(--accent);
  transition: transform .2s var(--ease), width .2s var(--ease), height .2s var(--ease), opacity .2s var(--ease);
}
.inspect i {
  position: absolute; width: 7px; height: 7px; background: #fff; border: 1px solid var(--accent);
}
.inspect i:nth-child(1) { left: -4px; top: -4px; }
.inspect i:nth-child(2) { right: -4px; top: -4px; }
.inspect i:nth-child(3) { left: -4px; bottom: -4px; }
.inspect i:nth-child(4) { right: -4px; bottom: -4px; }
.inspect-badge {
  position: absolute; left: 50%; top: calc(100% + var(--s-75)); transform: translateX(-50%);
  padding: var(--s-25) var(--s-75); border-radius: 4px;
  background: var(--accent); color: #000; white-space: nowrap;
  font-family: var(--mono); font-size: 12px; line-height: 16px;
}

/* type spec tag above the statement */
.statement-spec {
  display: flex; align-items: center; gap: var(--s-100); margin-bottom: var(--s-300);
  font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--accent-ink);
}
.statement-spec::before { content: ""; width: var(--s-400); height: 1px; background: var(--accent); }
.statement-spec:empty { display: none; }

/* artifacts inside the craft cards */
.artifact { margin-top: var(--s-400); padding: var(--s-300); border-radius: 12px; background: var(--surface); }
.artifact-label { display: flex; justify-content: space-between; gap: var(--s-200); font-size: 14px; line-height: 20px; font-weight: 500; }
.artifact-label span { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--accent-ink); }
.artifact code { font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--ink-2); }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-100); margin-top: var(--s-200); }
.swatches li { display: grid; gap: var(--s-75); }
.swatch { display: block; height: var(--s-600); border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.specimen { display: flex; align-items: baseline; gap: var(--s-200); margin-top: var(--s-200); padding-top: var(--s-200); border-top: 1px solid var(--line); }
.specimen-aa { font-size: 48px; line-height: 48px; font-weight: 600; letter-spacing: -0.03em; }
.specimen .caption-2 { color: var(--ink-2); }

.devices { display: flex; align-items: end; gap: var(--s-300); margin-top: var(--s-200); }
.devices li { display: grid; justify-items: center; gap: var(--s-75); }
.device { display: block; border: 1.5px solid var(--ink-2); border-radius: 6px; transition: border-color .3s var(--ease), background-color .3s var(--ease); }
[data-device="phone"] .device { width: 28px; height: 52px; }
[data-device="tablet"] .device { width: 52px; height: 68px; }
[data-device="desktop"] .device { width: 96px; height: 60px; }
.devices li.is-current .device { border-color: var(--accent); background: rgba(255, 138, 86, .12); }
.devices li.is-current code { color: var(--accent-ink); }

/* collaborator cursor at the contact button */
.contact-actions { position: relative; }
.cursor {
  position: absolute; left: 88px; top: 26px; display: flex; align-items: start; gap: var(--s-25);
  pointer-events: none;
  transition: transform .9s var(--ease), opacity .4s var(--ease);
}
.cursor-name {
  margin-top: var(--s-200); padding: var(--s-25) var(--s-75); border-radius: 4px;
  background: var(--accent); color: #000; font-size: 12px; line-height: 16px; font-weight: 500;
}
.js .cursor:not(.is-here) { opacity: 0; transform: translate(var(--s-800), var(--s-600)); }

/* 12 column layout grid, toggled with G */
.layout-grid { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.layout-grid .container { height: 100%; display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--s-300); }
.layout-grid span { background: rgba(255, 138, 86, .1); border-inline: 1px solid rgba(255, 138, 86, .35); }
.grid-toggle {
  margin-left: var(--s-200); padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 14px; line-height: 20px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 4px;
}
.grid-toggle:hover { color: var(--ink); }
kbd {
  margin-left: var(--s-50); padding: 0 var(--s-50); border: 1px solid var(--line); border-radius: 4px;
  font-family: var(--mono); font-size: 12px; line-height: 16px;
}
[data-mode="code"] .inspect, [data-mode="code"] .layout-grid { display: none; }

/* project palettes: the artwork's main colors */
.palette { display: flex; gap: var(--s-50); margin-top: var(--s-100); }
.palette li { width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.palette:empty { display: none; }
.palette-full:empty::before { content: "reading"; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.palette-strip { display: flex; height: var(--s-300); border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.palette-strip i { min-width: 6px; flex-basis: 0; }
.palette-codes { display: grid; margin-top: var(--s-75); }
.palette-codes button {
  display: flex; align-items: center; gap: var(--s-75); padding: var(--s-25) 0;
  border: 0; background: none; cursor: copy; text-align: left;
  font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--ink);
}
.palette-codes button i { width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.palette-codes button span { margin-left: auto; color: var(--ink-2); }
.palette-codes button:hover span::before { content: "copy  "; color: var(--accent-ink); }
.palette-codes button.is-copied span::before { content: "copied  "; color: var(--accent-ink); }

/* design toolbar: the tools a design app keeps at the bottom of the canvas */
.toolbar {
  position: fixed; left: 50%; bottom: var(--s-200); z-index: 50; transform: translateX(-50%);
  display: flex; gap: var(--s-25); padding: var(--s-50);
  border-radius: 14px;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(0, 0, 0, .06);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .25);
}
.toolbar button {
  display: flex; align-items: center; gap: var(--s-75);
  padding: var(--s-50) var(--s-100); border: 0; border-radius: 10px; background: none; cursor: pointer;
  font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-2);   /* Button-sm */
  transition: color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.toolbar button:hover { color: var(--ink); background: var(--surface); }
.toolbar button[aria-pressed="true"] { color: var(--ink); background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 4px 10px -4px rgba(0, 0, 0, .2); }
.toolbar button[aria-pressed="true"] kbd { border-color: var(--accent); color: var(--accent-ink); }
.toolbar kbd { margin: 0; color: var(--ink-2); font-weight: 400; }

/* side panels: layers on the left, properties on the right */
.tool-panel {
  position: fixed; top: 88px; z-index: 48; width: 248px; max-height: calc(100vh - 88px - 88px); overflow: auto;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, .25);
  font-size: 12px; line-height: 16px;
}
.tool-layers { left: var(--s-200); }
.tool-props { right: var(--s-200); }
.tool-panel-head {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; gap: var(--s-100);
  padding: var(--s-100) var(--s-200); border-bottom: 1px solid var(--line); background: inherit;
  font-size: 14px; line-height: 20px; font-weight: 500;
}
.tool-panel-head span + span { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.layers { padding: var(--s-75); }
.layer {
  display: flex; align-items: center; gap: var(--s-75); width: 100%;
  padding: var(--s-50) var(--s-75); border: 0; border-radius: 6px; background: none; cursor: pointer; text-align: left;
  font-size: 12px; line-height: 16px; color: var(--ink);
}
.layer:hover { background: var(--surface); }
.layer[data-depth="1"] { padding-left: var(--s-400); color: var(--ink-2); }
.layer-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-size { margin-left: auto; font-family: var(--mono); color: var(--ink-2); white-space: nowrap; }
.layer-kids { display: none; }
.layer-group.is-current > .layer { background: rgba(255, 138, 86, .14); font-weight: 500; }
.layer-group.is-current > .layer .layer-icon { color: var(--accent-ink); }
.layer-group.is-current > .layer-kids { display: block; }
.layer-icon { flex: none; display: inline-grid; place-items: center; width: 12px; height: 12px; font-family: var(--mono); font-size: 11px; line-height: 1; color: var(--ink-2); }
.layer-icon[data-kind="frame"]::before { content: "#"; }
.layer-icon[data-kind="text"]::before { content: "T"; }
.layer-icon[data-kind="image"]::before { content: ""; width: 9px; height: 9px; border: 1px solid currentColor; border-radius: 2px; }

.tool-panel-title { display: flex; align-items: center; gap: var(--s-75); padding: var(--s-100) var(--s-200) 0; font-size: 14px; line-height: 20px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.props-body { padding: var(--s-100) var(--s-200) var(--s-200); }
.props-empty { color: var(--ink-2); }
.prop-xy { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-50); }
.prop-xy span { display: flex; gap: var(--s-75); padding: var(--s-50) var(--s-75); border-radius: 6px; background: var(--surface); font-family: var(--mono); }
.prop-xy b { font-weight: 400; color: var(--ink-2); }
.prop-group { margin-top: var(--s-200); padding-top: var(--s-100); border-top: 1px solid var(--line); }
.prop-group-name { margin-bottom: var(--s-50); font-weight: 500; }
.prop { display: flex; justify-content: space-between; gap: var(--s-200); padding-block: var(--s-25); }
.prop span:first-child { color: var(--ink-2); white-space: nowrap; }
.prop span:last-child { font-family: var(--mono); text-align: right; }
.chip { display: inline-block; width: 10px; height: 10px; margin-right: var(--s-75); border-radius: 3px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }

/* measure: distances from the selection to its frame */
.measure { position: fixed; inset: 0; z-index: 41; pointer-events: none; }
.measure-parent { position: absolute; left: 0; top: 0; border: 1px dashed var(--accent); }
.measure-line { position: absolute; left: 0; top: 0; }
.measure-line.is-v { width: 0; border-left: 1px solid var(--accent); }
.measure-line.is-h { height: 0; border-top: 1px solid var(--accent); }
.measure-line span {
  position: absolute; padding: 0 var(--s-50); border-radius: 3px; background: var(--accent); color: #000;
  font-family: var(--mono); font-size: 11px; line-height: 16px; white-space: nowrap;
}
.measure-line.is-v span { top: 50%; left: var(--s-50); transform: translateY(-50%); }
.measure-line.is-h span { left: 50%; top: var(--s-50); transform: translateX(-50%); }

/* outline view: the page as wireframe boxes, images as crossed frames */
.is-outline .design, .is-outline .design *:not(.word):not(br) {
  background: none !important; box-shadow: none !important; filter: none !important; mix-blend-mode: normal !important;
  border-color: transparent !important; color: var(--ink) !important; -webkit-text-fill-color: var(--ink);
  outline: 1px solid rgba(0, 0, 0, .2); outline-offset: -1px;
}
html.is-outline .design img:not(.word) {
  object-position: -99999px 0;
  background:
    linear-gradient(to top right, transparent calc(50% - .5px), rgba(0, 0, 0, .25) 50%, transparent calc(50% + .5px)),
    linear-gradient(to top left, transparent calc(50% - .5px), rgba(0, 0, 0, .25) 50%, transparent calc(50% + .5px)) !important;
}
.is-outline .redline { visibility: hidden; }

[data-mode="code"] .tools { display: none; }
@media (max-width: 767px), (hover: none) { .tools { display: none; } }
@media (min-width: 768px) and (hover: hover) { .footer { padding-bottom: var(--s-900); } }

/* ==========================================================================
   Code mode: each section is swapped for its own HTML and CSS
   ========================================================================== */
.code { display: none; }
[data-mode="code"] [data-section] > .design { display: none; }
[data-mode="code"] .code { display: grid; }
[data-mode="code"] body { background: var(--code-bg); color: var(--code-text); }
[data-mode="code"] .section[data-section] { padding-block: var(--s-200); }
[data-mode="code"] .hero[data-section] { padding-top: calc(var(--s-900) + var(--s-400)); }
[data-mode="code"] .footer[data-section] { padding-block: var(--s-200) var(--s-600); }

.code { width: min(1200px, 100% - 2 * var(--s-300)); margin-inline: auto; grid-template-columns: 3fr 2fr; gap: var(--s-200); align-items: start; }
.code-pane { min-width: 0; border: 1px solid var(--code-line); border-radius: 12px; background: var(--code-panel); overflow: hidden; }
.code-pane-head {
  display: flex; justify-content: space-between; gap: var(--s-200);
  padding: var(--s-75) var(--s-200); border-bottom: 1px solid var(--code-line);
  font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--code-muted);
}
.code-pane pre {
  margin: 0; padding: var(--s-200); overflow-x: auto;
  font-family: var(--mono); font-size: 14px; line-height: 20px; color: var(--code-text);
  tab-size: 2;
}
.code .code-pane-js { grid-column: 1 / -1; }

/* editor gutter with line numbers */
.code-pane code { display: block; counter-reset: ln; }
.code-pane .line { display: block; position: relative; padding-left: var(--s-500); min-height: 20px; border-radius: 4px; transition: background-color .2s var(--ease); }
.code-pane .line::before {
  counter-increment: ln; content: counter(ln);
  position: absolute; left: 0; width: var(--s-300); text-align: right; color: #55554F;
}
.code-pane .line.is-linked { background: rgba(255, 138, 86, .12); }

/* editable CSS values */
.tok-val { border-radius: 3px; outline: none; cursor: text; transition: background-color .2s var(--ease); }
.tok-val:hover, .tok-val:focus { background: rgba(143, 184, 255, .14); }
.tok-val.is-edited { background: rgba(255, 138, 86, .2); }

/* drag a property name to change its number */
.tok-prop.is-scrub { cursor: ew-resize; border-bottom: 1px dashed rgba(143, 184, 255, .4); }
.tok-prop.is-scrub:hover { border-bottom-color: var(--code-attr); }
.is-scrubbing, .is-scrubbing * { cursor: ew-resize !important; user-select: none; }
/* color swatches in front of hex values */
.tok-swatch {
  display: inline-block; width: 12px; height: 12px; margin-right: var(--s-50); padding: 0;
  border: 0; border-radius: 3px; vertical-align: -1px; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
  transition: transform .15s var(--ease);
}
.tok-swatch:hover { transform: scale(1.25); }
.color-input { position: fixed; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }

/* preview button in each section's first pane */
.code-pane-head { align-items: center; }
.code-pane-head .pane-note { margin-left: auto; }
.pane-preview {
  padding: 0 var(--s-75); border: 1px solid var(--code-line); border-radius: 6px;
  background: none; cursor: pointer; color: var(--code-text);
  font-family: var(--mono); font-size: 12px; line-height: 20px;
}
.pane-preview:hover { border-color: var(--accent); color: var(--accent); }

/* live preview: a scaled copy of the section being edited */
.preview {
  position: fixed; right: var(--s-200); bottom: var(--s-200); z-index: 49; width: min(480px, 100vw - 2 * var(--s-200));
  border: 1px solid var(--code-line); border-radius: 12px; background: var(--code-panel); overflow: hidden;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .6);
}
.preview .code-pane-head span { color: var(--code-text); white-space: pre; }
.preview-view { overflow: auto; background: var(--canvas); }
.preview-stage { transform-origin: 0 0; color: var(--ink); background: var(--canvas); }
.preview-stage .is-target { outline: 4px solid var(--accent) !important; outline-offset: 4px; }
.preview-iframe { aspect-ratio: 16 / 9; border-radius: 12px; background: var(--surface); }
[data-mode="design"] .preview { display: none; }
.code-reset {
  padding: 0; border: 0; background: none; cursor: pointer; color: var(--code-tag);
  font-family: var(--mono); font-size: 12px; line-height: 16px; text-decoration: underline;
}
.tok-kw { color: var(--code-tag); }

.tok-tag { color: var(--code-tag); }
.tok-attr { color: var(--code-attr); }
.tok-str { color: var(--code-string); }
.tok-punc, .tok-comment { color: var(--code-muted); }
.tok-sel { color: var(--code-tag); }
.tok-prop { color: var(--code-attr); }

[data-mode="code"] .nav { background: rgba(31, 31, 31, .78); border-color: var(--code-line); }
[data-mode="code"] .logo-dark { display: none; }
[data-mode="code"] .logo-light { display: block; }
[data-mode="code"] .nav-links a { color: var(--code-muted); }
[data-mode="code"] .nav-links a[aria-current="page"],
[data-mode="code"] .nav-links a:hover { color: var(--code-text); background: var(--code-line); }
[data-mode="code"] .mode-switch { background: #2A2A2A; }
[data-mode="code"] .mode-switch button { color: var(--code-muted); }
[data-mode="code"] .mode-switch button[aria-pressed="true"] { color: #000; }
[data-mode="code"] .mode-thumb { transform: translateX(100%); background: var(--accent); }
[data-mode="code"] .menu-toggle { color: var(--code-text); }
[data-mode="code"] .mobile-menu { background: rgba(24, 24, 24, .92); color: var(--code-text); }
[data-mode="code"] :focus-visible { outline-color: var(--accent); }

/* swap fade */
main, .footer { transition: opacity .2s var(--ease); }
.is-switching main, .is-switching .footer { opacity: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .redline-spec { display: none; }
}
@media (max-width: 1000px) {
  .hero-grid, .project-hero-grid, .form-grid, .lost-grid { grid-template-columns: 1fr; gap: var(--s-600); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .props, .direct { max-width: 560px; }
  .hero-peek { max-width: 560px; }
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: var(--s-600); }
  .about-education .education { grid-template-columns: 1fr; }
  .code { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .nav { gap: var(--s-100); }
  .nav-links { display: none; }
  .menu-toggle { display: block; }
  .nav-logo img { width: 128px; }
  .heading-1 { font-size: 48px; line-height: 48px; }
  .heading-2 { font-size: 30px; line-height: 36px; }   /* Heading 4 size on phones */
  .section { padding-block: var(--s-700); }
  .section + .section .design { padding-top: var(--s-700); }
  .hero { padding-top: calc(var(--s-900) + var(--s-600)); }
  .clients-list { grid-template-columns: repeat(2, 1fr); gap: var(--s-400) var(--s-300); }
  .work-grid, .crafts-grid { grid-template-columns: 1fr; }
  .work-card:first-child .work-media { aspect-ratio: 4 / 3; }
  .craft { padding: var(--s-300); }
  .section-head { flex-direction: column; align-items: start; }
  .footer-links { margin-left: 0; flex-wrap: wrap; gap: var(--s-100) var(--s-300); }
  .field-row { grid-template-columns: 1fr; }
  .form-wrap { padding: var(--s-300); }
  .comment-pin { right: var(--s-200); }
  .cover-frame { padding: var(--s-200); }
  .lost-grid .empty-frame { margin-top: var(--s-300); }
}
@media (max-width: 767px) {
  .frame-label, .grid-toggle { display: none; }
  .cursor { left: 88px; }
}
@media (max-width: 479px) {
  .heading-1 { font-size: 36px; line-height: 40px; }
  .devices { gap: var(--s-200); }
  [data-device="desktop"] .device { width: 72px; height: 46px; }
  .redline { display: none; }
  .timeline li { grid-template-columns: 1fr; }
  .timeline-years { grid-row: auto; padding-top: 0; }
}
@media (min-width: 768px) {
  .mobile-menu { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; }
}
