/* ===== Design tokens ===== */
:root {
  --blue: #1d12ff;
  --blue-dark: #1109c9;
  --black: #0a0a0a;
  --white: #ffffff;
  --gray: #d4d4d4;
  --gray-soft: #ececec;
  --maxw: 1180px;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --radius: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Archivo", system-ui, sans-serif;
  color: var(--black);
  background: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, .brand, .eyebrow, .section-title {
  font-family: "Archivo Black", "Archivo", sans-serif;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

a { color: inherit; }

img, svg { display: block; max-width: 100%; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  background: var(--blue);
  color: var(--white);
  text-decoration: none;
  font-weight: 800;
  padding: 0.9rem 1.6rem;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--blue-dark); transform: translateY(-2px); }
.btn-light { background: var(--white); color: var(--blue); }
.btn-light:hover { background: var(--gray-soft); }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;          /* anchor children to the bar's bottom edge */
  justify-content: space-between;
  padding: 1.1rem var(--pad) 0;   /* no bottom padding so the title sits flush */
  background: var(--blue);
  color: var(--white);
  overflow: hidden;               /* crop any glyph bleed cleanly at the bar edge */
}
.brand {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 0.74;              /* pull cap-height down so the bottom meets the bar */
  margin-bottom: -1px;            /* bleed glyph bottoms 1px past the edge to kill the sliver */
  text-decoration: none;
  text-transform: uppercase;
}
.nav { align-self: center; }      /* keep nav vertically centered while the name drops */
.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  position: relative;
  padding: 0.25rem 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--white);
  transition: width 0.2s ease;
}
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 26px; height: 3px;
  background: var(--white);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(3rem, 7vw, 6rem) var(--pad) clamp(2rem, 4vw, 3rem);
  max-width: var(--maxw);
  margin: 0 auto;
}
.eyebrow {
  color: var(--blue);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  margin-bottom: 0.75rem;
}
.hero h1 {
  font-size: clamp(3.5rem, 11vw, 7rem);
  color: var(--blue);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  margin-left: -7px;
}
.hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  max-width: 46ch;
  margin-bottom: 2rem;
  color: #333;
}

/* Video card / media frames */
.hero-media { position: relative; }
.video-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--black);
  border: 4px solid var(--blue);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.video-card:hover { box-shadow: 0 12px 30px rgba(29, 18, 255, 0.25); }

/* project image: the blue frame hugs the image itself (no fixed box → no letterbox
   bars and no cropping). Height is capped so the rows stay reasonably even, and the
   image is centred in its column. Click opens the full-size version. */
.project-media {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.project-media img {
  display: block;
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  border: 4px solid var(--blue);
  border-radius: var(--radius);
  background: var(--black);
  transition: box-shadow 0.2s ease;
}
.project-media:hover img { box-shadow: 0 12px 30px rgba(29, 18, 255, 0.25); }

/* one-time attention cue on page load — draws the eye to the showreel, then settles */
.video-card { animation: reelGlow 1.7s ease-out 0.6s 3; }
@keyframes reelGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29, 18, 255, 0); }
  35% { box-shadow: 0 0 0 5px rgba(29, 18, 255, 0.35), 0 14px 40px rgba(29, 18, 255, 0.5); }
}
.hero-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
/* poster + play affordance that sits over the video until it's started */
.video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  cursor: pointer;
}
.video-overlay[hidden] { display: none; }
.play {
  position: relative;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease;
}
/* ripple radiating from the play button — part of the on-load attention cue */
.play::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  opacity: 0;
  animation: playRipple 1.7s ease-out 0.6s 3;
}
@keyframes playRipple {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2); opacity: 0; }
}
.video-overlay:hover .play { transform: scale(1.08); }
.play svg { width: 34px; height: 34px; fill: var(--blue); margin-left: 4px; }
.video-label {
  position: absolute;
  bottom: 0; left: 0;
  background: var(--blue);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.7rem;
}
.reel-fallback {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #666;
  text-align: center;
}
.reel-fallback a {
  color: var(--blue);
  font-weight: 600;
  text-underline-offset: 2px;
}

/* ===== About ===== */
.about {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  padding: clamp(2rem, 5vw, 3rem) var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.about-text h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--blue);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}
.about-text p { margin-bottom: 1rem; max-width: 52ch; color: #333; }

/* isometric staircase (an affordance — built by the iso renderer in script.js) */
.about-stairs {
  display: flex;
  justify-content: center;
  align-items: center;
}
.about-stairs svg { width: 100%; max-width: 240px; height: auto; overflow: visible; }

/* floating-ledges divider between Tools and Work */
.iso-divider {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2.5rem) var(--pad);
  display: flex;
  justify-content: center;
}
.iso-divider svg { height: clamp(96px, 18vw, 150px); width: auto; max-width: 100%; }

/* climb-to-top ladder button */
.scroll-top {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 60;
  width: 56px;
  height: 68px;
  padding: 9px;
  background: var(--white);
  border: 3px solid var(--blue);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.scroll-top.show { opacity: 1; transform: none; pointer-events: auto; }
.scroll-top:hover { background: var(--gray-soft); box-shadow: 0 8px 20px rgba(29, 18, 255, 0.25); }
.scroll-top svg { width: 100%; height: 100%; }

/* ===== Section titles ===== */
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  text-transform: uppercase;
  margin-bottom: 2rem;
  display: inline-block;
  border-bottom: 6px solid var(--blue);
  padding-bottom: 0.4rem;
}

/* ===== Tools ===== */
.tools {
  padding: clamp(2rem, 5vw, 3rem) var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.tool-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.tool-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.tool-list li:hover { background: var(--blue); color: var(--white); border-color: var(--blue); }
.tool-list svg { width: 38px; height: 38px; color: var(--blue); flex-shrink: 0; transition: color 0.2s ease; }
.tool-list li:hover svg { color: var(--white); }

/* ===== Work grid ===== */
.work {
  padding: clamp(2rem, 5vw, 3rem) var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}

/* ===== Screenshots gallery ===== */
.shots {
  padding: clamp(2rem, 5vw, 3rem) var(--pad) clamp(4rem, 8vw, 6rem);
  max-width: var(--maxw);
  margin: 0 auto;
}
.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}
.shot {
  display: block;
  padding: 0;
  aspect-ratio: 16 / 9;
  border: 4px solid var(--blue);
  border-radius: var(--radius);
  background: var(--black);
  overflow: hidden;
  cursor: zoom-in;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(29, 18, 255, 0.25); }
.project-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 4.5rem);
}
/* each project is a full-width row: image beside a title+description column */
.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
/* alternate rows flip the image to the other side */
.project:nth-child(even) .project-media { order: 2; }
.project-info h3 {
  font-size: 1.3rem;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.4rem;
}
.project-info .tags {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  margin-bottom: 0.6rem;
  font-weight: 600;
  max-width: none; /* the tag line uses the full column; don't inherit the 46ch body cap */
}
.project-info p { color: #333; font-size: 0.95rem; max-width: 46ch; margin-bottom: 0.85rem; }
.project-info p:last-child { margin-bottom: 0; }

/* ===== Footer ===== */
.site-footer {
  background: var(--blue);
  color: var(--white);
  padding: clamp(3rem, 7vw, 6rem) var(--pad) 2rem;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.footer-inner h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  text-transform: uppercase;
}
.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.footer-link svg { width: 22px; height: 22px; display: block; flex-shrink: 0; }
.footer-link:hover { opacity: 0.7; transform: translateY(-2px); }
.footer-meta {
  max-width: var(--maxw);
  margin: 3rem auto 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding-top: 1.5rem;
}

/* ===== Image lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 10, 10, 0.92);
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox-img {
  /* clamp against the viewport (minus the overlay's padding) so tall images can't
     overflow — a percentage here would resolve against the content-sized grid track */
  max-width: calc(100vw - clamp(2rem, 8vw, 6rem));
  max-height: calc(100vh - clamp(2rem, 8vw, 6rem));
  width: auto;
  height: auto;
  border: 4px solid var(--blue);
  border-radius: var(--radius);
}
.lightbox-close {
  position: fixed;
  top: clamp(0.5rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 2rem);
  background: none;
  border: 0;
  color: var(--white);
  font-size: 2.75rem;
  line-height: 1;
  cursor: pointer;
}

/* ===== Reveal on scroll ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .hero,
  .about { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .about-stairs { margin-top: 1rem; }
  .tool-list { grid-template-columns: repeat(2, 1fr); }
  /* stack each row to a single column, image-first throughout */
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .project-media { order: 0; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--blue);
    width: min(260px, 70vw);
    padding: 0.5rem 0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    transform: translateX(110%);
    transition: transform 0.25s ease;
  }
  .nav.open .nav-links { transform: none; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 0.9rem var(--pad);
  }
  .nav-links a::after { display: none; }
  .nav { position: static; }
  .site-header { position: sticky; }

  /* hamburger -> X */
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

@media (max-width: 500px) {
  .tool-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .video-card { animation: none; }
  .play::after { animation: none; }
}
