/* ============ Design tokens (borrowed from kartikgoel.com) ============ */
:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --ink: #0f0f0f;
  --ink-soft: #666666;
  --accent: #6536eb;
  --accent-dark: #4f27bd;
  --green-bg: #e4ffd9;
  --green-ink: #0c8233;
  --amber-bg: #fff3d6;
  --amber-ink: #a06b00;
  --blue-bg: #e3efff;
  --blue-ink: #1d5fb8;
  --border: #e6e6e6;
  --radius-lg: 24px;
  --radius-md: 16px;
  --font-display: "Clash Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .btn, .nav-logo, .eyebrow {
  font-family: var(--font-display);
}

/* ============ Reveal animation ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============ Nav ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 48px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
}
.nav-logo {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 5px;
}
.nav-links {
  display: flex;
  gap: 32px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s ease;
}
.nav-link:hover { color: var(--ink); }

/* ============ Hero ============ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 24px 60px;
  position: relative;
}
/* ---- Viewfinder wordmark ---- */
.viewfinder {
  position: relative;
  padding: 56px 72px;
  margin-bottom: 40px;
  color: #9a9a9a;
}
.vf-corner {
  position: absolute;
  width: 26px; height: 26px;
  border: 2.5px solid var(--ink);
}
.vf-tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.vf-tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.vf-bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.vf-br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.vf-rec, .vf-timecode, .vf-4k {
  position: absolute;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.vf-rec {
  top: 10px; left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #e02b2b;
}
.vf-rec-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #e02b2b;
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.vf-4k { top: 10px; right: 52px; }
.vf-battery { position: absolute; top: 10px; right: 14px; }
.vf-timecode {
  bottom: 10px; right: 14px;
  font-variant-numeric: tabular-nums;
}

.wordmark {
  font-family: var(--font-display);
  font-size: clamp(48px, 9vw, 110px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wm-line {
  display: inline-flex;
  align-items: center;
}
.wordmark-play {
  width: 0.72em; height: 0.72em;
  border-radius: 50%;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.05em;
  align-self: center;
  transform: translateY(0.09em);
  transition: transform 0.2s ease;
}
.wordmark-play::after {
  content: "";
  width: 0; height: 0;
  border-left: 0.26em solid #fff;
  border-top: 0.16em solid transparent;
  border-bottom: 0.16em solid transparent;
  margin-left: 0.06em;
}
.wordmark:hover .wordmark-play { transform: translateY(0.09em) scale(1.08); }

.hero-title {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 600;
  line-height: 1.4;
  max-width: 780px;
}
.hero-title .accent { color: var(--accent); }
.hero-cta {
  display: flex;
  gap: 16px;
  margin-top: 48px;
}
.scroll-hint {
  position: absolute;
  bottom: 36px;
  color: var(--ink-soft);
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  border: none;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(101, 54, 235, 0.3);
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  padding: 10px 20px;
}

/* ============ Project sections ============ */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}
.project {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  margin-bottom: 56px;
}
.project-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.project h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 600;
}
.project-sub {
  color: var(--ink-soft);
  font-size: 18px;
  margin-top: 8px;
  max-width: 680px;
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin: 20px 0 32px;
  font-size: 14px;
  color: var(--ink-soft);
}
.project-meta strong {
  color: var(--ink);
  font-weight: 600;
  margin-right: 6px;
}

/* Tags */
.tag {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
}
.tag-live { background: var(--green-bg); color: var(--green-ink); }
.tag-series { background: var(--blue-bg); color: var(--blue-ink); }
.tag-award { background: var(--amber-bg); color: var(--amber-ink); }

/* ============ Video embeds ============ */
.featured-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  cursor: pointer;
}
.featured-embed img, .featured-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.featured-embed img { object-fit: cover; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.video-card {
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: none;
}
.video-card.shown { display: block; }
.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}
.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-thumb img, .video-thumb iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}
.video-card { padding-bottom: 12px; }
.video-card p {
  font-size: 13.5px;
  font-weight: 500;
  /* No bottom padding: overflow clips at the padding edge, so a third line
     would otherwise bleed into it and get sliced mid-character. Height is
     pinned to exactly two lines + the top padding instead. */
  padding: 12px 14px 0;
  line-height: 1.45;
  height: calc(2.9em + 12px);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Play button overlay */
.play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  transition: background 0.2s ease;
}
.featured-embed:hover .play-btn, .video-thumb:hover .play-btn {
  background: rgba(0, 0, 0, 0.32);
}
.play-btn::after {
  content: "";
  width: 0; height: 0;
  border-left: 22px solid #fff;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  margin-left: 6px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}
.video-thumb .play-btn::after {
  border-left-width: 14px;
  border-top-width: 9px;
  border-bottom-width: 9px;
}

.show-more { margin: 24px auto 0; display: block; }
.show-more.hidden { display: none; }

/* ============ Written work ============ */
.written {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.eyebrow {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 36px;
}
.written-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.written-card {
  display: block;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.written-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
.written-card h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
}
.written-card p {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 18px;
}
.card-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
}

/* ============ About ============ */
.about {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.about-inner {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: center;
  max-width: 920px;
  margin: 0 auto;
}
.about-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
  filter: grayscale(1);
  display: block;
}
.about-bio {
  font-size: 20px;
  line-height: 1.65;
  color: #8a8a8a;
}
.about-bio strong { color: #222; font-weight: 600; }
.accent-name { color: var(--accent); font-weight: 600; }
.about-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}
.btn-dark {
  flex: 0 0 auto;
  background: #111;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}
.btn-dark:hover { background: #2c2c2c; }
.icon-btn {
  flex: 0 0 auto;          /* keeps them square — flex was shrinking the width */
  width: 54px; height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--ink); }

/* Career line */
.timeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  margin-top: 96px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.4s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s;
}
.timeline.visible::before { transform: scaleX(1); }
.timeline-item {
  position: relative;
  padding-top: 36px;
}
.timeline-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ink);
  transform: scale(0);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.timeline.visible .timeline-dot { transform: scale(1); }
.timeline-item.current .timeline-dot {
  background: #fff;
  border: 3px solid var(--accent);
}
.timeline-role, .timeline-org {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.timeline.visible .timeline-role,
.timeline.visible .timeline-org {
  opacity: 1;
  transform: none;
}
/* Stagger: each career step lands after the line reaches it */
.timeline-item:nth-child(1) .timeline-dot { transition-delay: 0.1s; }
.timeline-item:nth-child(2) .timeline-dot { transition-delay: 0.32s; }
.timeline-item:nth-child(3) .timeline-dot { transition-delay: 0.54s; }
.timeline-item:nth-child(4) .timeline-dot { transition-delay: 0.76s; }
.timeline-item:nth-child(5) .timeline-dot { transition-delay: 0.98s; }
.timeline-item:nth-child(6) .timeline-dot { transition-delay: 1.2s; }
.timeline-item:nth-child(1) .timeline-role, .timeline-item:nth-child(1) .timeline-org { transition-delay: 0.2s; }
.timeline-item:nth-child(2) .timeline-role, .timeline-item:nth-child(2) .timeline-org { transition-delay: 0.42s; }
.timeline-item:nth-child(3) .timeline-role, .timeline-item:nth-child(3) .timeline-org { transition-delay: 0.64s; }
.timeline-item:nth-child(4) .timeline-role, .timeline-item:nth-child(4) .timeline-org { transition-delay: 0.86s; }
.timeline-item:nth-child(5) .timeline-role, .timeline-item:nth-child(5) .timeline-org { transition-delay: 1.08s; }
.timeline-item:nth-child(6) .timeline-role, .timeline-item:nth-child(6) .timeline-org { transition-delay: 1.3s; }
.timeline-role {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  display: inline-block;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #d9d9d9;
}
.timeline-item.current .timeline-role { font-weight: 700; }
.timeline-org {
  display: block;
  margin-top: 18px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

/* ============ Footer ============ */
.footer {
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 32px 48px;
  font-size: 15px;
  color: var(--ink-soft);
}
.footer a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer a:hover { color: var(--ink); }
.footer-links { display: flex; gap: 24px; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .written-grid { grid-template-columns: 1fr; }

  .about-inner { grid-template-columns: 1fr; gap: 32px; }
  .about-photo { max-width: 260px; margin: 0 auto; }
  .about-text { text-align: center; }
  .about-bio { font-size: 17px; }
  /* Resume takes its own row so the two icons pair up centred beneath it,
     instead of Instagram orphaning onto a third line */
  .about-actions { justify-content: center; flex-wrap: wrap; }
  .about-actions .btn-dark {
    flex: 0 0 100%;
    max-width: 300px;
    margin: 0 auto 2px;
  }

  /* ---- Career line turns vertical, drawn segment by segment ---- */
  .timeline {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 56px;
    padding-left: 36px;
  }
  .timeline::before { display: none; }        /* horizontal track is desktop-only */

  .timeline-item { padding-top: 0; padding-bottom: 32px; }
  .timeline-item:last-child { padding-bottom: 0; }

  /* Connector running from this dot down to the next one */
  .timeline-item::after {
    content: "";
    position: absolute;
    left: -30px;
    top: 9px;
    bottom: -9px;
    width: 2px;
    background: var(--ink);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.4s ease;
  }
  .timeline.visible .timeline-item::after { transform: scaleY(1); }
  .timeline-item:last-child::after { display: none; }

  .timeline-dot { top: 2px; left: -36px; }
  .timeline-role { font-size: 16px; padding-bottom: 8px; }
  .timeline-org { margin-top: 12px; }

  /* Each connector draws just after its own dot lands */
  .timeline-item:nth-child(1)::after { transition-delay: 0.18s; }
  .timeline-item:nth-child(2)::after { transition-delay: 0.40s; }
  .timeline-item:nth-child(3)::after { transition-delay: 0.62s; }
  .timeline-item:nth-child(4)::after { transition-delay: 0.84s; }
  .timeline-item:nth-child(5)::after { transition-delay: 1.06s; }
}

@media (max-width: 700px) {
  /* ---- Videos: one hero video, then a horizontal shelf ---- */
  .project h2 { font-size: 22px; }
  .project-sub { font-size: 15px; margin-top: 6px; }
  .project-meta { display: none; }
  .featured-embed { margin-top: 20px; }

  .video-grid {
    display: flex;
    grid-template-columns: none;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* bleed to the screen edge so the shelf reads as scrollable */
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .video-grid::-webkit-scrollbar { display: none; }
  .video-card {
    flex: 0 0 47%;
    scroll-snap-align: start;
  }
  .video-card { padding-bottom: 10px; }
  .video-card p {
    font-size: 12.5px;
    padding: 10px 12px 0;
    height: calc(2.9em + 10px);
  }

  /* "Show more" drops the shelf into a stacked grid */
  .video-grid.expanded {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow-x: visible;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .video-grid.expanded .video-card { flex: none; }
}

@media (max-width: 600px) {
  .nav { padding: 14px 18px; }
  .nav-logo { font-size: 18px; }
  .nav-links { gap: 18px; }
  .nav-link { font-size: 12.5px; gap: 6px; }
  .nav-link svg { width: 15px; height: 15px; flex: 0 0 auto; }

  .viewfinder { padding: 44px 24px; }
  .vf-4k { display: none; }
  .project { padding: 28px 20px; }
  .footer { justify-content: center; text-align: center; }
}
