/* ==========================================================================
   Tamar Yadin — portfolio styles
   --------------------------------------------------------------------------
   1. Tokens (colors, fonts, motion)
   2. Base
   3. Shared pieces: header, footer, scroll-to-top, buttons, text helpers
   4. Home page
   5. Case study pages
   6. Sketchbook page
   7. 404 page
   Breakpoints: mobile < 680px · logo strip one line ≥ 900px
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --blue: #0020A8;          /* hero, mobile menu, links, active states */
  --navy-rule: #00157A;     /* mobile menu dividers */
  --strip-rule: #001E99EB;  /* logo strip divider on blue */
  --periwinkle: #5C6DB3;    /* (spare accent) */
  --mist: #C3CDF0;          /* secondary text on blue */
  --orange: #FF5A1F;        /* nav wave, arrows, CTA shadow, annotations */
  --peach: #F6DCCB;
  --lime: #E3F5BF;          /* marker behind key sentences */
  --stone: #D2CEC7;         /* footer, cards */
  --ink: #18181B;           /* primary text */
  --body: #3B3834;          /* case study body copy */
  --warm-gray: #5F5A54;     /* secondary text, labels */
  --taupe: #8A847C;         /* tertiary text */
  --pebble: #B9B2A8;        /* dotted rules */
  --sand: #E3DDD3;          /* hairline borders */
  --oat: #EAE5DC;           /* row hover */
  --linen: #F5F3EF;         /* section backgrounds */
  --white: #FFFFFF;

  --sans: 'Instrument Sans', system-ui, sans-serif;
  --serif: 'Literata', Georgia, serif;
  --mono: 'Martian Mono', ui-monospace, monospace;

  --gutter: clamp(20px, 5vw, 56px);  /* left/right page padding */
  --spring: cubic-bezier(.3, 1.6, .5, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);

  /* Wavy orange underline used on header links */
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='6' viewBox='0 0 12 6'%3E%3Cpath d='M0 3 Q3 0 6 3 T12 3' fill='none' stroke='%23FF5A1F' stroke-width='1.6'/%3E%3C/svg%3E");
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--blue); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }  /* keep proportions even with width/height attributes */
::selection { background: var(--stone); color: var(--blue); }
.case-study ::selection { background: var(--lime); color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.container { width: 100%; max-width: 1040px; margin: 0 auto; padding-inline: var(--gutter); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--white); padding: 10px 14px; border-radius: 4px;
}
.skip-link:focus { top: 12px; color: var(--white); }

/* Small text helpers */
.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono); font-size: 12px; color: var(--warm-gray);
  text-transform: uppercase; letter-spacing: 0.06em;
}
/* Lime marker highlight for key sentences */
.hl {
  font-weight: 500; font-style: italic; color: var(--ink);
  background: linear-gradient(transparent 62%, var(--lime) 62%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* 3a. Header ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  height: 58px; display: flex; align-items: center;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border-bottom: 1px solid var(--sand);
  box-shadow: 0 2px 10px rgba(24, 24, 27, 0.05);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .45s ease, color .45s ease, border-color .45s ease, box-shadow .45s ease;
}
/* Home: transparent over the blue hero until it scrolls away (toggled in JS) */
.site-header.is-transparent {
  background: rgba(255, 255, 255, 0); color: var(--white);
  border-bottom-color: transparent; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
/* Sketchbook: dark glass header */
.site-header.is-dark {
  background: rgba(0, 0, 0, 0.6); color: var(--white);
  border-bottom-color: transparent; box-shadow: none;
}
/* Mobile menu open */
.site-header.menu-open {
  background: var(--blue); color: var(--white);
  border-bottom-color: transparent; box-shadow: none;
}

.header-inner {
  width: 100%; max-width: 1040px; margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

/* Logo: each letter (<g>) wobbles on hover, staggered 28ms */
.logo { display: flex; align-items: center; padding: 6px 0; color: inherit; flex-shrink: 0; }
.logo:hover { color: inherit; }
.logo svg { overflow: visible; }
.logo g {
  transform-box: fill-box; transform-origin: 50% 50%;
  transition: transform .45s cubic-bezier(.3, 1.7, .5, 1);
}
.logo g:nth-child(2) { transition-delay: 28ms; }
.logo g:nth-child(3) { transition-delay: 56ms; }
.logo g:nth-child(4) { transition-delay: 84ms; }
.logo g:nth-child(5) { transition-delay: 112ms; }
.logo g:nth-child(6) { transition-delay: 140ms; }
.logo g:nth-child(7) { transition-delay: 168ms; }
.logo g:nth-child(8) { transition-delay: 196ms; }
.logo g:nth-child(9) { transition-delay: 224ms; }
.logo g:nth-child(10) { transition-delay: 252ms; }
.logo:hover g:nth-child(1), .logo:focus-visible g:nth-child(1) { transform: translate(0, -4px) rotate(-8deg); }
.logo:hover g:nth-child(2), .logo:focus-visible g:nth-child(2) { transform: translate(0, 3px) rotate(6deg); }
.logo:hover g:nth-child(3), .logo:focus-visible g:nth-child(3) { transform: translate(0, -5px) rotate(4deg); }
.logo:hover g:nth-child(4), .logo:focus-visible g:nth-child(4) { transform: translate(0, 3px) rotate(-6deg); }
.logo:hover g:nth-child(5), .logo:focus-visible g:nth-child(5) { transform: translate(0, -3px) rotate(10deg); }
.logo:hover g:nth-child(6), .logo:focus-visible g:nth-child(6) { transform: translate(0, 4px) rotate(-5deg); }
.logo:hover g:nth-child(7), .logo:focus-visible g:nth-child(7) { transform: translate(0, -4px) rotate(7deg); }
.logo:hover g:nth-child(8), .logo:focus-visible g:nth-child(8) { transform: translate(0, 3px) rotate(-9deg); }
.logo:hover g:nth-child(9), .logo:focus-visible g:nth-child(9) { transform: translate(0, -6px) rotate(0deg); }
.logo:hover g:nth-child(10), .logo:focus-visible g:nth-child(10) { transform: translate(0, 3px) rotate(6deg); }

/* Desktop nav with animated wavy underline */
.desk-nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font-size: 18px; }
.desk-nav a {
  color: inherit;
  padding: 4px 0 7px;
  background-image: var(--wave);
  background-repeat: repeat-x;
  background-position: 0 100%;
  background-size: 12px 0;
  transition: background-size .35s var(--spring);
}
.desk-nav a:hover, .desk-nav a:focus-visible {
  color: inherit;
  background-size: 12px 6px;
  animation: navWave .6s linear infinite;
}
.desk-nav .nav-work { font-weight: 600; }
.nav-arrow { font-size: 0.7em; margin-left: 3px; vertical-align: 0.15em; }
@keyframes navWave { from { background-position: 0 100%; } to { background-position: 12px 100%; } }

/* Mobile "Menu" button with two bars that turn into an × */
.menu-btn {
  display: none; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 4px 0 12px;
  background: none; border: 0; color: inherit; cursor: pointer;
  font-family: var(--mono); font-size: 16px;
}
.menu-bars { display: flex; flex-direction: column; gap: 5px; width: 20px; }
.menu-bars span { display: block; height: 2px; width: 100%; background: currentColor; transition: transform .3s ease; }
.menu-open .menu-bars span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-open .menu-bars span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* Full-height mobile menu panel */
.mobile-menu {
  position: absolute; top: 58px; left: 0; right: 0;
  height: calc(100vh - 58px); height: calc(100dvh - 58px);
  background: var(--blue); color: var(--white);
  padding: 24px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu > a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; border-bottom: 1px solid var(--navy-rule);
  color: var(--white); font-size: 28px; font-weight: 600; letter-spacing: -0.02em;
}
.mobile-menu > a:first-child { border-top: 1px solid var(--navy-rule); }
.mobile-menu > a span { font-size: 20px; color: var(--orange); }
.mobile-menu-foot {
  margin-top: auto; padding-top: 20px; border-top: 1px solid var(--navy-rule);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.mobile-menu-social { display: flex; align-items: center; margin-left: -10px; }
.mobile-menu-social a {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--mist);
}
.mobile-menu-social a:hover { color: var(--white); }
.mobile-menu-email { font-family: var(--mono); font-size: 13px; color: var(--mist); }
.mobile-menu-email:hover { color: var(--white); }

@media (max-width: 679px) {
  .desk-nav { display: none; }
  .menu-btn { display: flex; }
}

/* 3b. Footer ---------------------------------------------------------------- */
.site-footer { background: var(--stone); color: var(--ink); }
.footer-inner {
  max-width: 1040px; margin: 0 auto;
  padding: clamp(14px, 2vw, 16px) var(--gutter);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0 24px;
  font-family: var(--mono); font-size: 12px;
}
.footer-inner a, .footer-copy {
  display: flex; align-items: center; min-height: 44px; margin: -6px 0;
  color: var(--warm-gray); white-space: nowrap; flex-shrink: 0;
}
.footer-inner a:hover { color: var(--blue); }
.footer-copy span { font-family: var(--sans); font-size: 1.25em; line-height: 1; margin-right: 6px; }
.footer-links { display: flex; align-items: center; gap: 0 8px; }
.footer-dot { color: var(--taupe); }
.footer-dot-mobile { display: none; }

/* Dark footer (Sketchbook) */
.site-footer.is-dark { background: #000000; color: var(--white); border-top: 1px solid var(--body); }
.is-dark .footer-inner a, .is-dark .footer-copy { color: var(--pebble); }
.is-dark .footer-inner a:hover { color: var(--orange); }
.is-dark .footer-dot { color: var(--warm-gray); }

@media (max-width: 679px) {
  /* Mobile: icons hidden, a centered dot between © and email */
  .footer-links { flex: 1; margin-left: -24px; gap: 0; }
  .footer-inner .footer-social, .footer-dot { display: none; }
  .footer-dot-mobile { display: block; flex: 1; text-align: center; }
}

/* 3c. Scroll-to-top button (case studies on mobile; Sketchbook always) */
.to-top {
  position: fixed; right: 32px; bottom: 32px; z-index: 20;
  width: 52px; height: 52px; padding: 0; border: 0; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--white); color: var(--ink);
  box-shadow: 0 6px 20px rgba(24, 24, 27, 0.14);
  opacity: 0; transform: translateY(96px); pointer-events: none;
  transition: transform .6s cubic-bezier(.22, 1, .36, 1), opacity .4s ease, background-color .2s ease, color .2s ease;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--ink); color: var(--white); }
.to-top.is-dark { background: var(--ink); color: var(--white); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }
.to-top.is-dark:hover { background: var(--white); color: var(--ink); }
.to-top.mobile-only { display: none; }
@media (max-width: 679px) {
  .to-top { right: 24px; bottom: 16px; }
  .to-top.mobile-only { display: flex; }
  .to-top:hover { background: var(--white); color: var(--ink); }
  .to-top.is-dark:hover { background: var(--ink); color: var(--white); }
}

/* 3d. Buttons on blue ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; flex-shrink: 0; white-space: nowrap;
  font-weight: 600; font-size: 15px;
  padding: 13px clamp(14px, 4.4vw, 20px);
  border-radius: 999px;
  transition: transform .25s var(--spring), box-shadow .25s var(--spring);
}
.btn:hover, .btn:focus-visible { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 0 var(--orange); }
.btn-solid { background: var(--white); color: var(--blue); border: 1.5px solid var(--white); }
.btn-solid:hover { color: var(--blue); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid var(--white); }
.btn-outline:hover { color: var(--white); }
.btn-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 2px solid var(--white); color: var(--white);
  transition: transform .25s var(--spring);
}
.btn-icon:hover { color: var(--white); transform: translateY(-2px); }

/* Round arrow used on cards: rotates and fills blue on hover */
.arrow-circle {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; color: #000; border: 1.5px solid #000; background: transparent;
  transition: all .4s var(--ease-out);
}
a:hover .arrow-circle, a:focus-visible .arrow-circle {
  background: var(--blue); border-color: var(--blue); color: var(--white); transform: rotate(-45deg);
}

/* 4. Home -------------------------------------------------------------------- */
/* 4a. Hero (blue band; the header sits on top of it) */
.hero {
  margin-top: -58px; padding-top: 58px;
  min-height: min(100vh, 110vw); min-height: min(100svh, 110vw);
  display: flex; flex-direction: column; justify-content: center;
  background: var(--blue); color: var(--white);
}
.hero-intro {
  width: 100%; max-width: 1040px; margin: auto;
  padding: clamp(44px, 5.5vw, 72px) clamp(44px, 5vw, 56px) clamp(48px, 6vw, 80px);
}
.hero-row { display: flex; align-items: center; justify-content: center; gap: clamp(24px, 5vw, 56px); width: 100%; }
.hero-illustration {
  width: clamp(160px, 22vw, 186px); height: auto; aspect-ratio: 523 / 716;
  flex-shrink: 0; align-self: center; overflow: visible; margin-bottom: 16px;
}
.hero-illustration .head { transform-box: view-box; transform-origin: 272px 150px; }
.hero-text {
  flex: 0 1 auto; width: 100%; max-width: 497px; min-width: 0;
  display: flex; flex-direction: column; gap: clamp(22px, 2.6vw, 30px);
}
.hero h1 {
  margin: 0; font-weight: 500; font-size: clamp(19px, 4.4vw, 24px);
  line-height: 1.25; letter-spacing: -0.022em; text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-social { display: flex; gap: 10px; }

/* Narrow screens: illustration stacks above the text */
@media (max-width: 687px) {
  .hero-row { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero-illustration { width: 138px; align-self: flex-start; margin-bottom: 12px; }
}
@media (max-width: 679px) {
  .hero-actions { flex-wrap: nowrap; }
  /* Bigger tap targets: the two buttons share the row */
  .hero-actions .btn {
    flex: 1 1 auto; justify-content: center; min-height: 54px;
    padding-inline: clamp(10px, 3.4vw, 20px); font-size: clamp(15px, 4.3vw, 16px);
  }
  .hero-social { display: none; }
}

/* Custom cursor trail dots + bursts (created in js/home.js) */
.cursor-dot { position: fixed; pointer-events: none; z-index: 5; }

/* 4b. Logo strip */
.logo-strip { width: 100%; border-top: 1px solid var(--strip-rule); }
.logo-strip-inner {
  max-width: 1040px; margin: 0 auto;
  padding: 18px clamp(44px, 5vw, 56px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px clamp(20px, 2.6vw, 32px);
}
.logo-strip p {
  margin: 0; font-family: var(--mono); font-size: clamp(12px, 3.2vw, 13.5px);
  line-height: 1.5; color: var(--mist); white-space: nowrap;
}
.logos { display: flex; align-items: center; gap: clamp(12px, 2.2vw, 28px); flex-wrap: nowrap; }
.logos img { width: auto; flex-shrink: 0; opacity: 0.6; }
.logos .divider { width: 1px; height: 16px; background: var(--strip-rule); }
.logo-codecademy { height: clamp(15px, 1.9vw, 22px); }
.logo-similarweb { height: clamp(12px, 1.5vw, 17px); }
.logo-digitalocean { height: clamp(13px, 1.6vw, 17px); aspect-ratio: 1002 / 169; }
.logo-apester { height: clamp(12px, 1.45vw, 16px); aspect-ratio: 221 / 43; }
@media (min-width: 900px) { .logo-strip-inner { flex-wrap: nowrap; } }
@media (max-width: 679px) {
  .logo-strip-inner { justify-content: center; }
  /* One edge-to-edge row that can be swiped; js/home.js glides it on load */
  .logos {
    gap: 31px; width: calc(100% + 2 * clamp(44px, 5vw, 56px));
    margin-inline: calc(-1 * clamp(44px, 5vw, 56px));
    padding: 4px clamp(44px, 5vw, 56px);
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
  }
  .logos::-webkit-scrollbar { display: none; }
  .logos .divider { display: none; }
  .logo-codecademy { height: 17.6px; }
  .logo-similarweb, .logo-digitalocean { height: 15.4px; }
  .logo-apester { height: 13.9px; }
}

/* 4c. Section headings */
.section-head { display: flex; flex-direction: column; gap: 10px; }
.section-head h2 { margin: 0; font-weight: 600; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.02em; }
.lede { margin: 0; font-size: 16px; line-height: 1.55; color: var(--warm-gray); max-width: 52ch; text-wrap: pretty; }

/* 4d. Selected work */
.work {
  scroll-margin-top: 64px;
  padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(40px, 5vw, 64px);
}
.work .section-head { margin-bottom: clamp(28px, 3.4vw, 40px); }
.work-grid {
  margin-top: clamp(32px, 4vw, 48px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: clamp(16px, 2vw, 24px);
}
.work-card {
  display: flex; flex-direction: column; overflow: hidden;
  min-height: clamp(280px, 62vw, 520px);
  background: var(--stone); color: #000; border: 1px solid #000; border-radius: 10px;
  box-shadow: 0 0 0 0 #000;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.work-card:hover, .work-card:focus-visible { color: #000; transform: translate(-4px, -4px); box-shadow: 8px 8px 0 0 #000; }
.work-card-text { padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 12px; }
.work-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chip { font-family: var(--mono); font-size: 12px; color: #000; background: var(--white); padding: 4px 8px; border-radius: 4px; }
.work-card h3 {
  margin: 8px 0 0; font-weight: 600; font-size: clamp(26px, 2.8vw, 34px);
  line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; color: #000;
}
.work-card p { margin: 0; font-family: var(--serif); font-size: 16px; line-height: 1.5; color: #000; max-width: 38ch; }
.work-card-art { margin-top: auto; padding: 0 clamp(24px, 3vw, 36px); overflow: hidden; }
.work-card-art > div { height: 246px; }
/* The illustration host; js/home.js inlines the SVG so its lines can animate */
.card-ill {
  width: 100%; max-width: 354px; height: 268px;
  display: flex; align-items: center; justify-content: center;
}
.card-ill img, .card-ill svg { width: 88%; height: 88%; }
.card-ill--1 { transform: translateY(-24px); }
.card-ill--2 { transform: translate(-6px, -18px); }
.card-ill--2 img, .card-ill--2 svg { width: 70%; height: 70%; }
@media (max-width: 679px) { .work-card .arrow-circle { display: none; } }

/* 4e. Résumé */
.resume-band { background: linear-gradient(180deg, var(--linen), var(--white)); }
.resume {
  scroll-margin-top: 60px;
  padding-top: clamp(40px, 5vw, 64px); padding-bottom: clamp(56px, 8vw, 88px);
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 48px clamp(32px, 4.6vw, 48px);
}
.resume .section-head { flex: 1 1 100%; margin-bottom: clamp(-20px, -1vw, -8px); }

/* Sticky photo that swaps to the hovered row (desktop only) */
.resume-photo {
  flex: 0 1 34%; min-width: 200px;
  position: sticky; top: 84px; align-self: flex-start;
}
.resume-photo-frame {
  position: relative; width: 100%; aspect-ratio: 4 / 5;
  border-radius: 6px; overflow: hidden; background: #E9E4DC;
}
.resume-photo-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
}
.resume-photo-frame img.is-active { opacity: 1; }

.resume-list {
  flex: 1 1 420px; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; align-items: start;
}
.resume-col { display: flex; flex-direction: column; }
/* Experience rows are direct grid rows (1–6) so the Education label in
   column 2 lines up with the 4th experience row, as in the design */
.resume-col--exp { display: contents; }
.resume-col--exp > * { grid-column: 1; }
.resume-col--intern { grid-column: 2; grid-row: 1 / 5; align-self: stretch; }
.resume-col--edu { grid-column: 2; grid-row: 5 / 7; }
.resume-label {
  font-family: var(--mono); font-size: 12px; color: var(--warm-gray);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding-bottom: 10px; border-bottom: 1px solid var(--sand);
}
.resume-col--intern .resume-label--edu { margin-top: auto; }
.resume-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin: 0 -12px; padding: 14px 12px; border-radius: 4px;
  border-bottom: 1px solid var(--sand);
  transition: background .2s ease, border-color .2s ease;
}
.resume-row:last-child, .resume-row--last { border-bottom-color: transparent; }
.resume-row:hover { background: var(--oat); border-bottom-color: transparent; }
.resume-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.resume-row strong { font-size: 15px; line-height: 1.35; font-weight: 600; letter-spacing: -0.005em; }
.resume-row .role { font-size: 15px; line-height: 1.35; }
.resume-row .place, .resume-row .years { font-family: var(--mono); font-size: 12px; }
.resume-row .place { line-height: 1.5; color: var(--taupe); margin-top: 2px; }
.resume-row .years { flex-shrink: 0; white-space: nowrap; line-height: 1.75; color: var(--warm-gray); }
.plane { font-size: 15px; line-height: 0; margin: 0 5px; vertical-align: -1px; }

@media (max-width: 679px) {
  .resume-photo { display: none; }
  .resume-list { display: flex; flex-direction: column; align-items: stretch; }
  .resume-col--exp { display: flex; }
  .resume-col--intern { margin-top: 36px; }
  .resume-col--intern .resume-label--edu { margin-top: 36px; }
  .resume-row:hover { background: transparent; border-bottom-color: var(--sand); }
  .resume-row:last-child:hover, .resume-row--last:hover { border-bottom-color: transparent; }
}

/* 5. Case studies ------------------------------------------------------------- */
.case-study { overflow-x: clip; }
.cs-hero-band { background: var(--linen); }
.cs-hero { padding-top: clamp(16px, 2.4vw, 24px); padding-bottom: clamp(32px, 4vw, 52px); }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--taupe); }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; margin: -15px 0; color: var(--warm-gray); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb [aria-current] { color: var(--ink); }
.cs-hero-row { margin-top: clamp(14px, 2vw, 24px); display: flex; flex-wrap: wrap; align-items: center; gap: clamp(24px, 4vw, 48px); }
.cs-hero-text { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.pill {
  align-self: flex-start; font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em;
  background: var(--blue); color: var(--white); border-radius: 999px; padding: 6px 12px;
}
.cs-hero h1 { margin: 0; font-weight: 600; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.04; letter-spacing: -0.03em; text-wrap: balance; }
.cs-meta { font-family: var(--mono); font-size: 12px; color: var(--warm-gray); }
@media (max-width: 679px) {
  /* Mobile: company and year on their own line */
  .cs-meta-org { display: block; }
  .cs-meta-sep { display: none; }
}
.cs-hero figure { flex: 1 1 400px; min-width: 0; margin: 0; display: flex; justify-content: center; }
.cs-hero-ill { max-width: 100%; }
.cs-hero-ill img, .cs-hero-ill svg { width: 100%; height: 100%; }

/* Sticky section nav with scroll-spy */
.section-nav-bar {
  position: sticky; top: 58px; z-index: 9;
  background: rgba(245, 243, 239, 0.96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--sand); border-bottom: 1px solid var(--sand);
}
.section-nav {
  max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  font-family: var(--mono); font-size: 12px; white-space: nowrap;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
  padding: 0 10px; min-height: 44px; display: inline-flex; align-items: center;
  border-radius: 4px; border: 1px solid transparent; color: var(--warm-gray);
  transition: background .2s, color .2s, border-color .2s;
}
.section-nav a.is-active { color: var(--blue); font-weight: 500; border-radius: 0; box-shadow: inset 0 -2px 0 var(--blue); }

/* Each story section: label, heading, body in a centered 700px column */
.cs-section { scroll-margin-top: 110px; padding-top: clamp(72px, 10vw, 128px); }
.cs-section--first { padding-top: clamp(32px, 4vw, 48px); }
.cs-row {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px;
  max-width: 700px; margin-inline: auto;
  padding-top: 24px; border-top: 1px solid var(--sand);
}
.cs-row--plain { padding-top: 0; border-top: none; }
.cs-row--about { margin-top: clamp(40px, 5vw, 64px); }
.cs-row--sub { margin-top: clamp(72px, 9vw, 112px); }
.cs-label { font-family: var(--mono); font-size: 12px; color: var(--warm-gray); }
.cs-row h2, .cs-h2 { margin: 0; font-weight: 600; font-size: clamp(30px, 3.8vw, 46px); line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
.cs-text { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.about-logo { height: 26px; width: auto; aspect-ratio: 270 / 58; }

/* Editorial body copy */
.prose {
  font-family: var(--serif); font-size: clamp(17px, 1.5vw, 19px); line-height: 1.65; color: var(--body);
  display: flex; flex-direction: column; gap: 16px;
}
.prose p, p.prose { margin: 0; text-wrap: pretty; }
p.prose { display: block; }  /* a flex <p> would split inline highlights into separate blocks */
.prose--about { gap: 14px; }

figure { margin: 0; }
.caption { font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--warm-gray); text-align: center; }
.caption--left { text-align: left; }
.rounded { border-radius: 8px; }
.text-link {
  color: var(--blue); text-decoration: underline; text-underline-offset: 4px;
}
.text-link:hover { color: var(--ink); }

/* -- Case study 1 specifics -- */
.cs-figure { display: flex; flex-direction: column; gap: 12px; margin: 8px 0; }
.cards-before { aspect-ratio: 1692 / 426; border-radius: 8px; overflow: hidden; background: #F2F0EC; }
.cards-before img { width: 100%; height: 100%; object-fit: contain; }
.sprint-board { margin: 8px auto; width: 100%; max-width: 456px; }
.sprint-board img { width: 100%; height: auto; aspect-ratio: 1152 / 621; }
.stickers { margin: clamp(40px, 5vw, 64px) auto 0; max-width: 760px; }
.stickers img { width: 545px; max-width: 100%; height: auto; margin: 0 auto; border-radius: 8px; }

.research-grid {
  margin: clamp(40px, 5vw, 64px) auto 0; max-width: 860px;
  /* Column widths follow each image's aspect ratio (900×612 and 900×1259),
     so the two images end up exactly the same height */
  display: grid; grid-template-columns: minmax(0, 1.4706fr) minmax(0, 0.7149fr); align-items: start;
  gap: clamp(16px, 2vw, 24px);
}
.research-grid figure { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 679px) { .research-grid { grid-template-columns: 1fr; } }
.research-grid img { width: 100%; border-radius: 6px; box-shadow: 0 1px 2px rgba(24, 24, 27, .06), 0 8px 24px rgba(24, 24, 27, .06); }

/* Pain-point tiles */
.tiles {
  margin: 4px 0 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px;
}
.tiles li {
  background: var(--white); border: 1.5px solid var(--ink); border-radius: 6px;
  padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px;
}
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tile-num { font-family: var(--mono); font-size: 12px; color: var(--warm-gray); }
.tile-title { font-weight: 600; font-size: 17px; line-height: 1.25; }

.full-bleed { width: 100vw; margin-left: calc(50% - 50vw); }
.iterations { margin-top: clamp(36px, 5vw, 64px); }
.iterations img { width: 100%; }
.iterations .caption { margin-top: -12px; }

/* "a b c d" solution list next to the annotated card */
.solution {
  margin: clamp(32px, 4vw, 48px) auto 0; max-width: 760px;
  display: flex; flex-wrap: wrap; gap: clamp(28px, 5vw, 64px); align-items: center; justify-content: center;
}
.solution ol { flex: 1 1 260px; max-width: 360px; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 22px; }
.solution li { display: flex; gap: 18px; align-items: center; }
.solution li span:first-child {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  background: var(--blue); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 15px;
}
.solution li span:last-child { font-weight: 600; font-size: clamp(19px, 1.9vw, 23px); line-height: 1.2; letter-spacing: -0.01em; }
.solution figure { flex: 1 1 320px; max-width: 420px; }
.solution figure img { width: 100%; }
.card-system { margin: clamp(32px, 4vw, 48px) auto 0; border-radius: 10px; overflow: hidden; }
.card-system img {
  width: 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 70%, transparent 100%);
}

/* Impact stat tiles */
.stats {
  margin: 8px 0; font-family: var(--sans);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 12px;
}
.stats > div { background: var(--blue); border-radius: 6px; padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.stats dd {
  margin: 0; display: flex; align-items: baseline; gap: 6px;
  font-weight: 600; font-size: clamp(22px, 2.2vw, 26px); letter-spacing: -0.02em; line-height: 1; color: var(--lime);
  order: -1; /* arrow shows above the label */
}
.stats dt { font-size: 14px; line-height: 1.35; color: var(--mist); }
.live-link {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em;
}
.figma-file { margin-top: clamp(40px, 5vw, 64px); display: flex; flex-direction: column; gap: 12px; }
.figma-file img { width: 100%; }
.impact-band { margin-top: clamp(40px, 5vw, 64px); background: #FAF0E7; padding: clamp(40px, 6vw, 80px) var(--gutter); }
.impact-band figure { margin: 0 auto; max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.impact-band img { width: 100%; border-radius: 6px; }

/* -- Case study 2 specifics -- */
/* Annotated "before" dashboard; text sizes use container-query units */
.annotated { margin-top: clamp(24px, 3vw, 40px); padding-bottom: 1.6em; container-type: inline-size; }
.annotated-stage { position: relative; width: 100%; aspect-ratio: 2232 / 1460; font-family: var(--mono); }
.annotated-shot {
  position: absolute; left: 7.6%; top: 0; width: 82.7%;
  background: var(--white); border: 1.5px solid var(--stone); border-radius: 1.4cqw; padding: 0.8cqw;
}
.annotated-shot img { width: 100%; height: auto; aspect-ratio: 1846 / 1314; border-radius: 0.6cqw; }
.annotated-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.annotated-caption { position: absolute; left: 7.8%; right: 7.8%; top: 94.2%; font-size: max(12px, 1.7cqw); line-height: 1.4; color: var(--warm-gray); text-wrap: balance; }
.callout { position: absolute; font-size: max(12px, 1.9cqw); font-weight: 500; color: var(--orange); background: var(--white); padding: 0 2px; }

/* Four-step flow: row on desktop, column with ↓ arrows on mobile */
.flow {
  margin: 4px 0 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; line-height: 1.35; text-align: center;
}
.flow-step {
  flex: 1 1 110px; min-height: 56px; display: flex; align-items: center; justify-content: center;
  padding: 10px 4px; border-bottom: 1px dotted var(--pebble); color: var(--body);
}
.flow-step.is-active { border-bottom: 2px solid var(--blue); color: var(--blue); font-weight: 600; }
.flow-arrow { flex: 0 0 auto; color: var(--warm-gray); font-size: 14px; line-height: 1; }

/* Three "moments" cards */
.moments {
  font-family: var(--sans);
  margin: 4px 0 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px;
}
.moments li { background: var(--white); border-radius: 6px; padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.moments .num { font-family: var(--mono); font-size: 12px; color: var(--blue); }
.moments img { width: 100%; object-fit: contain; object-position: left center; height: 72px; margin: 28px 0 6px; }
.moments img.moment-lg { height: 96px; margin: 4px 0 6px; }
.moments .title { font-weight: 600; font-size: 19px; line-height: 1.2; letter-spacing: -0.015em; }
.moments .desc { font-family: var(--serif); font-size: 16px; line-height: 1.45; color: var(--body); text-wrap: pretty; }

/* Sketch strip: one row on desktop, two crops stacked on mobile */
.sketches-mobile { display: none; flex-direction: column; gap: 8px; }
.sketch-crop { position: relative; width: 100%; aspect-ratio: 705 / 410; overflow: hidden; background: var(--white); }
.sketch-crop img { position: absolute; top: 0; left: 0; width: 190.78%; height: auto; max-width: none; }
.sketch-crop--right img { left: -96.45%; }

@media (max-width: 679px) {
  .flow { flex-direction: column; flex-wrap: nowrap; gap: 4px; }
  .flow-step { flex: 0 0 auto; width: 100%; min-height: 48px; }
  .flow-arrow { transform: rotate(90deg); }
  .moments { grid-template-columns: 1fr; gap: 4px; }
  .moments li { padding: 12px 16px; align-items: center; text-align: center; gap: 6px; }
  .moments img { object-position: center; height: 64px; margin: 12px 0; }
  .moments img.moment-lg { height: 88px; margin: 0; }
  .sketches-desktop { display: none; }
  .sketches-mobile { display: flex; }
}

.subsections { margin: clamp(28px, 3.5vw, 40px) auto 0; max-width: 700px; display: flex; flex-direction: column; gap: clamp(28px, 3.5vw, 40px); }
.subsection { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.subsection + .subsection { padding-top: clamp(24px, 3vw, 32px); border-top: 1px dotted var(--pebble); }
.subsection .kicker { font-family: var(--mono); font-size: 12px; color: var(--blue); }
.subsection h3 { margin: 0; font-weight: 600; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; }
.subsection img { width: 100%; height: auto; border-radius: 8px; }
.dashboard-after { margin: clamp(40px, 5vw, 64px) auto 0; max-width: 960px; }
.dashboard-after img { width: 100%; height: auto; aspect-ratio: 1820 / 1346; border-radius: 10px; }

/* "More to the story" box */
.more { padding-top: clamp(72px, 10vw, 120px); }
.more-box {
  max-width: 620px; margin: 0 auto; padding: clamp(24px, 3vw, 32px) 0;
  border-top: 1px solid var(--sand); border-bottom: 1px solid var(--sand);
  display: flex; flex-direction: column; gap: 10px;
}
.more-box p { margin: 0; font-family: var(--serif); font-size: clamp(16px, 1.4vw, 18px); line-height: 1.6; color: var(--body); text-wrap: pretty; }
.more-box a { white-space: nowrap; }
.page-end { padding-bottom: clamp(88px, 12vw, 152px); }

/* "Next case study" card */
.next { padding-top: clamp(88px, 12vw, 152px); padding-bottom: clamp(72px, 10vw, 128px); }
.next-label { font-family: var(--mono); font-size: 12px; color: var(--warm-gray); padding-bottom: 16px; }
.next-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  color: #000; background: var(--stone); border: 1px solid #000; border-radius: 10px;
  box-shadow: 0 0 0 0 #000;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.next-card:hover, .next-card:focus-visible { color: #000; transform: translate(-4px, -4px); box-shadow: 8px 8px 0 0 #000; }
.next-card .arrow-circle { position: absolute; top: clamp(24px, 3vw, 36px); right: clamp(24px, 3vw, 36px); z-index: 1; }
.next-row { display: flex; align-items: stretch; }
.next-text { flex: 1 1 0; min-width: 0; padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 12px; }
.next-text .kicker { font-family: var(--mono); font-size: 12px; line-height: 40px; }
.next-text h3 { margin: 8px 0 0; font-weight: 600; font-size: clamp(26px, 2.8vw, 34px); line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; }
.next-text p { margin: 0; font-family: var(--serif); font-size: 16px; line-height: 1.5; max-width: 38ch; }
.next-art { flex: 1 1 0; min-width: 0; margin-top: auto; align-self: flex-end; padding: clamp(24px, 3vw, 36px) clamp(24px, 3vw, 36px) 0 0; overflow: hidden; }
.next-art > div { height: 246px; display: flex; align-items: center; justify-content: center; }
.next-art img { width: 248px; max-width: 100%; height: auto; }
@media (max-width: 799px) {
  .next-row { flex-direction: column; }
  .next-art { flex: 0 0 auto; align-self: stretch; padding: 0 clamp(24px, 3vw, 36px); }
}

/* 6. Sketchbook --------------------------------------------------------------- */
.sketchbook-page {
  background: #000; color: var(--white);
  /* Pencil cursor */
  --pencil: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2732%27%20height%3D%2732%27%20viewBox%3D%270%200%2032%2032%27%3E%3Ctext%20x%3D%272%27%20y%3D%2728%27%20font-size%3D%2728%27%20font-family%3D%27Segoe%20UI%20Symbol%2CApple%20Symbols%2CDejaVu%20Sans%2Csans-serif%27%20fill%3D%27%23fff%27%20stroke%3D%27%23000%27%20stroke-width%3D%271%27%20paint-order%3D%27stroke%27%3E%E2%9C%8E%3C%2Ftext%3E%3C%2Fsvg%3E") 3 28, auto;
}
.sketchbook-page, .sketchbook-page * { cursor: var(--pencil) !important; }
.sketch-grid-wrap { padding: 0 clamp(8px, 1.5vw, 16px) clamp(8px, 1.5vw, 16px); }
.sketch-grid {
  display: grid; gap: clamp(8px, 1.5vw, 16px);
  grid-template-columns: repeat(auto-fill, minmax(max(280px, calc(50% - clamp(8px, 1.5vw, 16px))), 1fr));
}
.sketch {
  display: block; width: 100%;
  aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--ink);
}
.sketch img { width: 100%; height: 100%; object-fit: cover; }


/* 7. 404 ------------------------------------------------------------------------ */
.not-found {
  min-height: calc(100vh - 58px - 68px);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 18px;
  padding-block: 64px;
}
.not-found h1 { margin: 0; font-weight: 600; font-size: clamp(30px, 3.8vw, 46px); line-height: 1.05; letter-spacing: -0.03em; }
.not-found p { margin: 0; font-family: var(--serif); font-size: clamp(17px, 1.5vw, 19px); line-height: 1.65; color: var(--body); }
.not-found .btn-solid { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
