/* ---------- Tokens (from Figma) ---------- */
:root {
  --ink: #121210;          /* page background */
  --ink-2: #1b1b1b;        /* dark text / borders */
  --paper: #e3e3e3;        /* light surfaces + light text */
  --red: #c70000;          /* accent */
  --serif: 'Merriweather', Georgia, serif;
  --display: 'Oswald', 'Arial Narrow', sans-serif;
  --max: 1280px;
  --gutter: 30px;
  --section-gap: 100px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.5;
}
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, p { margin: 0; }
a { color: inherit; }

.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main { display: flex; flex-direction: column; gap: var(--section-gap); }

/* ---------- Morse dividers ---------- */
.morse {
  --u: 4px;                         /* dot size; dash = 3u, gap = u, letter gap = 2u */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--u) * 2);
  color: var(--red);
}
.morse__letter { display: flex; gap: var(--u); }
.morse__dot, .morse__dash { height: var(--u); width: var(--u); background: currentColor; }
.morse__dash { width: calc(var(--u) * 3); }

.morse--hero   { --u: 24.615px; color: var(--paper); flex-wrap: nowrap; overflow: hidden; }
.morse--footer { --u: 20.984px; color: var(--ink);   flex-wrap: nowrap; justify-content: center; overflow: hidden; }

/* ---------- Hero ---------- */
.hero { background: var(--paper); color: var(--ink-2); padding: 60px 0 80px; }
.hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.hero__intro, .hero__media { flex: 0 1 572px; }
.hero__intro { display: flex; flex-direction: column; gap: 20px; }
.hero__name-block { display: flex; flex-direction: column; gap: 16px; }
.hero__greeting { font-size: 32px; line-height: 32px; }
.hero__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 128px;
  line-height: 100px;
}
.hero__role {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 32px;
  line-height: 48px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hero__tag {
  white-space: nowrap;
  background: var(--red);
  color: var(--paper);
  font-weight: 900;
  padding: 0 10px;
}

.hero__media { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.hero__logo { width: 100%; aspect-ratio: 928.57 / 500; overflow: hidden; }
.hero__video, .hero__still { display: block; width: 100%; height: 100%; object-fit: cover; }
.pause-btn[hidden] { display: none; }

.pause-btn {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent;
  border: 1px solid rgba(27, 27, 27, 0.5);
  cursor: pointer;
  padding: 0;
}
.pause-btn span { width: 4px; height: 24px; background: var(--ink-2); }
.pause-btn:hover { border-color: var(--ink-2); }
.pause-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
/* play icon when paused */
.is-paused .pause-btn span:first-child {
  width: 0; height: 0; background: none;
  border-style: solid; border-width: 12px 0 12px 18px;
  border-color: transparent transparent transparent var(--ink-2);
}
.is-paused .pause-btn span:last-child { display: none; }

/* ---------- Shared type ---------- */
.block { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.heading {
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  line-height: 32px;
  color: var(--paper);
}
.heading--dark { color: var(--ink); }

.about { font-size: 24px; line-height: 32px; }
.lede { max-width: 960px; line-height: 24px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  line-height: 16px;
}
.tags--icons li { display: flex; align-items: center; gap: 6px; }

.tool-icon { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; flex: none; }
.tool-icon--plain { border-radius: 0; object-fit: contain; }
.tool-icon--tile {
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
}
.tool-icon--tile img { width: auto; height: auto; }

/* ---------- Skills ---------- */
.skills { display: flex; flex-direction: column; gap: 60px; }
.skills__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.skills__col { display: flex; flex-direction: column; gap: 30px; }

.ai { display: flex; align-items: flex-start; gap: 10px; max-width: 960px; }
.ai__icon { position: relative; flex: none; width: 72px; height: 72px; }
.ai__letters { position: absolute; left: 24px; top: 24px; width: 23.093px; height: 24.3px; max-width: none; }
.ai p { flex: 1; line-height: 24px; }

/* ---------- Work ---------- */
.work { display: flex; flex-direction: column; gap: 20px; }
.work__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.tile { aspect-ratio: 1; border: 1px solid var(--ink-2); overflow: hidden; }
.tile button {
  position: relative; display: block; width: 100%; height: 100%;
  padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left;
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tile span {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 80px 20px 30px;
  background: linear-gradient(to top, rgba(0,0,0,.8) 20%, rgba(0,0,0,0));
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  line-height: 16px;
  color: #fff;
}
.tile button:hover img, .tile button:focus-visible img { transform: scale(1.04); }
.tile button:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }

/* ---------- Clients ---------- */
.clients { display: flex; flex-direction: column; gap: 60px; }
.logos { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; }
.logos img { width: auto; max-width: none; height: 52px;}

/* ---------- Contact ---------- */
.contact {
  margin-top: var(--section-gap);
  background: var(--paper);
  color: var(--ink);
  padding-bottom: 120px;
  display: flex; flex-direction: column; gap: 60px;
}
.contact__text { font-size: 20px; line-height: 1.4; }
.contact__text a { font-weight: 700; text-underline-offset: 3px; }
.contact__text a:hover { color: var(--red); }

/* ---------- Lightbox ---------- */
html:has(.lightbox[open]) { overflow: hidden; }
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(18, 18, 16, 0.98);
  color: var(--paper);
}
.lightbox[open] {
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }
.lightbox[open] { animation: lb-in .2s ease-out; }
@keyframes lb-in { from { opacity: 0; } }

.lightbox__bar {
  display: flex; align-items: center; gap: 20px;
  padding: 16px clamp(16px, 4vw, 40px);
  pointer-events: none;
}
.lightbox__bar > * { pointer-events: auto; }
.lightbox__title { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 32px; }
.lightbox__count { font-size: 14px; opacity: .7; margin-right: auto; font-variant-numeric: tabular-nums; }

.lightbox__close, .lightbox__nav {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; padding: 0;
  background: transparent; color: var(--paper);
  border: 1px solid rgba(227, 227, 227, .4);
  cursor: pointer;
  flex: none;
}
.lightbox__close:hover, .lightbox__nav:hover { background: var(--red); border-color: var(--red); }
.lightbox button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.lightbox__stage {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(8px, 2vw, 24px);
  padding: 0 clamp(16px, 4vw, 40px);
  min-height: 0;
}
.lightbox__figure {
  margin: 0; flex: 1; min-width: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.lightbox__img {
  max-width: 100%; max-height: calc(100% - 40px);
  width: auto; height: auto;
  object-fit: contain;
}
.lightbox__caption { font-size: 14px; opacity: .8; text-align: center; }

.lightbox__thumbs {
  display: flex; justify-content: safe center; gap: 8px;
  padding: 16px clamp(16px, 4vw, 40px) 24px;
  overflow-x: auto;
}
.lightbox__thumbs button {
  display: block; width: 72px; height: 45px; padding: 0;
  border: 2px solid transparent; background: none; cursor: pointer;
  opacity: .5; transition: opacity .15s;
}
.lightbox__thumbs button:hover { opacity: .85; }
.lightbox__thumbs button[aria-current="true"] { opacity: 1; border-color: var(--red); }
.lightbox__thumbs img { width: 100%; height: 100%; object-fit: cover; }


/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .work__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  :root { --section-gap: 72px; }
  .hero__inner { flex-direction: column; align-items: stretch; }
  .hero__intro, .hero__media { flex-basis: auto; }
  .skills__grid { grid-template-columns: 1fr; gap: 30px; }
  .work__grid { grid-template-columns: repeat(2, 1fr); }
  .tile span { line-height: 1.15; padding: 60px 16px 20px; }
}
@media (max-width: 560px) {
  .hero { padding: 40px 0 48px; }
  .hero__greeting, .hero__role { font-size: 24px; line-height: 36px; }
  .hero__name { font-size: 88px; line-height: 76px; }
  .about { font-size: 18px; line-height: 28px; }
  .morse--hero   { --u: 14px; }
  .morse--footer { --u: 12px; }
  .ai { flex-direction: column; }
  .contact__text { font-size: 18px; }
  .lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(18,18,16,.7); }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__stage { position: relative; }
}
@media (prefers-reduced-motion: reduce) {
  .tile img { transition: none; }
  .lightbox[open] { animation: none; }
}
