/* ============ fonts ============ */
@font-face{
  font-family: 'VCR';
  src: url('../fonts/VCR_OSD_MONO_1_001.ttf') format('truetype');
  font-display: swap;
}
@font-face{
  font-family: 'London Tube';
  src: url('../fonts/LondonTube-MABx_2.ttf') format('truetype');
  font-display: swap;
}

/* ============ tokens ============ */
:root{
  --ink: #000000;
  --paper: #ffffff;
  --muted: #8a8a8a;
  --line: #e4e4e4;

  --burst-yellow: #F5FF00;
  --burst-cyan: #4DFBFF;
  --burst-green: #5CFF4D;
  --burst-magenta: #FF4DFA;

  --header-h: 88px;
}

*{ box-sizing: border-box; }
html, body{ margin: 0; padding: 0; }
body{
  background: var(--paper);
  color: var(--ink);
  font-family: 'London Tube', sans-serif;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}
a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }

.cursor-white, .cursor-white *{
  cursor: url('images/cursors/cursor-white.png') 4 4, auto;
}
.cursor-black, .cursor-black *{
  cursor: url('images/cursors/cursor-black.png') 4 4, auto;
}

:focus-visible{
  outline: 3px solid var(--burst-cyan);
  outline-offset: 3px;
}

.vcr{
  font-family: 'VCR', monospace;
  text-transform: lowercase;
  letter-spacing: 0.03em;
}

/* ============ entry gate ============ */
#gate{
  position: fixed;
  inset: -40%;
  padding: 40%;
  z-index: 9999;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
#gate.hidden{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-logo{
  width: min(46vw, 300px);
  transition: transform 0.35s ease, opacity 0.35s ease;
}
#gate.flashing .gate-logo{
  animation: gateFlash 0.85s ease forwards;
}
@keyframes gateFlash{
  0%   { opacity: 1; transform: scale(1); filter: brightness(1); }
  30%  { opacity: 1; transform: scale(1.12); filter: brightness(2.4); }
  100% { opacity: 0; transform: scale(1.18); filter: brightness(2.4); }
}

#gate.shake .pw-line{
  animation: shake 0.4s ease;
}
@keyframes shake{
  0%, 100%{ transform: translateX(0); }
  20%{ transform: translateX(-8px); }
  40%{ transform: translateX(8px); }
  60%{ transform: translateX(-6px); }
  80%{ transform: translateX(6px); }
}

/* the clickable row: "enter password" hint + typed asterisks + cursor */
.pw-line{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-width: 340px;
  cursor: default;
}

.gate-hint{
  margin: 0;
  font-size: 20px;
  line-height: 1;
  color: #ffffff;
  letter-spacing: 0.12em;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.gate-hint.hidden-hint{
  opacity: 0;
  position: absolute;
  pointer-events: none;
}
#gate.flashing .gate-hint,
#gate.flashing .pw-asterisks,
#gate.flashing .cursor{ opacity: 0; transition: opacity 0.2s ease; }

.pw-asterisks{
  font-family: 'American Typewriter', Georgia, serif;
  font-weight: 700;
  color: #ffffff;
  font-size: 27px;
  line-height: 1;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.cursor{
  display: inline-block;
  width: 11px;
  height: 19px;
  background: var(--burst-yellow); /* JS cycles this exactly on each blink cycle boundary */
  margin-left: 5px;
  animation: blink 1s steps(1) infinite;
  vertical-align: -3px;
}

/* real input sits over the hint/asterisks, invisible, capturing keystrokes */
#pwInput{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  outline: none;
  background: transparent;
  cursor: default;
  caret-color: transparent;
}

@keyframes blink{
  0%, 49%{ opacity: 1; }
  50%, 100%{ opacity: 0; }
}

@media (prefers-reduced-motion: reduce){
  .gate-logo, #gate{ transition: none; }
  #gate.flashing .gate-logo{ animation: none; opacity: 0; }
  .cursor{ animation: none; }
}

/* ============ mobile gate adjustments ============ */
@media (max-width: 700px){
  /* the -40%/padding:40% overscan trick can leave a sliver of the page
     visible on mobile when the browser's own toolbar shows/hides. A plain
     full-bleed box using dynamic viewport height is more reliable here. */
  #gate{
    inset: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    justify-content: flex-start;
    padding-top: 14vh;
    gap: 20px;
  }
  .gate-logo{ width: min(52vw, 220px); }
  .gate-hint{ font-size: 16px; }
  .pw-asterisks{ font-size: 21px; }
  .cursor{ width: 9px; height: 16px; }
  .pw-line{ min-width: 260px; height: 30px; }
}

/* ============ site header (consistent across every page) ============ */
.site-header{
  position: relative;
  z-index: 10;
  min-height: 88px;
  height: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 10px 28px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-logo-link{ justify-self: start; }
.site-logo-static{ justify-self: start; }
.site-logo{ height: 68px; width: auto; }

.site-nav{
  justify-self: end;
  display: flex;
  gap: 44px;
}
.site-nav a{
  font-size: 18px;
  position: relative;
  padding-bottom: 4px;
}
.site-nav a::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: var(--nav-color, var(--burst-yellow));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after{
  transform: scaleX(1);
}
.site-nav a:nth-child(1){ --nav-color: var(--burst-yellow); }
.site-nav a:nth-child(2){ --nav-color: var(--burst-magenta); }
.site-nav a:nth-child(3){ --nav-color: var(--burst-cyan); }

/* ============ home / showreel stage ============ */
.reel-stage{
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  background: #000;
  overflow: hidden;
}
.reel-stage video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.reel-stage video::-webkit-media-controls,
.reel-stage video::-webkit-media-controls-start-playback-button,
.reel-stage video::-webkit-media-controls-play-button{
  display: none !important;
  -webkit-appearance: none;
}

/* ============ handles (bottom-left) ============ */
.handles{
  position: fixed;
  left: 24px;
  bottom: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.handles a{ opacity: 0.85; }
.handles a:hover{ opacity: 1; color: var(--burst-cyan); }
.handles.on-dark a{ color: #fff; }
.handles.on-light a{ color: #000; }

/* ============ blog page ============ */
.blog-intro{
  max-width: 720px;
  margin: 56px calc(50% - 336px) 8px calc(50% - 384px);
  padding: 0 24px;
}
.blog-intro h1{
  font-family: 'VCR', monospace;
  font-size: clamp(32px, 6vw, 52px);
  margin: 0 0 12px;
  text-transform: lowercase;
}
.blog-intro p{
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 56ch;
}

.feed{
  max-width: 720px;
  margin: 40px calc(50% - 336px) 120px calc(50% - 384px);
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.post{ position: relative; display: flex; flex-direction: column; gap: 14px; }

.post-title{
  font-family: 'VCR', monospace;
  font-size: 20px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  margin: 0;
  text-transform: lowercase;
}

.post-meta{
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.post-asterisk{
  position: absolute;
  left: -108px;
  top: -14px;
  font-family: 'American Typewriter', Georgia, serif;
  font-weight: 700;
  font-size: 126px;
  line-height: 1;
  color: var(--tag-color, var(--burst-yellow));
  text-shadow:
    -2.5px -2.5px 0 #000,
     2.5px -2.5px 0 #000,
    -2.5px  2.5px 0 #000,
     2.5px  2.5px 0 #000,
     0 -2.5px 0 #000,
     0  2.5px 0 #000,
    -2.5px 0 0 #000,
     2.5px 0 0 #000;
}
@media (max-width: 900px){
  .post-asterisk{
    position: static;
    display: block;
    font-size: 64px;
    margin-bottom: -8px;
  }
}

.post-media{
  max-width: 420px;
  border: 1px solid var(--line);
}
.post-media img, .post-media video{
  display: block;
  width: 100%;
  height: auto;
}

.post-media-row{
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), 1fr);
  gap: 8px;
}
.post-media-row .post-media{ aspect-ratio: 1/1; }

.post-caption{
  font-size: 16px;
  line-height: 1.55;
  max-width: 60ch;
}
.post-caption strong{ font-family: 'VCR', monospace; text-transform: lowercase; }

.post-embed{
  width: 100%;
  aspect-ratio: 16/9;
  border: 1px solid var(--line);
  background: #f2f2f2;
}
.post-embed iframe{ width: 100%; height: 100%; border: 0; }

/* ============ about page ============ */
.about-wrap{
  max-width: 640px;
  margin: 96px auto;
  padding: 0 24px;
  text-align: center;
}
.about-wrap h1{
  font-family: 'VCR', monospace;
  font-size: 34px;
  color: var(--ink);
  margin-bottom: 18px;
}
.about-wrap p{
  color: var(--ink);
  font-size: 18px;
  line-height: 1.6;
}

/* ============ work page ============ */
.work-intro{
  max-width: 780px;
  margin: 56px auto 0;
  padding: 0 24px;
}
.work-intro h1{
  font-family: 'VCR', monospace;
  font-size: clamp(32px, 6vw, 52px);
  margin: 0;
}

.work-list{
  max-width: 780px;
  margin: 40px auto 120px;
  padding: 0 24px;
}

.work-category{
  padding: 40px 0;
  border-top: 1px solid var(--line);
}
.work-category:first-child{ border-top: none; padding-top: 24px; }

.work-category h2{
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'VCR', monospace;
  font-size: 20px;
  margin: 0 0 22px;
  text-transform: lowercase;
}
.work-category h2::before{
  content: "";
  display: inline-block;
  width: 10px;
  height: 22px;
  background: var(--cat-color, var(--burst-yellow));
  transform: rotate(12deg);
  border-radius: 1px;
}

.work-items{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.work-items li{
  font-size: 17px;
  line-height: 1.5;
}
.work-items a{
  color: var(--ink);
  transition: color 0.15s ease;
}
.work-items a:hover,
.work-items a:focus-visible{
  color: var(--cat-color, var(--burst-yellow));
}

/* ============ contact page ============ */
.contact-wrap{
  max-width: 640px;
  margin: 140px auto;
  padding: 0 24px;
  text-align: center;
}
.contact-wrap h1{
  font-family: 'VCR', monospace;
  font-size: 34px;
  margin: 0 0 18px;
}
.contact-wrap p{
  font-size: 18px;
}
.contact-wrap a{
  border-bottom: 1px solid var(--ink);
}
.contact-wrap a:hover{
  color: var(--burst-magenta);
  border-color: var(--burst-magenta);
}

@media (max-width: 640px){
  .site-header{ padding: 10px 16px; }
  .site-nav{ gap: 16px; }
  .handles{ left: 16px; }
}
