:root {
  --color-bg: #ffffff;
  --color-text: #0a0a0a;
  --color-accent: #0033ff;
  --font-heading: 'Space Grotesk', 'Space Grotesk Fallback', sans-serif;
  --font-body: 'IBM Plex Sans', 'IBM Plex Sans Fallback', sans-serif;
  --nav-height: 72px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;
}

*, *::before, *::after {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-2) 0;
}

h1 { font-size: clamp(28px, 7vw, 48px); }
h2 { font-size: clamp(24px, 5vw, 32px); }
h3 { font-size: clamp(18px, 4vw, 20px); }

p { margin: 0 0 var(--space-2) 0; }

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

section {
  padding: var(--space-6) 0;
}

.btn {
  display: inline-block;
  background: var(--color-accent);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--color-accent);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: #ffffff;
  color: var(--color-accent);
  text-decoration: none;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-outline {
  background: #ffffff;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}

.btn-outline:hover {
  background: var(--color-text);
  color: #ffffff;
}

#site-nav {
  position: sticky;
  top: 0;
  min-height: var(--nav-height);
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-text);
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-height);
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.nav-name {
  font-family: var(--font-heading);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-links a {
  color: var(--color-text);
  font-weight: 500;
}

.nav-links a:hover { color: var(--color-accent); }

.nav-resume {
  font-size: 14px;
  opacity: 0.7;
}

#nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--color-text);
  font-size: 20px;
  padding: 4px 10px;
  cursor: pointer;
}

@media (max-width: 720px) {
  #nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-text);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--space-2) var(--space-3);
  }

  .nav-links a {
    padding: var(--space-1) 0;
    width: 100%;
  }

  .nav-links.is-open { display: flex; }
}

#hero {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  align-items: start;
}

.hero-copy {
  max-width: 700px;
}

/* Kept deliberately small on phones so the headline is not pushed under the
   fold by the portrait sitting above it. */
.hero-portrait {
  margin: 0;
  width: 120px;
  border: 2px solid var(--color-text);
  box-shadow: 10px 10px 0 var(--color-accent);
  line-height: 0;
}

.hero-portrait img {
  display: block;
  width: 100%;
  height: auto;
}

/* Two columns only once the text column can still hold a 48px headline. The
   portrait column flexes so the 760 to 900px band is not cramped. */
@media (min-width: 760px) {
  .hero-inner {
    grid-template-columns: 1fr minmax(180px, 260px);
    gap: var(--space-4);
    align-items: center;
  }

  .hero-copy {
    order: 1;
  }

  .hero-portrait {
    order: 2;
    width: 100%;
    box-shadow: 14px 14px 0 var(--color-accent);
  }
}

.hero-subline {
  font-size: clamp(16px, 3.5vw, 18px);
  max-width: 560px;
}

#about {
  border-top: 2px solid var(--color-text);
}

#about .container p {
  max-width: 640px;
}

#case-studies {
  border-top: 2px solid var(--color-text);
  background: #fafafa;
}

.case-study {
  padding: var(--space-4) 0;
  border-bottom: 1px solid #ddd;
  transition: padding-left 0.2s ease, border-left-color 0.2s ease;
  border-left: 4px solid transparent;
}

.case-study:hover {
  padding-left: var(--space-2);
  border-left-color: var(--color-accent);
}

.case-study:last-child { border-bottom: none; }

.case-study h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.case-study > div { margin-bottom: var(--space-2); }

.cs-metric {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
}

#skills {
  border-top: 2px solid var(--color-text);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.skill-tag {
  border: 2px solid var(--color-text);
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 14px;
  max-width: 100%;
  overflow-wrap: break-word;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.skill-tag:hover {
  background: var(--color-text);
  color: #ffffff;
}

#testimonials {
  border-top: 2px solid var(--color-text);
  background: #fafafa;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.testimonial {
  margin: 0;
  padding: var(--space-3);
  border-left: 4px solid var(--color-accent);
  background: var(--color-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.testimonial:hover {
  transform: translateY(-4px);
  box-shadow: 4px 4px 0 var(--color-text);
}

.testimonial cite {
  display: block;
  margin-top: var(--space-1);
  font-style: normal;
  font-weight: 500;
  opacity: 0.7;
}

@media (max-width: 720px) {
  .testimonial-grid { grid-template-columns: 1fr; }
}

#contact {
  border-top: 2px solid var(--color-text);
  text-align: center;
}

#contact p {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.contact-links {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-3);
}

footer {
  border-top: 2px solid var(--color-text);
  padding: var(--space-3) 0;
  font-size: 14px;
  opacity: 0.6;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-inner h1 {
  animation: hero-fade-up 0.6s ease both;
}

.hero-inner .hero-subline {
  animation: hero-fade-up 0.6s ease 0.1s both;
}

.hero-inner .btn {
  animation: hero-fade-up 0.6s ease 0.2s both;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-inner h1,
  .hero-inner .hero-subline,
  .hero-inner .btn {
    animation: none;
  }

  .btn:hover,
  .testimonial:hover,
  .case-study:hover {
    transform: none;
  }
}

/* Fallback faces with metrics measured from the real font files, so text does
   not reflow when the webfonts finish loading. */
@font-face {
  font-family: 'Space Grotesk Fallback';
  src: local('Arial');
  size-adjust: 101.02%;
  ascent-override: 97.40%;
  descent-override: 28.90%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'IBM Plex Sans Fallback';
  src: local('Arial');
  size-adjust: 97.45%;
  ascent-override: 105.18%;
  descent-override: 28.22%;
  line-gap-override: 0%;
}

/* Keyboard focus. Ring sits outside the element so it lands on the page
   background: black on white is 19.8:1, well past the 3:1 minimum. A dark ring
   drawn inside the cobalt button would only reach 2.75:1. */
:focus-visible {
  outline: 3px solid var(--color-text);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-text);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  padding: var(--space-1) var(--space-2);
  z-index: 200;
}

.skip-link:focus {
  left: var(--space-2);
  top: var(--space-1);
  text-decoration: none;
}

@media (max-width: 720px) {
    }

#content {
  border-top: 2px solid var(--color-text);
}

.section-note {
  max-width: 640px;
  opacity: 0.75;
}

.clip-group {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-2);
}

.clip {
  position: relative;
  display: block;
  margin: 0;
  aspect-ratio: 9 / 16;
  border: 2px solid var(--color-text);
  overflow: hidden;
  background: var(--color-text);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.clip:hover,
.clip:focus-within {
  transform: translateY(-3px);
  box-shadow: 6px 6px 0 var(--color-accent);
  text-decoration: none;
}

.clip-poster,
.clip-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
}

/* The video sits over its still and only reveals once it is actually playing. */
.clip-video {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.clip.is-playing .clip-video {
  opacity: 1;
}

.clip-label {
  z-index: 2;
  position: absolute;
  left: 0;
  bottom: 0;
  background: var(--color-text);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 8px;
}

@media (max-width: 720px) {
  .clip-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .clip:hover,
  .clip:focus-within {
    transform: none;
  }

  .clip-video {
    transition: none;
  }
}

/* Nothing should ever scroll the page sideways. */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

img, video, iframe, svg {
  max-width: 100%;
}

/* At 320px the 16px gap forced a single column, so seventeen clips became a
   very long stack of oversized tiles. A tighter gap keeps two columns. */
@media (max-width: 400px) {
  .clip-grid {
    gap: 8px;
  }
}

/* Clickability affordance. Touch devices get the arrow permanently, since they
   have no hover state to reveal anything. */
.clip-arrow {
  z-index: 2;
  position: absolute;
  top: 0;
  right: 0;
  background: var(--color-accent);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  padding: 5px 7px;
}

.clip-cta {
  z-index: 2;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  background: var(--color-accent);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 8px;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* A scrim so the video underneath never fights the overlay text. */
.clip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-text);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .clip:hover .clip-cta,
  .clip:focus-within .clip-cta {
    opacity: 1;
    transform: translateY(0);
  }

  .clip:hover::after,
  .clip:focus-within::after {
    opacity: 0.18;
  }

  .clip:hover .clip-arrow,
  .clip:focus-within .clip-arrow {
    opacity: 0;
  }
}

/* No hover available, so the cta bar never appears and the arrow is the whole
   affordance. Keyboard focus still gets the bar. */
@media (hover: none) {
  .clip-cta {
    display: none;
  }

  .clip:focus-within .clip-cta {
    display: block;
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .clip-cta,
  .clip::after {
    transition: none;
  }
}

/* The link is stretched over the whole tile so the entire thing is clickable,
   with the sound control layered above it. A button cannot live inside an
   anchor, which is why the tile is a figure rather than a link. */
.clip-open {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
}

.clip-sound {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 3;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-text);
  color: #ffffff;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.clip-sound:hover {
  background: var(--color-accent);
}

.clip-sound .icon-sound { display: none; }
.clip-sound[aria-pressed="true"] .icon-sound { display: block; }
.clip-sound[aria-pressed="true"] .icon-mute { display: none; }
.clip-sound[aria-pressed="true"] { background: var(--color-accent); }

.clip-label {
  right: 32px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clip-note {
  font-size: 14px;
  opacity: 0.7;
  max-width: 560px;
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-2);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* The LinkedIn piece is landscape, so it gets its own wider tile rather than
   being squeezed into the 9:16 grid. */
.clip-wide {
  aspect-ratio: 16 / 9;
  max-width: 560px;
}

.clip-grid-wide {
  display: block;
}

/* On 320px screens the narrower tile pushes three titles past two lines, and
   the clamp was hiding the tail. Three lines is 54px of a 235px tile. */
@media (max-width: 400px) {
  .clip-label {
    -webkit-line-clamp: 3;
  }
}

/* Case study data figures. Built in HTML rather than SVG so the type stays at
   real CSS sizes instead of scaling down with a viewBox. Every value is printed
   next to its mark, so nothing is encoded by colour alone. */
:root {
  --fig-track: #d9e0ff;   /* a lighter step of the cobalt, per meter spec */
  --fig-muted: #c9c9c9;   /* de-emphasis only, always paired with a label */
  --fig-rule: #ededed;
}

.cs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0 0 var(--space-2) 0;
}

.cs-org,
.cs-kind {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 2px solid var(--color-text);
}

.cs-org {
  background: var(--color-text);
  color: #ffffff;
}

.cs-kind {
  color: var(--color-text);
}

.cs-figure {
  display: grid;
  gap: var(--space-3);
  border: 2px solid var(--color-text);
  background: var(--color-bg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.fig-title {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}

.fig-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: var(--space-2);
}

.fig-stat {
  display: flex;
  flex-direction: column;
  border-left: 3px solid var(--color-accent);
  padding-left: 10px;
}

.fig-stat-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(19px, 4.5vw, 25px);
  line-height: 1.1;
}

.fig-stat-label {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 3px;
}

.fig-meter-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px var(--space-2);
  margin-bottom: 6px;
}

.fig-meter-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}

.fig-meter-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(17px, 4vw, 21px);
  white-space: nowrap;
}

.fig-track {
  display: block;
  height: 10px;
  background: var(--fig-track);
}

.fig-track-fill {
  display: block;
  height: 100%;
  background: var(--color-accent);
}

.fig-bars {
  display: grid;
  gap: var(--space-2);
}

.fig-bar-row {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  align-items: center;
  gap: var(--space-2);
}

.fig-bar-label {
  font-size: 12px;
  opacity: 0.7;
}

.fig-bar-track {
  display: block;
  height: 12px;
  background: var(--fig-rule);
}

.fig-bar {
  display: block;
  height: 100%;
  background: var(--fig-muted);
}

.fig-bar.is-accent {
  background: var(--color-accent);
}

.fig-bar-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

/* Below 560px the three column bar row cannot hold a 118px label, a track and a
   value, so the track drops to its own line. */
@media (max-width: 560px) {
  .fig-bar-row {
    grid-template-columns: 1fr auto;
    gap: var(--space-1) var(--space-2);
  }

  .fig-bar-label { grid-column: 1; grid-row: 1; }
  .fig-bar-value { grid-column: 2; grid-row: 1; text-align: right; }
  .fig-bar-track { grid-column: 1 / -1; grid-row: 2; }

  .cs-figure {
    padding: var(--space-2);
  }
}

/* The career path reads faster as a list than as a paragraph, and it carries
   the same facts in a third of the words. */
.about-path {
  list-style: none;
  margin: 0 0 var(--space-3) 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
  max-width: 640px;
}

.about-path li {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-2);
  font-size: 15px;
}

.about-path strong {
  font-family: var(--font-heading);
  font-weight: 700;
  display: block;
}

/* Case studies open on the gist: title, badges, figure, impact. The narrative
   lives behind a native details element, so it needs no JavaScript, stays
   keyboard operable, and still works if scripts fail. */
.cs-more {
  margin-top: var(--space-2);
  border-top: 2px solid var(--color-text);
}

.cs-more > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.cs-more > summary::-webkit-details-marker {
  display: none;
}

/* A drawn indicator rather than the default triangle, to match the hard edges. */
.cs-more > summary::after {
  content: "+";
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  border: 2px solid var(--color-accent);
  padding: 1px 5px 3px;
}

.cs-more[open] > summary::after {
  content: "\2013";
}

.cs-more > summary:hover {
  text-decoration: underline;
}

.cs-more > div:first-of-type {
  margin-top: var(--space-1);
}

/* Brand marks drawn in the site palette rather than brand colours, so the nav
   stays two inks plus cobalt. Hard edged squares, consistent with the toggle. */
.nav-social {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--color-text);
  color: var(--color-text);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-icon:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
  text-decoration: none;
}

@media (max-width: 720px) {
  .nav-social {
    padding: var(--space-1) 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-icon {
    transition: none;
  }
}

/* Just above the hamburger breakpoint the nav is 9px too wide once the two
   brand buttons are in. A tighter gap in that band fixes it without moving
   the breakpoint. */
@media (min-width: 721px) and (max-width: 820px) {
  .nav-links {
    gap: var(--space-2);
  }
}
