/* Elim Hannaford — portfolio
   Rebuilt from her Figma Sites design. Measurements are taken from the
   published Figma site at a 1311px-wide window (1281px content + 15px margins). */

:root {
  --ink: #000;
  --ink-name: #1c0b29;
  --muted: #767676;
  --bg: #fff;
  --pad: 15px;
  --header-h: 46px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 60px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.1;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; font-weight: inherit; }
img, video { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; top: -60px; left: var(--pad); z-index: 200; background: var(--ink); color: #fff; padding: 10px 14px; }
.skip:focus { top: 8px; }

/* ---------- Header ---------- */
.site-header { position: fixed; inset: 0 0 auto 0; height: var(--header-h); background: var(--bg); z-index: 100; }
.site-header__inner {
  height: 100%; margin: 0 var(--pad);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}
.site-header a { font-size: 20px; line-height: 1.21; letter-spacing: -0.006em; transition: color .25s ease; }
.site-header .brand { color: var(--ink-name); }
.site-header a:hover { color: var(--muted); }
main { padding-top: var(--header-h); }

/* ---------- Shared "Explore →" link ---------- */
.explore { display: inline-flex; gap: 4px; color: var(--muted); font-size: 16px; line-height: 1.1; transition: color .25s ease; }
.explore > span[aria-hidden] { transition: transform .25s ease; }
.explore:hover, a:hover > .explore { color: var(--ink); }
.explore:hover > span[aria-hidden], a:hover > .explore > span[aria-hidden] { transform: translateX(3px); }

/* ---------- Scrolling strips ---------- */
.strip { overflow: hidden; }
.strip__track { display: flex; width: max-content; will-change: transform; }
.strip:hover .strip__track { animation-play-state: paused; }
.strip__set { display: flex; align-items: flex-start; gap: var(--gap); padding-right: var(--gap); }
.strip__set img, .strip__set video { width: var(--tile); height: auto; flex: none; }
@keyframes strip { to { transform: translateX(var(--shift, -50%)); } }

/* ---------- Fade in on scroll (matches Figma: 0.45s ease-out, 0.15s delay) ---------- */
.js .reveal { opacity: 0; transition: opacity .45s ease-out .15s; }
.js .reveal.is-visible { opacity: 1; }

/* ---------- Home ---------- */
.hero { margin: 0 var(--pad); padding: 69px 0 129px; border-bottom: 1px solid var(--ink); }
.hero h1 { font-weight: 700; font-size: 105px; line-height: 1.1; letter-spacing: -0.0315em; }
.hero h1 span { display: block; }
.hero p { margin-top: 44px; font-size: 45px; line-height: 1; letter-spacing: -0.0135em; }
.section-label { margin: 40px var(--pad) 0; font-size: 24px; line-height: 1; letter-spacing: -0.05em; }

.work { padding-top: 143px; }
.project { margin-bottom: 92px; }
.project:last-child { margin-bottom: 0; }
.project .strip { margin: 0 var(--pad); }
.project .strip__set img, .project .strip__set video { height: 446px; object-fit: cover; }
.project__strip { display: block; }
.project__meta { margin: 20px var(--pad) 0; display: grid; grid-template-columns: 286px 1fr 316px; column-gap: 20px; }
.project__title { font-size: 16px; font-weight: 700; line-height: 1; }
.project__roles { margin-top: 4px; font-weight: 700; color: var(--muted); }
.project__desc { grid-column: 3; }
.project__desc .explore { margin-top: 30px; }

/* ---------- Case study pages ---------- */
.cs-head { display: grid; grid-template-columns: 1fr 1fr; margin: 0 var(--pad); padding-top: 74px; }
.cs-head h1 { font-size: 65px; line-height: 1; letter-spacing: -0.049em; padding-right: 20px; }
.cs-head__text { font-size: 20px; line-height: 1.21; letter-spacing: -0.006em; }
.cs-intro + .cs-tags { margin-top: 44px; }
.cs-tags { color: var(--muted); }
.cs-tags li { line-height: 1.4; }

.block { margin-top: var(--mt); }
.row { display: flex; align-items: flex-start; padding: 0 var(--pad); }
.cell { flex: none; width: var(--w); margin-left: var(--ml); overflow: hidden; background: #f4f4f4; }
.cell img, .cell video { width: 100%; height: 100%; object-fit: cover; }
.cs-body .strip { margin: 0 var(--pad); }

.brand-grid, .more-grid { display: grid; gap: 14px; margin: 0 var(--pad); }
.brand-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 30px; }
.more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile img { width: 100%; height: auto; aspect-ratio: 310 / 296; object-fit: cover; transition: opacity .25s ease; }
.more-grid .tile img { aspect-ratio: 418 / 399; }
.tile:hover img { opacity: .92; }
.tile .explore { margin-top: 10px; }

.more-work { margin: 14px var(--pad) 0; padding-top: 29px; border-top: 1px solid var(--ink); }
.more-work h2 { font-size: 65px; line-height: 1; letter-spacing: -0.049em; margin-bottom: 104px; }
.more-work .more-grid { margin: 0; }
.cs-body + .more-work, .block + .more-work { margin-top: 30px; }

/* ---------- About ---------- */
/* About: each text block sits centred between the lines above and below it */
.about-intro { margin: 0 var(--pad); padding: clamp(64px, 13vw, 187px) 0; }
.about-intro h1 { font-size: clamp(34px, 5.6vw, 92px); line-height: 1; letter-spacing: -0.045em; text-wrap: balance; }
.rule { margin: 0 var(--pad); border: 0; border-top: 1px solid var(--ink); }

.about-body { margin: 0 var(--pad); padding: clamp(36px, 4vw, 64px) 0; font-size: clamp(17px, 1.15vw + 6px, 26px); line-height: 1.3; letter-spacing: -0.006em; }
.about-body p + p { margin-top: 1.1em; }
.about-page .site-footer { margin-top: 0; }
.clients { margin: 30px var(--pad) 0; }
.clients h2 { margin: 0 0 20px; font-size: 16px; color: var(--muted); letter-spacing: -0.03em; }
.clients li { font-size: clamp(17px, 1.15vw + 6px, 26px); line-height: 1.4; letter-spacing: -0.006em; }

/* ---------- Footer ---------- */
.site-footer { margin: 100px var(--pad) 0; border-top: 1px solid var(--ink); overflow: hidden; }
.site-footer__name { overflow: visible; }
.site-footer__cols {
  display: grid; grid-template-columns: calc(50vw - 2 * var(--pad)) 1fr auto;
  padding: 100px 40px 0 0; font-size: 20px; line-height: 1;
}
.site-footer__col { grid-column: 2; }
.site-footer__col + .site-footer__col { grid-column: 3; }
.site-footer h2 { margin: 0 0 30px; font-size: inherit; letter-spacing: -0.05em; }
.site-footer a { transition: color .25s ease; }
.site-footer a:hover { color: var(--muted); }
/* The name is sized by script.js to run exactly from divider edge to divider edge. */
.site-footer__name {
  display: block; margin-top: 48px; font-weight: 700; font-size: 13.4vw;
  line-height: 0.8; letter-spacing: -0.03em; white-space: nowrap; padding-bottom: 0.06em;
  transition: color .25s ease;
}
.site-footer__name span { display: inline-block; white-space: nowrap; }
.site-footer a.site-footer__name:hover { color: var(--ink); opacity: .85; }

@media (prefers-reduced-motion: reduce) {
  .strip__track { animation: none !important; }
  .js .reveal { opacity: 1; transition: none; }
}

/* ---------- Tablet (800–1279) ---------- */
@media (max-width: 1279px) {
  .hero h1 { font-size: 70px; }
  .hero p { font-size: 32px; }
  .project .strip__set img { width: 360px; height: 348px; }
  .project__meta { grid-template-columns: 1fr 1fr; }
  .project__desc { grid-column: 2; }
  .cs-head h1, .more-work h2 { font-size: 52px; }
  .block { margin-top: calc(var(--mt) * .8); }
}

/* ---------- Phone (<800) ---------- */
@media (max-width: 799px) {
  .site-header a { font-size: 16px; }
  .hero { padding: 48px 0 64px; }
  .hero h1 { font-size: 50px; }
  .hero p { margin-top: 24px; font-size: 24px; padding-right: var(--pad); }
  .work { padding-top: 60px; }
  .project { margin-bottom: 64px; }
  .project .strip { margin: 0 var(--pad); }
  .project .strip__set img { width: 260px; height: 252px; }
  .project__meta { margin: 16px var(--pad) 0; grid-template-columns: 1fr; row-gap: 16px; }
  .project__desc { grid-column: 1; }
  .project__desc .explore { margin-top: 16px; }

  .cs-head { grid-template-columns: 1fr; row-gap: 24px; padding-top: 40px; }
  .cs-head h1, .more-work h2 { font-size: 40px; }
  .cs-head__text { font-size: 18px; }
  .cs-intro + .cs-tags { margin-top: 24px; }
  .block { margin-top: 12px; }
  .cs-body > .block:first-child { margin-top: 48px; }
  .row { flex-wrap: wrap; gap: 12px; }
  .cell { margin-left: 0; width: 100%; }
  .row--4 .cell, .row--5 .cell, .row--6 .cell { width: calc(50% - 6px); }
  .cs-body .strip__set img { width: calc(var(--tile) * .8); }
  .brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; gap: 12px; }
  .more-grid { grid-template-columns: 1fr; row-gap: 24px; }
  .more-work h2 { margin-bottom: 32px; }
  .brand-grid + * , section.block { margin-top: 48px; }

  .site-footer__cols { grid-template-columns: 1fr auto; padding: 60px var(--pad) 0 0; }
  .site-footer__col { grid-column: 1; }
  .site-footer__col + .site-footer__col { grid-column: 2; }
}

/* Videos that play while hovered (tapped on phones) */
.hover-play .cell--video { cursor: pointer; position: relative; }
.hover-play .cell--video::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px;
  border-radius: 50%; background: rgba(0,0,0,.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l8 5-8 5z' fill='white'/%3E%3C/svg%3E") center / 28px no-repeat;
  transition: opacity .25s ease; pointer-events: none;
}
.hover-play .cell--video.is-playing::after { opacity: 0; }
