/* SkullSeed case studies: the shared layout every page in /work/ uses.
   A page links ../../css/skullseed.css (tokens, fonts, buttons), then this file, and sets its own
   --accent (the project's color) on <html>. The parts, top to bottom:
     .cs-top      running head
     .cs-hero     kicker, title, lede, .cs-meta (client, disciplines, tools) and a hero picture
                  (.cs-hero-art, or .cs-hero-stack for three pieces fanned like cards)
     .cs-feature  the main piece (picture, video, or a 3D model behind a button)
     .cs-section  numbered sections; .cs-gallery for pictures (two to a row, --3 for three),
                  .cs-notes for text and a .cs-quote, .cs-figures for captioned close-ups,
                  .cs-steps for deliverables (text beside a screenshot), .cs-points for short
                  cards of text, .cs-stats for big numbers, .cs-icons, .cs-photos for snapshots
     .cs-divider  a dark band that sets off extra material
   Animations (.cs-anim) show a still frame until on screen, and have a Pause button.
   Pictures that enlarge are links with data-zoom (case-study.js opens them in .cs-lightbox). */

:root { --accent: #F28C6B; --measure: 64ch; }

html { background: var(--cream); }
body { background: var(--cream); }
img, video { display: block; max-width: 100%; height: auto; }
button, a { cursor: var(--cursor); }

.cs-wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* ---------- Running head ---------- */

.cs-top {
  border-bottom: var(--border);
  background: var(--cream);
  font-size: 13px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cs-top .cs-wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.cs-top span:last-child { opacity: 0.7; }
@media (max-width: 520px) { .cs-top span:last-child { display: none; } }

/* ---------- Hero ---------- */

.cs-hero {
  background: var(--accent);
  border-bottom: var(--border);
  padding: clamp(28px, 6vw, 64px) 0;
  overflow: hidden; /* the fanned cards may reach past a phone's edge */
}
.cs-hero .cs-wrap { display: grid; gap: clamp(28px, 5vw, 56px); align-items: center; }
@media (min-width: 760px) {
  .cs-hero .cs-wrap { grid-template-columns: 1.1fr 1fr; }
}
.cs-kicker {
  display: inline-block;
  margin: 0 0 14px;
  padding: 2px 10px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  font-size: 13px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cs-title { font-size: clamp(34px, 6vw, 58px); line-height: 1.02; letter-spacing: -0.01em; margin: 0 0 18px; }
.cs-lede { font-size: clamp(17px, 2vw, 19px); max-width: 40ch; margin: 0 0 26px; }

.cs-meta { display: grid; gap: 14px; margin: 0; }
@media (min-width: 520px) {
  .cs-meta { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .cs-meta:has(> div:nth-child(4)) { grid-template-columns: repeat(2, 1fr); }
}
.cs-meta div { border-top: var(--border); padding-top: 8px; }
.cs-meta dt { font-size: 12px; font-weight: var(--weight-bold); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.cs-meta dd { margin: 2px 0 0; font-weight: var(--weight-bold); line-height: 1.35; }

.cs-hero-art {
  margin: 0;
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-window);
  overflow: hidden;
  transform: rotate(1.5deg);
}
.cs-hero-art img { width: 100%; }

/* Three pieces fanned out like a hand of cards; the last one sits in front */
.cs-hero-stack { position: relative; margin: 0; aspect-ratio: 1 / 1; max-width: 460px; width: 100%; justify-self: center; }
.cs-hero-stack img {
  position: absolute;
  top: 50%; left: 50%;
  width: 56%;
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-icon);
  box-shadow: var(--shadow-small);
  transform: translate(-50%, -50%) translateX(var(--x, 0)) rotate(var(--r, 0deg));
}
.cs-hero-stack img:nth-child(1) { --x: -42%; --r: -9deg; }
.cs-hero-stack img:nth-child(2) { --x: 42%; --r: 8deg; }
.cs-hero-stack img:nth-child(3) { --r: -1.5deg; box-shadow: var(--shadow-window); }
@media (max-width: 520px) { .cs-hero-stack { width: 86%; } }

/* ---------- Frames: a picture or video drawn as a tiny window ---------- */

.cs-frame {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-window);
  overflow: hidden;
}
.cs-frame-bar { display: flex; gap: 6px; padding: 8px 10px; border-bottom: var(--border); }
.cs-frame-bar i { width: 11px; height: 11px; border: 2px solid var(--ink); border-radius: 50%; }
.cs-frame-bar span { margin-left: auto; font-size: 13px; font-weight: var(--weight-bold); line-height: 11px; }

/* ---------- Feature ---------- */

.cs-feature { padding: clamp(36px, 6vw, 64px) 0 0; }
.cs-stage { position: relative; aspect-ratio: 2286 / 1600; background: var(--accent); }
.cs-stage video,
.cs-stage spline-viewer { display: block; width: 100%; height: 100%; object-fit: cover; }
.cs-stage [hidden] { display: none; }
.cs-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.cs-controls .btn { background-color: var(--cream); }
.cs-controls .btn-primary { background-color: var(--ink); }
.cs-caption { margin: 0 0 0 auto; font-size: 14px; opacity: 0.8; }
html:not(.js) .cs-controls .btn,
.cs-controls [hidden] { display: none; }

/* ---------- Sections ---------- */

.cs-section { padding: clamp(44px, 7vw, 80px) 0 0; }
.cs-section:last-child { padding-bottom: clamp(56px, 8vw, 96px); }
.cs-section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 24px; }
.cs-num {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border: var(--border);
  border-radius: 50%;
  background: var(--accent);
  font-size: 14px;
  font-weight: var(--weight-bold);
  transform: translateY(-3px);
}
.cs-section-head h2 { font-size: clamp(24px, 3.4vw, 32px); margin: 0; }
.cs-section-head p { margin: 0; opacity: 0.75; }
.cs-intro { max-width: var(--measure); font-size: 17px; margin: 0 0 clamp(28px, 4vw, 40px); }

/* Gallery: pictures with a short label and note under each, two to a row */
.cs-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 560px) {
  .cs-gallery { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}
@media (min-width: 820px) {
  .cs-gallery--3 { grid-template-columns: repeat(3, 1fr); gap: 26px; }
}
.cs-card {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-icon);
  box-shadow: var(--shadow-small);
  overflow: hidden;
}
.cs-zoom { display: block; position: relative; border-bottom: var(--border); overflow: hidden; }
.cs-zoom img { width: 100%; transition: transform 0.25s; }
.cs-zoom:hover img { transform: scale(1.04); }
.cs-zoom:focus-visible { outline-offset: -6px; }
.cs-zoom::after {
  /* a magnifier badge, so it reads as "click to enlarge" */
  content: "";
  position: absolute;
  right: 8px; bottom: 8px;
  width: 30px; height: 30px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232B2A28' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='5.5'/%3E%3Cpath d='M15 15l4.5 4.5'/%3E%3C/svg%3E") center / 18px no-repeat;
  opacity: 0;
  transition: opacity 0.15s;
}
.cs-zoom:hover::after, .cs-zoom:focus-visible::after { opacity: 1; }
.cs-card-text { padding: 12px 14px 16px; }
.cs-card-label {
  display: inline-block;
  margin-bottom: 6px;
  padding: 0 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 12px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cs-card h3 { font-size: 19px; margin: 0 0 4px; }
.cs-card p { font-size: 15px; line-height: 1.5; margin: 0; }

/* Notes: running text beside a pull quote */
.cs-notes { display: grid; gap: 32px; align-items: start; }
@media (min-width: 760px) {
  .cs-notes { grid-template-columns: 1fr 1fr; gap: 48px; }
}
.cs-notes p { max-width: var(--measure); }
.cs-quote {
  position: relative;
  margin: 8px 0 0;
  padding: 34px 26px 24px;
  background: var(--accent);
  border: var(--border);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-window);
  transform: rotate(-1deg);
}
.cs-quote::before {
  content: "\201C";
  position: absolute;
  top: -26px; left: 18px;
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--cream);
  border-radius: 50%;
  font-size: 44px;
  font-weight: var(--weight-bold);
  line-height: 1;
  padding-top: 16px;
}
.cs-quote p { font-size: 17px; line-height: 1.6; margin: 0; }

/* Figures: captioned close-ups, two to a row; --wide spans the row, --band crops to a strip */
.cs-figures { display: grid; gap: 26px; margin-top: clamp(32px, 5vw, 48px); }
@media (min-width: 560px) {
  .cs-figures { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .cs-figure--wide { grid-column: 1 / -1; }
}
.cs-figure { margin: 0; }
.cs-figure img {
  width: 100%;
  border: var(--border);
  border-radius: var(--radius-icon);
  box-shadow: var(--shadow-small);
}
/* --band crops a mostly empty picture to a strip through its middle */
.cs-figure--band img { aspect-ratio: 3 / 1; object-fit: cover; }
.cs-figure figcaption { margin-top: 12px; font-size: 15px; line-height: 1.5; }
.cs-figure figcaption strong { display: block; font-weight: var(--weight-bold); }

/* Animations: a still frame with a round Pause/Play button in the corner, matching the magnifier badge */
.cs-anim-media { position: relative; }
/* Side by side, animations share one frame shape so their captions line up */
.cs-figures .cs-anim:not(.cs-figure--wide) img { aspect-ratio: 1000 / 710; object-fit: contain; background: #fff; }
.cs-figures .cs-anim.cs-figure--wide img { padding: 14px clamp(16px, 4%, 40px); background: #fff; }
.cs-anim-toggle {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  right: 8px; bottom: 8px;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 50%;
  cursor: var(--cursor);
}
.cs-anim-toggle svg { width: 14px; height: 14px; fill: currentColor; }
.cs-anim-toggle:hover { background: var(--ink); color: var(--cream); }
.cs-anim-toggle:active { transform: translate(1px, 1px); }
.cs-anim-toggle:focus-visible { outline-offset: 2px; }
html:not(.js) .cs-anim-toggle { display: none; }

/* Steps: a deliverable's text beside its screenshot; the text stays in view as you scroll */
.cs-steps { display: grid; gap: clamp(44px, 7vw, 72px); margin: 0; padding: 0; list-style: none; }
.cs-step { display: grid; gap: 22px; align-items: start; }
@media (min-width: 860px) {
  .cs-step { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; }
  .cs-step-text { position: sticky; top: 24px; }
}
.cs-step-text h3 { font-size: 22px; margin: 0 0 8px; }
.cs-step-text p { font-size: 16px; }
.cs-step .cs-num { margin-bottom: 12px; transform: none; }
.cs-step .cs-frame .cs-zoom { border-bottom: 0; }
.cs-step .cs-figures { margin-top: 32px; }
.cs-figure .cs-card-label { margin-bottom: 4px; }

/* Points: short cards of text */
.cs-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-point {
  padding: 18px 20px 20px;
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-icon);
  box-shadow: var(--shadow-small);
}
.cs-point h3 { font-size: 18px; line-height: 1.35; margin: 4px 0 10px; }
.cs-point p { font-size: 15px; line-height: 1.55; margin: 0; }

/* Stats: big numbers, two to a row */
.cs-stats { display: grid; gap: 26px; margin: clamp(32px, 5vw, 48px) 0 0; padding: 0; list-style: none; }
@media (min-width: 560px) {
  .cs-stats { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}
.cs-stat {
  padding: 18px 22px 22px;
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-icon);
  box-shadow: var(--shadow-small);
}
.cs-stat-num { display: inline-block; padding: 0 4px; margin-left: -4px; background: linear-gradient(transparent 58%, var(--accent) 58%); font-size: clamp(48px, 7vw, 68px); font-weight: var(--weight-bold); line-height: 1; letter-spacing: -0.02em; }
.cs-stat h3 { font-size: 18px; margin: 10px 0 6px; }
.cs-stat p { font-size: 15px; line-height: 1.55; margin: 0; }

/* Who said a quote */
.cs-quote footer { margin-top: 14px; font-size: 15px; line-height: 1.4; }
.cs-quote footer strong { display: block; font-weight: var(--weight-bold); }

/* Icons: a row of icons, each on its own white tile */
.cs-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  margin: clamp(28px, 4vw, 40px) 0 0;
  padding: 0;
  list-style: none;
}
.cs-icons li {
  padding: 16px;
  background: #fff;
  border: var(--border);
  border-radius: var(--radius-icon);
  box-shadow: var(--shadow-small);
}
.cs-icons img { width: 80px; height: 80px; }

/* Photos: snapshots with a wide bottom edge, tilted a little either way */
.cs-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 30px 26px;
  margin: clamp(28px, 4vw, 40px) 0 0;
  padding: 0;
  list-style: none;
}
.cs-photos li { padding: 10px 10px 30px; background: #fff; border: var(--border); border-radius: var(--radius-small); box-shadow: var(--shadow-small); transform: rotate(-1.2deg); }
.cs-photos li:nth-child(even) { transform: rotate(1.4deg); }
.cs-photos li:nth-child(3n) { transform: rotate(-0.4deg); }
.cs-photos .cs-zoom { border: 2px solid var(--ink); }

/* ---------- Divider: a dark band that sets off extra material ---------- */

.cs-divider {
  margin-top: clamp(56px, 8vw, 96px);
  padding: clamp(36px, 6vw, 56px) 0;
  background: var(--ink);
  color: var(--cream);
}
.cs-divider .cs-kicker { background: var(--accent); color: var(--ink); }
.cs-divider h2 { font-size: clamp(30px, 5vw, 44px); margin: 0 0 10px; }
.cs-divider p { max-width: 54ch; margin: 0; opacity: 0.9; }
.cs-divider + .cs-section { padding-top: clamp(40px, 6vw, 64px); }

/* ---------- Lightbox ---------- */

.cs-lightbox {
  width: min(92vw, 1100px);
  max-height: 92vh;
  margin: auto;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  border: var(--border);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-window);
  overflow: hidden;
}
.cs-lightbox[open] { display: flex; flex-direction: column; }
.cs-lightbox::backdrop { background: rgba(43, 42, 40, 0.82); }
.cs-lightbox-bar { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; border-bottom: var(--border); }
.cs-lightbox-bar figcaption { flex: 1; min-width: 0; font-weight: var(--weight-bold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-lightbox form { margin: 0; }
.cs-lightbox .btn { padding: 4px 12px; font-size: 14px; background-color: var(--cream); }
.cs-lightbox figure { display: flex; flex-direction: column; min-height: 0; margin: 0; }
.cs-lightbox img { flex: 1; min-height: 0; width: 100%; max-height: calc(92vh - 60px); object-fit: contain; background: var(--cream); }

@media (prefers-reduced-motion: reduce) {
  .cs-hero-art, .cs-quote, .cs-photos li, .cs-photos li:nth-child(n) { transform: none; }
}
