:root {
  color-scheme: dark;
  --ink: #000;
  --paper: #fff;
  --muted: #aaa;
  --line: rgba(255,255,255,.28);
  --ease: cubic-bezier(.2,.8,.2,1);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; min-width: 0; margin: 0; overflow: hidden; background: var(--ink); color: var(--paper); overscroll-behavior: none; }
body { position: relative; }
button, a { color: inherit; font: inherit; }
button { cursor: pointer; }
a { text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid white; outline-offset: 4px; }
[hidden] { display: none !important; }

/* The video is the canvas: no frame, captions, page copy, or scrolling. */
.experience { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; background: #000; }
.dialogue-video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; background: #000; cursor: pointer; opacity: 1; transition: opacity 360ms linear; }
.idle-loop-video { z-index: 2; opacity: 0; pointer-events: none; }

.topbar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; min-height: 76px; padding: max(20px, env(safe-area-inset-top)) clamp(22px, 3.2vw, 52px) 12px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; background: linear-gradient(to bottom, rgba(0,0,0,.62), transparent); }
.nav-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 34px; padding: 7px 0; border: 0; border-radius: 0; background: transparent; color: rgba(255,255,255,.94); font-size: 12px; letter-spacing: .01em; white-space: nowrap; cursor: pointer; pointer-events: auto; transition: opacity .2s ease, transform .2s var(--ease); }
.nav-button:hover:not(:disabled) { opacity: .65; }
.nav-button:disabled { opacity: .34; cursor: default; }
.nav-button > span[aria-hidden="true"] { font-size: 18px; line-height: 1; }
.back-button:hover:not(:disabled) > span:first-child { transform: translateX(-3px); }
.nav-actions { display: flex; align-items: center; gap: clamp(22px, 3vw, 46px); margin-left: auto; margin-right: clamp(22px, 3.5vw, 54px); pointer-events: auto; }
.portfolio-button { gap: 7px; }
.resume-button { gap: 7px; }
.portfolio-button > span { font-size: 15px !important; }
.home-button { margin-left: auto; }

.sound-button { position: fixed; z-index: 12; right: max(24px, env(safe-area-inset-right)); top: max(78px, calc(env(safe-area-inset-top) + 70px)); bottom: auto; width: 37px; height: 37px; display: grid; place-items: center; padding: 9px; border: 1px solid rgba(255,255,255,.38); border-radius: 50%; background: rgba(0,0,0,.28); color: #fff; transition: background .2s ease, color .2s ease, opacity .2s ease; }
.sound-button:hover { background: #fff; color: #000; }
.sound-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sound-button .volume-on { display: none; }
.sound-button[aria-pressed="true"] .volume-on { display: block; }
.sound-button[aria-pressed="true"] .volume-off { display: none; }

.choices { position: absolute; z-index: 10; pointer-events: none; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: clamp(18px, 3.6vw, 62px); padding: clamp(110px, 17vh, 188px) clamp(36px, 7vw, 108px) max(38px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.18) 24%, rgba(0,0,0,.75) 60%, #000 100%); animation: choices-in .4s var(--ease) both; }
.choice { pointer-events: auto; width: 100%; min-width: 0; min-height: 112px; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 14px; padding: 14px 0 0; border: 0; border-top: 1px solid rgba(255,255,255,.36); background: transparent; color: #fff; text-align: left; transition: padding .22s var(--ease), border-color .22s ease, opacity .22s ease; animation: choice-in .38s var(--ease) both; }
.choice:hover { padding-left: 7px; border-color: rgba(255,255,255,.9); }
.choice-label { display: block; min-width: 0; font-size: clamp(14px, 1.48vw, 21px); line-height: 1.25; letter-spacing: -.03em; font-weight: 450; overflow-wrap: break-word; hyphens: auto; }
.choice:nth-child(2) { animation-delay: .06s; }
.choice:nth-child(3) { animation-delay: .12s; }

/* Portrait phones: the two secondary actions become persistent edge tabs. */
.edge-action { display: none; }
.contact-overlay { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 22px; }
.overlay-scrim { position: absolute; inset: 0; border: 0; background: rgba(0,0,0,.82); backdrop-filter: blur(15px); animation: fade-in .2s ease; }
.contact-card { z-index: 1; position: relative; width: min(100%, 510px); padding: clamp(24px, 4vw, 42px); border: 1px solid rgba(255,255,255,.36); background: #050505; box-shadow: 0 30px 100px rgba(0,0,0,.6); animation: card-in .3s var(--ease); }
.close-button { position: absolute; top: 15px; right: 17px; width: 32px; height: 32px; border: 0; background: transparent; color: #fff; font-size: 27px; font-weight: 300; line-height: 1; }
.close-button:hover { opacity: .65; }
.contact-card h1 { margin: 0 35px 27px 0; max-width: 350px; font-size: clamp(24px, 3.7vw, 34px); font-weight: 450; letter-spacing: -.055em; line-height: 1.08; }
.waveform { height: 28px; display: flex; align-items: center; gap: 4px; margin: 0 0 25px; }
.waveform i { display: block; height: 4px; width: 2px; background: white; opacity: .72; }
.waveform.is-playing i { animation: wave .7s ease-in-out infinite alternate; }
.waveform i:nth-child(3n) { animation-delay: -.2s; }
.waveform i:nth-child(4n) { animation-delay: -.5s; }
.waveform i:nth-child(5n) { animation-delay: -.35s; }
.email-row, .phone-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; }
.email-row { border-top: 1px solid rgba(255,255,255,.25); }
.phone-row { border-top: 1px solid rgba(255,255,255,.25); border-bottom: 1px solid rgba(255,255,255,.25); }
.email-address, .phone-number { min-width: 0; overflow-wrap: anywhere; font-size: clamp(14px, 2.4vw, 18px); letter-spacing: -.025em; }
.phone-number { transition: opacity .18s ease; }
.phone-number:hover { opacity: .68; }
.copy-button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #fff; background: #fff; color: #000; font-size: 11px; font-weight: 650; transition: color .18s ease, background .18s ease; }
.copy-button:hover { background: transparent; color: #fff; }
.contact-links { display: flex; flex-wrap: wrap; gap: 18px; padding-top: 19px; }
.contact-link { display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.78); font-size: 12px; transition: color .18s ease; }
.contact-link:hover { color: #fff; }
.audio-only-media { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: -100px; bottom: 0; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 25px; transform: translate(-50%, 14px); padding: 10px 14px; border: 1px solid rgba(255,255,255,.35); background: #050505; color: #fff; font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@keyframes choice-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes choices-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes wave { from { height: 4px; } to { height: var(--wave-height, 22px); } }

@media (max-width: 700px) {
  .topbar { min-height: 63px; padding: max(14px, env(safe-area-inset-top)) 18px 8px; background: linear-gradient(to bottom, rgba(0,0,0,.56), transparent); }
  .nav-button { min-height: 36px; font-size: 11px; }
  .back-button > span:first-child, .home-button > span:last-child { font-size: 21px; }
  .nav-button:disabled { opacity: .4; }
  .dialogue-video { object-fit: contain; object-position: center; }
  .sound-button { right: max(17px, env(safe-area-inset-right)); top: max(68px, calc(env(safe-area-inset-top) + 60px)); bottom: auto; width: 33px; height: 33px; padding: 7px; }
  .choices { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(7px, 2vw, 12px); padding: 78px 30px max(22px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.32) 25%, rgba(0,0,0,.82) 59%, #000 100%); }
  .choice { min-width: 0; min-height: 106px; gap: 9px; padding-top: 10px; }
  .choice-label { font-size: clamp(11px, 2.65vw, 15px); line-height: 1.25; letter-spacing: -.02em; overflow-wrap: break-word; }
  .contact-overlay { padding: 16px; }
  .contact-card { padding: 27px 21px 23px; }
  .contact-card h1 { font-size: 26px; margin-bottom: 23px; }
  .email-row, .phone-row { align-items: flex-start; flex-direction: column; gap: 13px; }
  .copy-button { align-self: flex-start; }
  .contact-links { gap: 15px; }
  .toast { bottom: max(25px, env(safe-area-inset-bottom)); max-width: calc(100vw - 50px); white-space: normal; text-align: center; }
}

/* Contact and Portfolio become edge tabs on narrow phone screens only. */
@media (max-width: 600px) {
  .button-label { display: none; }
  .nav-actions { display: contents; margin: 0; }
  /* Keep Resume centered between the top navigation controls on phones. */
  .resume-button { position: absolute; left: 50%; top: max(18px, env(safe-area-inset-top)); transform: translateX(-50%); margin: 0; padding: 7px 10px; }
  .home-button { margin-left: auto; }
  .contact-button, .portfolio-button {
    position: fixed; z-index: 22; top: 50%; display: flex; align-items: center; justify-content: center;
    width: 25px; min-height: 0; padding: 12px 5px; border: 1px solid rgba(255,255,255,.52);
    background: rgba(0,0,0,.72); color: #fff; font-size: 8px; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase; writing-mode: vertical-rl; backdrop-filter: blur(8px);
  }
  .contact-button { left: 0; transform: translateY(-50%); }
  .portfolio-button { right: 0; transform: translateY(-50%) rotate(180deg); gap: 7px; }
  .portfolio-button > span { font-size: 11px !important; }
  .contact-button:hover, .portfolio-button:hover { background: #fff; color: #000; }
}

/* Short landscape phones: retain all three choices without swallowing the video. */
@media (max-width: 700px) and (max-height: 520px) {
  .topbar { min-height: 48px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 4px; }
  .sound-button { top: max(48px, calc(env(safe-area-inset-top) + 42px)); width: 29px; height: 29px; }
  .choices { padding: 45px 34px max(10px, env(safe-area-inset-bottom)); gap: 8px; }
  .choice { min-height: 66px; gap: 5px; padding-top: 7px; }
  .choice-label { font-size: clamp(10px, 1.8vw, 13px); line-height: 1.18; }
}
@media (max-width: 380px) {
  .contact-button, .portfolio-button { width: 23px; font-size: 7px; }
  .choices { gap: 7px; padding-left: 29px; padding-right: 29px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .choice { min-height: 100px; gap: 7px; }
  .choice-label { font-size: 10.5px; line-height: 1.23; letter-spacing: -.015em; }
  .email-address, .phone-number { font-size: 14px; }
}
@media (min-width: 601px) and (max-width: 700px) {
  .nav-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; margin-right: 18px; }
  .button-label { display: inline; }
  .nav-button { font-size: 11px; gap: 6px; }
  .home-button { margin-left: 0; }
  .contact-button, .portfolio-button { position: relative; top: auto; right: auto; left: auto; width: auto; min-height: 36px; padding: 7px 0; border: 0; background: transparent; font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; writing-mode: horizontal-tb; transform: none; backdrop-filter: none; }
  .portfolio-button { gap: 6px; }
  .portfolio-button > span { font-size: 14px !important; }
}
@media (max-height: 650px) and (min-width: 701px) {
  .topbar { min-height: 62px; }
  .choices { padding-top: 80px; padding-bottom: 25px; }
  .choice { min-height: 90px; padding-top: 8px; gap: 10px; }
}
/* A phone rotated to landscape still uses the edge actions, without duplicate top links. */
@media (pointer: coarse) and (max-height: 520px) and (min-width: 701px) {
  .topbar { min-height: 48px; padding: max(8px, env(safe-area-inset-top)) 18px 4px; }
  .button-label { display: none; }
  .nav-actions { display: contents; margin: 0; }
  .resume-button { position: absolute; left: 50%; top: max(8px, env(safe-area-inset-top)); transform: translateX(-50%); margin: 0; padding: 5px 8px; }
  .home-button { margin-left: auto; }
  .contact-button, .portfolio-button {
    position: fixed; z-index: 22; top: 50%; display: flex; align-items: center; justify-content: center;
    width: 25px; min-height: 0; padding: 12px 5px; border: 1px solid rgba(255,255,255,.52);
    background: rgba(0,0,0,.72); color: #fff; font-size: 8px; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase; writing-mode: vertical-rl; backdrop-filter: blur(8px);
  }
  .contact-button { left: 0; transform: translateY(-50%); }
  .portfolio-button { right: 0; transform: translateY(-50%) rotate(180deg); gap: 7px; }
  .portfolio-button > span { font-size: 11px !important; }
  .sound-button { top: max(48px, calc(env(safe-area-inset-top) + 42px)); width: 29px; height: 29px; }
  .choices { padding: 45px 34px max(10px, env(safe-area-inset-bottom)); gap: clamp(12px, 2vw, 24px); }
  .choice { min-height: 66px; padding-top: 7px; gap: 5px; }
  .choice-label { font-size: clamp(12px, 1.4vw, 16px); line-height: 1.18; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Deliberate black intermission hides the source reload between dialogue clips. */
.intermission {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #000;
  opacity: 1;
  pointer-events: auto;
  transition: opacity .24s ease;
}
.intermission.is-releasing { opacity: 0; pointer-events: none; }
.intermission-title {
  max-width: min(760px, 78vw);
  color: #fff;
  font-size: clamp(19px, 2.25vw, 31px);
  font-weight: 450;
  line-height: 1.2;
  letter-spacing: -.035em;
  text-align: center;
  animation: intermission-title-in .22s ease both;
}
.start-audio-gate {
  position: fixed;
  z-index: 45;
  top: 50%;
  left: 50%;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  padding: 0 0 0 3px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 50%;
  background: rgba(0,0,0,.72);
  color: #fff;
  transform: translate(-50%, -50%);
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.start-audio-gate:hover { background: #fff; color: #000; transform: translate(-50%, -50%) scale(1.04); }
.start-audio-gate svg { width: 23px; height: 23px; }
@keyframes intermission-title-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  .intermission-title { max-width: 72vw; font-size: clamp(17px, 4.3vw, 24px); }
  .start-audio-gate { width: 56px; height: 56px; }
}

/* After a clip, hold on black with a concise prompt above the dialogue choices. */
.choices.is-waiting { background: #000; padding-top: clamp(110px, 17vh, 188px); }
.choices.is-waiting::before { content: "Choose your question below."; grid-column: 1 / -1; display: block; color: #fff; font-size: clamp(18px, 2.1vw, 28px); line-height: 1.2; letter-spacing: -.03em; margin-bottom: clamp(24px, 4vh, 44px); }
