/* Percentage image sizing in a grid can grow past the portrait frame. */
.beyond-stage .beyond-portrait { position: relative; height: clamp(380px, 44vw, 580px); min-height: 0; overflow: visible; }
.beyond-stage .beyond-portrait img {
  position: absolute;
  inset: 0;
  margin: auto;
  display: block;
  width: auto;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}
.beyond-stage { min-height: 0; }
.beyond-section { padding-bottom: 70px; }
.sound-switch { color: var(--cyan); border: 1px solid #79aef04d; padding: 10px 13px; font: 500 8px var(--orbit); letter-spacing: 1px; background: #091528; cursor: pointer; white-space: nowrap; }
.sound-switch:hover, .sound-switch:focus-visible { border-color: var(--cyan); }
.sound-switch[aria-pressed=false] { color: #8496b1; }
.header-tools { display: flex; gap: 14px; align-items: center; }

.nav-grid .nav-contact-aside { align-items: center; }
.contact-phone { position: relative; width: min(100%, 305px); padding: 14px 16px 24px; border: 2px solid #7da6dc77; border-radius: 32px; background: linear-gradient(150deg, #15283e, #050b14 65%); box-sizing: border-box; box-shadow: 0 20px 65px #0008, inset 0 0 0 5px #07101a; overflow: hidden; }
.contact-phone::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent, #7eafff16, transparent); height: 35%; pointer-events: none; animation: contact-scan 6s linear infinite; }
.phone-status { display: flex; justify-content: space-between; color: #83a8d7; font: 500 7px var(--orbit); letter-spacing: 1px; padding: 8px 7px 0; }
.phone-status i { display: inline-block; width: 4px; height: 4px; background: #88c9b9; border-radius: 50%; margin-right: 5px; box-shadow: 0 0 8px #88c9b9; }
.phone-notch { width: 78px; height: 13px; background: #04090e; border: 1px solid #38516d; border-radius: 10px; margin: 2px auto 19px; }
.phone-screen { position: relative; z-index: 1; padding: 12px 12px 20px; }
.phone-screen .eyebrow { font-size: 7px; letter-spacing: 1px; }
.phone-screen h3 { font: 500 24px/1.3 var(--orbit); color: #e4efff; margin: 15px 0 25px; }
.phone-contact { display: block; position: relative; padding: 14px 18px 14px 0; border-top: 1px solid #7ea9e62b; }
.phone-contact small { display: block; color: #779acb; font: 400 7px var(--orbit); letter-spacing: 1px; margin-bottom: 6px; }
.phone-contact strong { display: block; color: #d2e1f7; font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.phone-contact > span { position: absolute; right: 0; top: 28px; color: var(--cyan); }
.phone-contact:hover strong { color: var(--cyan); }
.phone-location { font-size: 10px; color: #8299b9; margin: 17px 0; }
.phone-screen .cyber-button { padding: 12px; min-height: 36px; font-size: 7px; }
.phone-home { height: 4px; width: 60px; border-radius: 10px; background: #83a3c9; margin: 0 auto; opacity: .5; }
.navigation[open] .contact-phone { animation: phone-entry .65s cubic-bezier(.18,.7,.2,1) both; }
.nav-contact-aside .theme-controls { margin-top: 20px; }
@keyframes phone-entry { from { opacity: 0; transform: translateY(22px) rotateY(-12deg); } to { opacity: 1; transform: none; } }
@keyframes contact-scan { from { transform: translateY(-180%); } to { transform: translateY(450%); } }

.work-mindset { --mindset-progress: 0; --mindset-x: .5; --mindset-y: .5; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(35px, 6vw, 90px); overflow: visible; background: radial-gradient(ellipse at calc(var(--mindset-x) * 100%) calc(var(--mindset-y) * 100%), #1e38512b, transparent 65%); }
.mindset-heading { position: sticky; top: 105px; align-self: start; min-width: 0; }
.mindset-heading h2 { font: 600 clamp(29px, 3.8vw, 48px)/1.1 var(--orbit); letter-spacing: -.03em; color: #dceaff; margin: 28px 0; }
.mindset-heading h2 em { font-style: normal; color: var(--cyan); }
.mindset-heading > p { font-size: 14px; color: #91a6c6; line-height: 1.95; }
.mindset-signals { margin: 30px 0; display: grid; gap: 17px; }
.mindset-signals span { font: 400 8px var(--orbit); letter-spacing: 1px; color: #7d9cc7; padding-left: 20px; position: relative; }
.mindset-signals span::before { content: ''; width: 9px; height: 1px; background: var(--cyan); position: absolute; left: 0; top: 50%; }
.mindset-meter { border-top: 1px solid #648dbb44; position: relative; padding-top: 18px; }
.mindset-meter i { display: block; position: absolute; top: -1px; left: 0; height: 2px; width: 100%; transform: scaleX(var(--mindset-progress)); transform-origin: left; background: var(--cyan); box-shadow: 0 0 10px #79b0ff77; }
.mindset-meter > span { color: #6b88b1; font: 400 7px var(--orbit); letter-spacing: 1px; }
.mindset-principles { display: grid; gap: 24px; min-width: 0; }
.mindset-principle { position: relative; padding: clamp(25px, 3.3vw, 40px); background: linear-gradient(140deg, #0d1829bb, #070d17); border: 1px solid #6f99d233; transition: transform .55s, opacity .55s, border-color .4s; }
.mindset-number { color: #6d9bd060; font: 500 28px var(--orbit); display: block; margin-bottom: 24px; }
.mindset-principle .eyebrow { font-size: 8px; letter-spacing: 1px; }
.mindset-principle h3 { color: #d9e8ff; font: 500 clamp(18px, 2vw, 25px)/1.45 var(--orbit); margin: 17px 0; }
.mindset-principle p { color: #91a6c4; font-size: 13px; line-height: 1.9; }
.mindset-principle.is-active { border-color: #87b7f78c; }
.mindset-principle.is-active .mindset-number { color: var(--cyan); }
.mindset-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.mindset-tags span { font: 400 7px var(--orbit); color: #7a9dcc; letter-spacing: .5px; padding: 7px; border: 1px solid #6489be22; }
@media (max-width: 900px) { .work-mindset { grid-template-columns: 1fr; gap: 30px; } .mindset-heading { position: static; } }
@media (max-width: 700px) {
  .beyond-stage .beyond-portrait { height: 440px; max-width: 300px; }
  .nav-grid .nav-contact-aside { width: 100%; align-items: center; }
  .contact-phone { max-width: 305px; }
  .phone-screen h3 { font-size: 22px; }
  .work-mindset { padding-top: 65px; padding-bottom: 65px; }
  .mindset-heading h2 { font-size: clamp(28px, 7vw, 42px); }
  .sound-switch { font-size: 7px; padding: 9px; }
  .header-tools { gap: 8px; }
}
@media (max-width: 360px) { .beyond-stage .beyond-portrait { height: 380px; } .contact-phone { padding-left: 12px; padding-right: 12px; } }
.paused .contact-phone::after, .paused .navigation[open] .contact-phone { animation: none; }
@media (prefers-reduced-motion: reduce) { .contact-phone::after, .navigation[open] .contact-phone { animation: none; } .mindset-principle { transition: none; } }
.hero .workspace-layer {
  inset: 0;
  transform: none;
  will-change: auto;
}
.hero .workspace-silver { filter: brightness(.85); }
.hero .workspace-blue {
  background-image: url(assets/workspace-hacker-reveal.webp);
  filter: none;
  clip-path: none;
  -webkit-mask-image: var(--hero-mask, linear-gradient(transparent, transparent));
  mask-image: var(--hero-mask, linear-gradient(transparent, transparent));
  transition: none;
}
.hero.reveal-all .workspace-blue {
  clip-path: none;
  -webkit-mask-image: none;
  mask-image: none;
}
.hero .banner-controls { flex-wrap: wrap; max-width: 72%; gap: 10px; }
.hero .banner-controls button[aria-pressed="true"] { border-color: var(--cyan); color: var(--cyan); }
@media (hover: hover) and (pointer: fine) and (min-width: 901px) {
  .hero #reveal-world { display: none; }
}
.paused .hero .workspace-layer { transform: none; }
@media (max-width: 600px) {
  .hero .banner-controls { right: 5%; bottom: 68px; max-width: 90%; }
  .hero .banner-controls button { padding: 12px 10px; font-size: 8px; }
  .hero .workspace-layer { background-position: 66% center; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .workspace-layer { transform: none; }
}
/* Use a flat, single-card carousel on narrow screens. */
@media (max-width: 900px) {
  .projects-section .project-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    padding: 24px clamp(16px, 5vw, 44px) 32px;
    perspective: none;
    overflow: hidden;
  }
  .project-stage .project-counter,
  .project-stage .project-stack,
  .project-stage .project-current,
  .project-stage .project-controls {
    position: relative;
    inset: auto;
    transform: none;
    width: 100%;
    min-width: 0;
  }
  .project-stage .project-counter { min-height: 24px; }
  .project-stage .project-stack {
    height: clamp(310px, 82vw, 430px);
    perspective: none;
  }
  .project-stack .project-card {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    transform: none !important;
    will-change: auto;
    box-shadow: none;
    backface-visibility: hidden;
  }
  .project-stack .project-card:not(.active) { display: none; }
  .project-card .card-label { top: 16px; left: 20px; font-size: 7px; letter-spacing: 1px; }
  .project-card .visual-initials { top: 64px; left: 20px; font-size: 36px; }
  .project-card .visual-copy { top: 113px; bottom: auto; left: 20px; right: 20px; }
  .project-card .visual-copy strong { display: none; }
  .project-card .visual-copy small { margin: 0; font-size: 10px; letter-spacing: .4px; }
  .project-card .card-caption {
    left: 20px;
    right: 20px;
    bottom: 75px;
    max-width: none;
    font-size: clamp(16px, 4.5vw, 22px);
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .project-card .hold-label { left: 20px; right: auto; bottom: 20px; font-size: 8px; }
  .project-card .hold-label i { width: 32px; height: 32px; }
  .project-card .visual-index { right: 20px; bottom: 76px; font-size: 64px; }
  .project-stage .project-current { display: block; }
  .project-current > div { display: none; }
  .project-current .cyber-button { width: 100%; min-width: 0; min-height: 44px; font-size: 10px; }
  .project-stage .project-controls { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 10px; }
  .project-controls > button { width: 44px; height: 44px; }
  .project-controls #project-dots { max-width: none; justify-content: center; flex-wrap: wrap; gap: 8px; }
  #project-dots button { width: 10px; height: 10px; }
  .project-stage .project-scroll-hint { display: none; }
  .archive-grid > a { min-width: 0; }
  .archive-grid > a span { overflow-wrap: anywhere; }
  .project-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-project, .gallery-info { min-width: 0; }
  .gallery-info h2 { overflow-wrap: anywhere; }
}
@media (max-width: 600px) {
  .project-gallery { grid-template-columns: minmax(0, 1fr); }
  .gallery-art .visual-copy { bottom: 78px; }
  .gallery-art .visual-copy strong { max-width: 100%; }
  .gallery-art > span { bottom: 16px; right: 16px; }
}
@media (max-width: 900px) {
  .laptop-sequence,
  .paused .laptop-sequence { height: auto; }
  .laptop-sequence .laptop-sticky {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    display: block;
    overflow: visible;
    padding: 48px clamp(16px, 5vw, 44px);
  }
  .laptop-sequence .build-heading { position: relative; top: auto; opacity: 1; margin-bottom: 28px; }
  .laptop-sequence .build-heading h2 { font-size: clamp(26px, 6vw, 40px); }
  .laptop-sequence #build-status,
  .laptop-sequence .editor-code,
  .laptop-sequence .terminal,
  .laptop-sequence .screen-result,
  .laptop-sequence .lid-logo,
  .laptop-sequence .build-bottom,
  .laptop-sequence .build-progress { display: none; }
  .laptop-sequence .laptop-scene,
  .laptop-sequence .laptop-device,
  .laptop-sequence .laptop-lid,
  .laptop-sequence .laptop-screen {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-width: 0;
    aspect-ratio: auto;
    margin: 0;
    padding: 0;
    transform: none;
    perspective: none;
    transform-style: flat;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    background: transparent;
  }
  .laptop-sequence .screen-contact {
    position: relative;
    inset: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    overflow: visible;
    border: 1px solid #34506f;
    border-radius: 12px;
  }
  .laptop-sequence .screen-contact #contact-form { padding: clamp(18px, 4vw, 28px); grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .screen-contact #contact-form > * { min-width: 0; }
  .laptop-sequence .screen-contact #contact-form label { grid-column: 1; font-size: 13px; gap: 8px; }
  .laptop-sequence .screen-contact #contact-form input,
  .laptop-sequence .screen-contact #contact-form select,
  .laptop-sequence .screen-contact #contact-form textarea { min-height: 48px; font-size: 16px; }
  .laptop-sequence .screen-contact #contact-form textarea { height: 140px; }
  .laptop-sequence .screen-contact #contact-form button { width: 100%; min-height: 48px; }
  .laptop-sequence .screen-contact .form-note { font-size: 11px; overflow-wrap: anywhere; }
  .laptop-sequence .screen-contact .form-heading { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 900px) {
  .laptop-sequence .laptop-lid {
    padding: 7px;
    border: 1px solid #8194ab;
    border-radius: 14px 14px 5px 5px;
    background: linear-gradient(145deg, #68788c, #1b2635 35%, #68788c);
    box-shadow: 0 20px 45px #0006, 0 0 35px #489afa18;
    transform-origin: center bottom;
    transform: perspective(1000px) rotateX(calc((1 - var(--mobile-open, 1)) * -8deg));
  }
  .laptop-sequence .laptop-screen { background: #07101b; border-radius: 8px; overflow: hidden; }
  .laptop-sequence .editor-bar { display: flex; padding: 14px 12px; min-height: 40px; gap: 6px; }
  .laptop-sequence .editor-bar span { font-size: 9px; min-width: 0; overflow-wrap: anywhere; }
  .laptop-sequence .screen-contact { border: 0; border-radius: 0; }
  .laptop-sequence .screen-contact #contact-form { padding: clamp(14px, 4vw, 26px); }
  .laptop-sequence .laptop-base {
    display: block;
    position: relative;
    top: auto;
    left: auto;
    width: calc(100% + 12px);
    height: 48px;
    margin-left: -6px;
    transform: none;
    border-radius: 2px 2px 16px 16px;
    background: linear-gradient(#6d7a8c, #26313f 80%, #728198);
    border: 1px solid #8194ab;
    box-shadow: 0 18px 30px #0005;
  }
  .laptop-sequence .keyboard { height: 16px; margin: 5px 13% 0; }
  .laptop-sequence .trackpad { height: 12px; margin: 3px auto; }
}
.paused .laptop-sequence .laptop-lid { transform: none; }
@media (prefers-reduced-motion: reduce) { .laptop-sequence .laptop-lid { transform: none; } }
.site-header .brand { width: clamp(120px, 16vw, 190px); height: auto; flex-shrink: 0; filter: none; }
.brand img, .footer-name img, .boot-logo img { display: block; width: 100%; height: auto; object-fit: contain; }
.footer-name { display: inline-block; width: min(260px, 100%); }
.boot .boot-logo { display: block; width: min(250px, 65vw); height: auto; }
@media (max-width: 600px) { .site-header .brand { width: 120px; } }
