@import url("https://cdn.jsdelivr.net/fontsource/fonts/opendyslexic@latest/latin-400-normal.css");
@import url("https://cdn.jsdelivr.net/fontsource/fonts/opendyslexic@latest/latin-700-normal.css");

:root {
  color-scheme: light;
  --bg: #f3f0ea;
  --surface: rgba(255, 255, 255, 0.66);
  --surface-strong: rgba(255, 255, 255, 0.84);
  --surface-soft: rgba(20, 27, 34, 0.03);
  --text: #1a2128;
  --muted: #68727c;
  --muted-strong: #49535d;
  --line: rgba(20, 27, 34, 0.09);
  --line-strong: rgba(20, 27, 34, 0.18);
  --accent: #1a2128;
  --success: #477255;
  --danger: #8c5454;
  --shadow: 0 10px 28px rgba(20, 27, 34, 0.05);
  --shadow-card: 0 8px 20px rgba(20, 27, 34, 0.045);
  --shadow-hover: 0 14px 32px rgba(20, 27, 34, 0.08);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --content-width: 1120px;
  --display-font: "Aptos", "Segoe UI Variable Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --text-font: "Aptos", "Segoe UI Variable Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --dyslexic-font: "OpenDyslexic", "Comic Sans MS", "Trebuchet MS", sans-serif;
  --mono-font: "IBM Plex Mono", "Cascadia Code", Consolas, monospace;
  --transition: 180ms ease;
  --transition-slow: 320ms ease;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #13171b;
  --surface: rgba(24, 29, 34, 0.72);
  --surface-strong: rgba(24, 29, 34, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --text: #edf1f3;
  --muted: #a5adb4;
  --muted-strong: #cfd6db;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #edf1f3;
  --success: #8ec6a0;
  --danger: #d7a2a2;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  --shadow-card: 0 8px 22px rgba(0, 0, 0, 0.16);
  --shadow-hover: 0 14px 34px rgba(0, 0, 0, 0.24);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html.readable-mode {
  --display-font: var(--dyslexic-font);
  --text-font: var(--dyslexic-font);
}

html.readable-mode body,
html.readable-mode button,
html.readable-mode input,
html.readable-mode textarea,
html.readable-mode select {
  font-family: var(--dyslexic-font);
}

html.readable-mode h1,
html.readable-mode h2,
html.readable-mode h3,
html.readable-mode h4,
html.readable-mode h5,
html.readable-mode h6,
html.readable-mode .button,
html.readable-mode .control-button,
html.readable-mode .project-toggle {
  font-family: var(--dyslexic-font);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--text-font);
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

::selection {
  background: rgba(26, 33, 40, 0.14);
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 100;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  transition: top var(--transition);
}

.skip-link:focus {
  top: 16px;
}

.site-chassis {
  display: none;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: 0.95rem 1.1rem 0;
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-monogram {
  width: 2.45rem;
  height: 2.45rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-family: var(--mono-font);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.brand-copy {
  display: grid;
  gap: 0.08rem;
}

.brand-name {
  font-weight: 600;
  font-size: 0.98rem;
}

.brand-role {
  color: var(--muted);
  font-size: 0.76rem;
}

.primary-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.primary-nav a {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.primary-nav a[aria-current="page"] {
  color: var(--text);
  border-color: var(--line-strong);
}

.primary-nav a[aria-current="page"] {
  background: var(--surface-strong);
  box-shadow: inset 0 0 0 1px var(--line);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.control-button,
.button,
.filter-chip,
.project-toggle {
  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.control-button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.control-button-icon {
  width: 2.75rem;
  min-width: 2.75rem;
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

#langToggle {
  width: 2.75rem;
  font-family: var(--mono-font);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-controls .control-button[aria-pressed="true"] {
  background: var(--surface-strong);
  box-shadow: inset 0 0 0 1px var(--line);
}

.control-icon {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-grid;
  place-items: center;
  color: currentColor;
}

.control-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.control-button:hover,
.control-button:focus-visible,
.button:hover,
.button:focus-visible,
.filter-chip:hover,
.filter-chip:focus-visible,
.project-toggle:hover,
.project-toggle:focus-visible {
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle span {
  position: absolute;
  left: 50%;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform var(--transition);
}

.nav-toggle span:first-child {
  transform: translate(-50%, -4px);
}

.nav-toggle span:last-child {
  transform: translate(-50%, 4px);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translate(-50%, 0) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translate(-50%, 0) rotate(-45deg);
}

main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.2rem 1.1rem 3rem;
}

.page-shell,
.section-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.page-shell {
  padding: clamp(1.5rem, 2.8vw, 2.3rem);
}

.hero-layout.page-shell,
#home.page-shell {
  padding-top: clamp(1.15rem, 2vw, 1.6rem);
  padding-bottom: clamp(1.15rem, 2vw, 1.6rem);
}

.section-shell {
  margin-top: 1rem;
  padding: clamp(1.3rem, 2.5vw, 1.9rem);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: clamp(1.1rem, 2.8vw, 2.2rem);
  align-items: start;
}

.home-hero {
  align-items: center;
}

.hero-copy,
.page-intro-copy,
.detail-copy {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.hero-panel {
  display: grid;
  gap: 0.9rem;
}

.eyebrow,
.micro-label,
.project-category,
.status-badge,
.aside-label {
  font-family: var(--mono-font);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow,
.aside-label,
.micro-label {
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display-font);
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(2.55rem, 5vw, 4.1rem);
  line-height: 0.98;
  max-width: 13ch;
  font-weight: 600;
}

.page-intro h1,
.detail-hero h1 {
  max-width: 14ch;
}

h2.section-title,
.section-heading h2,
.detail-hero h2 {
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  line-height: 1.05;
  font-weight: 600;
}

.hero-lead,
.lede,
.section-heading p,
.panel-copy,
.project-summary,
.project-why,
.detail-copy p,
.detail-panel p,
.story-list li,
.contact-points li,
.form-note,
.footer-copy {
  color: var(--muted);
  line-height: 1.7;
}

.hero-lead {
  font-size: 1rem;
  max-width: 58ch;
  margin-top: 0.15rem;
}

.hero-actions,
.page-actions,
.detail-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-actions {
  margin-top: 0.35rem;
}

.hero-actions .button {
  min-height: 2.8rem;
  padding: 0.72rem 1.02rem;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.hero-actions .button:hover,
.hero-actions .button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(20, 27, 34, 0.08);
}

html[data-theme="dark"] .hero-actions .button:hover,
html[data-theme="dark"] .hero-actions .button:focus-visible {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.68rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 500;
  font-size: 0.92rem;
}

.button-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.button-secondary,
.button-tertiary {
  color: var(--text);
  background: transparent;
}

.button-tertiary {
  color: var(--muted);
}

.split-layout,
.project-grid,
.detail-grid,
.contact-grid,
.about-grid {
  display: grid;
  gap: 0.85rem;
}

.split-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 1.2rem;
  align-items: start;
}

.plain-stack {
  display: grid;
  gap: 0.9rem;
}

.plain-block {
  padding-top: 0.15rem;
}

.plain-block + .plain-block {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.plain-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  line-height: 1.7;
}

.content-section {
  max-width: 58rem;
}

.narrow-copy {
  max-width: 48rem;
  display: grid;
  gap: 0.9rem;
  color: var(--muted);
  line-height: 1.75;
}

.profile-card,
.project-card,
.detail-panel,
.contact-form-shell,
.hero-portrait-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-card);
}

.profile-card,
.project-card,
.detail-panel,
.contact-form-shell {
  padding: 1rem;
}

.hero-portrait-card {
  padding: 0.42rem;
  background: transparent;
  border-color: rgba(20, 27, 34, 0.08);
  box-shadow: none;
}

.project-card,
.detail-panel,
.contact-form-shell,
.profile-card {
  transition: transform var(--transition), box-shadow var(--transition-slow), border-color var(--transition);
}

.project-card:hover,
.project-card:focus-within,
.detail-panel:hover,
.contact-form-shell:hover,
.profile-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}

.hero-portrait-frame {
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 4 / 4.9;
  background: rgba(20, 27, 34, 0.03);
  border: 1px solid rgba(20, 27, 34, 0.06);
}

.hero-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.98) contrast(1.01);
}

html[data-theme="dark"] .hero-portrait-card {
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .hero-portrait-frame {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.section-heading {
  display: grid;
  gap: 0.45rem;
  max-width: 48rem;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
}

.timeline {
  display: grid;
  gap: 0.8rem;
}

.timeline-item {
  padding: 0.6rem 0 0 0.95rem;
  border-left: 1px solid var(--line);
}

.timeline-item:first-child {
  padding-top: 0;
}

.timeline-item p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.pill-list,
.detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pill-list li,
.detail-list li {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.81rem;
}

.project-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-field {
  flex: 1 1 320px;
}

.search-field input,
.field input,
.field textarea {
  width: 100%;
  padding: 0.78rem 0.88rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
}

.search-field input:focus,
.field input:focus,
.field textarea:focus {
  border-color: var(--line-strong);
}

.filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-chip {
  min-height: 2.45rem;
  padding: 0.55rem 0.82rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.filter-chip.is-active {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.project-ecosystem-section {
  display: grid;
  gap: 1rem;
}

.project-ecosystem-heading h2 {
  margin: 0;
}

.project-ecosystem-heading p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.project-grid-section {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
  display: grid;
  gap: 0.72rem;
}

.overview-card {
  min-height: 100%;
  align-content: start;
  gap: 0.85rem;
}

.overview-card .project-summary {
  max-width: 35ch;
}

.overview-card .project-links {
  margin-top: auto;
}

.overview-card .button {
  min-height: 2.5rem;
  padding: 0.66rem 0.92rem;
  border-color: var(--line-strong);
  background: var(--surface);
}

.overview-card .button:hover,
.overview-card .button:focus-visible {
  background: var(--surface-strong);
}

.project-card-top,
.detail-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: transparent;
}

.status-roadmap {
  color: var(--muted-strong);
  border-color: var(--line);
}

.project-category {
  color: var(--muted);
}

.project-card h3 {
  font-size: 1.3rem;
  line-height: 1.08;
  font-weight: 600;
}

.project-problem {
  padding: 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: transparent;
}

.project-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  cursor: pointer;
  font-weight: 500;
}

.project-toggle::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--transition);
}

.project-toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

.project-details {
  display: grid;
  gap: 0.75rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.story-list {
  list-style: none;
  padding: 0;
  margin: 0.9rem 0 0;
  display: grid;
  gap: 0;
}

.story-list li {
  padding: 0.75rem 0;
  padding-left: 1rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.story-list li:first-child {
  border-top: 1px solid var(--line);
}

.story-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.7rem;
  top: 0.85rem;
}

.project-detail-shell {
  display: grid;
  gap: 1rem;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  gap: 1rem;
}

.detail-visual {
  padding: 0.95rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.diagram-stage {
  display: grid;
  gap: 0.65rem;
}

.diagram-window {
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(20, 27, 34, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 27, 34, 0.05) 1px, transparent 1px),
    transparent;
  background-size: 24px 24px, 24px 24px, auto;
  position: relative;
  overflow: hidden;
}

.diagram-window::before,
.diagram-window::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.diagram-window::before {
  left: 10%;
  right: 20%;
  top: 22%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(20, 27, 34, 0.45), transparent);
}

.diagram-window::after {
  left: 24%;
  width: 44%;
  bottom: 28%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(20, 27, 34, 0.25), transparent);
}

.diagram-notes {
  display: grid;
  gap: 0.5rem;
}

.diagram-notes span {
  display: block;
  height: 0.65rem;
  border-radius: 999px;
  background: rgba(20, 27, 34, 0.08);
}

.diagram-notes span:nth-child(2) {
  width: 82%;
}

.diagram-notes span:nth-child(3) {
  width: 68%;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  gap: 0.85rem;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-intro {
  display: grid;
  gap: 0.7rem;
  max-width: 68rem;
  margin-inline: auto;
}

.page-intro-copy {
  max-width: 54rem;
}

.page-intro.has-lottie {
  grid-template-columns: minmax(0, 1fr) minmax(200px, 420px);
  align-items: center;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  max-width: 76rem;
}

.page-intro.has-lottie .page-intro-copy {
  max-width: none;
}

.page-lottie-wrap {
  width: 100%;
  align-self: center;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.page-lottie-wrap svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Projects hero — Machine Book (1250×600, 25:12) */
#projectsLottie {
  aspect-ratio: 25 / 12;
  filter: saturate(0.65);
}

html[data-theme="dark"] #projectsLottie {
  filter: saturate(0.5) brightness(0.75);
}

/* About hero — Brain Bulb with Gears (1920×1080, 16:9) */
#aboutLottie {
  aspect-ratio: 16 / 9;
  filter: saturate(0.8);
}

html[data-theme="dark"] #aboutLottie {
  filter: invert(1) hue-rotate(178deg) saturate(0.6);
}

/* Contact hero — Waving human hand (1150×802) */
#contactLottie {
  aspect-ratio: 1150 / 802;
  max-width: 420px;
  justify-self: center;
  filter: saturate(0.58) contrast(0.96) brightness(0.98);
}

#contactLottie svg {
  transform: scale(1.55) !important;
  transform-origin: center;
}

html[data-theme="dark"] #contactLottie {
  filter: saturate(0.48) contrast(1.04) brightness(0.78);
}

.contact-grid {
  grid-template-columns: minmax(280px, 0.84fr) minmax(0, 1.16fr);
}

.contact-form-shell form {
  display: grid;
  gap: 0.75rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field span {
  color: var(--muted-strong);
  font-weight: 500;
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.contact-turnstile {
  min-height: 70px;
}

.form-status {
  min-height: 1.5rem;
  margin: 0;
  color: var(--muted);
}

.form-status.is-success {
  color: var(--success);
}

.form-status.is-error {
  color: var(--danger);
}

.projects-empty {
  color: var(--muted);
  margin: 1rem 0 0;
}

.site-footer {
  padding: 0 1.1rem 1.8rem;
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr auto auto;
  align-items: start;
  gap: 1.25rem;
  padding-top: 1rem;
  color: var(--muted);
}

.footer-title {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.footer-copy,
.footer-meta p {
  margin: 0.45rem 0 0;
}

.footer-copy {
  max-width: 34ch;
}

.footer-nav,
.footer-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.footer-nav a,
.footer-meta a {
  padding: 0.22rem 0;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.footer-nav a:hover,
.footer-nav a:focus-visible,
.footer-nav a[aria-current="page"],
.footer-meta a:hover,
.footer-meta a:focus-visible {
  color: var(--text);
  border-color: var(--line-strong);
}

.privacy-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 130;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.9rem;
  align-items: center;
  max-width: min(44rem, calc(100vw - 2rem));
  margin-left: auto;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.privacy-banner[hidden],
.modal[hidden] {
  display: none;
}

.privacy-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.privacy-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(20, 27, 34, 0.18);
}

.modal-content {
  width: min(38rem, 100%);
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  min-width: 2.3rem;
  min-height: 2.3rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.modal-body {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.85rem;
}

.modal-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--line-strong);
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .hero-layout,
  .split-layout,
  .project-grid,
  .detail-hero,
  .detail-layout,
  .about-grid,
  .contact-grid,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-layout {
    gap: 1.25rem;
  }

  .hero-copy {
    max-width: 44rem;
  }

  .hero-panel {
    max-width: 22rem;
  }

  .page-intro.has-lottie {
    grid-template-columns: 1fr;
  }

  .page-lottie-wrap {
    max-width: 480px;
    margin-inline: auto;
  }

  #contactLottie {
    max-width: 360px;
  }

  #contactLottie svg {
    transform: scale(1.24) !important;
  }

  .section-header-row,
  .project-toolbar {
    align-items: start;
  }
}

@media (max-width: 860px) {
  .site-header {
    padding-inline: 1rem;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand toggle"
      "controls controls";
    align-items: start;
    gap: 0.7rem;
  }

  .brand-mark {
    grid-area: brand;
    min-width: 0;
  }

  .brand-copy {
    min-width: 0;
  }

  .brand-name,
  .brand-role {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-toggle {
    grid-area: toggle;
    justify-self: end;
  }

  .header-controls {
    grid-area: controls;
    justify-self: stretch;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scrollbar-width: none;
  }

  .header-controls::-webkit-scrollbar {
    display: none;
  }

  .primary-nav {
    position: absolute;
    top: calc(100% + 0.65rem);
    left: 1rem;
    right: 1rem;
    display: grid;
    gap: 0.4rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--transition), transform var(--transition), visibility 0ms linear 220ms;
  }

  .primary-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0ms;
  }

  .primary-nav a {
    padding: 0.7rem 0;
  }

  .control-button {
    flex: 0 0 auto;
  }

  .detail-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    gap: 1rem;
  }

  .project-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .footer-inner {
    gap: 0.85rem;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero-copy {
    order: 2;
    max-width: none;
  }

  .hero-panel {
    order: 1;
    max-width: 18rem;
    justify-self: center;
  }

  .hero-portrait-card {
    padding: 0.55rem;
  }

  .hero-portrait-frame {
    aspect-ratio: 1 / 1.08;
  }

  .hero-actions {
    gap: 0.55rem;
  }
}

@media (max-width: 760px) {
  .project-grid-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  main {
    padding-inline: 1rem;
  }

  .site-header {
    padding-inline: 0.85rem;
  }

  .header-inner {
    gap: 0.6rem;
  }

  .brand-mark {
    gap: 0.65rem;
  }

  .brand-monogram {
    width: 2.2rem;
    height: 2.2rem;
  }

  .brand-name {
    font-size: 0.92rem;
  }

  .brand-role {
    font-size: 0.72rem;
  }

  .header-controls {
    gap: 0.35rem;
  }

  .page-shell,
  .section-shell {
    padding: 1rem;
    border-radius: 16px;
  }

  .section-header-row {
    gap: 0.7rem;
  }

  .project-card,
  .detail-panel,
  .contact-form-shell,
  .profile-card {
    box-shadow: 0 6px 16px rgba(20, 27, 34, 0.05);
  }

  h1 {
    font-size: clamp(2.05rem, 9vw, 3.2rem);
    max-width: none;
  }

  .hero-layout.page-shell,
  #home.page-shell {
    padding-top: 0.9rem;
    padding-bottom: 1rem;
  }

  .hero-copy {
    gap: 0.45rem;
  }

  .hero-lead {
    font-size: 0.96rem;
    max-width: none;
  }

  .hero-panel {
    width: min(100%, 15rem);
  }

  .hero-actions,
  .page-actions,
  .detail-actions,
  .form-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .button {
    width: 100%;
  }

  .privacy-banner {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0ms !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .page-lottie-wrap {
    display: none;
  }
}
