/* ==========================================================================
   Tokens — taken from the Figma styles (www.huwmandesign.com/*)
   ========================================================================== */
:root {
  /* Colour */
  --white: #ffffff;
  --dusty-gray: #999999;   /* muted text */
  --mine-shaft: #333333;   /* borders */
  --cod-gray: #0e0e0e;     /* card background */
  --black: #000000;
  --white-50: rgba(255, 255, 255, 0.5);

  /* Type */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --max-width: 1120px;
  --narrow-width: 736px;
  --gutter: 24px;
  --section-space: 100px;
  --radius: 16px;

  /* Spacing */
  --space-2xs: 2px;
  --space-xs: 8px;
  --space-s: 12px;
  --space-m: 16px;
  --space-l: 24px;
  --space-xl: 32px;
  --space-2xl: 40px;
  --space-3xl: 48px;
  --space-4xl: 80px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Leave room for the sticky nav when the browser scrolls to a focused
     element, so keyboard focus is never hidden behind it (WCAG 2.4.11) */
  scroll-padding-top: 100px;
}

/* Anchor jumps land below the sticky nav */
[id] { scroll-margin-top: 100px; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
  border-radius: 4px;
}

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

.container--narrow {
  max-width: calc(var(--narrow-width) + var(--gutter) * 2);
}

.muted { color: var(--dusty-gray); }

/* ==========================================================================
   Type scale — fluid between mobile and desktop
   ========================================================================== */
.h1 {
  font-size: clamp(44px, 7vw, 80px);
  font-weight: 400;
  line-height: 1.1;          /* 88 / 80 */
  letter-spacing: -0.03em;   /* -2.4px at 80px */
  text-align: center;
  text-wrap: balance;
}

.h1 .muted { display: inline; }

.h2 {
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 400;
  line-height: 1.2;          /* 57.6 / 48 */
  letter-spacing: -0.03em;   /* -1.44px at 48px */
  text-wrap: balance;
}

.h2--center { text-align: center; }

.h3 {
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
}

.body {
  color: var(--dusty-gray);
  font-size: 16px;
  line-height: 24px;
}

.body--center { text-align: center; }

.small {
  color: var(--dusty-gray);
  font-size: 14px;
  line-height: 21px;
}

.link {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-block: var(--space-l);
  background: var(--black);
  border-bottom: 1px solid transparent;
  transition: transform 0.35s ease, border-color 0.2s ease, background-color 0.2s ease;
}

/* Once the page has scrolled: thin divider so the bar reads over content */
.nav--scrolled { border-bottom-color: var(--mine-shaft); }

/* Hidden while scrolling down, back as soon as you scroll up */
.nav--hidden { transform: translateY(-100%); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;          /* comfortable tap target */
  height: 44px;
}

.logo img { height: 40px; width: auto; }

/* Logos darken slightly on hover (nav and footer) */
.logo img { transition: filter 0.2s ease; }
.logo:hover img,
.logo:focus-visible img { filter: brightness(0.7); }

.nav__links {
  display: flex;
  gap: var(--space-xl);
}

.nav__links a {
  font-size: 16px;
  line-height: 20px;
  transition: color 0.2s ease;
}

.nav__links a:hover { color: var(--dusty-gray); }

/* Burger toggle: hidden until mobile */
.nav__toggle { display: none; }

@media (max-width: 809px) {
  /* Matches the Figma "Nav - Phone / Closed" frame */
  .nav {
    padding-block: 20px;
    background: var(--black);
    border-bottom: 1px solid var(--mine-shaft);
  }

  .nav__inner { padding-inline: 20px; justify-content: flex-start; }

  .nav__toggle {
    position: relative;
    display: block;
    width: 44px;            /* 32px icon from Figma, with a comfortable tap area */
    height: 44px;
    margin-left: auto;      /* push the burger to the right edge */
    margin-right: -6px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }

  .nav__toggle-bar {
    position: absolute;
    left: 11px;
    height: 2px;
    border-radius: 10px;
    background: var(--white);
    transition: transform 0.25s ease, width 0.25s ease, top 0.25s ease;
  }

  .nav__toggle-bar:first-child { top: 16px; width: 22px; }
  .nav__toggle-bar:last-child { top: 26px; width: 18px; }

  /* Bars turn into a cross when open */
  .nav--open .nav__toggle-bar:first-child { top: 21px; width: 22px; transform: rotate(45deg); }
  .nav--open .nav__toggle-bar:last-child { top: 21px; width: 22px; transform: rotate(-45deg); }

  /* Open state: header and panel turn Cod Gray, matching the Figma open nav */
  .nav--open { background: var(--cod-gray); border-bottom-color: transparent; }

  /* Dropdown panel */
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 66px 20px 28px;
    background: var(--cod-gray);
    border-bottom: 1px solid var(--mine-shaft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }

  /* Inset divider between the logo row and the links */
  .nav__links::before {
    content: "";
    position: absolute;
    top: 35px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: var(--mine-shaft);
  }

  .nav--open .nav__links {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
  }

  .nav__links a {
    display: block;
    padding-block: 20px;
    font-size: 20px;
    line-height: 28px;
  }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding-block: var(--section-space); }

.hero { padding-top: 140px; }

.section--projects { padding-top: 120px; }

/* Projects */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3xl) var(--space-xl);
  margin-top: var(--space-3xl);
}

.project {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.project__image {
  position: relative;
  aspect-ratio: 544 / 400;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--cod-gray);
}

.project__image::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--mine-shaft);
  border-radius: inherit;
  pointer-events: none;
}

.project__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project:hover .project__image img { transform: scale(1.03); }

.project__title {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.project__lock { display: inline-flex; color: var(--dusty-gray); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Statement */
.statement {
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.43;          /* 40 / 28 */
  text-align: center;
  text-wrap: pretty;
}

/* About */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-xl);
}

.about__image {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 544 / 271;
  border-radius: var(--radius);
  box-shadow: 0 16px 64px 0 var(--black);
}

.about__image img { height: 100%; width: auto; }

.about__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
  max-width: 440px;
  padding-top: var(--space-m);
}

.stats dt {
  color: var(--dusty-gray);
  font-size: 14px;
  line-height: 21px;
}

.stats dd {
  margin-top: var(--space-xs);
  font-size: 48px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

/* Career */
.career__title { margin-bottom: var(--space-4xl); }

.career {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

.job {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--mine-shaft);
}

.job__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.job__years {
  color: var(--dusty-gray);
  font-size: 16px;
  line-height: 24px;
}

/* Contact */
.contact { padding-block: 160px; }

.contact__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-l);
}

.contact__inner .body { max-width: 544px; }

.contact__inner .button { margin-top: var(--space-m); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px;
  border: 1px solid var(--white-50);
  border-radius: 100px;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--black);
}

/* Footer */
.footer { padding: 64px 0 48px; }

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-xl);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 200px;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.footer__links a {
  color: var(--dusty-gray);
  font-size: 14px;
  line-height: 21px;
  transition: color 0.2s ease;
}

.footer__links a:hover { color: var(--white); }


/* ==========================================================================
   Case study pages
   ========================================================================== */
.h1--case {
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.1;            /* 70.4 / 64 */
  letter-spacing: -0.03em;     /* -1.92px at 64px */
}

.cs-hero { padding: 79px 0 40px; }

.cs-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4xl);
}

.cs-hero__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

.cs-hero__desc { max-width: var(--narrow-width); }

.cs-label { color: var(--white); }

.cs-image {
  position: relative;
  width: 100%;
}

.cs-image img,
.cs-image picture { display: block; width: 100%; height: auto; }

/* Exports with square corners get rounded to match the other images */
.cs-image--hero,
.cs-image--rounded { border-radius: var(--radius); overflow: hidden; }

.cs-image--outcome { background: none; overflow: visible; }
.cs-image--outcome img { filter: drop-shadow(0 16px 13.5px var(--black)); }

/* Transparent illustrations sit straight on the page */
.cs-image--illustration { border-radius: 0; overflow: visible; }

/* One caption per image set: only under the last image in each section */
.cs-narrow .cs-figure:has(+ .cs-figure) figcaption { display: none; }

/* Different image sets per breakpoint (e.g. App Store pairs split on mobile) */
.cs-stack { display: flex; flex-direction: column; gap: 63px; }   /* 32px gap + 31px padding, from the Figma mobile frame */
.cs-stack img { width: 100%; height: auto; border-radius: var(--radius); }
.cs-only-mobile { display: none; }
@media (max-width: 809px) {
  .cs-only-wide { display: none; }
  .cs-only-mobile { display: flex; }
  /* Keep the 63px rhythm across the join between sets (32px gap + 31px) */
  .cs-narrow .cs-figure + .cs-figure { margin-top: 31px; }
}

/* Full-width figure below a two-column block */
.cs-wide { margin-top: var(--space-xl); }

/* Image with a drop shadow (Apple Pay design system shot) */
.cs-image--shadow img { filter: drop-shadow(0 16px 27px var(--black)); }

/* Three short points in a row (stacks on smaller screens) */
.cs-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }
@media (max-width: 1199px) { .cs-points { grid-template-columns: 1fr; } }

/* Research findings: stats, sub-headings and lists */
.cs-findings { display: flex; flex-direction: column; gap: var(--space-xl); padding-block: var(--space-m); }
.cs-finding { display: flex; flex-direction: column; gap: var(--space-xs); }
.cs-subhead { color: var(--white); font-size: 20px; font-weight: 700; line-height: 28px; }
.cs-stats strong { font-weight: 700; }
.cs-bullets { list-style: disc; padding-left: 20px; }

/* Two columns: image + text, either way round */
.cs-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-xl);
}

.cs-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  min-width: 0;
}

.cs-split .cs-text { gap: var(--space-xl); }

.cs-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}

/* Single narrow column */
.cs-narrow {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-width: calc(640px + var(--gutter) * 2);
}

.cs-strong {
  color: var(--white);
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
}

.cs-list ul {
  list-style: disc;
  padding-left: 20px;
}

/* Phone on a soft backdrop (micro animation) */
.cs-phone-stage {
  display: flex;
  justify-content: center;
  padding-block: var(--space-l);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #e6eaf6 0%, #f5e3d5 100%);
}

.cs-phone {
  width: min(318px, 70%);
  height: auto;
  object-fit: cover;
  border-radius: 32px;
}

/* Mobile: slightly tighter corners suit narrower images */
@media (max-width: 809px) {
  :root { --radius: 12px; }
  .cs-phone { border-radius: 24px; }
}

/* ==========================================================================
   Next project (end of each case study)
   ========================================================================== */
.next-project__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-m);
}

.next-project__card { width: 100%; max-width: 544px; }

.next-project__arrow {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.next-project__card:hover .next-project__arrow { transform: translateX(4px); }

/* ==========================================================================
   Lock page (NDA case studies)
   ========================================================================== */
.lock { padding-block: 120px 160px; }

.lock__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-l);
  max-width: calc(544px + var(--gutter) * 2);
}

.lock__icon { color: var(--dusty-gray); }

.lock__message--error { color: var(--white); }

.lock__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  width: 100%;
  margin-top: var(--space-m);
}

.lock__label {
  color: var(--dusty-gray);
  font-size: 14px;
  line-height: 21px;
}

.lock__row {
  display: flex;
  gap: var(--space-s);
}

.lock__input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 20px;
  border: 1px solid var(--mine-shaft);
  border-radius: 100px;
  background: var(--cod-gray);
  color: var(--white);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.lock__input:focus {
  outline: none;
  border-color: var(--white-50);
}

.lock__button {
  background: none;
  color: var(--white);
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .lock { padding-block: 64px 96px; }
  .lock__row { flex-direction: column; }
  .lock__input { flex: none; width: 100%; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  :root { --section-space: 72px; }

  .hero { padding-top: 96px; }
  .section--projects { padding-top: 88px; }

  .about { grid-template-columns: 1fr; }
  .about__image { max-width: 544px; }

  .job { grid-template-columns: 1fr; gap: var(--space-m); }


  .career__title { margin-bottom: var(--space-3xl); }
}

@media (max-width: 640px) {
  :root { --gutter: 20px; --section-space: 56px; }



  .projects { grid-template-columns: 1fr; gap: var(--space-xl); }

  .contact { padding-block: 96px; }
}

/* Case study pages: tablet 810–1199px, mobile below 810px (Figma frames) */
@media (max-width: 1199px) {
  .cs-page { --gutter: 40px; }
  .cs-page .section { padding-block: 64px; }
  .cs-hero { padding: 80px 0 40px; }

  .cs-split,
  .cs-wide,
  .cs-narrow {
    grid-template-columns: 1fr;
    max-width: calc(618px + 96px * 2);
    padding-inline: 96px;
  }
  /* One column: heading and copy always come before the image */
  .cs-split > .cs-text { order: -1; }
}

@media (max-width: 809px) {
  .cs-split,
  .cs-wide,
  .cs-narrow { padding-inline: var(--gutter); }
  .cs-hero { padding-top: 64px; }
  .cs-hero__inner { gap: var(--space-3xl); }
}

/* Mobile footer: brand block, then links stacked underneath (Figma "Footer - Phone") */
@media (max-width: 809px) {
  .footer { padding: 40px 0; }
  .footer__inner { flex-direction: column; gap: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav { transition: none; }
  * { transition: none !important; }
}

/* ==========================================================================
   Transitions — matched to the Framer site: elements fade up ~20px as they
   enter the screen; whatever is visible on load cascades in order.
   Only applied when JavaScript runs, so content is never hidden without it.
   ========================================================================== */
:root {
  --reveal-distance: 20px;
  --reveal-duration: 1.5s;
  --reveal-ease: cubic-bezier(0.16, 1, 0.3, 1);   /* gentle ease-out */
}

.js .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity var(--reveal-duration) var(--reveal-ease) var(--delay, 0s),
    transform var(--reveal-duration) var(--reveal-ease) var(--delay, 0s);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Keep the button's hover transition alongside its reveal */
.js .button.reveal {
  transition:
    opacity var(--reveal-duration) var(--reveal-ease) var(--delay, 0s),
    transform var(--reveal-duration) var(--reveal-ease) var(--delay, 0s),
    background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}
