/* Portfolio art direction: editorial layout, route marks, and Apple-inspired liquid-glass materials. */
:root {
  --ink-950: #0e1024;
  --ink-900: #151b3d;
  --ink-800: #1f2a57;
  --violet: #7d5cff;
  --cyan: #00d3ff;
  --pink: #ff6fcf;
  --mint: #34d8ad;
  --page: #0e1024;
  --page-rgb: 14, 16, 36;
  --surface: #151b3d;
  --surface-rgb: 21, 27, 61;
  --text: #edf2ff;
  --text-soft: #cdd7ff;
  --text-muted: #a4aed1;
  --edge: rgba(205, 215, 255, .22);
  --edge-strong: rgba(205, 215, 255, .42);
  --glass-alpha: .72;
  --glass-blur: 20px;
  --glass-light: rgba(255, 255, 255, .12);
  --shadow: 0 24px 64px rgba(0, 0, 0, .28);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --page: #f3f5fc;
  --page-rgb: 243, 245, 252;
  --surface: #fbfcff;
  --surface-rgb: 251, 252, 255;
  --text: #151b3d;
  --text-soft: #344166;
  --text-muted: #596586;
  --edge: rgba(21, 27, 61, .16);
  --edge-strong: rgba(21, 27, 61, .34);
  --glass-light: rgba(255, 255, 255, .76);
  --shadow: 0 20px 55px rgba(31, 42, 87, .12);
}

html[data-theme="dark"] { color-scheme: dark; }
html[data-glass="clear"] { --glass-alpha: .52; --glass-blur: 26px; }
html[data-glass="balanced"] { --glass-alpha: .78; --glass-blur: 18px; }
html[data-glass="solid"] { --glass-alpha: .98; --glass-blur: 0px; }

html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 86% 4%, rgba(0, 211, 255, .10), transparent 30rem),
    radial-gradient(ellipse at 6% 20%, rgba(125, 92, 255, .13), transparent 32rem),
    linear-gradient(155deg, var(--page), var(--ink-900) 74%, var(--ink-800));
  background-attachment: fixed;
  font-family: var(--sans);
  line-height: 1.68;
}
html[data-theme="light"] body {
  background:
    radial-gradient(ellipse at 86% 4%, rgba(0, 211, 255, .14), transparent 30rem),
    radial-gradient(ellipse at 6% 20%, rgba(125, 92, 255, .12), transparent 32rem),
    linear-gradient(155deg, #f7f8fc, #edf2ff 76%, #dbe2ff);
}
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
  border-radius: 5px;
}
::selection { background: rgba(0, 211, 255, .3); color: var(--text); }

.container { width: min(1200px, calc(100% - 3.5rem)); }
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(var(--page-rgb), var(--glass-alpha));
  border-bottom: 1px solid var(--edge);
  backdrop-filter: saturate(175%) blur(var(--glass-blur));
  -webkit-backdrop-filter: saturate(175%) blur(var(--glass-blur));
}
html[data-glass="solid"] .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; }
.nav { min-height: 76px; gap: 1.1rem; padding: .7rem 0; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand > span:last-child { display: flex; align-items: baseline; gap: .25em; font-size: .92rem; font-weight: 550; letter-spacing: .015em; }
.brand b { color: var(--text-soft); font-weight: 750; }
.brand-monogram {
  display: grid; place-items: center; width: 2.35rem; height: 2.35rem;
  border: 1px solid var(--edge-strong); border-radius: 12px;
  color: var(--cyan); font: 700 .68rem var(--mono); letter-spacing: -.08em;
  background: linear-gradient(145deg, rgba(0, 211, 255, .12), rgba(125, 92, 255, .11));
}
.nav-links { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .35rem; }
.nav-links a {
  color: var(--text-soft); font-size: .78rem; font-weight: 620; letter-spacing: .01em;
  text-decoration: none; border: 1px solid transparent; background: transparent;
  box-shadow: none; border-radius: 999px; padding: .42rem .68rem;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--text); border-color: var(--edge); background: rgba(var(--surface-rgb), .58);
  transform: none;
}
.language-switcher { display: inline-flex; align-items: center; padding: 3px; gap: 2px; border: 1px solid var(--edge); border-radius: 999px; background: rgba(var(--surface-rgb), .5); }
.language-switcher button {
  min-width: 2.05rem; border: 0; border-radius: 999px; padding: .28rem .4rem;
  background: transparent; color: var(--text-muted); font: 700 .64rem var(--mono); cursor: pointer;
}
.language-switcher button.is-active { color: var(--ink-950); background: var(--cyan); }
html[data-theme="light"] .language-switcher button.is-active { color: #0e1024; }
.skip-link {
  position: absolute; top: .7rem; left: .7rem; z-index: 60; padding: .65rem 1rem;
  color: #0e1024; background: var(--cyan); border-radius: .5rem; transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.glass-surface, .card {
  background:
    linear-gradient(145deg, var(--glass-light), rgba(255, 255, 255, .015) 55%),
    rgba(var(--surface-rgb), var(--glass-alpha));
  border: 1px solid var(--edge);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .22);
  backdrop-filter: saturate(165%) blur(var(--glass-blur));
  -webkit-backdrop-filter: saturate(165%) blur(var(--glass-blur));
}
html[data-glass="solid"] .glass-surface,
html[data-glass="solid"] .card { backdrop-filter: none; -webkit-backdrop-filter: none; }
.card { border-radius: 1.1rem; }
.section { padding: 3rem 0; }
.section h2, .section h3, .section p { color: var(--text); }
.section p, .lead { color: var(--text-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 2.85rem; padding: .7rem 1rem; border-radius: 999px;
  border: 1px solid rgba(0, 211, 255, .65); color: #0e1024; background: var(--cyan);
  box-shadow: 0 8px 22px rgba(0, 211, 255, .13);
  font: 720 .85rem var(--sans); text-decoration: none; transition: transform .18s ease, filter .18s ease;
}
.btn:hover { color: #0e1024; background: #57e1ff; transform: translateY(-2px); }
.btn.secondary { color: var(--text); background: rgba(var(--surface-rgb), .65); border-color: var(--edge-strong); box-shadow: none; }
.btn.secondary:hover { color: var(--text); background: rgba(var(--surface-rgb), .94); }
.btn.disabled-button { color: var(--text-muted); background: rgba(var(--surface-rgb), .42); border-color: var(--edge); box-shadow: none; cursor: default; pointer-events: none; }
.text-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-soft); text-decoration: none; font-weight: 650; }
.text-link:hover { color: var(--cyan); }

.portfolio-main { padding-top: 2.35rem; }
.portfolio-hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  align-items: center; gap: clamp(2rem, 6vw, 5.4rem); min-height: 540px; padding: 2.6rem 0 5.2rem;
}
.hero-copy { position: relative; padding: 1rem 0 0; }
.hero-copy::before {
  content: ""; position: absolute; z-index: -1; left: -1.2rem; top: -.3rem;
  width: 11rem; height: 12rem; opacity: .42;
  background-image: radial-gradient(rgba(0, 211, 255, .4) 1px, transparent 1px);
  background-size: 13px 13px; mask-image: linear-gradient(135deg, black, transparent 72%);
}
.eyebrow, .mono-index, .section-marker, .timeline-index, .project-meta, .practice-code {
  font: 700 .68rem var(--mono); letter-spacing: .105em; text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: .65rem; color: var(--cyan); margin: 0 0 1.1rem; }
.eyebrow-dot { width: .42rem; height: .42rem; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(52, 216, 173, .12); }
.portfolio-hero h1 {
  max-width: 780px; margin: 0; color: var(--text); font-size: clamp(3rem, 6.7vw, 6.25rem);
  line-height: .99; letter-spacing: -.065em; font-weight: 650;
}
.portfolio-hero h1 em { color: var(--cyan); font: italic 500 .86em var(--serif); letter-spacing: -.055em; }
.hero-lead { max-width: 600px; margin: 1.6rem 0 0; color: var(--text-soft); font-size: clamp(1rem, 1.4vw, 1.14rem); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.3rem; margin-top: 1.8rem; }
.hero-footnote { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem; margin-top: 3.1rem; color: var(--text-muted); font-size: .76rem; }
.mono-index { color: var(--text-muted); font-size: .62rem; }
.hero-footnote .mono-index { color: var(--pink); }

.route-card {
  position: relative; overflow: hidden; padding: 1.1rem 1.25rem 1rem; border-radius: 1.2rem 1.2rem 3.5rem 1.2rem;
  min-height: 380px;
}
.route-card::after { content: ""; position: absolute; right: -5rem; top: -6rem; width: 15rem; height: 15rem; border-radius: 50%; border: 1px solid rgba(0, 211, 255, .17); box-shadow: 0 0 0 20px rgba(0, 211, 255, .025), 0 0 0 42px rgba(125, 92, 255, .035); pointer-events: none; }
.route-card-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.route-symbol { color: var(--cyan); font-size: 1.1rem; }
.route-art { display: block; width: 100%; height: auto; margin: .65rem 0 .1rem; overflow: visible; }
.route-line-back { stroke: rgba(125, 92, 255, .33); stroke-width: 11; fill: none; }
.route-line { stroke: var(--cyan); stroke-width: 1.6; stroke-dasharray: 4 7; fill: none; }
.route-stop { fill: var(--page); stroke: var(--cyan); stroke-width: 2; }
.route-pulse { fill: rgba(125, 92, 255, .11); stroke: var(--violet); stroke-width: 1; stroke-dasharray: 3 5; }
.route-label { fill: var(--text); font: 700 12px var(--mono); letter-spacing: 1px; }
.route-lat { fill: var(--text-muted); font: 9px var(--mono); letter-spacing: .7px; }
.route-caption { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--edge); padding-top: .9rem; }
.route-caption p { max-width: 24rem; margin: 0; color: var(--text-soft); font-size: .82rem; }
.route-stamp { display: grid; place-items: center; flex: 0 0 auto; width: 2.9rem; height: 2.9rem; border: 1px solid var(--edge-strong); border-radius: 50%; color: var(--pink); font: 700 .62rem/1.1 var(--mono); transform: rotate(9deg); }

.story-section { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1.4rem; padding: 4.25rem 0; border-top: 1px solid var(--edge); }
.section-marker { display: block; max-width: 100%; color: var(--cyan); font-size: .62rem; line-height: 1.55; overflow-wrap: anywhere; padding-top: .45rem; }
.section-body { min-width: 0; }
.section-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.8rem; }
.section-heading-row > div { max-width: 720px; }
.section-heading-row h2, .profile-grid h2, .contact-section h2 {
  margin: .4rem 0 0; color: var(--text); font-size: clamp(2rem, 4vw, 3.65rem);
  line-height: 1.08; letter-spacing: -.05em; font-weight: 620;
}
.section-heading-row h2 em, .profile-grid h2 em { color: var(--cyan); font-family: var(--serif); font-weight: 500; }
.section-aside { max-width: 19rem; margin: 0 0 .25rem; color: var(--text-muted); font-size: .82rem; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); }
.profile-grid h2 { font-size: clamp(2rem, 4vw, 3.45rem); }
.profile-copy > p { margin: .3rem 0 1.15rem; color: var(--text-soft); }
.language-notes { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.55rem; }
.language-notes > span { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .68rem; border: 1px solid var(--edge); border-radius: 999px; color: var(--text-soft); background: rgba(var(--surface-rgb), .4); font-size: .75rem; }
.language-notes b { color: var(--cyan); font: 700 .62rem var(--mono); }

.timeline { border-top: 1px solid var(--edge-strong); }
.timeline-entry { position: relative; display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); align-items: center; gap: 1.1rem; padding: 1.35rem .5rem; border-bottom: 1px solid var(--edge); }
.timeline-entry.featured-entry { background: linear-gradient(90deg, rgba(125, 92, 255, .12), transparent 75%); }
.timeline-date { color: var(--cyan); font: 700 .78rem var(--mono); white-space: nowrap; }
.timeline-date span { display: block; margin-top: .25rem; color: var(--text-muted); font: 500 .64rem var(--sans); }
.timeline-index { display: block; color: var(--text-muted); font-size: .59rem; margin-bottom: .2rem; }
.timeline-content h3 { margin: .1rem 0; font-size: 1.06rem; letter-spacing: -.02em; }
.timeline-content p { margin: .2rem 0 0; color: var(--text-muted); font-size: .82rem; }
.timeline-mark { color: var(--text-muted); font: 700 .67rem var(--mono); text-align: right; }

.practice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.practice-card { position: relative; overflow: hidden; min-height: 225px; padding: 1.15rem 1.3rem; border-radius: 1rem 1rem 2.7rem 1rem; }
.practice-card::before { content: ""; position: absolute; right: -2.2rem; bottom: -3.2rem; width: 10rem; height: 10rem; border: 1px solid rgba(0, 211, 255, .32); border-radius: 50%; box-shadow: 0 0 0 17px rgba(0, 211, 255, .045), 0 0 0 35px rgba(125, 92, 255, .05); pointer-events: none; }
.practice-card-ph::before { border-color: rgba(255, 111, 207, .34); }
.practice-top { position: relative; display: flex; align-items: center; justify-content: space-between; }
.practice-code { color: var(--cyan); }
.practice-glyph { color: var(--pink); font: 500 1.15rem var(--serif); }
.practice-card h3 { position: relative; margin: 1.35rem 0 .35rem; color: var(--text); font-size: 1.35rem; }
.practice-card p { position: relative; max-width: 34rem; margin: 0; color: var(--text-soft); font-size: .88rem; }
.practice-tags { display: flex; flex-wrap: wrap; gap: .5rem; position: relative; margin-top: 1rem; }
.practice-tags span { padding: .28rem .48rem; border: 1px solid var(--edge); border-radius: 999px; color: var(--text-muted); font: 650 .58rem var(--mono); letter-spacing: .04em; }

.capability-list { border-top: 1px solid var(--edge-strong); }
.capability-row { display: grid; grid-template-columns: minmax(0, 1fr) 12rem; align-items: start; gap: 1rem; padding: 1.2rem 0; border-bottom: 1px solid var(--edge); }
.capability-row h3 { margin: 0; color: var(--text); font-size: 1.15rem; }
.capability-row p { max-width: 51rem; margin: .3rem 0 0; color: var(--text-soft); font-size: .86rem; }
.capability-state { justify-self: end; margin-top: .23rem; padding: .35rem .55rem; border: 1px solid var(--edge); border-radius: 999px; color: var(--text-muted); font-size: .62rem; text-align: center; }
.honesty-note { display: grid; grid-template-columns: 2rem 1fr; gap: .75rem; margin-top: 1.3rem; padding: 1rem 1.15rem; border-left: 2px solid var(--pink); background: rgba(255, 111, 207, .055); }
.honesty-symbol { display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border: 1px solid rgba(255, 111, 207, .6); border-radius: 50%; color: var(--pink); font: 700 .78rem var(--serif); }
.honesty-note p { margin: 0; color: var(--text-soft); font-size: .81rem; }

.project-ledger { border-top: 1px solid var(--edge-strong); }
.project-line { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; align-items: center; gap: 1.25rem; padding: 1.2rem .2rem; border-bottom: 1px solid var(--edge); }
.project-brand-mark { display: grid; place-items: center; width: 3.6rem; height: 3.6rem; border: 1px solid var(--edge); border-radius: 1.1rem; background: rgba(var(--surface-rgb), .55); color: var(--text); font: 700 .8rem var(--mono); }
.project-brand-mark img { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.project-brand-mark-purple { background: linear-gradient(145deg, rgba(125, 92, 255, .3), rgba(0, 211, 255, .11)); color: #d8ccff; }
.project-main h3 { margin: .12rem 0; font-size: 1.28rem; letter-spacing: -.03em; }
.project-main p { max-width: 55rem; margin: .1rem 0 0; color: var(--text-soft); font-size: .82rem; }
.project-meta { color: var(--cyan); font-size: .58rem; }
.project-arrow { display: inline-flex; align-items: center; gap: .7rem; color: var(--text-soft); font-size: .76rem; font-weight: 700; text-decoration: none; }
.project-arrow b { color: var(--cyan); font-size: 1.1rem; }
.project-arrow:hover { color: var(--cyan); }
.project-tabs { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.project-tabs a { display: inline-flex; gap: .7rem; align-items: center; padding: .5rem .8rem; border: 1px solid var(--edge); border-radius: 999px; color: var(--text-soft); text-decoration: none; font-size: .76rem; }
.project-tabs a:hover { border-color: var(--cyan); color: var(--cyan); }
.contact-section { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin: 2.2rem 0 4rem; padding: clamp(1.3rem, 4vw, 2.4rem); border-radius: 1.1rem 1.1rem 3rem 1.1rem; }
.contact-section > div { max-width: 760px; }
.contact-section h2 { margin: .55rem 0; font-size: clamp(1.7rem, 3vw, 2.6rem); }
.contact-section p:not(.eyebrow) { margin: .4rem 0 0; color: var(--text-soft); font-size: .88rem; }
.contact-button { flex: 0 0 auto; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.4rem 0 2rem; border-top: 1px solid var(--edge); color: var(--text-muted); font-size: .72rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .9rem; }
.site-footer a, .site-footer a:visited { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); }

.language-switcher button { font-family: var(--mono); }
.accessibility-menu { position: relative; margin-left: .2rem; }
.accessibility-menu > summary { display: flex; align-items: center; justify-content: center; width: 2.35rem; height: 2.35rem; list-style: none; cursor: pointer; border: 1px solid var(--edge); border-radius: 50%; color: var(--cyan); background: rgba(var(--surface-rgb), .55); }
.accessibility-menu > summary::-webkit-details-marker { display: none; }
.accessibility-panel { position: absolute; top: calc(100% + .7rem); right: 0; z-index: 40; width: min(19rem, calc(100vw - 2rem)); padding: 1rem; border: 1px solid var(--edge-strong); border-radius: 1rem; background: rgba(var(--surface-rgb), .96); color: var(--text); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.accessibility-panel fieldset { border: 0; padding: 0; margin: 0; }
.accessibility-panel legend, .accessibility-theme-label { display: block; margin-bottom: .55rem; color: var(--text-soft); font-size: .74rem; font-weight: 700; }
.material-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.material-options button, .theme-toggle {
  min-height: 2.4rem; padding: .45rem .5rem; border: 1px solid var(--edge); border-radius: .65rem;
  color: var(--text-soft); background: rgba(var(--page-rgb), .55); font: 650 .68rem var(--sans); cursor: pointer;
}
.material-options button[aria-pressed="true"] { border-color: var(--cyan); color: var(--text); background: rgba(0, 211, 255, .13); }
.theme-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: .8rem; text-align: left; }
.theme-toggle span:last-child { color: var(--cyan); }
.accessibility-hint { margin: .55rem 0 0; color: var(--text-muted); font-size: .66rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

body[data-page="apps"] .apps-hero, body[data-page="games"] .apps-hero { max-width: 790px; margin: 2.5rem auto 0; text-align: left; }
body[data-page="apps"] .apps-hero h1, body[data-page="games"] .apps-hero h1 { font-size: clamp(2.7rem, 6vw, 5rem); line-height: 1.02; letter-spacing: -.055em; }
body[data-page="apps"] .apps-hero .lead, body[data-page="games"] .apps-hero .lead { max-width: 42rem; margin: .85rem 0 0; color: var(--text-soft); }
body[data-page="apps"] main.container, body[data-page="games"] main.container { padding-bottom: 2rem; }
body[data-page="apps"] .app-card, body[data-page="games"] .app-card { border-radius: 1rem 1rem 2.8rem 1rem; }
body[data-page="apps"] .app-card h2, body[data-page="games"] .app-card h2 { color: var(--text); letter-spacing: -.035em; }
body[data-page="apps"] .app-card p, body[data-page="games"] .app-card p { color: var(--text-soft); }
body[data-page="apps"] .game-features > div, body[data-page="games"] .game-features > div { border-color: var(--edge); background: rgba(var(--page-rgb), .2); }
body[data-page="apps"] footer, body[data-page="games"] footer, body[data-page="privacy"] footer, body[data-page="legal"] footer { padding-top: 1.4rem; padding-bottom: 2rem; border-top: 1px solid var(--edge); color: var(--text-muted); }
body[data-page="privacy"] .legal-content h1, body[data-page="legal"] .legal-content h1 { font-size: clamp(2.3rem, 5vw, 4rem); letter-spacing: -.045em; }
body[data-page="privacy"] .legal-content p, body[data-page="privacy"] .legal-content li,
body[data-page="legal"] .legal-content p, body[data-page="legal"] .legal-content li { color: var(--text-soft); }
body[data-page="privacy"] .legal-content a, body[data-page="legal"] .legal-content a { color: var(--cyan); }

@media (max-width: 1000px) {
  .container { width: min(100% - 2rem, 780px); }
  .nav { flex-wrap: wrap; justify-content: space-between; }
  .nav-links { order: 3; justify-content: flex-start; width: 100%; }
  .portfolio-hero { grid-template-columns: 1fr 1fr; gap: 1.5rem; min-height: 0; padding-bottom: 4rem; }
  .portfolio-hero h1 { font-size: clamp(2.8rem, 7vw, 5rem); }
  .route-card { min-height: 330px; }
}
@media (max-width: 700px) {
  .container { width: min(100% - 1.3rem, 560px); }
  .nav { min-height: 0; padding: .65rem 0; }
  .nav-links { gap: .25rem; }
  .nav-links a { font-size: .7rem; padding: .38rem .5rem; }
  .language-switcher { margin-left: .1rem; }
  .portfolio-main { padding-top: .6rem; }
  .portfolio-hero { grid-template-columns: 1fr; gap: 1.6rem; padding: 2.2rem 0 3.1rem; }
  .portfolio-hero h1 { font-size: clamp(2.5rem, 11.5vw, 4.5rem); }
  .hero-lead { margin-top: 1.1rem; font-size: .98rem; }
  .hero-footnote { margin-top: 2rem; }
  .route-card { min-height: 0; }
  .story-section { grid-template-columns: 1fr; gap: .5rem; padding: 2.8rem 0; }
  .section-marker { padding: 0; }
  .section-heading-row { display: block; }
  .section-aside { margin-top: .85rem; }
  .profile-grid, .practice-grid { grid-template-columns: 1fr; gap: 1.3rem; }
  .profile-grid h2, .section-heading-row h2 { font-size: 2.4rem; }
  .timeline-entry { grid-template-columns: 5.1rem minmax(0,1fr); gap: .7rem; padding: 1rem .15rem; }
  .timeline-date { font-size: .65rem; white-space: normal; }
  .timeline-content h3 { font-size: .97rem; }
  .timeline-content p { font-size: .75rem; }
  .timeline-mark { font-size: .58rem; }
  .capability-row { grid-template-columns: 1.65rem minmax(0,1fr); gap: .65rem; }
  .capability-state { grid-column: 2; justify-self: start; margin: .1rem 0 0; }
  .project-line { grid-template-columns: 3.2rem minmax(0,1fr); gap: .8rem; }
  .project-brand-mark { width: 3rem; height: 3rem; border-radius: .85rem; }
  .project-main h3 { font-size: 1.1rem; }
  .project-main p { font-size: .76rem; }
  .project-arrow { grid-column: 2; justify-self: start; }
  .contact-section { align-items: flex-start; flex-direction: column; gap: 1.1rem; margin-bottom: 2.6rem; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .accessibility-panel { right: -.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  .btn, .nav-links a, .language-switcher, .glass-surface, .card { border: 1px solid CanvasText; }
  .route-line, .route-stop, .route-pulse { stroke: CanvasText; }
}


/* Mantiene la entrada progresiva al desplazarse, con contenido visible si no hay JavaScript. */
.fade-in { opacity: 1; transform: none; transition: none; }
html.scroll-reveal-ready .fade-in:not(.visible) {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .25, 1);
}
html.scroll-reveal-ready .fade-in.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html.scroll-reveal-ready .fade-in { opacity: 1; transform: none; transition: none; }
}

/* Responsive balance: keep editorial columns aligned and prevent long labels from forcing overflow. */
@media (max-width: 820px) {
  .portfolio-hero { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; padding-top: 2.1rem; }
  .route-card { width: min(100%, 560px); min-height: 0; margin-inline: auto; }
}

@media (max-width: 700px) {
  .portfolio-main { padding-top: 0.65rem; }
  .portfolio-hero { padding: 1.8rem 0 2.8rem; }
  .portfolio-hero h1, .profile-grid h2, .section-heading-row h2, .contact-section h2 {
    max-width: 100%; overflow-wrap: break-word;
  }
  .hero-actions { gap: 0.8rem 1rem; }
  .hero-footnote { margin-top: 1.6rem; font-size: 0.8rem; }
  .story-section { grid-template-columns: minmax(0, 1fr); gap: 0.55rem; padding: 2.8rem 0; }
  .section-marker { padding: 0; }
  .section-heading-row { display: block; }
  .section-aside { margin-top: 0.75rem; }
  .profile-grid, .practice-grid { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .profile-grid h2, .section-heading-row h2 { font-size: clamp(2rem, 8.2vw, 2.4rem); }
  .practice-card { min-height: 0; padding: 1.15rem; }
  .timeline-entry { grid-template-columns: 5.1rem minmax(0, 1fr); gap: 0.65rem; padding: 1rem 0.1rem; }
  .timeline-date { font-size: 0.64rem; white-space: normal; }
  .timeline-content h3 { font-size: 0.96rem; overflow-wrap: anywhere; }
  .timeline-content p { font-size: 0.75rem; }
  .capability-row { grid-template-columns: minmax(0, 1fr); gap: 0.45rem; }
  .capability-state { grid-column: 1; justify-self: start; max-width: 100%; margin: 0.1rem 0 0; }
  .project-line { grid-template-columns: 3rem minmax(0, 1fr); gap: 0.75rem; }
  .project-brand-mark { width: 3rem; height: 3rem; }
  .project-main { min-width: 0; }
  .project-main h3 { font-size: 1.08rem; }
  .project-main p { font-size: 0.77rem; overflow-wrap: anywhere; }
  .project-arrow { grid-column: 2; justify-self: start; }
  .contact-section { align-items: flex-start; flex-direction: column; gap: 1rem; margin-bottom: 2.5rem; }
  .contact-section > div { min-width: 0; width: 100%; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .accessibility-panel { right: -0.15rem; }
}

@media (max-width: 380px) {
  .timeline-entry { grid-template-columns: 4.65rem minmax(0, 1fr); gap: 0.5rem; }
  .profile-grid h2, .section-heading-row h2 { font-size: 2rem; }
  .route-card { padding: 1rem; }
  .route-lat { font-size: 8px; }
}

/* Compact disclosure navigation and restored contact module. */
.navigation-panel { display: contents; }
.nav-menu-toggle { display: none; }
.contact-restored { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 2rem; }
.contact-details { display: grid; gap: .6rem; margin-top: 1.4rem; font-style: normal; font-size: .88rem; }
.contact-details a { width: fit-content; max-width: 100%; overflow-wrap: anywhere; color: var(--cyan); }
.contact-restored .contact-form { width: 100%; min-width: 0; margin: 0; padding: 1.25rem; border-radius: 1rem; }
.contact-form input, .contact-form textarea { box-sizing: border-box; width: 100%; font-size: 16px; color: var(--text); background: rgba(var(--page-rgb), .6); border-color: var(--edge-strong); }
.contact-form label { color: var(--text-soft); }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--text-muted); }
.contact-form .btn { margin-top: 1rem; }
.contact-form .hp-field { display: none; }
.contact-form button:disabled { opacity: .65; cursor: wait; }
.whatsapp-float { z-index: 25; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); }
.site-footer { padding-bottom: 5.5rem; }
@media (max-width: 1000px) {
  .site-header { position: sticky; top: 0; }
  .nav { display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px; grid-template-areas: "brand controls toggle"; min-height: 64px; padding: .5rem 0; gap: 0 .45rem; }
  .nav > .brand { grid-area: brand; gap: .45rem; }
  .nav > .brand > span:last-child { font-size: clamp(.8rem, 3.1vw, 1rem); }
  .nav .brand-monogram { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; }
  .nav > .accessibility-menu { grid-area: controls; margin: 0; }
  .nav > .accessibility-menu > summary { width: 44px; height: 44px; }
  .nav-menu-toggle { grid-area: toggle; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--edge); border-radius: 50%; color: var(--text); background: rgba(var(--surface-rgb), .7); font: 22px/1 var(--sans); cursor: pointer; }
  .nav > .navigation-panel { display: none; grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; }
  .nav.is-menu-open > .navigation-panel { display: grid; gap: .65rem; padding: .65rem 0 .3rem; max-height: calc(100dvh - 80px); overflow-y: auto; }
  .nav .navigation-panel .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem; width: 100%; margin: 0; }
  .nav .navigation-panel .nav-links > a { min-height: 44px; width: 100%; padding: .4rem; font-size: .8rem; }
  .nav .navigation-panel .nav-links > a:last-of-type:nth-of-type(odd) { grid-column: 1 / -1; width: 100%; }
  .nav .navigation-panel .language-switcher { display: flex; justify-content: center; justify-self: center; width: auto; margin: 0; padding: 3px; gap: 3px; border: 1px solid var(--edge); border-radius: 999px; background: rgba(var(--surface-rgb), .5); }
  .nav .navigation-panel .language-switcher::before { display: none; }
  .nav .navigation-panel .language-switcher button { width: 44px; min-height: 44px; padding: .4rem; font-size: .72rem; }
  .accessibility-panel { right: -3rem; width: min(300px, calc(100vw - 2rem)); }
}
@media (max-width: 700px) {
  .contact-restored { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
  .contact-restored .contact-form { padding: 1rem; }
  .whatsapp-float { width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 50%; }
  .whatsapp-float span { display: none; }
}
