/* Phones and touch screens. Loaded after styles.css and music-player.css so these win by order. */

/* Keep stray taps and presses from selecting portfolio copy; editable fields and email copying stay available. */
@media(max-width:760px),(pointer:coarse){
  body{-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
  input,textarea,[contenteditable]:not([contenteditable=false]),a[href^="mailto:"]{-webkit-user-select:text;user-select:text}
}

/* Project cards at a normal phone size: a shorter screenshot, tighter body, and the "hard part" left for the
   project page. The robot lane keeps its column; its labels go, so nothing overlaps the copy beside it. */
@media(max-width:760px){
  .project-row{margin-bottom:64px}
  .project-art{height:200px}
  .project-body{padding:18px 18px 16px}
  .project-body h3{font-size:21px;margin:10px 0 8px}
  .project-body>p{font-size:16px;line-height:1.75}
  .project-body>p.project-hard{display:none}
  .project-foot{margin-top:16px;padding-top:14px}
  .robot-task,.portfolio-station-label{display:none}
}
@media(max-width:420px){
  .project-art{height:178px;margin:6px 6px 0}
  .project-body{padding:16px 15px 14px}
  .project-body h3{font-size:20px}
  .project-body>p{font-size:16px}
  .vault-art{--px:2}
}

/* The robot saves its desktop-experience aside for visitors who enter the phone mini game. */
:is(#play-phone-note,#maintenance-phone-note){margin:8px 0 0;color:#efb8d9;font:13px/1.55 var(--mono);text-align:center}
:is(#play-phone-note,#maintenance-phone-note)[hidden]{display:none}
@media(max-height:520px) and (min-width:560px){:is(#arcade-session,#maintenance-session)>.play-intro{grid-column:2}}
#robot-dialogue{--robot-border:#508c82;position:fixed;left:0;top:0;z-index:15;width:194px;height:34px;box-sizing:border-box;padding:6px 8px;border:1px solid var(--robot-border);border-radius:3px;background:#0b2028f5;color:#b5ffdd;font:13px/20px var(--mono);text-align:center;pointer-events:none;white-space:nowrap}
#robot-dialogue[hidden]{display:none}
#robot-dialogue::after{content:"";position:absolute;left:var(--tail,24px);bottom:-6px;width:12px;height:12px;transform:rotate(45deg);background:#0b2028f5;border-right:1px solid var(--robot-border);border-bottom:1px solid var(--robot-border)}
#robot-dialogue[data-task=charging]{--robot-border:#b88e58;color:#ffc680}
/* Short screens retain a usable board and reachable controls instead of squeezing the game to a strip. */
@media(max-width:559px) and (max-height:700px){
  :is(#arcade-session,#maintenance-session){padding:12px;grid-template-rows:auto auto minmax(220px,1fr) auto auto;overflow-y:auto;overscroll-behavior:contain;pointer-events:auto}
  :is(#workshop-area,#maintenance-area){min-height:220px}
}
@media(min-width:560px) and (max-height:520px){
  :is(#arcade-session,#maintenance-session){grid-template-columns:minmax(0,1fr) min(44vw,300px);grid-template-rows:repeat(4,auto);overflow-y:auto;overscroll-behavior:contain;pointer-events:auto;align-content:start}
  :is(#arcade-session,#maintenance-session)>.play-intro{grid-column:2}
  :is(#workshop-area,#maintenance-area){position:sticky;top:0;align-self:start;height:calc(100svh - 24px);min-height:0}
  :is(#play-phone-note,#maintenance-phone-note){text-align:left}
}

/* Keep the work heading's backdrop outside the left lane. The compact phone layout below sets its final inset. */
@media(max-width:760px){.work-heading::before{left:54px}}
@media(max-width:420px){.work-heading::before{left:51px}}

/* Phones and touch tablets: the radio (even a playing one) waits off screen while its spot would cover the hero's calls
   to action; site.js sets html.radio-over-cta from where they sit (same media test). Same slide as the tuck in styles.css. */
@media(max-width:560px),(pointer:coarse) and (max-width:1100px){html.radio-over-cta .music-player{transform:translateY(calc(100% + 30px));opacity:0;visibility:hidden;transition:transform .35s,opacity .35s,visibility 0s .35s}}

/* Bonus game on touch screens: a square neon joystick (script.js), like a game's square touch stick. The knob follows
   the thumb but stays inside the square; a small chevron centred on each side points outward and lights up pink with
   the heading. The chevrons are 44px buttons that still work from a keyboard; their arrow glyphs only show in the
   plain styles.css d-pad, used when script.js never runs. */
@media(pointer:coarse){
  .play-dpad.play-stick{position:relative;display:block;flex:none;width:150px;height:150px;border:1px solid #75eaf366;background:radial-gradient(circle,#8f7cf62e,#8f7cf600 62%),linear-gradient(#75eaf30f 1px,transparent 1px) 0 0/25% 25%,linear-gradient(90deg,#75eaf30f 1px,transparent 1px) 0 0/25% 25%,#080b20eb;box-shadow:0 0 24px #75eaf31a,inset 0 0 24px #000c;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
  .play-stick::before{content:"";position:absolute;inset:-4px;pointer-events:none;opacity:.8;background:linear-gradient(var(--cyan),var(--cyan)) 0 0/14px 2px,linear-gradient(var(--cyan),var(--cyan)) 0 0/2px 14px,linear-gradient(var(--cyan),var(--cyan)) 100% 0/14px 2px,linear-gradient(var(--cyan),var(--cyan)) 100% 0/2px 14px,linear-gradient(var(--cyan),var(--cyan)) 0 100%/14px 2px,linear-gradient(var(--cyan),var(--cyan)) 0 100%/2px 14px,linear-gradient(var(--cyan),var(--cyan)) 100% 100%/14px 2px,linear-gradient(var(--cyan),var(--cyan)) 100% 100%/2px 14px;background-repeat:no-repeat}
  .play-stick button{position:absolute;display:block;width:44px;height:44px;padding:0;border:0;background:none;color:#75eaf3;font-size:0;opacity:.7;transition:opacity .15s,color .15s;--out:4px}
  .play-stick button::before{content:"";position:absolute;inset:0;margin:auto;width:10px;height:10px;border:solid currentColor;border-width:2px 2px 0 0;transform:rotate(var(--turn)) translate(var(--out),calc(var(--out)*-1)) scale(var(--grow,1));filter:drop-shadow(0 0 3px currentColor);transition:transform .15s}
  .play-stick [data-direction=ArrowUp]{top:0;left:calc(50% - 22px);--turn:-45deg}
  .play-stick [data-direction=ArrowDown]{bottom:0;left:calc(50% - 22px);--turn:135deg}
  .play-stick [data-direction=ArrowLeft]{left:0;top:calc(50% - 22px);--turn:-135deg}
  .play-stick [data-direction=ArrowRight]{right:0;top:calc(50% - 22px);--turn:45deg}
  .play-stick[data-heading=ArrowUp] [data-direction=ArrowUp],.play-stick[data-heading=ArrowDown] [data-direction=ArrowDown],.play-stick[data-heading=ArrowLeft] [data-direction=ArrowLeft],.play-stick[data-heading=ArrowRight] [data-direction=ArrowRight]{opacity:1;color:#ff94de;--grow:1.25}
  .stick-knob{position:absolute;left:calc(50% - 28px);top:calc(50% - 28px);width:56px;height:56px;border:1px solid #9cf3f9;border-radius:3px;background:linear-gradient(155deg,#2d2c6e,#13163a 72%);box-shadow:0 0 16px #75eaf34d,inset 0 1px 0 #ffffff29,inset 0 0 16px #8f7cf640;pointer-events:none;will-change:transform;transition:transform .16s cubic-bezier(.2,.8,.3,1.3)}
  .stick-knob::after{content:"";position:absolute;inset:17px;border:1px solid #a998ff;border-radius:2px;box-shadow:0 0 8px #8f7cf699}
  .play-stick.is-held .stick-knob{transition:none;border-color:#d4fcff;box-shadow:0 0 24px #75eaf380,inset 0 1px 0 #ffffff3d,inset 0 0 18px #ee61c64d}
  .play-stick.is-held .stick-knob::after{border-color:#ff94de;box-shadow:0 0 10px #ee61c6b3}
}
@media(pointer:coarse) and (max-height:520px) and (min-width:560px){
  .play-dpad.play-stick{width:124px;height:124px}
  .stick-knob{width:48px;height:48px;left:calc(50% - 24px);top:calc(50% - 24px)}
  .stick-knob::after{inset:14px}
  .play-stick button{--out:5px}
}

/* Touch feedback (touch-fx.js): a layer above the page that never takes input; only transform and opacity animate.
   No will-change here: a running transform/opacity animation gets its own layer anyway, and a finished one gives it
   back instead of holding dozens of idle full-size layers after a single swipe. */
#touch-fx{position:fixed;inset:0;z-index:9;pointer-events:none;overflow:hidden;contain:strict}
#touch-fx i{position:absolute;left:0;top:0;opacity:0}
#touch-fx .fx-cell{width:var(--size);height:var(--size);border:1px solid #8aefff;background:#57d7f82e;box-shadow:0 0 14px #57d7f8aa,inset 0 0 12px #57d7f840}
#touch-fx .fx-cell.violet{border-color:#c39bff;background:#a66ef72e;box-shadow:0 0 14px #a66ef7aa,inset 0 0 12px #a66ef740}
#touch-fx .fx-lock{width:var(--size);height:var(--size);filter:drop-shadow(0 0 4px #75eaf3);background:linear-gradient(#a7f7ff,#a7f7ff) 0 0/10px 2px,linear-gradient(#a7f7ff,#a7f7ff) 0 0/2px 10px,linear-gradient(#a7f7ff,#a7f7ff) 100% 0/10px 2px,linear-gradient(#a7f7ff,#a7f7ff) 100% 0/2px 10px,linear-gradient(#a7f7ff,#a7f7ff) 0 100%/10px 2px,linear-gradient(#a7f7ff,#a7f7ff) 0 100%/2px 10px,linear-gradient(#a7f7ff,#a7f7ff) 100% 100%/10px 2px,linear-gradient(#a7f7ff,#a7f7ff) 100% 100%/2px 10px;background-repeat:no-repeat}
#touch-fx .fx-ring{width:70px;height:70px;margin:-35px 0 0 -35px;border:2px solid #8aefff;border-radius:50%;box-shadow:0 0 18px #75eaf3aa,inset 0 0 14px #75eaf366}
#touch-fx .fx-spark{width:var(--size);height:2px;transform-origin:0 50%;background:#8aefff;box-shadow:0 0 8px #57e1f8}
#touch-fx .fx-spark.violet{background:#e08cff;box-shadow:0 0 8px #ce66f3}
@media(prefers-reduced-motion:reduce){#touch-fx{display:none}}

/* Phones and tablets: the scene's loops run off the per-frame repaint path. The drone scanners and a working pad's glow
   take their colour from the scene tick (script.js sets --scan, --work and --work-stroke at the scene's 30 fps,
   tracing the same curves as the desktop keyframes) instead of a CSS animation that restyles and repaints the maze at
   the display rate. The background grid scrolls as a composited layer (script.js moves --grid-y) instead of
   repainting the whole screen, and each skyline parallaxes on its own small layer. */
@media(max-width:760px),(pointer:coarse){
  .drone-scanner{animation:none;stroke:var(--scan,#ffac65)}
  .portfolio-dock.charging .station-pad,.portfolio-service.servicing .station-pad{animation:none;stroke-width:calc(1.3px + 1.2px * var(--work,0));filter:drop-shadow(0 0 calc(7px * var(--work,0)) #8aead366)}
  .portfolio-dock.charging .station-pad{stroke:var(--work-stroke,#64b6a6)}
  .portfolio-service.servicing .station-pad{stroke:var(--work-stroke,#ab825b)}
  .portfolio-service.online.servicing .station-pad{stroke:var(--work-stroke,#8aead3)}
  .skyline{will-change:transform}
  .ambient-grid{background:none;overflow:hidden}
  .ambient-grid::before{content:"";position:absolute;left:0;right:0;top:0;height:calc(100% + var(--cell,44px));background-image:linear-gradient(#5662b310 1px,transparent 1px),linear-gradient(90deg,#5662b310 1px,transparent 1px);background-size:var(--cell,44px) var(--cell,44px);transform:translateY(var(--grid-y,0px));will-change:transform}
}

/* A narrow reading-progress lane keeps the phone robot clear of the project cards. */
@media(max-width:760px){
  #portfolio-stations,#maze-walls,#drones,.arcade-actor.is-drone,#play-invite,#robot-play-hit{display:none!important}
  #robot-dialogue{width:min(248px,calc(100vw - 72px));height:auto;padding:9px 11px;text-align:left;white-space:normal;font:13px/1.5 var(--mono);z-index:16;box-shadow:0 8px 24px #0006}
  #robot-dialogue::after{left:-6px;top:var(--tail-y,18px);bottom:auto;border-right:0;border-bottom:1px solid var(--robot-border);border-left:1px solid var(--robot-border)}
  .mobile-progress-track,.mobile-progress-fill{fill:none;stroke-linecap:round;vector-effect:non-scaling-stroke}
  .mobile-progress-track{stroke:#75eaf326;stroke-width:2}
  .mobile-progress-fill{stroke:#8aead3;stroke-width:2;filter:drop-shadow(0 0 3px #8aead344)}
}

/* Give phone content the screen width, with just enough room for the bot beside it. */
@media(max-width:760px){
  .hero{height:auto;min-height:0;--city-horizon:240px;--city-setback:calc(0px - var(--horizon-line-offset,14px));--city-height:132px;--city-far-height:82px}
  .hero-copy{padding:clamp(260px,64vw,280px) 16px 76px}
  .hero-copy::before{inset:230px -10px 0}
  .sun{top:12px;width:clamp(176px,48vw,190px);height:clamp(176px,48vw,190px)}
  .floor-wrap{height:calc(100% - 242px)}
  .hero-description{line-height:1.7;margin-block:16px 20px}
  .hero-tags{margin-top:16px}
  .hero-bottom{bottom:22px;gap:10px}
  .about,.ugc,.contact{padding-inline:16px;margin-top:56px}
  .about-portrait{margin-bottom:24px;padding-top:24px}
  .player-stats div{padding-block:7px}
  .about-bio,.ugc-copy>p,.contact-lede{font-size:15px;line-height:1.6;margin-top:12px}
  .about-now{margin-top:14px}
  .about-page-link{margin-top:18px}
  .skills,.studio-profile .skills{grid-template-columns:minmax(0,1fr);margin-top:18px;padding-top:16px;gap:12px}
  .skill-group h3{margin-bottom:4px;letter-spacing:.4px}
  .skill-chips{display:block;font:13px/1.6 var(--mono)}
  .skill-chips li{display:inline;padding:0;border:0;background:none;font-size:13px;line-height:1.6;overflow-wrap:normal}
  .skill-chips li:not(:last-child)::after{content:" · ";color:var(--muted)}
  .about + .work{margin-top:56px}
  .work{padding-inline:8px;--robot-lane:48px}
  .work-heading{padding:0 0 20px var(--robot-lane);margin-bottom:24px}
  .work-heading::before{left:calc(var(--robot-lane) - 12px)}
  .work-heading>p{font-size:15px;line-height:1.5;margin-top:10px}
  .work-heading .work-intro>span{font-size:15px;color:#c0c5db}
  .work-gallery-link{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .work-gallery-link>a{grid-column:1/-1}
  .work-gallery-link .gallery-cta,.work-gallery-link #open-starbreak,.work-gallery-link #open-maintenance{display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%;min-height:44px;margin:0;padding:10px 9px;font:13px/1.35 var(--mono);letter-spacing:0;text-align:left}
  .work-gallery-link #open-starbreak span{margin:0}
  .services{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:18px;gap:14px 12px}
  .services li{padding-top:9px}
  .services svg{width:18px;height:18px;margin-bottom:6px}
  .services b{font-size:13px;line-height:1.4;letter-spacing:0;margin-bottom:5px}
  .services span{font-size:15px;line-height:1.5}
  .project-row{padding-left:var(--robot-lane);margin-bottom:32px}
  .project-card{max-width:none}
  .project-body{padding:16px 14px}
  .project-body>p{max-width:68ch;font-size:15px;line-height:1.6}
  .project-foot{margin-top:14px;padding-top:12px;gap:8px}
  .project-tags{gap:5px}
  .project-tags span{padding:4px 6px}
  .ugc-points{margin-top:20px;gap:9px}
  .ugc-stage{margin-top:28px}
  .ugc-copy>p.ugc-hint{margin-top:20px}
  .contact-panel{padding:24px 18px}
  .contact-list{margin-top:24px;padding-top:18px;gap:12px}
  .contact-row{margin-top:22px}
  .end-note{margin-top:12px;padding:40px 16px 36px 40px}
  .site-footer{margin-inline:16px;gap:12px}
  .page-main{padding:8px 12px 36px}
  .page-hero,.studio-page .page-hero{padding:22px 0 26px;margin-bottom:28px}
  .page-section,.page-visual{margin-bottom:30px}
  .page-summary,.page-lede,.page .hard-part p,.system p{line-height:1.7}
  .page .hard-part{padding:20px 16px}
  .page-list{gap:9px 20px}
  .studio-profile{margin:28px 0 44px;gap:24px}
  .process-grid{gap:14px}
  .process-grid article{padding:20px}
  .process-grid h2{margin-top:14px}
  .process-grid p,.article-body section p{line-height:1.75}
  .studio-cta{padding:22px 18px;margin-top:36px;gap:16px}
  .faq-list summary{padding-block:18px}
  .faq-answer{padding-bottom:18px}
  .faq-answer p{line-height:1.75}
  .blog-card>a{grid-template-columns:26px 1fr;gap:12px;padding:20px 16px}
  .blog-card p:not(.eyebrow){line-height:1.7}
  .article-body section{margin-bottom:28px}
}
/* Mobile summaries keep the landing page brief; desktop keeps the full copy. */
.work-heading .mobile-copy{display:none}
.work-intro>.desktop-copy,.work-gallery-link .desktop-copy,.work-gallery-link .mobile-copy{font:inherit;color:inherit}
.work-gallery-link #open-starbreak .desktop-copy{margin-left:0}
@media(max-width:760px){
  .work-heading .desktop-copy{display:none}
  .work-heading .mobile-copy{display:block}
}
