:root {
  --bg: #030914;
  --ink: #edf6ff;
  --muted: #8eafcc;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --indigo: #6366f1;
  --line: rgba(125, 211, 252, .16);
  --font: "Vazirmatn", "Segoe UI", sans-serif;
  --display: "Syne", "Vazirmatn", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0 }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html[dir="rtl"] { --display: "Vazirmatn", "Syne", sans-serif }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  overflow-x: clip;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  position: relative;
}
body:before { display: none; }
img { max-width: 100%; display: block; height: auto }
a { color: inherit; text-decoration: none }
button, input, textarea, select { font: inherit; color: inherit }
#net, .aurora { position: fixed; inset: 0; pointer-events: none; z-index: 0 }
.aurora {
  background:
    radial-gradient(80vw 50vh at 8% -8%, rgba(34, 211, 238, .2), transparent 55%),
    radial-gradient(60vw 40vh at 100% 0%, rgba(99, 102, 241, .22), transparent 50%),
    radial-gradient(50vw 40vh at 70% 100%, rgba(37, 99, 235, .16), transparent 55%),
    linear-gradient(180deg, #030914, #071428 42%, #030914);
}
.cursor {
  position: fixed; width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, .75);
  transform: translate(-50%, -50%);
  pointer-events: none; z-index: 90; mix-blend-mode: screen;
  transition: width .2s, height .2s, background .2s;
}
.cursor.on { width: 52px; height: 52px; background: rgba(34, 211, 238, .1) }
@media (pointer: coarse) { .cursor { display: none } }

.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4vw;
  background: rgba(3, 9, 20, .78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  width: 100%;
  max-width: 100%;
  flex-wrap: nowrap;
}
.brand { font-family: var(--display); font-weight: 800; letter-spacing: .03em }
.brand span { color: var(--cyan) }
/* the wrapper only exists to become one drawer on narrow screens; on wide
   ones it steps out of the way so the bar stays a single flex row */
.nav-sheet { display: contents }
.links { display: flex; gap: 14px; margin-inline-start: auto; align-items: center; flex-shrink: 1 }
.links a { color: var(--muted); font-size: .84rem; white-space: nowrap }
.links a:hover, .nav-cta { color: #fff }
.nav-cta {
  padding: 7px 14px; border: 1px solid rgba(34, 211, 238, .45);
  border-radius: 999px; box-shadow: 0 0 24px rgba(34, 211, 238, .2);
}
.lang { display: flex; flex-shrink: 0; gap: 4px }
.lang a {
  font-size: .68rem; padding: 5px 7px; border-radius: 8px;
  border: 1px solid transparent; color: var(--muted);
  white-space: nowrap;
}
.lang a.on, .lang a:hover {
  border-color: var(--cyan); color: #fff; background: rgba(34, 211, 238, .1);
}
.nav-toggle {
  display: none; margin-inline-start: auto; width: 42px; height: 42px;
  background: transparent; border: 1px solid var(--line); border-radius: 10px;
}
.nav-toggle i, .nav-toggle i:before, .nav-toggle i:after {
  display: block; width: 18px; height: 2px; background: #fff; position: relative;
}
.nav-toggle i:before, .nav-toggle i:after { content: ""; position: absolute; left: 0 }
.nav-toggle i:before { top: -6px }
.nav-toggle i:after { top: 6px }

main { width: 100%; max-width: 100%; overflow-x: clip; position: relative; z-index: 1 }
.hero, .section, .foot, .manifesto { position: relative; z-index: 1; max-width: 100% }
.hero {
  min-height: calc(100vh - 64px);
  padding: 7vh 5vw 12vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 40px;
  align-items: center;
  overflow: hidden;
}
.hero-copy { max-width: 720px; min-width: 0; overflow: hidden }
.kicker {
  color: var(--cyan); letter-spacing: .16em; text-transform: uppercase;
  font-size: .78rem; display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); margin-bottom: 14px;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, .7);
  animation: pulse 1.8s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 12px transparent } }
.hero h1 { position: relative; overflow: hidden }
.hero h1 .ghost {
  position: absolute; inset-inline-start: 0; top: -38%;
  font-family: var(--display); font-size: clamp(3rem, 10vw, 8rem);
  color: transparent; -webkit-text-stroke: 1px rgba(125, 211, 252, .12);
  letter-spacing: -.06em; pointer-events: none; z-index: -1;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
}
.hero h1 .line {
  display: block;
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 6.2rem);
  line-height: .95; letter-spacing: -.04em;
  background: linear-gradient(120deg, #fff 10%, #7dd3fc 48%, #818cf8 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 8s linear infinite;
}
@keyframes shine { to { background-position: 220% 50% } }
.roles {
  font-family: var(--mono); color: var(--cyan);
  min-height: 1.6em; font-size: 1.15rem; margin: 12px 0 16px;
}
.lead { color: var(--muted); font-size: 1.08rem; margin-bottom: 12px }
.quote {
  font-family: var(--display); font-size: 1.25rem; color: #dbeafe;
  border-inline-start: 3px solid var(--cyan); padding-inline-start: 14px; margin: 18px 0;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 22px; border-radius: 999px; border: 0; cursor: pointer;
  transition: transform .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-3px) }
.btn-glow {
  background: linear-gradient(90deg, #0891b2, #2563eb 55%, #4f46e5);
  box-shadow: 0 10px 40px rgba(34, 211, 238, .28); font-weight: 700;
}
.btn-ghost { background: transparent; border: 1px solid var(--line) }
.hero-visual { position: relative; min-height: 520px; min-width: 0; overflow: hidden }
.orbit, .orbit i {
  position: absolute; inset: 6%; border-radius: 50%;
  border: 1px dashed rgba(34, 211, 238, .28); pointer-events: none;
}
.orbit { animation: spin 28s linear infinite }
.orbit i:nth-child(1) { inset: 0; animation: spin 18s linear infinite reverse }
.orbit i:nth-child(2) { inset: 12%; animation: spin 22s linear infinite }
.orbit i:nth-child(3) { inset: 22%; border-style: solid; border-color: rgba(99,102,241,.2) }
@keyframes spin { to { transform: rotate(360deg) } }
.scroll-hint {
  position: absolute; inset-inline-start: 5vw; bottom: 28px;
  color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: 10px;
}
.scroll-hint b {
  width: 18px; height: 28px; border: 1px solid var(--line); border-radius: 20px; position: relative;
}
.scroll-hint b:after {
  content: ""; width: 4px; height: 8px; border-radius: 4px; background: var(--cyan);
  position: absolute; left: 50%; top: 5px; transform: translateX(-50%);
  animation: wheel 1.4s infinite;
}
@keyframes wheel { to { top: 14px; opacity: 0 } }

.frame {
  position: relative; overflow: hidden; border-radius: 28px;
  background: #0b1c33; border: 1px solid var(--line);
  min-height: 280px;
}
.frame img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.05) contrast(1.05);
  transition: transform 1.1s ease, filter .4s;
}
.frame:hover img { transform: scale(1.06); filter: saturate(1.15) contrast(1.1) }
.frame-ring {
  position: absolute; inset: -20%; z-index: 0; pointer-events: none;
  background: conic-gradient(from 180deg, transparent, #22d3ee, transparent 32%, #6366f1, transparent 70%);
  animation: spin 10s linear infinite; opacity: .55;
}
.hero-frame, .about-frame, .contact-frame { position: relative; z-index: 1; min-height: 520px }
.hero-frame img, .about-frame img, .contact-frame img, .g2 img { min-height: 520px; object-fit: cover }
.frame figcaption {
  position: absolute; inset-inline-start: 16px; bottom: 16px; z-index: 2;
  font-family: var(--mono); font-size: .75rem; padding: 6px 10px;
  background: rgba(3, 9, 20, .72); border: 1px solid var(--line); border-radius: 999px;
}
.frame-empty {
  min-height: inherit; height: 100%;
  display: grid; place-items: center; text-align: center; padding: 28px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, .08), rgba(99, 102, 241, .1)),
    repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(125,211,252,.05) 12px, rgba(125,211,252,.05) 13px);
}
.frame-empty b { display: block; font-family: var(--mono); color: var(--cyan); margin-bottom: 8px }
.frame-empty span { color: var(--muted); font-size: .9rem; max-width: 260px }

.manifesto {
  margin: 10px 5vw 0;
  padding: 8vh 6vw;
  border-radius: 36px;
  background:
    linear-gradient(120deg, rgba(8, 47, 73, .85), rgba(30, 27, 75, .72));
  border: 1px solid var(--line);
  overflow: hidden;
}
.manifesto p {
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 3.6rem);
  line-height: 1.15; letter-spacing: -.03em; max-width: 18ch;
}

.section { padding: 110px 5vw; overflow-x: hidden }
.section-index {
  font-family: var(--mono); color: rgba(125, 211, 252, .28);
  font-size: 5rem; line-height: 1; margin-bottom: -10px;
}
.section-head { margin-bottom: 42px; max-width: 820px }
.section-head h2, .about-copy h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.08; letter-spacing: -.03em;
}
.muted, .prose p { color: var(--muted) }
.prose p { margin-bottom: 1em; font-size: 1.05rem }
.about-layout {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 36px; align-items: start;
}
.job { margin-top: 18px; color: var(--cyan); font-family: var(--mono) }
/* the max() floor keeps the intended column count on wide screens and lets the
   grid drop a column on its own once the tracks would get too narrow */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(250px, 30%), 1fr)); gap: 16px; margin-top: 36px }
.pillars article {
  padding: 26px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(15, 35, 68, .72), rgba(8, 20, 40, .6));
  border: 1px solid var(--line);
  transition: transform .35s, border-color .35s;
}
.pillars article:hover { transform: translateY(-6px); border-color: rgba(34, 211, 238, .45) }
.pillars span { font-family: var(--mono); color: var(--cyan) }
.pillars h3 { margin: 10px 0 12px; font-size: 1.25rem }
.pillars p { color: var(--muted) }

.gallery-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: end;
}
@supports (grid-template-columns: repeat(auto-fit, minmax(max(260px, 30%), 1fr))) {
  .gallery-grid { grid-template-columns: repeat(auto-fit, minmax(max(260px, 30%), 1fr)) }
}
.g2 { min-height: 620px }
.g1, .g3 { min-height: 460px }
.g1 img, .g3 img { min-height: 460px; object-fit: cover }
.g2 img { min-height: 620px }

.marquee { overflow: hidden; width: 100%; max-width: 100%; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); margin: 12px 0 }
.track { display: flex; gap: 14px; width: max-content; animation: slide 40s linear infinite; will-change: transform }
.reverse .track { animation-direction: reverse; animation-duration: 48s }
.track span {
  padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--mono); background: rgba(11, 31, 61, .6);
}
.track .alt { color: var(--cyan) }
@keyframes slide { to { transform: translateX(-50%) } }
/* in rtl the track is anchored to the right edge, so it has to travel the
   other way or it drifts out of the visible window */
@keyframes slide-rtl { to { transform: translateX(50%) } }
html[dir="rtl"] .track { animation-name: slide-rtl }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-top: 26px }
.chip-cloud li {
  padding: 8px 12px; border-radius: 999px; font-size: .86rem;
  background: rgba(34, 211, 238, .08); border: 1px solid var(--line);
}

.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(320px, 45%), 1fr)); gap: 18px }
.skill {
  display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: center;
  padding: 18px; border-radius: 22px; border: 1px solid var(--line);
  background: rgba(8, 20, 40, .55);
}
.skill p { color: var(--muted); font-size: .92rem }
.ring {
  width: 84px; height: 84px; border-radius: 50%;
  background: conic-gradient(#22d3ee calc(var(--p) * 1%), rgba(255,255,255,.08) 0);
  display: grid; place-items: center;
  box-shadow: 0 0 24px rgba(34, 211, 238, .18);
}
.ring b {
  width: 64px; height: 64px; border-radius: 50%; background: #07101f;
  display: grid; place-items: center; font-family: var(--mono); font-size: .9rem;
}

.timeline { list-style: none; position: relative; max-width: 880px }
.timeline:before {
  content: ""; position: absolute; inset-inline-start: 8px; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(var(--cyan), transparent);
}
.timeline li { position: relative; padding-inline-start: 42px; margin-bottom: 22px }
.node {
  position: absolute; inset-inline-start: 1px; top: 34px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 18px #22d3ee;
}
.glass {
  background: linear-gradient(180deg, rgba(15, 35, 68, .72), rgba(8, 20, 40, .6));
  border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
}
.card { overflow: hidden }
.card img, .ph { width: 100%; height: 210px; object-fit: cover }
.ph {
  display: grid; place-items: center; font-family: var(--display);
  font-size: 3rem; color: var(--cyan);
  background: linear-gradient(135deg, #0b1f3d, #13284d);
}
.card-body { padding: 20px 22px 24px }
.when { color: var(--cyan); font-family: var(--mono); font-size: .85rem }
.card h3 { font-size: 1.25rem; margin: 6px 0 8px }
.card p { color: var(--muted) }
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(300px, 45%), 1fr)); gap: 18px }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 22px }
.contact-side { display: grid; gap: 16px }
.form, .info { padding: 28px }
.field { display: grid; gap: 6px; margin-bottom: 14px }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(196px, 45%), 1fr)); gap: 12px }
.form input, .form textarea {
  width: 100%; background: rgba(2, 8, 20, .55); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; outline: none;
}
.form textarea { resize: vertical; min-height: 120px }
.form input:focus, .form textarea:focus {
  border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15);
}
.form-status { min-height: 1.4em; margin-top: 10px; color: #7dd3fc }
.channels { list-style: none; display: grid; gap: 12px }
.channels span { color: var(--muted); font-size: .8rem }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px }
.socials a { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem }
.socials a:hover { border-color: var(--cyan); color: var(--cyan) }
.foot { text-align: center; color: var(--muted); padding: 30px 5vw 50px; border-top: 1px solid var(--line) }

.hero-copy, .about-copy, .section-head, .pillars article, .skill, .timeline li, .edu-grid article, .form, .contact-side {
  animation: rise .9s cubic-bezier(.16,1,.3,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(28px) } to { opacity: 1; transform: none } }

@media (max-width: 1280px) {
  .links a { font-size: .78rem; gap: 10px }
  .nav { gap: 8px }
}
@media (max-width: 1100px) {
  .hero, .about-layout, .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-visual, .hero-frame, .about-frame, .g1, .g2, .g3 { min-height: 420px }
  .hero-frame img, .about-frame img, .g1 img, .g2 img, .g3 img { min-height: 420px }
  .contact-frame, .contact-frame img { min-height: 380px }
  /* stacked portraits would otherwise run their full aspect ratio and push
     everything else off the screen */
  .hero-frame, .about-frame, .contact-frame, .g1, .g2, .g3,
  .hero-frame img, .about-frame img, .contact-frame img,
  .g1 img, .g2 img, .g3 img { max-height: 60vh; max-height: 60svh }
  .nav-toggle { display: grid; place-items: center }
  .nav-sheet {
    display: none;
    position: absolute; top: 100%; inset-inline: 0;
    background: #050d1c;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 26px 50px rgba(2, 6, 18, .55);
    padding: 14px 5vw 20px;
    max-height: calc(100vh - 68px);
    max-height: calc(100svh - 68px);
    overflow-y: auto;
  }
  .nav.open .nav-sheet { display: block }
  .links, .lang { display: none }
  .nav.open .links {
    display: flex; flex-direction: column; align-items: stretch;
    gap: 2px; margin: 0;
  }
  .nav.open .links a { padding: 11px 2px; font-size: .96rem }
  .nav.open .nav-cta {
    margin-top: 8px; text-align: center; padding: 12px 14px;
  }
  .nav.open .lang {
    display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px;
    margin-top: 14px; padding-top: 14px;
    border-top: 1px solid var(--line);
  }
}
.cosmos { padding: 0; overflow: clip; max-width: 100%; background: transparent }
/* the heading rides on the empty sky at the top of the stage rather than
   stacking above it, which otherwise leaves a dead band the height of half
   the scene between this section and the one before it */
.cosmos-intro {
  position: absolute; z-index: 20;
  top: 0; inset-inline-start: 0;
  padding: 46px 5vw 0;
  max-width: min(860px, 92%);
}
.cosmos-intro h2 { text-shadow: 0 2px 18px rgba(2, 6, 18, .9) }
.cosmos-intro .muted { text-shadow: 0 2px 14px rgba(2, 6, 18, .9) }
.cosmos-track { height: 100vh; position: relative }
.cosmos-sticky {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: transparent;
  touch-action: pan-y;
}
.cosmos-sticky:before { display: none; }
.photon-veil { display: none; }
#gargantua {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  pointer-events: none;
  z-index: 10;
  background: transparent;
}
.planet-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 12;
}
.planet {
  pointer-events: auto;
  position: absolute;
  left: 50%; top: 50%;
  width: 100px; height: 100px;
  border: 0; padding: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity .25s;
  box-shadow: 0 0 0 0 rgba(186, 230, 253, 0);
}
.planet:hover, .planet:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px rgba(186, 230, 253, .55), 0 0 26px rgba(56, 189, 248, .25);
}
.planet-tag {
  position: absolute; left: 50%; top: calc(100% + 14px);
  transform: translateX(-50%);
  font-family: var(--mono); font-size: .74rem;
  color: #dbeafe; white-space: nowrap;
  opacity: 0; transition: opacity .35s;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .9);
  letter-spacing: .08em;
  pointer-events: none;
}
.planet.is-front .planet-tag, .planet:hover .planet-tag { opacity: 1 }
.era-hud {
  position: absolute; z-index: 26;
  inset-inline-start: 5vw; bottom: 11vh;
  max-width: min(420px, 70vw);
  pointer-events: none;
}
.era-kicker {
  font-family: var(--mono); color: #fbbf24; letter-spacing: .18em;
  font-size: .7rem; text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(2, 6, 18, .95);
}
.era-when {
  font-family: var(--mono); color: #7dd3fc; margin: 6px 0 4px;
  text-shadow: 0 2px 14px rgba(2, 6, 18, .95);
}
.era-title {
  font-family: var(--display); font-size: clamp(1.2rem, 3vw, 2rem); line-height: 1.15;
  text-shadow: 0 2px 18px rgba(2, 6, 18, .95), 0 0 46px rgba(2, 6, 18, .8);
}
.cosmos-hint {
  position: absolute; z-index: 26; inset-inline-end: 5vw; bottom: 8vh;
  font-size: .82rem; color: #8eafcc; max-width: 240px;
  text-align: end;
  text-shadow: 0 2px 14px rgba(2, 6, 18, .95);
}
html[dir="rtl"] .cosmos-hint { text-align: start }
.wormhole-panel {
  position: absolute; z-index: 30;
  inset: auto 5vw 18vh 5vw;
  max-width: 720px;
  margin-inline: auto;
  left: 0; right: 0;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(8, 16, 36, .88), rgba(2, 6, 16, .92));
  border: 1px solid rgba(251, 191, 36, .28);
  box-shadow: 0 0 80px rgba(255, 140, 40, .18), 0 30px 80px rgba(0,0,0,.55);
  backdrop-filter: blur(16px);
  animation: iris .45s cubic-bezier(.16,1,.3,1);
}
.wormhole-panel[hidden] { display: none }
@keyframes iris {
  from { opacity: 0; transform: translateY(24px) scale(.96) }
  to { opacity: 1; transform: none }
}
.wh-close {
  position: absolute; top: 10px; inset-inline-end: 10px;
  background: transparent; border: 1px solid var(--line); color: #fff;
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.wh-visual { border-radius: 16px; overflow: hidden; min-height: 140px; background: #0b1c33 }
.wh-visual img, .wh-ph { width: 100%; height: 160px; object-fit: cover; display: block }
.wh-visual img[hidden], .wh-ph[hidden] { display: none }
.wh-ph { display: grid; place-items: center; font-family: var(--display); font-size: 2.4rem; color: #fbbf24 }
.wh-copy h3 { margin: 6px 0 8px; font-size: 1.2rem }
.wh-copy p { color: var(--muted) }
@media (max-width: 1100px) {
  .wormhole-panel {
    grid-template-columns: 1fr;
    inset: auto 4vw 10vh 4vw;
    max-height: 66vh;
    overflow-y: auto;
  }
  .era-hud { bottom: 20vh }
  .cosmos-hint { display: none }
}

/* ==========================================================================
   responsive layer
   ========================================================================== */

/* full-height blocks follow the visible viewport on phones, so the browser
   chrome sliding in and out never crops the scene */
@supports (height: 100svh) {
  .hero { min-height: calc(100svh - 64px) }
  .cosmos-track, .cosmos-sticky { height: 100svh }
}

@media (max-width: 1280px) {
  .section { padding: 96px 5vw }
  .manifesto { padding: 7vh 6vw }
}

@media (max-width: 1024px) {
  .section { padding: 84px 5vw }
  .section-index { font-size: 4rem }
  .hero { padding: 5vh 5vw 10vh; gap: 32px }
  .manifesto { margin: 10px 4vw 0; padding: 6vh 6vw; border-radius: 28px }
  .manifesto p { max-width: 24ch }
  .form, .info { padding: 24px }
  .pillars { margin-top: 28px }
}

@media (max-width: 760px) {
  .nav { padding: 10px 5vw }
  .brand { font-size: 1.02rem }
  .section { padding: 68px 5vw }
  .section-index { font-size: 3.2rem; margin-bottom: -6px }
  .section-head { margin-bottom: 30px }
  .hero { padding: 4vh 5vw 8vh; min-height: 0; gap: 26px }
  .hero-visual, .hero-frame, .about-frame, .contact-frame,
  .g1, .g2, .g3 { min-height: 340px }
  .hero-frame img, .about-frame img, .contact-frame img,
  .g1 img, .g2 img, .g3 img { min-height: 340px }
  .roles { font-size: 1.02rem }
  .lead, .prose p { font-size: 1rem }
  .quote { font-size: 1.08rem; margin: 14px 0 }
  .scroll-hint { display: none }
  .manifesto { padding: 5vh 7vw; border-radius: 24px }
  .manifesto p { max-width: none }
  .pillars article { padding: 22px }
  .frame { border-radius: 22px }
  .card img, .ph { height: 176px }
  .card-body { padding: 18px 18px 20px }
  .skill { padding: 16px; gap: 14px; grid-template-columns: 76px 1fr }
  .ring { width: 70px; height: 70px }
  .ring b { width: 54px; height: 54px; font-size: .8rem }
  .form, .info { padding: 20px; border-radius: 20px }
  /* clears the sticky bar when the stage is scrolled flush to the top */
  .cosmos-intro { padding: 62px 5vw 0; max-width: 100% }
  .cosmos-intro .section-index { font-size: 2.4rem; margin-bottom: -8px }
  .era-hud { inset-inline: 5vw; max-width: none; bottom: 12vh }
  .btn { padding: 13px 20px }
  .foot { padding: 26px 5vw 40px }
}

@media (max-width: 520px) {
  .section { padding: 56px 5vw }
  .section-index { font-size: 2.6rem }
  .hero-visual, .hero-frame, .about-frame, .contact-frame,
  .g1, .g2, .g3 { min-height: 290px }
  .hero-frame img, .about-frame img, .contact-frame img,
  .g1 img, .g2 img, .g3 img { min-height: 290px }
  .hero-actions { gap: 10px }
  .hero-actions .btn { flex: 1 1 100%; }
  .chip-cloud li { font-size: .8rem; padding: 7px 10px }
  .track span { padding: 8px 13px; font-size: .88rem }
  .card img, .ph { height: 158px }
  .channels { gap: 10px }
  .socials a { font-size: .8rem }
  .wh-visual { min-height: 0 }
  .wh-visual img, .wh-ph { height: 120px }
  .wormhole-panel { padding: 14px; border-radius: 18px; gap: 12px }
  .planet-tag { font-size: .68rem; top: calc(100% + 8px) }
  .foot { font-size: .9rem }
}

@media (max-width: 380px) {
  .section { padding: 48px 5vw }
  .skill { grid-template-columns: 1fr; text-align: start }
  .ring { width: 62px; height: 62px }
  .ring b { width: 48px; height: 48px; font-size: .74rem }
  .frame-empty { padding: 20px }
  .frame-empty span { font-size: .84rem }
}

/* phones held sideways: the tall blocks would swallow the screen */
@media (max-height: 560px) and (orientation: landscape) {
  .nav.open .links { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px }
  .nav.open .nav-cta { grid-column: 1 / -1 }
  .hero { min-height: 0; padding: 26px 5vw 34px }
  .hero-visual, .hero-frame { min-height: 260px }
  .hero-frame img { min-height: 260px }
  .section { padding: 52px 5vw }
  .era-hud { bottom: 6vh; max-width: min(340px, 46vw) }
  .era-title { font-size: 1.02rem }
  .era-when { margin: 3px 0 2px; font-size: .8rem }
  /* a sideways phone has no room for a paragraph over the scene */
  .cosmos-intro { padding: 16px 5vw 0; max-width: min(420px, 48vw) }
  .cosmos-intro .muted { display: none }
  .cosmos-intro .section-index { font-size: 2rem; margin: 0 }
  .wormhole-panel { max-height: 74vh; inset: auto 4vw 6vh 4vw }
}

/* keep text clear of a notch when the phone is on its side */
@supports (padding: max(0px)) {
  .nav { padding-inline: max(4vw, env(safe-area-inset-left), env(safe-area-inset-right)) }
  .section, .foot, .hero, .cosmos-intro {
    padding-inline: max(5vw, env(safe-area-inset-left), env(safe-area-inset-right));
  }
}

/* comfortable hit areas wherever there is no mouse */
@media (pointer: coarse) {
  .links a, .lang a, .socials a, .channels a { padding-block: 10px }
  .btn { min-height: 48px }
  .nav-toggle { width: 46px; height: 46px }
  .wh-close { padding: 9px 14px }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
