/* Intentional viewport layouts. No section is removed from mobile navigation. */
@media (min-width: 1600px) {
  .wrap { width: min(1440px, calc(100% - 160px)); }
  .hero { min-height: 800px; gap: 70px; }
  .hero-title { font-size: 11rem; }
  .hero-art { max-width: 560px; }
  .section { padding-block: 128px; }
}

@media (max-width: 1100px) {
  .character-anchor { right: 3px; width: 60px; }
  .character-swing img { height: 148px; }
  .project-visual { padding: 57px 22px 24px; }
  .project-featured .project-visual { padding: 60px 25px 30px; }
  .wrap { width: calc(100% - 64px); }
  .brand-wordmark { display: none; }
  .nav-shell { gap: 22px; }
  .hero { padding-top: 52px; grid-template-columns: 1.15fr 1fr; }
  .hero-title { font-size: clamp(5rem, 10.6vw, 7.5rem); }
  .hero-actions { gap: 10px; }.hero-actions .button { padding-inline: 16px; gap: 12px; }
  .hero-actions > .text-link { flex-basis: 100%; margin-top: 4px; }
  .hero-art { padding-right: 20px; }
  .section { padding-block: 88px; }
  .about-layout { gap: 50px; }.education-layout { gap: 42px; }
  .stack-inspector { grid-template-columns: 250px minmax(0, 1fr); }
  .stack-controls { padding: 12px; }.stack-option { padding: 13px 10px; }
  .skill-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .project-featured .project-surface { grid-template-columns: 1fr 1.05fr; }
  .project-content { padding: 25px; }
  .contact-panel { padding: 48px; }
}

@media (max-width: 820px) {
  .character-anchor { right: 2px; width: 47px; }
  .character-swing img { height: 116px; }
  .project-featured .project-visual { min-height: 0; padding: 60px 45px 25px; border-right: 0; border-bottom: 1px solid var(--line); }
  .project-visual { padding: 55px 17px 22px; }
  .browser-toolbar { gap: 7px; padding-inline: 9px; }
  .browser-toolbar .code-dots { gap: 3px; }
  .browser-toolbar .code-dots i { width: 4px; height: 4px; }
  
  
  
  
  :root { --header-height: 78px; }
  html:not(.nav-enhanced) { scroll-padding-top: 190px; }
  .wrap { width: calc(100% - 48px); }
  .nav-shell { flex-wrap: wrap; justify-content: space-between; gap: 0; padding-block: 12px; }
  .brand-wordmark { display: block; }
  .nav-actions { margin-left: auto; }
  /* Without JS, the menu is a visible wrapping row. With JS, the same links form a disclosure. */
  .primary-nav { order: 3; flex-basis: 100%; justify-content: center; flex-wrap: wrap; gap: 6px 22px; padding-top: 10px; margin: 0; }
  .primary-nav a { font-size: .875rem; }
  .nav-enhanced .menu-toggle { display: flex; }
  .nav-shell { position: relative; }
  .nav-enhanced .primary-nav { position: absolute; top: calc(100% + 8px); left: 0; right: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 14px; gap: 6px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-12px) scale(.985); transform-origin: top; transition: opacity .22s ease, transform .35s var(--ease-out), visibility 0s .25s; }
  .nav-enhanced .primary-nav.is-open { max-height: calc(100svh - 108px); overflow-y: auto; opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s; }
  @media (prefers-reduced-motion: no-preference) {
    .primary-nav.is-open a { animation: panel-enter .5s var(--ease-out) backwards; }
    .primary-nav.is-open a:nth-child(2) { animation-delay: 35ms; }
    .primary-nav.is-open a:nth-child(3) { animation-delay: 70ms; }
    .primary-nav.is-open a:nth-child(4) { animation-delay: 105ms; }
    .primary-nav.is-open a:nth-child(5) { animation-delay: 140ms; }
    .primary-nav.is-open a:nth-child(6) { animation-delay: 175ms; }
  }
  .nav-enhanced .primary-nav a { padding: 13px 15px; border: 1px solid var(--line); border-radius: 6px; }
  .nav-enhanced .primary-nav a::after { left: 15px; right: 15px; bottom: 7px; }
  .hero { min-height: 0; padding-block: 50px 27px; gap: 24px; grid-template-columns: 1.2fr 1fr; }
  .hero-title { font-size: clamp(4.3rem, 10.6vw, 6rem); }.hero-intro { font-size: .625rem; gap: 8px; margin-bottom: 24px; }.hero-role { font-size: .75rem; letter-spacing: .15em; }
  .hero-description { font-size: .9375rem; }.hero-bottom { margin-top: 20px; }
  .hero-actions { margin-top: 22px; }.hero-actions > .button { width: 100%; max-width: 255px; }
  .hero-art { padding-right: 16px; }.portrait-panel { aspect-ratio: .69; }.portrait-caption { font-size: 1.35rem; left: 16px; bottom: 20px; }.portrait-cross { display: none; }
  .art-coordinate { right: -28px; }.hero-foot { margin-top: 18px; }.hero-foot-note { display: none; }
  .stack-ribbon .wrap { font-size: 1.3rem; gap: 15px; padding-block: 21px; }.stack-ribbon span[aria-hidden] { font-size: .875rem; }
  .about-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 32px; }.about-visual { padding: 18px; }.about-copy > .lead { font-size: 1.15rem; }.about-copy > p { font-size: .9375rem; }
  .heading-split { align-items: flex-start; flex-direction: column; gap: 0; }.heading-split .section-intro { max-width: 470px; }
  .stack-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .stack-inspector { grid-template-columns: 1fr; }.stack-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-right: 0; border-bottom: 1px solid var(--line); gap: 8px; padding: 14px; }.stack-option { gap: 8px; padding: 10px; }.stack-option > span:last-child { display: none; }.stack-option small { font-size: .6875rem; }.tech-monogram { width: 29px; height: 32px; font-size: .75rem; }
  .education-layout { grid-template-columns: 1fr; gap: 0; }.education-layout .section-intro { max-width: 480px; }
  .experience-card { padding-inline: 30px; }.experience-header { align-items: flex-start; flex-direction: column; gap: 20px; }.experience-header h3 { font-size: 2.5rem; }
  .project-featured .project-surface { grid-template-columns: 1fr; }
  .projects-grid { gap: 22px; }.project-content { padding: 24px; }
  .contact-panel { padding: 38px; }.contact-decoration { font-size: 5rem; right: 30px; }.contact-bottom { gap: 14px; }
  .site-footer { gap: 15px 30px; }.site-footer p:last-child { margin-left: 0; }.footer-name { flex-basis: 100%; }
}

@media (max-width: 600px) {
  .character-anchor { right: 1px; width: 37px; }
  .character-swing { padding-top: 16px; }.character-swing::before { height: 20px; }
  .character-swing img { height: 92px; }.character-light { top: 16px; }
  .project-visual, .project-featured .project-visual { min-height: 0; padding: 56px 20px 22px; }
  .preview-heading { left: 20px; right: 20px; }
  .preview-open { padding: 10px; }.preview-open > span { font-size: .625rem; }
  .preview-caption { margin-top: 16px; }
  .live-browser { border-radius: 7px; }
  .wrap { width: calc(100% - 40px); }.section { padding-block: 70px; }
  h2 { font-size: clamp(2.95rem, 12.5vw, 4rem); }
  .section-heading { margin-bottom: 34px; }.section-heading .eyebrow { margin-bottom: 21px; }
  .eyebrow { font-size: .6875rem; letter-spacing: .12em; gap: 10px; }
  .brand { gap: 5px; }.brand-mark, .brand-mark img { width: 38px; height: 38px; }.brand-wordmark { font-size: .6875rem; }.brand-wordmark > span { font-size: .5625rem; }
  .theme-toggle { width: 40px; height: 40px; }.nav-actions { gap: 8px; }.menu-toggle { padding-inline: 11px; }.menu-label { font-size: .75rem; }
  .hero { grid-template-columns: 1fr; gap: 34px; padding-top: 36px; }
  .hero-title { font-size: clamp(5rem, 20vw, 7.7rem); line-height: .88; }.hero-intro { margin-bottom: 25px; }.hero-role { font-size: .8125rem; }.hero-description { max-width: 355px; font-size: 1rem; }
  .hero-actions { gap: 10px; }.hero-actions > .button { width: auto; max-width: none; padding: 14px 16px; flex-grow: 1; gap: 12px; font-size: .8125rem; }.hero-actions > .text-link { margin-top: 7px; }
  .hero-art { width: min(88%, 360px); justify-self: center; padding: 12px; margin-top: 8px; }.portrait-panel { aspect-ratio: .95; border-bottom-right-radius: 50px; }.hero-portrait { object-position: 50% 25%; }.portrait-caption { font-size: 1.35rem; }.portrait-cross { display: block; font-size: 1.8rem; }.hero-orbit { inset: 10px -10px; }.art-coordinate { right: -24px; font-size: .5625rem; }
  .hero-foot { margin-top: 8px; padding-top: 20px; font-size: .6875rem; }.scroll-cue { min-height: 35px; }
  .stack-ribbon .wrap { justify-content: center; flex-wrap: wrap; gap: 13px 17px; font-size: 1.25rem; padding-block: 22px; }.stack-ribbon span[aria-hidden] { font-size: .6875rem; }
  .about-layout { grid-template-columns: 1fr; gap: 35px; }.about-visual { width: 230px; }.about-copy > .lead { font-size: 1.25rem; }.about-copy > p { font-size: 1rem; }.about-pillars { gap: 6px; }.about-pillars span { padding: 6px 9px; font-size: .75rem; }
  .code-lab { margin-inline: 15px; }.code-notice { margin-inline: 20px; }
  .lab-controls > div { flex-wrap: wrap; }.lab-controls input { flex-basis: 100%; }
  .lab-run { width: 100%; min-height: 42px; }.code-copy { font-size: .5625rem; padding: 7px; }
  .hud-body dl { grid-template-columns: 1fr 1fr; gap: 20px; }.dev-hud summary { padding: 16px; font-size: .6875rem; }.hud-body { padding-inline: 16px; }
  .preview-load { min-height: 44px; }.preview-feedback { min-width: 95px; }
  .stack-section { padding-top: 65px; }.stack-heading h3 { font-size: 2.4rem; }
  .stack-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 10px; }.stack-option { gap: 9px; padding: 11px 8px; font-size: .8125rem; }.stack-option small { font-size: .625rem; }.tech-monogram { width: 30px; }
  .code-toolbar { padding: 14px 16px; gap: 10px; font-size: .625rem; }.code-label { display: none; }.stack-summary { padding: 25px 20px 18px; }.stack-summary p { min-height: 0; }.code-window { margin: 0 15px 20px; padding: 17px; font-size: .75rem; min-height: 230px; }.stack-detail-foot { padding: 14px 20px; font-size: .625rem; }
  .skill-categories { grid-template-columns: 1fr 1fr; gap: 25px 20px; }.skill-category li { font-size: .75rem; padding: 4px 7px; overflow-wrap: anywhere; }.skill-category h4 { font-size: .8125rem; }
  .timeline { padding-left: 23px; }.timeline-node { left: -28px; }.timeline-card { padding: 25px 23px; }.timeline-card h3 { font-size: 2.25rem; }.qualification { font-size: .9375rem; }
  .experience-card { padding-inline: 22px; }.experience-header { padding-block: 28px; }.experience-date { font-size: .8125rem; gap: 7px; }.experience-header h3 { font-size: 2.4rem; }.responsibility { gap: 15px; padding-block: 24px; }.responsibility-number { font-size: 1.6rem; width: 28px; }.responsibility h4 { font-size: 1rem; }.responsibility p { font-size: .9375rem; }.responsibility-mark { display: none; }
  .projects-grid { grid-template-columns: 1fr; }.project-featured { grid-column: auto; }
  .project-content { padding: 25px; }.project-content h3 { font-size: 2.6rem; }.project-meta { font-size: .625rem; }.project-meta > span:last-child:not(:first-child) { display: none; }.project-content > p { font-size: .9375rem; }.project-actions { gap: 9px; }.project-link { padding: 10px 12px; }
  .contact-panel { padding: 30px 24px; border-radius: 13px; }.contact-panel h2 { font-size: clamp(2.8rem, 11.8vw, 4.3rem); }.contact-panel > .eyebrow { font-size: .625rem; gap: 8px; margin-bottom: 28px; }.contact-decoration { font-size: 3.5rem; right: 15px; top: 28px; opacity: .5; }.contact-intro { font-size: .9375rem; }.contact-intro br { display: none; }.contact-actions { gap: 20px; }.contact-email { font-size: .8125rem; }.contact-bottom { margin-top: 30px; padding-top: 25px; align-items: flex-start; flex-direction: column; gap: 15px; }
  .site-footer { padding-bottom: 30px; flex-direction: column; align-items: flex-start; gap: 13px; font-size: .6875rem; }.footer-name { flex-basis: auto; }.back-to-top { right: 12px; bottom: 12px; }
}

@media (max-width: 359px) {
  .project-visual, .project-featured .project-visual { padding-inline: 16px; }
  .preview-heading { font-size: .5625rem; left: 16px; right: 16px; }
  .preview-status { font-size: .5rem; }
  .wrap { width: calc(100% - 32px); }
  .brand-wordmark { display: none; }
  .hero-title { font-size: 4.9rem; }.hero-intro { font-size: .5625rem; letter-spacing: .08em; gap: 7px; }.eyebrow-line { width: 20px; }.hero-actions > .button { width: 100%; font-size: .875rem; }.hero-role { font-size: .75rem; }
  .hero-art { width: 88%; }.portrait-caption { font-size: 1.2rem; }
  .stack-option { gap: 7px; }.tech-monogram { width: 25px; font-size: .6875rem; }.stack-option small { font-size: .5625rem; }.stack-option { font-size: .75rem; }
  .timeline-card { padding: 22px 18px; }.experience-header h3 { font-size: 2.15rem; }.experience-date { font-size: .75rem; }.experience-card { padding-inline: 18px; }
  .project-content { padding: 22px; }.project-content h3 { font-size: 2.35rem; }.project-actions { flex-direction: column; align-items: flex-start; }
  .contact-panel { padding: 28px 20px; }.contact-panel h2 { font-size: 2.7rem; }.contact-panel > .eyebrow { letter-spacing: .055em; font-size: .5625rem; }.contact-decoration { display: none; }.contact-email { font-size: .75rem; }
}

@media (hover: none), (pointer: coarse) {
  .cursor-glow { display: none; }
  .primary-nav a, .project-details summary, .contact-bottom a { min-height: 44px; }
  .project-surface { transform: none; }
}

@media (prefers-reduced-motion: reduce) { .nav-enhanced .primary-nav { transition: none; } }

/* The preview studio adapts independently from the page underneath. */
@media (max-width: 900px) {
  .studio-toolbar { gap: 8px; padding-inline: 16px; }
  .studio-dimensions { order: 3; flex-basis: 100%; }
  .studio-footer > span { flex-basis: 100%; margin-left: 0; }
  .code-toolbar { flex-wrap: wrap; gap: 8px 12px; }
  .code-toolbar .code-label { display: none; }
  .code-wrap { margin-left: auto; }.code-copy { margin-left: 0; }
}
@media (max-width: 600px) {
  .preview-studio { width: calc(100vw - 12px); height: calc(100svh - 12px); border-radius: 12px; }
  .studio-header { padding: 12px 16px; }.studio-header h2 { font-size: 1.65rem; }
  .studio-header .eyebrow { font-size: .5rem; margin-bottom: 4px; }
  .studio-projects { padding-inline: 0; }.studio-projects button { padding: 11px 12px; gap: 6px; flex: 1; justify-content: center; font-size: .5rem; }.studio-projects button span { font-size: .6875rem; }
  .studio-toolbar { padding: 8px 12px; gap: 6px; }
  .studio-devices button { padding: 7px 8px; font-size: .625rem; min-height: 38px; }
  .studio-tools button, .studio-tools a { padding-inline: 7px; min-height: 38px; font-size: .625rem; }
  .studio-tools button span { display: none; }
  .studio-tools { gap: 2px; }
  .studio-dimensions { font-size: .5625rem; }
  .studio-footer { padding: 7px 12px; gap: 2px 10px; font-size: .5625rem; }
  .studio-footer > p { flex-basis: 100%; }.studio-footer > span { flex-basis: auto; margin-left: 0; }
  .studio-footer button { font-size: .5625rem; padding: 5px 0; min-height: 32px; }
  .studio-cover { padding: 18px; gap: 12px; }.studio-cover p { font-size: .75rem; }
  .code-toolbar #code-file { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .code-wrap, .code-copy { min-height: 38px; font-size: .5625rem; }
  .contact-copy { min-height: 44px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .preview-studio { height: calc(100svh - 8px); }
  .studio-header { padding-block: 7px; }.studio-header .eyebrow { display: none; }.studio-header h2 { font-size: 1.5rem; }
  .studio-projects { display: none; }.studio-shell { grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .studio-toolbar { padding-block: 5px; }.studio-dimensions { order: initial; flex-basis: auto; }
  .studio-footer > span { display: none; }
}

@media (max-width: 600px) {
  .live-preview-window { aspect-ratio: 4 / 5; }
  .preview-interact, .preview-cover-toggle, .preview-stop { min-height: 44px; padding-inline: 10px; font-size: .625rem; }
  .preview-controls { gap: 8px; }
}
