/* =========================================================
   Briana Morrison — Portfolio styles
   1. Design tokens (change colors/fonts/spacing here)
   2. Base + reset
   3. Accessibility helpers
   4. Header
   5. Hero + "builds" easter egg
   6. Sticker
   7. Work section: filters + project cards
   8. Footer
   9. Custom cursor
   10. Reduced motion
   11. Case study pages
   12. Lightbox (zoomed images)
   13. Play page
   14. About page
   ========================================================= */


/* ---------- 1. Design tokens ----------
   CSS custom properties ("variables"). Use them everywhere instead of
   typing hex codes, so a color change only happens in one place. */
:root {
  /* Color */
  --color-bg: #FBF8F3;          /* warm paper off-white */
  --color-text: #1E2A47;        /* navy — main text */
  --color-text-muted: #5B6478;  /* supporting text (5.6:1 contrast on bg) */
  --color-coral: #D85A30;       /* the one interaction color: lines, underlines, frames */
  --color-coral-deep: #B8431F;  /* use when WHITE TEXT sits on coral (passes contrast) */
  --color-line: #E6E0D6;        /* hairline dividers */
  --color-line-strong: #B9B2A6; /* small decorative marks, like the dot in project meta */
  --color-white: #FFFFFF;

  /* Project color theme. Case study pages can swap these with a theme class
     (see "Project color themes" in section 11). Default = coral. */
  --project-accent: var(--color-coral);           /* lines, big numbers, markers (3:1+) */
  --project-accent-text: var(--color-coral-deep); /* small colored text (4.5:1+) */
  --project-tint: #FAECE7;                         /* mats behind screens */
  --project-highlight: #FBE3DA;                    /* band behind hovered/current sidebar link */

  /* Category tints behind project previews */
  --tint-product: #FAECE7;      /* coral tint */
  --tint-web: #E6F1FB;          /* blue tint */
  --tint-graphic: #FAEEDA;      /* yellow tint */

  /* Type */
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Spacing scale — reuse these instead of random numbers */
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: 4rem;

  /* Layout */
  --page-max: 1200px;
  /* clamp(min, preferred, max): side padding grows with the screen, within limits */
  --page-pad: clamp(1.25rem, 4vw, 3rem);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 250ms;
}


/* ---------- 2. Base + reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box; /* padding is included in an element's width — easier math */
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth; /* sidebar section links glide instead of jumping (off with reduced motion) */
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  margin: 0;
}

p { margin: 0; }

/* The "hidden" attribute always hides, even if a class gives the element a display value */
[hidden] { display: none !important; }

a {
  color: inherit;
  text-decoration-color: var(--color-coral);
  text-underline-offset: 0.2em;
}

/* Visible focus ring for keyboard users (never remove this without a replacement) */
:focus-visible {
  outline: 2px solid var(--color-coral);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--color-coral);
  color: var(--color-white);
}

/* Shared wrapper: header, main sections, and footer all line up on the same edges */
.site-header,
.hero,
.work,
.play,
.about,
.site-footer {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}


/* ---------- 3. Accessibility helpers ---------- */

/* Hidden visually, still read by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Skip link: off-screen until a keyboard user tabs to it */
.skip-link {
  position: absolute;
  left: var(--space-s);
  top: -100px;
  background: var(--color-text);
  color: var(--color-white);
  padding: var(--space-xs) var(--space-s);
  border-radius: 6px;
  z-index: 100;
}
.skip-link:focus { top: var(--space-s); }


/* ---------- 4. Header ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;               /* on narrow phones, the nav drops under the name */
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-xs) var(--space-m);
  padding-block: var(--space-m);
}

.site-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  text-decoration: none;
}

.nav-list {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  text-decoration: none;
  /* underline drawn with a background so it can grow on hover */
  background: linear-gradient(var(--color-coral), var(--color-coral)) left bottom / 0% 1.5px no-repeat;
  padding-bottom: 2px;
  transition: color var(--dur) var(--ease-out), background-size var(--dur) var(--ease-out);
}

.nav-list a:hover {
  color: var(--color-text);
  background-size: 100% 1.5px;
}

/* Current page or section: navy text + full coral underline.
   [aria-current] matches both "page" (homepage) and "true" (project pages, inside Work) */
.nav-list a[aria-current] {
  color: var(--color-text);
  background-size: 100% 1.5px;
}


/* ---------- 5. Hero ---------- */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-l);
  /* Keeps the hero short: generous but never taller than about a third of the screen */
  padding-top: clamp(2rem, 7vh, 4.5rem);
  padding-bottom: clamp(1.75rem, 5vh, 3rem);
}

.hero-title {
  /* Fluid type: 2rem on phones, up to 3.4rem on large screens */
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 22ch;   /* "ch" ≈ width of one character, keeps lines a readable length */
  text-wrap: balance; /* evens out line lengths in browsers that support it */
}

.hero-sub {
  margin-top: var(--space-s);
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* --- Easter egg: "builds" selection frame --- */
.builds {
  position: relative;   /* the frame is positioned relative to this word */
  font-style: italic;
  white-space: nowrap;
}

.builds-frame {
  position: absolute;
  /* Fallback position only. main.js measures the actual letter shapes and
     overrides top/left/width/height so the frame is centered on the ink. */
  inset: 0 -0.12em;
  border: 1px solid var(--color-coral);
  opacity: 0;
  pointer-events: none;  /* the frame never blocks clicks */
  user-select: none;     /* the size label won't get copied with the text */
  transition: opacity 200ms var(--ease-out);
}

/* Shown on hover, or when tapped on a phone (JS adds .is-selected) */
.builds:hover .builds-frame,
.builds.is-selected .builds-frame {
  opacity: 1;
}

/* Little square handles in each corner, like a design tool */
.handle {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--color-white);
  border: 1px solid var(--color-coral);
}
.handle--tl { top: -4px;    left: -4px; }
.handle--tr { top: -4px;    right: -4px; }
.handle--bl { bottom: -4px; left: -4px; }
.handle--br { bottom: -4px; right: -4px; }

/* Size label under the frame, e.g. "128 × 46" — measured live by main.js */
.builds-size {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-coral-deep);
  color: var(--color-white);
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: 0.01em;
  padding: 4px 7px;
  border-radius: 4px;
  white-space: nowrap;
}


/* ---------- 6. Stickers ----------
   Briana's own illustrations, saved as PNGs with a white die-cut border.
   The tilt and shadow make them read as paper stuck to the page. */
.sticker {
  flex-shrink: 0;
  width: clamp(84px, 10vw, 120px);
  transform: rotate(-10deg);
  /* drop-shadow follows the sticker's outline (box-shadow would draw a square) */
  filter: drop-shadow(0 2px 3px rgba(30, 42, 71, 0.12)) drop-shadow(0 8px 14px rgba(30, 42, 71, 0.08));
}

.sticker img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;      /* the sticker (not the image) receives the drag */
  -webkit-user-drag: none;   /* stops the browser's own "drag a ghost image" behavior */
}

/* Pixel-art stickers: when the browser shrinks the image, keep hard square
   pixels instead of smoothing them into a blur */
.sticker--pixel img {
  image-rendering: pixelated;
}

/* Swap stickers: a second image sits exactly on top of the first and
   appears on hover and while the sticker is being carried */
.sticker--swap .sticker-alt {
  position: absolute;
  inset: 0;
  opacity: 0;               /* no fade: pixel art looks best switching instantly */
}
.sticker--swap:hover .sticker-alt,
.sticker--swap.is-dragging .sticker-alt {
  opacity: 1;
}

/* --- Movable stickers (main.js, section 9) --- */
.sticker {
  cursor: grab;              /* shown when the custom cursor is off */
  touch-action: none;        /* on phones, dragging a sticker moves it instead of scrolling */
  user-select: none;
  transition: transform 200ms var(--ease-out), filter 200ms var(--ease-out);
}

/* Hover: the shadow grows a little, like it's lifting off the page */
.sticker:hover {
  filter: drop-shadow(0 3px 4px rgba(30, 42, 71, 0.14)) drop-shadow(0 12px 20px rgba(30, 42, 71, 0.12));
}

/* Once a sticker has been moved, it belongs to the whole page */
.sticker.is-loose {
  position: absolute;
  z-index: 50;
}

/* While it's being carried: bigger shadow, and main.js scales it up slightly */
.sticker.is-dragging {
  cursor: grabbing;
  filter: drop-shadow(0 6px 8px rgba(30, 42, 71, 0.16)) drop-shadow(0 20px 32px rgba(30, 42, 71, 0.16));
}

/* Homepage: a small cluster of flower stickers, overlapping like
   stickers slapped onto a laptop. Each one gets its own size, spot and tilt. */
.sticker-cluster {
  position: relative;
  flex-shrink: 0;
  width: clamp(150px, 17vw, 220px);
  aspect-ratio: 1;
}
.sticker-cluster .sticker {
  position: absolute;
}
.sticker--pink {
  width: 56%;
  left: 6%;
  top: 30%;
  transform: rotate(-10deg);
  z-index: 2;                 /* on top of the others */
}
.sticker--blue {
  width: 40%;
  right: 4%;
  top: 4%;
  transform: rotate(14deg);
  z-index: 1;
}
.sticker--purple {
  width: 34%;
  right: 10%;
  bottom: 2%;
  transform: rotate(-24deg);
  z-index: 3;
}

/* Sticker on a case study page: tucked into the top-right of the intro */
.cs-intro {
  position: relative;
}
.cs-sticker {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(64px, 9vw, 104px);
  transform: rotate(10deg);   /* default tilt for case study stickers */
}

/* Per-sticker tilts — change the number to adjust */
.cs-sticker--lemon { transform: rotate(-30deg); }  /* tipped diagonally */
.cs-sticker--star  { transform: rotate(8deg); }   /* a smaller tilt keeps the pixel steps crisp */
.cs-sticker--shell { transform: rotate(-8deg); }

/* ---------- 7. Work section ---------- */
.work {
  padding-bottom: var(--space-xl);
}

.work:focus { outline: none; } /* it's only focused by the skip link */

/* --- Filter buttons --- */
.filters {
  display: flex;
  flex-wrap: wrap;            /* on phones, filters wrap instead of hiding off-screen */
  gap: var(--space-xs) clamp(1rem, 3vw, 1.75rem);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--color-line);
  margin-bottom: var(--space-l);
}

.filter {
  /* reset the browser's default button look */
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  padding: 0.25rem 0 0.2rem;
  /* same growing coral underline as the nav, for consistency */
  background-image: linear-gradient(var(--color-coral), var(--color-coral));
  background-position: left bottom;
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  transition: color var(--dur) var(--ease-out), background-size var(--dur) var(--ease-out);
}

.filter:hover {
  color: var(--color-text);
}

/* The selected filter. aria-pressed="true" is set by main.js — styling the
   accessibility attribute keeps what you SEE and what screen readers HEAR in sync. */
.filter[aria-pressed="true"] {
  color: var(--color-text);
  background-size: 100% 1.5px;
}

.filter-count {
  font-size: 0.7em;
  vertical-align: super;
  margin-left: 0.15em;
  color: var(--color-text-muted);
}

/* --- Project grid --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 equal columns */
  gap: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* When a filter leaves only one project, it spans the full width
   with a wider preview, so the page doesn't look half-empty */
.project-grid.is-single .project-card {
  grid-column: 1 / -1;
}
@media (min-width: 641px) {
  .project-grid.is-single .project-media {
    aspect-ratio: 5 / 2;
  }
}

/* Cards fade up gently when a filter shows them */
.project-card.is-entering {
  animation: card-in 400ms var(--ease-out) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* --- One project card --- */
.project-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.project-link:focus-visible {
  outline-offset: 6px;
  border-radius: 14px;
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;   /* every preview has the same shape, whatever the file size */
  border-radius: 12px;
  overflow: hidden;        /* clips the zoom on hover to the rounded corners */
  background: var(--tint-product);
}

/* Category tints (show while media loads, and around contained images) */
.project-media--product { background: var(--tint-product); }
.project-media--web     { background: var(--tint-web); }
.project-media--graphic { background: var(--tint-graphic); }

.project-media img,
.project-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;       /* fill the box, cropping edges if needed */
  transition: transform 600ms var(--ease-out);
}

/* For logos and artwork that shouldn't be cropped */
.project-media--contain img {
  object-fit: contain;
  padding: 9%;
}

/* Hover: the preview zooms in slightly */
.project-link:hover .project-media img,
.project-link:hover .project-media video,
.project-link:focus-visible .project-media img,
.project-link:focus-visible .project-media video {
  transform: scale(1.03);
}

.project-info {
  padding-top: 0.9rem;
}

.project-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: clamp(1.35rem, 1.1rem + 0.6vw, 1.6rem);
  line-height: 1.2;
}

.project-meta {
  margin-top: 0.25rem;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

/* The dot between category and role. aria-hidden in the HTML,
   so screen readers don't read "dot" out loud. */
.meta-sep {
  margin-inline: 0.6em;   /* space on both sides of the dot */
  color: var(--color-line-strong);
}

/* "In progress" label */
.status-pill {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  line-height: 1;
  color: var(--color-coral-deep);
  background: var(--tint-product);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
}


/* ---------- 8. Footer ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-m);
  padding-block: var(--space-m) var(--space-l);
  /* Divider line drawn as a background so it lines up with the content edges
     (a border would stretch into the side padding) */
  background: linear-gradient(var(--color-line), var(--color-line))
              top center / calc(100% - 2 * var(--page-pad)) 1px no-repeat;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-m);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--color-text);
}


/* ---------- 9. Custom cursor ----------
   Only active when main.js adds .has-custom-cursor to <html>
   (mouse/trackpad users). Touch devices keep normal behavior.
   main.js moves it with transform; translate(-50%, -50%) there keeps it
   centered on the pointer at every size. */
.has-custom-cursor,
.has-custom-cursor * {
  cursor: none;
}

/* Keep the normal text cursor inside form fields (added later on Contact) */
.has-custom-cursor input,
.has-custom-cursor textarea {
  cursor: text;
}

.cursor {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 999px;  /* a circle at 14×14, a pill when it gets wider */
  background: var(--color-text);
  border: 1.5px solid var(--color-text);
  pointer-events: none;  /* clicks go "through" the cursor to the page */
  z-index: 1000;
  overflow: hidden;
  transition: width 300ms var(--ease-out), height 300ms var(--ease-out),
              background-color var(--dur) var(--ease-out), opacity 150ms linear;
}

.has-custom-cursor .cursor {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Over links and buttons: grows into a hollow ring so you can still see what's under it */
.cursor.is-hovering {
  width: 36px;
  height: 36px;
  background-color: transparent;
}

/* Over a project card: stretches into a pill with a label.
   The width is set by main.js to fit the text. */
.cursor.is-pill {
  height: 36px;
  background-color: var(--color-text);
}

.cursor-label {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-white);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 60ms linear; /* hides quickly so text never peeks out of a shrinking pill */
}

.cursor.is-pill .cursor-label {
  opacity: 1;
  transition: opacity 150ms linear 120ms; /* text appears once the pill has started to open */
}

/* Hidden when the pointer leaves the window */
.cursor.is-hidden { opacity: 0; }


/* ---------- 10. Reduced motion ----------
   Respect people who've asked their device for less animation. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}


/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .project-grid {
    grid-template-columns: minmax(0, 1fr); /* one column on phones */
  }

  .hero {
    align-items: flex-start;
  }

  /* Smaller sticker cluster tucked to the side so the intro gets the width */
  .sticker-cluster {
    width: 92px;
    margin-top: -0.75rem;
  }
}


/* ---------- 11. Case study pages ---------- */

/* Two columns: sticky sidebar + content */
.cs-layout {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
  padding-top: clamp(1.5rem, 5vh, 3rem);
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5.5rem);
}

/* --- Sidebar --- */
.cs-sidebar {
  position: sticky;           /* stays in view while the content scrolls */
  top: 2rem;
  align-self: start;          /* needed for sticky to work inside a grid */
  max-height: calc(100vh - 4rem);
  overflow-y: auto;           /* scrolls on its own if a short screen can't fit it */
  font-size: 0.92rem;
}

.cs-back {
  display: inline-block;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-bottom: var(--space-l);
  transition: color var(--dur) var(--ease-out);
}
.cs-back:hover { color: var(--color-text); }

/* This project's sections, with a thin line on the left */
.cs-toc {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--color-line);
}

/* Each link is a "tab" attached to the gray line.
   On hover, the text turns the project color and a soft band of the
   project color slides out from the line behind it. */
.cs-toc a {
  display: block;
  width: fit-content;              /* the band ends just after the text */
  padding: 0.25rem 0.75rem 0.25rem 0.9rem;
  margin-left: -1px;               /* sits right on top of the gray line */
  border-left: 1.5px solid transparent;
  border-radius: 0 6px 6px 0;      /* rounded on the right, flat where it meets the line */
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  /* the band is a background that grows from 0% to 100% wide, starting at the line */
  background-image: linear-gradient(var(--project-highlight), var(--project-highlight));
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 0% 100%;
  transition: color var(--dur) var(--ease-out),
              background-size 300ms var(--ease-out),
              border-color var(--dur) var(--ease-out);
}

.cs-toc a:hover,
.cs-toc a:focus-visible {
  color: var(--project-accent-text);
  background-size: 100% 100%;
}

/* The section you're currently reading (set by main.js):
   band stays out, and the line beside it turns the project color */
.cs-toc a.is-active {
  color: var(--project-accent-text);
  background-size: 100% 100%;
  border-left-color: var(--project-accent);
}

/* Small gap between links so the bands don't touch */
.cs-toc li + li { margin-top: 2px; }

/* --- Content column --- */
.cs-content {
  min-width: 0;
  max-width: 780px;
  padding-bottom: var(--space-xl);
}

/* Intro */
.cs-kicker {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.cs-title {
  font-size: clamp(2.6rem, 1.8rem + 3vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 0.3rem;
}

.cs-lede {
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.5;
  margin-top: var(--space-m);
  max-width: 40ch;
}

.cs-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-s) var(--space-m);
  margin: var(--space-l) 0 0;
  padding-top: var(--space-m);
  border-top: 1px solid var(--color-line);
}
.cs-facts dt {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.cs-facts dd {
  margin: 0.15rem 0 0;
}

/* Hero video */
.cs-hero-media {
  position: relative;
  background: var(--project-tint);
  margin: var(--space-l) 0 0;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
}
.cs-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Small Pause/Play button on autoplaying videos */
.video-toggle {
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  appearance: none;
  border: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-white);
  background: rgba(30, 42, 71, 0.82); /* navy, slightly see-through */
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}
.video-toggle:hover { background: var(--color-text); }

/* Sections */
.cs-section {
  margin-top: clamp(4rem, 9vw, 6.5rem);
  scroll-margin-top: 2rem;  /* leaves breathing room when jumping here from the sidebar */
}

.cs-number {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--project-accent-text);
  letter-spacing: 0.04em;
}

.cs-heading {
  font-size: clamp(1.9rem, 1.5rem + 1.2vw, 2.5rem);
  line-height: 1.1;
  margin-top: 0.2rem;
}

/* A big serif sentence: the problem, the "how might we" question */
.cs-statement {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem);
  line-height: 1.35;
  margin-top: var(--space-m);
  max-width: 34ch;
}

/* Body text: comfortable reading width */
.cs-text {
  max-width: 62ch;
  margin-top: var(--space-s);
}
.cs-text p + p { margin-top: var(--space-s); }

.cs-list {
  max-width: 62ch;
  margin: var(--space-m) 0 0;
  padding-left: 1.2rem;
}
.cs-list li + li { margin-top: 0.6rem; }
.cs-list li::marker { color: var(--project-accent); }

.cs-subheading {
  font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.7rem);
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

/* Small label, e.g. "Core research insights" */
.cs-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: var(--space-l) 0 0;
}

/* Research insights: numbered with big coral serif numbers */
.cs-insights {
  list-style: none;
  counter-reset: insight;       /* CSS counters number the items automatically */
  margin: var(--space-s) 0 0;
  padding: 0;
}
.cs-insights li {
  counter-increment: insight;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: var(--space-s);
  padding: var(--space-m) 0;
  border-top: 1px solid var(--color-line);
}
.cs-insights li:last-child { border-bottom: 1px solid var(--color-line); }
.cs-insights li::before {
  content: counter(insight);
  grid-row: span 2;
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1;
  color: var(--project-accent);
}
.cs-insight-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0;
}
.cs-insights p {
  margin-top: 0.4rem;
  max-width: 60ch;
  color: var(--color-text);
}

/* Design decisions */
.cs-decision { margin-top: var(--space-l); }
.cs-decision-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.3rem;
  margin: 0;
}
.cs-decision .cs-text { margin-top: 0.5rem; }

/* --- Figures (images) --- */
.cs-figure {
  margin: var(--space-m) 0 0;
}

.cs-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--color-line);
}

.cs-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* "Mat": screens laid on a tinted background, like prints on paper */
.cs-figure--mat {
  display: flex;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--project-tint);
  border-radius: 12px;
}
.cs-figure--mat img {
  width: 100%;
  height: auto;             /* with width/height in the HTML, the browser reserves the space before loading */
  border: 0;
  border-radius: 0;         /* the screens bring their own rounded corners */
  /* drop-shadow (unlike box-shadow) follows the image's actual shape,
     so the shadow curves around the transparent corners */
  filter: drop-shadow(0 1px 1px rgba(30, 42, 71, 0.08)) drop-shadow(0 8px 18px rgba(30, 42, 71, 0.08));
}

/* Screens on a mat are sized by WIDTH (not height), so nothing jumps while loading */
.cs-figure--mat .zoom { width: min(100%, 600px); }

/* Portrait screens (like a single phone page) stay narrower */
.cs-figure--narrow .zoom { width: min(100%, 380px); }

/* Two screens side by side */
.cs-figure--pair {
  gap: clamp(1rem, 4vw, 2.5rem);
  align-items: flex-start;
}
.cs-figure--pair figure {
  flex: 0 1 260px;
  margin: 0;
  text-align: center;
}
.cs-figure--pair .zoom { width: 100%; }

/* Tall images (like a storyboard) stay narrower and centered */
.cs-figure--medium {
  max-width: 560px;
  margin-inline: auto;
}

/* Images with a transparent background: no outline or rounded corners,
   so the page shows through (also applies in the zoom view) */
.cs-figure--plain img {
  border: 0;
  border-radius: 0;
}
.lightbox-img.is-plain {
  box-shadow: none;
  border-radius: 0;
}

/* A video inside the case study (with the browser's own controls) */
.cs-figure-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: var(--project-tint);
}

/* --- Visual (graphic design) pages --- */

/* Showcase: the main artwork, large, on a tinted panel (used instead of a hero video) */
.cs-showcase {
  margin: var(--space-l) 0 0;
  padding: clamp(2rem, 6vw, 4.5rem) var(--space-m);
  background: var(--project-tint);
  border-radius: 12px;
  display: flex;
  justify-content: center;
}
.cs-showcase img {
  display: block;
  width: min(100%, 300px);  /* sized by width so the space is reserved before it loads */
  height: auto;
}

/* Same yellow as the graphic design cards on the homepage */
.cs-showcase--graphic {
  background: var(--tint-graphic);
}

/* Gallery: several versions side by side on white cards (e.g. logo variations) */
.cs-gallery {
  list-style: none;
  margin: var(--space-m) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 1.25rem);
}
.cs-gallery figure { margin: 0; }
.cs-gallery .zoom {
  aspect-ratio: 1;           /* every card is a square, whatever the logo's shape */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14%;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: 12px;
}
.cs-gallery img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}
.cs-gallery figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Cover art: large and square, with a soft shadow like a printed album cover */
.cs-figure--cover {
  max-width: 520px;
  margin-inline: auto;
}
.cs-figure--cover img {
  border: 0;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(30, 42, 71, 0.1), 0 16px 40px rgba(30, 42, 71, 0.16);
}

/* Button-style link, e.g. "Play the game" (filled with the project color) */
.cs-actions {
  margin-top: var(--space-m);
}
.cs-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  background: var(--project-accent-text);  /* dark enough for white text */
  color: var(--color-white);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.cs-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 42, 71, 0.16);
}
.cs-button span[aria-hidden] {
  transition: transform var(--dur) var(--ease-out);
}
.cs-button:hover span[aria-hidden] {
  transform: translate(2px, -2px); /* the ↗ arrow nudges toward where it's going */
}

/* Tinted note box, e.g. "redesign in progress" */
.cs-callout {
  max-width: 62ch;
  margin-top: var(--space-m);
  padding: var(--space-m) clamp(1.25rem, 3vw, 2rem);
  background: var(--project-tint);
  border-radius: 12px;
}
/* A status pill on its own line under a subheading */
.cs-subheading + p > .status-pill {
  display: inline-block;
  margin-top: var(--space-s);
}

/* On case study pages, status pills take the project's color instead of coral */
.cs-content .status-pill {
  color: var(--project-accent-text);
  background: var(--project-highlight);
}
.cs-callout > p + p { margin-top: 0.5rem; }
.cs-callout .cs-actions { margin-top: 0.75rem; }

.cs-callout .status-pill {
  display: inline-block;
  margin-bottom: 0.75rem;
  background: var(--color-white); /* stands out on the tinted box */
}

/* The clickable wrapper around zoomable images */
.zoom {
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;            /* shown when the custom cursor is off */
}
.zoom:focus-visible {
  outline-offset: 4px;
  border-radius: 10px;
}

/* --- Next project --- */
.cs-next {
  margin-top: clamp(4rem, 9vw, 6.5rem);
  padding-top: var(--space-l);
  border-top: 1px solid var(--color-line);
}
.cs-next-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.cs-next-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 1.5rem + 1.5vw, 2.75rem);
  text-decoration: none;
}
.cs-next-link span {
  display: inline-block;
  transition: transform var(--dur) var(--ease-out);
}
.cs-next-link:hover span { transform: translateX(6px); }

/* --- Project color themes ---
   Add a theme class to a project page's <body> to give it its own supporting color.
   Keep each set contrast-safe: accent 3:1+, accent-text 4.5:1+ on the background. */
.theme-green {
  --project-accent: #3F8A55;
  --project-accent-text: #2C6E45;  /* readable on the background AND on the highlight band */
  --project-tint: #E6F1E8;
  --project-highlight: #DCEEE1;
}

.theme-blue {
  --project-accent: #3E7FC1;
  --project-accent-text: #255F99;  /* readable on the background AND on the highlight band */
  --project-tint: #E6F0FA;
  --project-highlight: #DDEBF8;
}

.theme-burgundy {
  --project-accent: #B8404F;
  --project-accent-text: #8E2436;  /* readable on the background, the band, and under white text */
  --project-tint: #FBEDEF;
  --project-highlight: #F6DFE2;
}

.theme-teal {
  --project-accent: #2A9690;
  --project-accent-text: #1D6F69;  /* readable on the background, the band, and under white text */
  --project-tint: #E4F4F2;
  --project-highlight: #D9EFEC;
}

/* --- Case study on tablets and phones --- */
@media (max-width: 900px) {
  .cs-layout {
    grid-template-columns: minmax(0, 1fr); /* one column */
    gap: 0;
  }

  /* The sidebar shrinks to just the "All work" link; the sections flow below it */
  .cs-sidebar {
    position: static;
    max-height: none;
  }
  .cs-sidebar nav { display: none; }
  .cs-back { margin-bottom: var(--space-m); }
}

/* Logo gallery: 2 per row on phones */
@media (max-width: 640px) {
  .cs-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* an odd one out at the end spans the full row, with a wider card */
  .cs-gallery li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .cs-gallery li:last-child:nth-child(odd) .zoom { aspect-ratio: 2 / 1; padding: 8%; }
}

/* On phones the two screens stay side by side (the comparison is the point);
   they get smaller, and a tap opens each one full size */
@media (max-width: 640px) {
  /* On phones the title fills the width, so the sticker moves up beside "All work" */
  .cs-sticker { width: 50px; top: -3.4rem; }
  .cs-figure--pair { gap: 0.75rem; }
  .cs-figure--pair figure { flex: 1 1 0; }
}


/* ---------- 12. Lightbox (zoomed images) ----------
   Uses the built-in <dialog> element: it traps keyboard focus inside,
   closes with Esc, and hides the page from screen readers while open. */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.lightbox::backdrop {
  /* solid paper (same as --color-bg), so transparent images don't show the page behind.
     Written as a hex code because some browsers don't pass variables into ::backdrop */
  background: #FBF8F3;
}

.lightbox-inner {
  width: 100%;
  height: 100%;
  overflow: auto;              /* wide diagrams (like the user flow) scroll sideways */
  display: flex;
  padding: 4.5rem 2rem 2rem;
}

.lightbox-img {
  display: block;
  margin: auto;                /* centers it when it fits */
  max-height: calc(100vh - 6.5rem);
  max-width: 100%;             /* normal images fit the screen */
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(30, 42, 71, 0.08), 0 16px 48px rgba(30, 42, 71, 0.12);
}

.lightbox-video {
  display: block;
  margin: auto;
  max-width: 100%;
  max-height: calc(100vh - 6.5rem);
  border-radius: 8px;
  background: #000;
}

/* Very wide images (main.js adds this) keep their height and scroll sideways,
   so diagrams like the user flow stay readable */
.lightbox-img.is-wide {
  max-width: none;
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  appearance: none;
  border: 1px solid var(--color-line);
  background: var(--color-white);
  color: var(--color-text);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}
.lightbox-close:hover { border-color: var(--color-text); }

@media (max-width: 640px) {
  .lightbox-inner { padding: 4rem 1rem 1rem; }
}


/* ---------- 13. Play page ---------- */
.play {
  padding-bottom: var(--space-xl);
}

.play-intro {
  position: relative;
  padding-top: clamp(2rem, 7vh, 4.5rem);
  padding-bottom: clamp(1.5rem, 4vh, 2.5rem);
}

.play-title {
  font-size: clamp(2.6rem, 1.8rem + 3vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.play-sub {
  margin-top: 0.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
  color: var(--color-text-muted);
}

.play-section {
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.play-heading {
  font-size: clamp(1.5rem, 1.25rem + 0.8vw, 1.9rem);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-line);
  margin-bottom: var(--space-m);
}

/* Videos: two across */
.play-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}

/* Images: masonry, using CSS columns. Each piece keeps its own shape,
   and pieces flow down one column, then the next. */
.play-masonry {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 3 260px;            /* up to 3 columns, each at least 260px wide */
  column-gap: clamp(1rem, 2.5vw, 1.75rem);
}
.play-masonry .play-item {
  break-inside: avoid;         /* never split one piece across two columns */
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

/* The clickable media: rounded, with a gentle zoom on hover */
.play-item .zoom {
  overflow: hidden;
  border-radius: 10px;
  background: var(--color-line);  /* placeholder color while loading */
}
.play-item img,
.play-item video {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 600ms var(--ease-out);
}
.play-grid--videos video {
  aspect-ratio: 2630 / 1608;   /* the recordings' shape, so space is reserved */
  object-fit: cover;
}
.play-item .zoom:hover img,
.play-item .zoom:hover video,
.play-item .zoom:focus-visible img,
.play-item .zoom:focus-visible video {
  transform: scale(1.025);
}

.play-caption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.play-name {
  color: var(--color-text);
}

@media (max-width: 640px) {
  .play-grid { grid-template-columns: minmax(0, 1fr); }
}

/* --- Sticker sheet --- */
/* A white backing sheet, like a real sheet of stickers */
.sticker-sheet {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.25rem, 4vw, 2.75rem);
  max-width: 540px;                 /* fits 3 per row */
  margin-inline: auto;
  padding: clamp(1.75rem, 5vw, 3rem);
  background: var(--color-white);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(30, 42, 71, 0.06), 0 10px 30px rgba(30, 42, 71, 0.08);
}

/* Each spot on the sheet: the sticker sits on top of its own faint outline */
.sheet-slot {
  position: relative;
  width: clamp(76px, 13vw, 112px);
  aspect-ratio: 1;
}

.sheet-slot .sticker,
.sheet-ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(var(--tilt, 0deg));
}

/* Every sticker fits inside its square spot, whatever its shape (the lemon is tall) */
.sheet-slot .sticker img,
.sheet-ghost {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* The empty spot left behind: the sticker's shape as a pale gray silhouette */
.sheet-ghost {
  filter: brightness(0) opacity(0.07);
  pointer-events: none;
}
.sheet-ghost--pixel { image-rendering: pixelated; }


/* ---------- 14. About page ---------- */
.about {
  padding-bottom: var(--space-xl);
}

/* Intro: text on the left, Polaroid on the right */
.about-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-l);
  padding-top: clamp(2rem, 7vh, 4.5rem);
}

.about-title {
  font-size: clamp(2.6rem, 1.8rem + 3vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.about-lede {
  margin-top: var(--space-m);
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem);
  line-height: 1.35;
  max-width: 26ch;
}

.about-section {
  margin-top: clamp(4rem, 9vw, 6rem);
  scroll-margin-top: 2rem;
}

.about-heading {
  font-size: clamp(1.7rem, 1.4rem + 1vw, 2.2rem);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-line);
  margin-bottom: var(--space-m);
}

.about-subheading {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  margin: var(--space-l) 0 var(--space-s);
}
.about-heading + .about-subheading,
.skill-group .about-subheading { margin-top: 0; }  /* both skill groups start at the same height */

.about-text { max-width: 62ch; }
.about-text p + p { margin-top: var(--space-s); }

/* --- Polaroid (flips over when pressed) --- */
.polaroid {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: clamp(200px, 24vw, 280px);
  perspective: 1200px;                 /* gives the flip its 3D depth */
  transform: rotate(4deg);
  transition: transform var(--dur) var(--ease-out);
}
.polaroid:hover { transform: rotate(2deg) translateY(-3px); }

.polaroid-inner {
  display: grid;                       /* both faces sit in the same grid cell */
  transition: transform 700ms var(--ease-out);
  transform-style: preserve-3d;
}
/* Flips on hover, on keyboard focus, and on tap (phones, via aria-pressed) */
.polaroid:hover .polaroid-inner,
.polaroid:focus-visible .polaroid-inner,
.polaroid[aria-pressed="true"] .polaroid-inner {
  transform: rotateY(180deg);
}

.polaroid-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  padding: 7% 7% 24%;               /* the thick bottom edge of a Polaroid */
  border-radius: 3px;
  backface-visibility: hidden;         /* hide each side while it faces away */
  -webkit-backface-visibility: hidden;
  box-shadow: 0 1px 2px rgba(30, 42, 71, 0.08), 0 12px 30px rgba(30, 42, 71, 0.12);
}

.polaroid-front img {
  display: block;
  width: 100%;
  height: auto;             /* let aspect-ratio decide the height, not the HTML attribute */
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* The back: a little note, like writing on the back of a photo */
.polaroid-back {
  transform: rotateY(180deg);
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 12%;
  background: #FFFDF8;
  gap: 0.75rem;
}
.polaroid-note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.4;
}
.polaroid-sign {
  font-family: var(--font-serif);
  color: var(--color-coral-deep);
}

/* --- Off the clock: a scattered row of photos --- */
.photo-row {
  list-style: none;
  margin: var(--space-l) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  row-gap: 1.5rem;
}

.photo {
  width: clamp(112px, 10vw, 142px);
  margin-inline: -0.35rem;      /* photos overlap a little, like a pile on a table */
  transform: rotate(var(--tilt, 0deg));
  filter: drop-shadow(0 2px 3px rgba(30, 42, 71, 0.1)) drop-shadow(0 10px 18px rgba(30, 42, 71, 0.1));
  transition: transform var(--dur) var(--ease-out);
}
/* Hover: the photo straightens and lifts a little, like picking it up */
/* Hover (while still in the row): the photo straightens and lifts a little.
   Once it's been moved, main.js controls its tilt instead. */
.photo:not(.is-loose):hover {
  transform: rotate(0deg) translateY(-4px) scale(1.06);
  position: relative;
  z-index: 2;                   /* the hovered photo comes to the top of the pile */
}

.photo-slot { list-style: none; }

/* On phones the photos fill most of the screen, so a straight up/down swipe
   still scrolls the page; a sideways drag picks a photo up */
@media (pointer: coarse) {
  .photo.sticker { touch-action: pan-y; }
}
.photo img {
  display: block;
  width: 100%;
  height: auto;
}

/* Landscape scans are wider */
.photo--wide { width: clamp(165px, 14.5vw, 205px); }

/* Regular photos get a white instant-film frame so they match the scans */
.photo--framed {
  background: var(--color-white);
  /* fixed padding: a % here would be measured against the whole row, not the photo */
  padding: 0.6rem 0.6rem 2rem;
  border-radius: 3px;
}
.photo--framed img {
  height: auto;             /* let aspect-ratio decide the height, not the HTML attribute */
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* --- Skills --- */
.skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-l);
}
.tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tag-list li {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: var(--color-white);
  font-size: 0.92rem;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

/* Hover: each tag lights up in one of the site colors (coral, blue, yellow, pink),
   repeating in that order, and lifts a little with a small tilt */
.tag-list li:nth-child(4n+1) { --tag-tint: #FBE6DD; --tag-text: #A63C1B; --tag-line: #F1B9A4; }
.tag-list li:nth-child(4n+2) { --tag-tint: #E3EEF9; --tag-text: #255F99; --tag-line: #AFCBEB; }
.tag-list li:nth-child(4n+3) { --tag-tint: #FBF0CC; --tag-text: #7A5800; --tag-line: #EED38A; }
.tag-list li:nth-child(4n+4) { --tag-tint: #FBE4EC; --tag-text: #9C2E5A; --tag-line: #F0B5C9; }

.tag-list li:hover {
  background: var(--tag-tint);
  color: var(--tag-text);
  border-color: var(--tag-line);
  transform: translateY(-2px) rotate(-2deg);
}
.tag-list li:nth-child(even):hover { transform: translateY(-2px) rotate(2deg); }

/* --- Resume ---
   Each group gets its own color from the site palette:
   work = coral, education = blue, extracurriculars = yellow.
   --group-tint is the hover background, --group-accent the marker,
   --group-text the readable colored text. */
.resume-group--work      { --group-tint: #FBE6DD; --group-accent: #D85A30; --group-text: #A63C1B; }
.resume-group--education { --group-tint: #E3EEF9; --group-accent: #3E7FC1; --group-text: #255F99; }
.resume-group--extra     { --group-tint: #FBF0CC; --group-accent: #E0B23A; --group-text: #7A5800; }

.resume-group + .resume-group {
  margin-top: clamp(3rem, 7vw, 4.5rem);
}

/* Group label: small text in the group's color */
.resume-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--group-text);
  margin: 0 0 var(--space-xs);
}

.resume-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

/* Each entry is a soft card that fills with the group's color on hover.
   Negative margin + padding keeps the text lined up with the rest of the page. */
.resume-item {
  position: relative;
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);  /* dates | details */
  gap: var(--space-m);
  padding: var(--space-m) 1.25rem;
  margin-inline: -1.25rem;
  border-radius: 14px;
  /* the tint grows in from the left, like the sidebar on project pages */
  background-image: linear-gradient(var(--group-tint), var(--group-tint));
  background-repeat: no-repeat;
  background-size: 0% 100%;
  transition: background-size 400ms var(--ease-out);
}

/* A short colored marker on the left that grows on hover */
.resume-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--space-m);
  width: 3px;
  height: 1.5rem;
  border-radius: 3px;
  background: var(--group-accent);
  transition: height 400ms var(--ease-out);
}

.resume-item:hover {
  background-size: 100% 100%;
}
.resume-item:hover::before {
  height: calc(100% - 2 * var(--space-m));
}

.resume-date {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  padding-top: 0.25rem;
}
.resume-role {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.35rem;
  margin: 0;
  transition: transform var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.resume-item:hover .resume-role {
  transform: translateX(4px);
  color: var(--group-text);
}
.resume-org {
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}
.resume-desc {
  margin-top: 0.6rem;
  max-width: 62ch;
}

/* "Present" roles get a small dot that gently pulses: happening now */
.now-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 0.5rem;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--group-accent);
  box-shadow: 0 0 0 0 var(--group-accent);
  animation: now-pulse 2.4s ease-out infinite;
}
@keyframes now-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--group-accent) 50%, transparent); }
  70%  { box-shadow: 0 0 0 7px color-mix(in srgb, var(--group-accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- Contact --- */
.contact-links {
  list-style: none;
  margin: var(--space-m) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s) var(--space-l);
}
.contact-link {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
  text-decoration: none;
  /* same growing coral underline as the nav */
  background: linear-gradient(var(--color-coral), var(--color-coral)) left bottom / 100% 1.5px no-repeat;
  padding-bottom: 2px;
  transition: background-size var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.contact-link:hover { color: var(--color-coral-deep); }

/* --- About on tablets and phones --- */
@media (max-width: 760px) {
  .about-intro {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }
  .about-lede { margin-inline: auto; }
  .skills { grid-template-columns: minmax(0, 1fr); }
  .resume-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
    padding-inline: 0.85rem;     /* keeps the colored marker off the screen edge */
    margin-inline: -0.85rem;
  }
}
