/* Ben Scammels Portfolio — shared styles. Follows STYLEGUIDE.md v1.0 */
:root {
  --bg: #F7F4F3; --surface: #FFFFFF; --stone: #EDE8E5; --border: #DDD6D2;
  --petal: #E2CEC5; --olive: #978F7C; --carbon: #222622; --onyx: #111113;
  --text: #222622; --text-body: #4A463B; --text-muted: #5E5848; --text-logo: #6B6553;
  --cobalt: #2F4FA2; --cobalt-dark: #24408A; --cobalt-tint: #E3E8F5;
  --teal: #1F5C57; --teal-dark: #174A46; --teal-tint: #DCE8E6;
  --on-dark: #F7F4F3; --on-dark-body: #D9D3C9; --on-dark-muted: #B8B09D;
  --dark-chip: #34392F; --dark-divider: #3A3F39;
  --font: 'Figtree', system-ui, sans-serif;
  --container: 1200px; --gutter: 24px; --section-gap: 120px; --article-gap: 72px; --grid-gap: 20px;
  --r-pill: 999px; --r-sm: 12px; --r-md: 16px; --r-lg: 24px; --r-xl: 32px;
  --shadow-1: 0 12px 32px rgba(34, 38, 34, 0.10);
  --shadow-2: 0 16px 40px rgba(34, 38, 34, 0.14);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; line-height: 1.6; }
a { color: var(--text); transition: color 150ms ease; }
a:hover { color: var(--cobalt); }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-weight: 500; margin: 0; color: var(--text); }
p { color: var(--text-body); margin: 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* Typography */
.display { font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.05; letter-spacing: -0.03em; }
.page-title { font-size: clamp(2.25rem, 4.5vw, 3.5rem); line-height: 1.08; letter-spacing: -0.03em; }
.section-title { font-size: clamp(1.75rem, 3.5vw, 2.5rem); line-height: 1.1; letter-spacing: -0.02em; }
.article-h2 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; }
.card-title { font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; }
.lead { font-size: 19px; line-height: 1.6; max-width: 680px; }
.meta { font-size: 14px; line-height: 1.4; color: var(--text-muted); }
.eyebrow { font-size: 12px; font-weight: 600; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.metric { font-size: 64px; font-weight: 400; line-height: 1; letter-spacing: -0.04em; color: var(--cobalt); }

/* Header */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--petal); object-fit: cover; flex: none; }
.brand .avatar { width: 66px; height: 66px; }
.brand-name { font-size: 15px; font-weight: 600; line-height: 1.2; display: block; }
.brand-role { font-size: 13px; color: var(--text-muted); display: block; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; background: var(--stone); padding: 6px; border-radius: var(--r-pill); }
.nav a { padding: 12px 18px; font-size: 14px; font-weight: 500; border-radius: var(--r-pill); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav a[aria-current], .nav-contact-btn[aria-expanded="true"] { background: var(--surface); }
.nav-contact-btn { padding: 12px 18px; font: inherit; font-size: 14px; font-weight: 500; color: var(--text); background: transparent; border: 0; border-radius: var(--r-pill); min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; transition: color 150ms ease; }
.nav-contact-btn:hover { color: var(--cobalt); }
.site-header { position: relative; }
.contact-menu { position: absolute; right: 0; top: calc(100% - 8px); z-index: 60; width: min(340px, 100%); background: var(--surface); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-2); }
.contact-menu[hidden] { display: none; }
.contact-menu p { font-size: 15px; line-height: 1.5; margin: 0 0 16px; }
.menu-email a { font-size: 15px; font-weight: 500; color: var(--text); text-decoration: none; }
.menu-email a:hover { color: var(--cobalt); }
.menu-email .copy-bubble { max-width: 280px; bottom: auto; top: calc(100% + 12px); transform: translateY(-4px); }
.menu-email .copy-bubble.is-visible { transform: none; }
.menu-email .copy-bubble::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--carbon); }
@media (max-width: 700px) { .contact-menu { left: 0; width: auto; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 16px 28px; font: 500 16px/1 var(--font); border-radius: var(--r-pill); text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: color 150ms ease, background 150ms ease; }
.btn-primary { background: var(--carbon); color: var(--bg); }
.btn-primary:hover { color: var(--bg); background: #000; }
.btn-contact { background: var(--cobalt); color: #fff; }
.btn-contact:hover { color: #fff; background: var(--cobalt-dark); }
.btn-secondary { background: transparent; border-color: var(--carbon); color: var(--carbon); }
.btn-icon { width: 48px; height: 48px; padding: 0; border-radius: 50%; }

/* Tags & badge */
.tag { display: inline-block; padding: 7px 14px; font-size: 13px; font-weight: 500; border-radius: var(--r-pill); background: var(--petal); }
.tag:nth-child(4n+2) { background: var(--cobalt-tint); color: var(--cobalt-dark); }
.tag:nth-child(4n+3) { background: var(--teal-tint); color: var(--teal-dark); }
.tag:nth-child(4n+4) { background: var(--surface); }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--surface); border-radius: var(--r-pill); font-size: 14px; font-weight: 500; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }

/* Cards & grids */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--grid-gap); }
.card { background: var(--surface); border-radius: var(--r-lg); padding: 28px; }
.icon-tile { width: 52px; height: 52px; border-radius: var(--r-md); background: var(--petal); display: grid; place-items: center; color: var(--teal); margin-bottom: 20px; }
.icon-tile svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.project-card { display: block; background: var(--surface); border-radius: var(--r-lg); padding: 14px 14px 24px; text-decoration: none; transition: transform 200ms ease, box-shadow 200ms ease; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); color: var(--text); }
.project-card .thumb { position: relative; height: 240px; border-radius: var(--r-md); background: var(--petal); overflow: hidden; margin-bottom: 20px; }
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-card .chip { position: absolute; right: 12px; bottom: 12px; background: var(--cobalt); color: #fff; font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: var(--r-pill); }
.project-card .card-title, .project-card .meta { padding: 0 10px; }

/* Panels */
.panel-dark { background: var(--carbon); color: var(--on-dark-body); border-radius: var(--r-xl); padding: 64px 48px; }
.panel-dark h2 { color: var(--on-dark); }
.panel-dark .metric { color: var(--petal); }
.panel-dark .meta { color: var(--on-dark-muted); }
.panel-petal { background: var(--petal); border-radius: var(--r-xl); padding: 64px 48px; }

/* Layout helpers */
.section { margin-top: var(--section-gap); }
.hero { padding: 96px 0 72px; }
.prose { max-width: 760px; font-size: 17px; line-height: 1.7; }

/* Footer */
.site-footer { margin-top: var(--section-gap); border-top: 1px solid var(--border); padding: 32px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--text-muted); }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--cobalt); }
.site-footer nav { display: flex; gap: 24px; }

@media (max-width: 600px) {
  .panel-dark, .panel-petal { padding: 40px 24px; }
  .hero { padding: 56px 0 48px; }
  :root { --section-gap: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .project-card:hover { transform: none; }
}

/* ---- Homepage components ---- */
.hero-centre { text-align: center; }
.hero-centre .display { max-width: 900px; margin: 0 auto 28px; }
.hero-centre .lead { margin: 0 auto; }
.section-heading { text-align: center; margin-bottom: 48px; }
.project-card .card-title { margin-bottom: 8px; }

/* Testimonial */
.testimonial { position: relative; }
.testimonial-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.testimonial-slides { flex: 1; min-width: 0; text-align: center; }
.quote-mark { width: 40px; height: 40px; color: var(--teal); margin: 0 auto 20px; display: block; }
.testimonial-lead { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 400; line-height: 1.25; letter-spacing: -0.02em; color: var(--text); max-width: 900px; margin: 0 auto; }
.testimonial-rest { max-width: 760px; margin: 20px auto 0; font-size: 17px; line-height: 1.7; }
.attribution { display: inline-flex; align-items: center; gap: 14px; margin-top: 32px; text-align: left; }
.attribution .avatar { width: 48px; height: 48px; background: var(--surface); }
.attribution-name { font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; display: block; line-height: 1.2; }
.attribution-role { font-size: 14px; color: var(--text-muted); display: block; }
.testimonial-btn { background: var(--surface); border: 0; color: var(--carbon); display: grid; place-items: center; cursor: pointer; flex: none; }
.testimonial-btn:hover { background: var(--carbon); color: var(--bg); }
.testimonial-btn svg, .icon-sm { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.testimonial-slide[hidden] { display: none; }
.testimonial.is-single .testimonial-btn { display: none; }

/* Logo grid */
.logo-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.logo-cell { min-width: 0; background: var(--surface); height: 140px; display: grid; place-items: center; padding: 24px; }
.logo-cell img { max-height: 44px; max-width: min(130px, 100%); width: auto; height: auto; object-fit: contain; filter: grayscale(1); opacity: .7; }

/* Contact */
.contact { text-align: center; }
.contact h2 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 16px; }
.contact p { font-size: 18px; margin-bottom: 32px; }

@media (max-width: 900px) { .logo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .testimonial-row { flex-wrap: wrap; justify-content: center; }
  .testimonial-slides { order: -1; flex-basis: 100%; }
  .metric { font-size: 48px; }
  .nav a { padding: 12px 14px; }
}

/* ---- Work page ---- */
.page-hero { text-align: center; padding: 96px 0 72px; }
.page-hero .page-title { margin-bottom: 20px; }
.page-hero .lead { margin: 0 auto; }
.work-list { display: grid; gap: var(--grid-gap); }
.work-card { display: flex; flex-wrap: wrap; gap: 32px; align-items: stretch; background: var(--surface); border-radius: var(--r-lg); padding: 20px; }
.work-card .thumb { flex: 1 1 320px; min-height: 340px; border-radius: var(--r-md); background: var(--petal); overflow: hidden; }
.work-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.work-card .body { flex: 1 1 320px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; padding: 32px 20px 32px 0; }
.work-card .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.work-card .card-title { font-size: 22px; font-weight: 600; }
.work-card .client { font-size: 15px; font-weight: 500; line-height: 1.2; letter-spacing: .04em; text-transform: uppercase; color: var(--text); margin-bottom: 24px; }
.work-card .btn { align-self: flex-start; }
.work-card .scroll-hero { flex: 1 1 320px; min-width: 0; height: 340px; padding: 24px; border-radius: var(--r-md); }
@media (max-width: 600px) {
  .page-hero { padding: 56px 0 48px; }
  .work-card { padding: 14px; gap: 20px; }
  .work-card .body { padding: 0 10px 10px; }
}
/* White tag would vanish on a white card, so use Stone there */
.work-card .tag:nth-child(4n+4), .project-card .tag:nth-child(4n+4) { background: var(--stone); }

/* ---- Skills & AI page ---- */
.prose-centre { max-width: 760px; margin: 0 auto; text-align: center; }
.prose-centre p { font-size: 17px; line-height: 1.7; }
.prose-centre p + p { margin-top: 20px; }
.page-hero .lead + .prose-centre { margin-top: 32px; }
.feature-list { display: grid; gap: 56px; max-width: 900px; margin: 0 auto; }
.feature { display: flex; flex-wrap: wrap; align-items: center; gap: 32px 56px; }
.feature-icon { width: 120px; height: 120px; border-radius: 50%; background: var(--petal); display: grid; place-items: center; color: var(--teal); flex: none; }
.feature-icon svg { width: 44px; height: 44px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.feature-body { flex: 1 1 320px; }
.feature-body h3 { font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 12px; }
.feature-body p { font-size: 16px; line-height: 1.7; max-width: 560px; }
.logo-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .logo-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .logo-grid--3 .logo-cell:last-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .feature { flex-direction: column; align-items: flex-start; }
  .feature-icon { width: 88px; height: 88px; }
  .feature-icon svg { width: 36px; height: 36px; }
}
h1, h2, .testimonial-lead { text-wrap: balance; }
.section-heading .section-title { max-width: 760px; margin-left: auto; margin-right: auto; }
.logo-grid--3 .logo-cell img { max-width: min(180px, 100%); }

/* Footer email + copy button */
.footer-email { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.copy-btn { width: 44px; height: 44px; margin: -10px -13px -10px 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); display: grid; place-items: center; cursor: pointer; transition: color 150ms ease, background 150ms ease; }
.copy-btn:hover { color: var(--cobalt); background: var(--stone); }
.copy-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.copy-bubble { position: absolute; right: 0; bottom: calc(100% + 12px); width: max-content; max-width: 240px; padding: 10px 16px; background: var(--carbon); color: var(--on-dark); font-size: 14px; line-height: 1.4; border-radius: var(--r-md); opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity 200ms ease, transform 200ms ease; }
.copy-bubble::after { content: ""; position: absolute; right: 18px; top: 100%; border: 6px solid transparent; border-top-color: var(--carbon); }
.copy-bubble.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .copy-bubble { transform: none; } }

/* Homepage project cards: client name in capitals, sectors on their own row */
.project-card .client { padding: 0 10px; font-size: 15px; font-weight: 500; line-height: 1.2; letter-spacing: .04em; text-transform: uppercase; color: var(--text); margin-bottom: 10px; }
.project-card .card-title { font-weight: 600; }
.project-card .tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 10px; margin-top: 16px; }

/* Vertically centre name + role beside the avatar circle */
.brand > span:last-child, .attribution > span:last-child { display: block; }
.brand-role, .attribution-role { line-height: 1.3; }
.brand-name, .attribution-name { line-height: 1.3; }

/* ---- Case study page ---- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.cs-hero { padding: 48px 0 72px; }
.breadcrumb { margin-bottom: 32px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--cobalt); }
.cs-hero-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 48px; }
.cs-hero-text { flex: 1 1 420px; }
.cs-hero-text .page-title { margin-bottom: 24px; }
.cs-hero-text .lead { margin-bottom: 48px; }
.cs-role { font-size: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; line-height: 1.5; color: var(--text); margin-bottom: 24px; }
.cs-role .meta { font-weight: 400; text-transform: none; letter-spacing: 0; }
.cs-hero .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-hero .hero-stack { flex: 1 1 420px; }

/* Image stack */
.image-stack { position: relative; height: 460px; background: var(--petal); border-radius: var(--r-xl); overflow: hidden; }
.image-stack .shot { position: absolute; width: 62%; height: 58%; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-1); overflow: hidden; }
.image-stack .shot img { width: 100%; height: 100%; object-fit: cover; }
.stack-2 .shot:nth-child(1) { left: 8%; top: 10%; }
.stack-2 .shot:nth-child(2) { left: 30%; top: 32%; box-shadow: var(--shadow-2); }
.stack-3 .shot { width: 56%; height: 54%; }
.stack-3 .shot:nth-child(1) { left: 6%; top: 8%; }
.stack-3 .shot:nth-child(2) { left: 22%; top: 22%; }
.stack-3 .shot:nth-child(3) { left: 38%; top: 38%; box-shadow: var(--shadow-2); }
.article-stack { margin-top: 48px; }

/* Layout */
.cs-layout { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.cs-aside { flex: 1 1 200px; position: sticky; top: 24px; align-self: flex-start; }
.cs-article { flex: 999 1 640px; min-width: 0; }
.cs-article > section { scroll-margin-top: 24px; }
.cs-article > section + section { margin-top: var(--article-gap); }
.cs-article .eyebrow { margin-bottom: 12px; }
.cs-article .article-h2 { margin-bottom: 20px; max-width: 760px; text-wrap: balance; }
.cs-article .prose + .prose { margin-top: 20px; }
.solution + .solution { margin-top: 48px; }
.solution .article-h2 { margin-top: 0; }

/* On this page */
.cs-nav { display: flex; flex-direction: column; gap: 2px; }
.cs-nav .eyebrow { color: var(--text-muted); margin-bottom: 12px; padding: 0 14px; }
.cs-nav a { padding: 10px 14px; border-radius: var(--r-sm); font-size: 15px; font-weight: 500; text-decoration: none; color: var(--text-body); min-height: 44px; display: flex; align-items: center; }
.cs-nav a[aria-current] { background: var(--surface); color: var(--cobalt); }

/* Outcomes strip */
.outcomes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--stone); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 40px; }
.outcome { background: var(--surface); padding: 36px 24px; text-align: center; }
.outcome .metric { font-size: 60px; margin-bottom: 12px; }
.outcome p:last-child { font-size: 15px; line-height: 1.5; }

/* Testimonial in article */
.cs-testimonial { padding: 48px 40px; }
.cs-testimonial .quote-mark { margin: 0 0 16px; }
.cs-testimonial .testimonial-lead { font-size: clamp(1.375rem, 2.4vw, 1.75rem); text-align: left; margin: 0; max-width: none; text-wrap: wrap; }
.cs-testimonial .testimonial-rest { margin: 16px 0 0; max-width: none; text-align: left; font-size: 16px; }

/* Team */
.team-card { background: var(--surface); border-radius: var(--r-lg); padding: 32px; display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: flex-start; }
.team-card .article-h2 { flex: 0 1 200px; margin: 0; }
.bullet-list { list-style: none; margin: 0; padding: 0; flex: 1 1 300px; }
.bullet-list li { position: relative; padding: 14px 0 14px 24px; font-size: 16px; color: var(--text-body); border-bottom: 1px solid var(--stone); }
.bullet-list li:last-child { border-bottom: 0; }
.bullet-list li::before { content: ""; position: absolute; left: 0; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--teal); }

@media (max-width: 920px) { .cs-aside { position: static; } }
@media (max-width: 600px) {
  .cs-hero { padding: 32px 0 48px; }
  .image-stack { height: 320px; }
  .outcome .metric { font-size: 48px; }
  .cs-testimonial { padding: 36px 24px; }
  .team-card { padding: 24px; }
}

/* ---- Stack carousel (case study images) ---- */
.stack-carousel { --sc-gutter: 72px; display: grid; grid-template-columns: var(--sc-gutter) minmax(0, 1fr) var(--sc-gutter); background: var(--petal); border-radius: var(--r-xl); padding: 70px 0 24px; } /* top gap above the back cards = side gap */
.sc-cards { position: relative; aspect-ratio: 16 / 10; grid-column: 2; grid-row: 1; }
.sc-card { position: absolute; inset: 0; margin: 0; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-1); overflow: hidden; transform-origin: 50% 0; transition: transform 400ms cubic-bezier(.2, .7, .2, 1), opacity 300ms ease; cursor: pointer; }
.sc-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.sc-card[data-depth="0"] { transform: none; z-index: 3; box-shadow: var(--shadow-2); cursor: zoom-in; }
.sc-card[data-depth="1"] { transform: translateY(-28px) scale(.94); z-index: 2; }
.sc-card[data-depth="2"] { transform: translateY(-52px) scale(.88); z-index: 1; }
.sc-card:not([data-depth="0"]):not([data-depth="1"]):not([data-depth="2"]) { transform: translateY(-52px) scale(.88); opacity: 0; pointer-events: none; z-index: 0; }
.sc-expand { position: absolute; top: 12px; right: 12px; z-index: 5; width: 40px; height: 40px; border: 0; border-radius: var(--r-sm); background: var(--surface); color: var(--carbon); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity 150ms ease; box-shadow: var(--shadow-1); }
.sc-cards:hover .sc-expand, .sc-expand:focus-visible { opacity: 1; }
.sc-expand:hover { color: var(--cobalt); }
.sc-expand svg, .sc-btn svg, .lb-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: none) { .sc-expand { opacity: 1; } }
.sc-controls { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; }
.sc-btn { position: relative; flex: 0 0 18%; min-height: 44px; width: 22px; padding: 0; border: 0; border-radius: var(--r-pill); background: #F4EEEA; color: var(--carbon); display: grid; place-items: center; cursor: pointer; transition: background 150ms ease; }
.sc-btn::after { content: ""; position: absolute; inset: 0 -11px; } /* widens the tap area to 44px */
.sc-btn svg { width: 14px; height: 14px; }
.sc-btn:hover { background: var(--cobalt); color: #fff; }
.sc-caption { grid-column: 2; grid-row: 2; margin: 20px 0 0; min-height: 3em; text-align: center; font-size: 15px; line-height: 1.5; color: var(--text); }

/* Lightbox */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--onyx); color: var(--on-dark); }
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lb-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 72px 24px 32px; max-width: 100%; }
.lb-media img { display: block; max-width: min(1400px, 92vw); max-height: calc(100vh - 200px); border-radius: var(--r-md); }
.lb-placeholder { width: min(1100px, 88vw, calc((100vh - 200px) * 1.6)); aspect-ratio: 16 / 10; background: var(--surface); border-radius: var(--r-md); }
.lb-caption { margin: 0; max-width: 720px; text-align: center; font-size: 15px; line-height: 1.5; color: var(--on-dark-body); }
.lb-btn { position: absolute; width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: var(--dark-chip); color: var(--on-dark); display: grid; place-items: center; cursor: pointer; }
.lb-btn:hover { background: #4a5046; }
.lb-btn:focus-visible { outline-color: var(--petal); }
.lb-close { top: 20px; right: 20px; }
.lb-prev, .lb-next { top: 50%; margin-top: -22px; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
@media (max-width: 600px) {
  .stack-carousel { --sc-gutter: 36px; padding: 42px 0 16px; }
  .sc-card[data-depth="1"] { transform: translateY(-20px) scale(.94); }
  .sc-card[data-depth="2"] { transform: translateY(-38px) scale(.88); }
  .lb-prev, .lb-next { top: auto; bottom: 20px; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .sc-card { transition: none; } }

/* ---- Scrolling hero image ---- */
.scroll-hero { position: relative; background: var(--petal); border-radius: var(--r-xl); padding: 32px; height: clamp(420px, 38vw, 500px); }
.sf-window { position: relative; height: 100%; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-2); overflow: hidden; }
.sf-scroll { height: 100%; overflow-y: auto; scrollbar-width: none; cursor: zoom-in; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.sf-scroll::-webkit-scrollbar { display: none; }
.sf-scroll.is-dragging { cursor: grabbing; }
.sf-scroll img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.sf-bar { position: absolute; top: 10px; bottom: 10px; right: 6px; width: 16px; z-index: 4; opacity: 0; transition: opacity 200ms ease; touch-action: none; }
.sf-bar::before { content: ""; position: absolute; left: 4px; right: 4px; top: 0; bottom: 0; border-radius: var(--r-pill); background: rgba(34, 38, 34, .10); }
.sf-thumb { position: absolute; left: 4px; right: 4px; top: 0; height: 60px; border-radius: var(--r-pill); background: #4D524B; cursor: grab; transition: background 150ms ease; }
.sf-thumb:hover, .sf-bar.is-active .sf-thumb { background: var(--cobalt); }
.sf-bar.is-active .sf-thumb { cursor: grabbing; }
.scroll-hero:hover .sf-bar, .scroll-hero:focus-within .sf-bar, .sf-bar.is-active { opacity: 1; }
.sf-open { right: 34px; }
.scroll-hero:hover .sf-open, .scroll-hero:focus-within .sf-open { opacity: 1; }
@media (hover: none) { .sf-bar { opacity: 1; } }
@media (max-width: 600px) { .scroll-hero { padding: 20px; height: 380px; } }

/* Scrollable full-screen viewer */
.lb-scroller { width: min(1100px, 92vw); max-height: calc(100vh - 110px); overflow-y: auto; border-radius: var(--r-md); background: var(--surface); overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #6b7066 transparent; cursor: grab; user-select: none; -webkit-user-select: none; }
.lb-scroller.is-dragging { cursor: grabbing; }
.lb-scroller img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.lightbox-scroll .lb-inner { padding: 72px 24px 24px; }
.lb-scroller:focus-visible { outline: 2px solid var(--petal); outline-offset: 4px; }

/* Petal wash (matches the frame) on the cards behind: 50% on the first, 75% on the second (and anything hidden further back) */
.sc-card::after { content: ""; position: absolute; inset: 0; background: var(--petal); opacity: 0; pointer-events: none; transition: opacity 400ms cubic-bezier(.2, .7, .2, 1); }
.sc-card[data-depth="1"]::after { opacity: .5; }
.sc-card[data-depth="2"]::after { opacity: .75; }
.sc-card:not([data-depth="0"]):not([data-depth="1"]):not([data-depth="2"])::after { opacity: .75; }
@media (prefers-reduced-motion: reduce) { .sc-card::after { transition: none; } }

.lightbox-scroll .lb-scroller { max-height: calc(100vh - 170px); }

/* Homepage cards: vary the second chip colour (brown, then blue or green) */
.project-card:nth-child(even) .tag:nth-child(2) { background: var(--teal-tint); color: var(--teal-dark); }

/* Stack carousel: the cards behind are plain brown blocks (mid, then light) */
.sc-card:not([data-depth="0"]) { pointer-events: none; }
.sc-card:not([data-depth="0"]) > * { visibility: hidden; }
.sc-card[data-depth="1"] { background: #C9B3A8; }
.sc-card[data-depth="2"] { background: #D7C6BD; opacity: 0; }
.sc-card[data-depth="1"]::after, .sc-card[data-depth="2"]::after { opacity: 0; }
.sc-card:not([data-depth="0"]):not([data-depth="1"]):not([data-depth="2"]) { opacity: 0; }

/* Case study outcomes as statement cards (no headline metrics) */
.outcome-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px; }
.outcome-card { background: var(--cobalt-tint); border-radius: var(--r-lg); padding: 28px; }
.outcome-card p { margin: 0; }
.outcome-card .outcome-label { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--cobalt-dark); margin-bottom: 12px; }
.outcome-cards--joined { gap: 1px; background: var(--stone); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 40px; }
.outcome-cards--joined .outcome-card { background: var(--surface); border-radius: 0; }
.outcome-cards--joined .outcome-label { color: var(--cobalt); }
.outcome-cards--six { grid-template-columns: repeat(3, 1fr); }
.outcome-logo { display: grid; place-items: center; }
.outcome-logo img { width: min(152px, 56%); height: auto; }
@media (max-width: 800px) { .outcome-cards--six { grid-template-columns: 1fr; } }
/* First card is long: give it half the width and the full height; the other two stack beside it */
.outcome-cards--feature { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
.outcome-cards--feature .outcome-card:first-child { grid-row: span 2; }
@media (max-width: 700px) { .outcome-cards--feature { grid-template-columns: 1fr; } .outcome-cards--feature .outcome-card:first-child { grid-row: auto; } }
.work-cta { display: flex; justify-content: center; margin: 40px 0 0; }

/* Homepage project cards: 16px brown frame; the whole image is shown (not cropped), centred */
.project-card .thumb { padding: 16px; display: flex; align-items: center; justify-content: center; }
.project-card .thumb img { width: auto; height: auto; max-width: 100%; max-height: 100%; border-radius: calc(var(--r-md) - 4px); }

/* Homepage cards: brown image area runs edge to edge across the top of the card, with square bottom corners */
.project-card .thumb { margin: -14px -14px 20px; height: 260px; border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* Static (landscape / animated) hero: no scrolling, centred */
.scroll-hero--static .sf-scroll { display: flex; align-items: center; overflow: hidden; }
.scroll-hero--static .sf-scroll img { height: auto; }
.scroll-hero--static, .work-card .scroll-hero--static { height: auto; }
.scroll-hero--static .sf-window { height: auto; }
.scroll-hero--static .sf-scroll { display: block; height: auto; }
/* Wider-than-card slides: show the whole image */
.sc-card.sc-wide img { object-fit: contain; object-position: center; }
.lb-media .lb-scroller { max-height: calc(100vh - 200px); }
.lb-media .lb-scroller img { max-width: none; max-height: none; border-radius: 0; }

/* Controls: only the down button at first; the up button flows out of it after the first click */
.sc-btn[data-sc="up"] { flex-basis: 0; min-height: 0; margin-bottom: -8px; opacity: 0; transform: translateY(24px) scale(.5); visibility: hidden; pointer-events: none;
  transition: flex-basis 520ms cubic-bezier(.2, .8, .2, 1), min-height 520ms cubic-bezier(.2, .8, .2, 1), margin 520ms cubic-bezier(.2, .8, .2, 1), opacity 420ms ease 80ms, transform 520ms cubic-bezier(.2, .8, .2, 1), visibility 0s linear 520ms, background 150ms ease; }
.sc-controls.is-open .sc-btn[data-sc="up"] { flex-basis: 18%; min-height: 44px; margin-bottom: 0; opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: flex-basis 520ms cubic-bezier(.2, .8, .2, 1), min-height 520ms cubic-bezier(.2, .8, .2, 1), margin 520ms cubic-bezier(.2, .8, .2, 1), opacity 420ms ease 80ms, transform 520ms cubic-bezier(.2, .8, .2, 1), visibility 0s, background 150ms ease; }
@media (prefers-reduced-motion: reduce) { .sc-btn[data-sc="up"], .sc-controls.is-open .sc-btn[data-sc="up"] { transition: none; } }
/* Taller carousel window (4:3) for near-square slides, so the full height shows */
.sc-4x3 .sc-cards { aspect-ratio: 33 / 25; }
.sc-4x3 .sc-card img { object-fit: cover; object-position: top; }
/* Work page: static images fill the card (height set by the card, like the Great Yellow one) */
.work-card .scroll-hero { height: auto; min-height: 340px; display: flex; }
.work-card .scroll-hero .sf-window { flex: 1; height: auto; min-height: 0; }
.work-card .scroll-hero .sf-scroll { position: absolute; inset: 0; height: auto; display: block; }
.work-card .scroll-hero--static .sf-scroll img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* Header avatar: same springy growth on hover as the quote avatar */
.brand .avatar { transition: transform 900ms cubic-bezier(.55, .05, .25, 1.4); will-change: transform; }
.brand:hover .avatar { transform: scale(1.08); }
@media (prefers-reduced-motion: reduce) { .brand .avatar { transition: none; } }
/* Work page: whole card is clickable and lifts on hover, like the homepage cards. The image area keeps its own click (full-size viewer). */
.work-card { position: relative; transition: transform 200ms ease, box-shadow 200ms ease; }
.work-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.work-card .btn::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.work-card .scroll-hero { z-index: 2; }
.work-card:has(.btn:focus-visible) { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.work-card .btn:focus-visible { outline: none; }
@media (hover: none), (prefers-reduced-motion: reduce) { .work-card:hover { transform: none; } }
/* Case-study hero: chips sit above the role/dates */
.cs-hero-text .tags { margin-bottom: 28px; }
.cs-hero-text .cs-role { margin-bottom: 0; }
/* Two-column card grid (Skills page) */
.grid-2 { grid-template-columns: repeat(2, 1fr); width: 80%; margin-inline: auto; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; width: 100%; } }

/* Skills cards: icon animations on hover */
.ico { overflow: visible; }
.ico * { transform-box: fill-box; transform-origin: center; }
/* sparkles: the big star pulses, the small ones twinkle */
@keyframes sp-pulse { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(12deg); } }
@keyframes sp-twinkle { 0%, 100% { transform: scale(1); opacity: 1; } 35% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.35); opacity: 1; } }
.card.is-hot .sp-main { animation: sp-pulse 1.1s ease-in-out infinite; }
.card.is-hot .sp-a { animation: sp-twinkle 1.1s ease-in-out infinite; }
.card.is-hot .sp-b { animation: sp-twinkle 1.1s ease-in-out .45s infinite; }
/* compass: the needle spins twice and settles pointing north (and spins back on leave) */
.ico-compass .needle { transform-box: view-box; transform-origin: 12px 12px; transition: transform 1.8s cubic-bezier(.16, .72, .3, 1.08); }
.grid-2 .card:hover .ico-compass .needle { transform: rotate(-765deg); }
/* bars: heights fluctuate */
.ico-bars .bar { transform-origin: 50% 100%; }
@keyframes bar-a { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(2.6); } }
@keyframes bar-b { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.45); } }
@keyframes bar-c { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.5); } }
.card.is-hot .b1 { animation: bar-a 1s ease-in-out infinite; }
.card.is-hot .b2 { animation: bar-b 1.2s ease-in-out .15s infinite; }
.card.is-hot .b3 { animation: bar-c .9s ease-in-out .3s infinite; }
@media (prefers-reduced-motion: reduce) { .ico * { animation: none !important; transition: none !important; } }

/* Prototyping icon: three stacked layers. The bottom one slides out of the tile, a new one drops in at the top, and the stack of three is restored. */
.tile-clip { overflow: hidden; }
.ico-layers .ly { fill: var(--petal); }
.ico-layers .ly-a { transform: translateY(0); }
.ico-layers .ly-b { transform: translateY(5px); }
.ico-layers .ly-c { transform: translateY(10px); }
.ico-layers .ly-n { opacity: 0; transform: translateY(-20px); }
@keyframes ly-out { 0% { transform: translateY(10px); opacity: 1; } 25%, 99% { transform: translateY(48px); opacity: 1; } 100% { transform: translateY(10px); opacity: 1; } }
@keyframes ly-shift-a { 0%, 25% { transform: translateY(0); } 50%, 99% { transform: translateY(5px); } 100% { transform: translateY(0); } }
@keyframes ly-shift-b { 0%, 25% { transform: translateY(5px); } 50%, 99% { transform: translateY(10px); } 100% { transform: translateY(5px); } }
@keyframes ly-in { 0%, 24% { transform: translateY(-20px); opacity: 0; } 25% { transform: translateY(-20px); opacity: 1; } 50%, 99% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(0); opacity: 0; } }
.card.is-hot .ly-c { animation: ly-out 2.2s cubic-bezier(.45, 0, .25, 1) infinite; }
.card.is-hot .ly-a { animation: ly-shift-a 2.2s cubic-bezier(.45, 0, .25, 1) infinite; }
.card.is-hot .ly-b { animation: ly-shift-b 2.2s cubic-bezier(.45, 0, .25, 1) infinite; }
.card.is-hot .ly-n { animation: ly-in 2.2s cubic-bezier(.45, 0, .25, 1) infinite; }

/* Homepage cards */
/* dashboard: the big squares shrink while the small ones grow (swapping sizes), then everything returns */
.ico-dash rect { vector-effect: non-scaling-stroke; }
.ico-dash .d-big1, .ico-dash .d-sm2 { transform-origin: 50% 0; }
.ico-dash .d-big2, .ico-dash .d-sm1 { transform-origin: 50% 100%; }
@keyframes d-grow { 0%, 6% { transform: scaleY(1); } 38%, 56% { transform: scaleY(1.8); } 90%, 100% { transform: scaleY(1); } }
@keyframes d-shrink { 0%, 6% { transform: scaleY(1); } 38%, 56% { transform: scaleY(.5556); } 90%, 100% { transform: scaleY(1); } }
.card.is-hot .d-sm1, .card.is-hot .d-sm2 { animation: d-grow 2.2s cubic-bezier(.45, 0, .25, 1) infinite; }
.card.is-hot .d-big1, .card.is-hot .d-big2 { animation: d-shrink 2.2s cubic-bezier(.45, 0, .25, 1) infinite; }
/* flow: the connector is drawn into one box and re-emerges on the other side, then goes round again */
.ico-flow .fl-l, .ico-flow .fl-r { stroke-dasharray: 1 1; }
.ico-flow .fl-l { stroke-dashoffset: 0; }
.ico-flow .fl-r { stroke-dashoffset: 1; opacity: 0; }
@keyframes fl-l { 0% { stroke-dashoffset: 0; opacity: 1; } 28% { stroke-dashoffset: -1; opacity: 1; } 28.1%, 59.9% { stroke-dashoffset: -1; opacity: 0; } 60% { stroke-dashoffset: 1; opacity: 1; } 85%, 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes fl-r { 0%, 14.9% { stroke-dashoffset: 1; opacity: 0; } 15% { stroke-dashoffset: 1; opacity: 1; } 42%, 55% { stroke-dashoffset: 0; opacity: 1; } 83% { stroke-dashoffset: -1; opacity: 1; } 83.1%, 100% { stroke-dashoffset: -1; opacity: 0; } }
.card.is-hot .fl-l { animation: fl-l 3s cubic-bezier(.45, 0, .25, 1) infinite; }
.card.is-hot .fl-r { animation: fl-r 3s cubic-bezier(.45, 0, .25, 1) infinite; }
/* shuffle: the two arrows are redrawn left to right, crossing over */
.ico-shuffle .sh1, .ico-shuffle .sh2a, .ico-shuffle .sh2b { stroke-dasharray: 1 1; stroke-dashoffset: 0; }
@keyframes sh1 { 0% { stroke-dashoffset: 0; opacity: 1; } 14% { stroke-dashoffset: -1; opacity: 1; } 14.1%, 19.9% { stroke-dashoffset: 1; opacity: 0; } 20% { stroke-dashoffset: 1; opacity: 1; } 52%, 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes sh1h { 0%, 4% { opacity: 1; } 8%, 50% { opacity: 0; } 58%, 100% { opacity: 1; } }
@keyframes sh2a { 0%, 4% { stroke-dashoffset: 0; opacity: 1; } 12% { stroke-dashoffset: -1; opacity: 1; } 12.1%, 29.9% { stroke-dashoffset: 1; opacity: 0; } 30% { stroke-dashoffset: 1; opacity: 1; } 42%, 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes sh2b { 0%, 10% { stroke-dashoffset: 0; opacity: 1; } 20% { stroke-dashoffset: 1; opacity: 1; } 20.1%, 41.9% { stroke-dashoffset: -1; opacity: 0; } 42% { stroke-dashoffset: -1; opacity: 1; } 58%, 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes sh2h { 0%, 14% { opacity: 1; } 20%, 56% { opacity: 0; } 64%, 100% { opacity: 1; } }
.card.is-hot .sh1 { animation: sh1 2.8s cubic-bezier(.45, 0, .25, 1) infinite; }
.card.is-hot .sh1h { animation: sh1h 2.8s ease infinite; }
.card.is-hot .sh2a { animation: sh2a 2.8s cubic-bezier(.45, 0, .25, 1) infinite; }
.card.is-hot .sh2b { animation: sh2b 2.8s cubic-bezier(.45, 0, .25, 1) infinite; }
.card.is-hot .sh2h { animation: sh2h 2.8s ease infinite; }
/* route: a dark dot emerges from the bottom circle and travels the line to the top circle */
.ico-route .rt-dot { offset-path: path("M6 19 H17.5 a3.5 3.5 0 0 0 0-7 H6.5 a3.5 3.5 0 0 1 0-7 H18"); offset-rotate: 0deg; offset-distance: 0%; opacity: 0; transform: scale(0); }
@keyframes rt-run { 0% { offset-distance: 0%; transform: scale(0); opacity: 1; } 10% { offset-distance: 0%; transform: scale(1); opacity: 1; } 78% { offset-distance: 100%; transform: scale(1); opacity: 1; } 90% { offset-distance: 100%; transform: scale(0); opacity: 1; } 100% { offset-distance: 100%; transform: scale(0); opacity: 0; } }
.card.is-hot .rt-dot { animation: rt-run 2.4s cubic-bezier(.45, 0, .25, 1) infinite; }

/* Flat carousel: shorter window, no letterbox gaps; taller images top-aligned with the bottom cropped */
.sc-flat .sc-cards { aspect-ratio: 1.8 / 1; }
.sc-flat .sc-card.sc-wide img, .sc-flat .sc-card img { object-fit: cover; object-position: top; }

/* Locked Great Yellow card */
.work-card .thumb-locked { position: relative; flex: 1 1 320px; min-height: 340px; border-radius: var(--r-md); overflow: hidden; background: var(--cobalt); }
.work-card .thumb-locked img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(6px); transform: scale(1.06); }
.btn-unlock { gap: 10px; }
.btn-unlock svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Password gate */
.gate { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(34,38,34,.28); }
.gate::backdrop { background: rgba(34,38,34,.35); backdrop-filter: blur(6px); }
.gate-form { position: relative; padding: 40px 32px 32px; display: flex; flex-direction: column; }
.gate-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--cobalt-tint); color: var(--cobalt); display: grid; place-items: center; margin-bottom: 20px; }
.gate-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gate h2 { font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 8px; }
.gate-sub { margin-bottom: 24px; }
.gate-label { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.gate-input { font: 400 16px/1 var(--font); height: 52px; padding: 0 18px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); }
.gate-input:focus { outline: 2px solid var(--cobalt); outline-offset: 1px; border-color: var(--cobalt); }
.gate-input.is-invalid { border-color: #B3261E; background: #FDF3F2; }
.gate-input.is-invalid:focus { outline-color: #B3261E; }
.gate-error { color: #B3261E; font-size: 14px; line-height: 1.4; margin-top: 8px; }
.gate-error::before { content: "! "; font-weight: 700; }
.gate-submit { margin-top: 24px; width: 100%; }
.gate-back { margin-top: 16px; text-align: center; font-size: 14px; color: var(--text-muted); }
.gate-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--carbon); display: grid; place-items: center; cursor: pointer; }
.gate-close:hover { background: var(--stone); }
.gate-close svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; }
.gate-form.is-shake { animation: gate-shake 360ms ease; }
@keyframes gate-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .gate-form.is-shake { animation: none; } }

/* Direct visits to a locked page: blur it until unlocked */
html.is-gated .container { filter: blur(14px); pointer-events: none; user-select: none; }
html.is-gated body { overflow: hidden; }
.lock-badge { position: absolute; top: 50%; left: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: var(--surface); color: var(--cobalt); display: grid; place-items: center; box-shadow: var(--shadow-2); }
.lock-badge svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gate-label { margin-top: 24px; }
.gate-field { position: relative; display: flex; flex-direction: column; }
.gate-field .gate-input { padding-right: 52px; }
.gate-eye { position: absolute; top: 50%; right: 8px; width: 40px; height: 40px; margin-top: -20px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); display: grid; place-items: center; cursor: pointer; }
.gate-eye:hover { background: var(--stone); color: var(--carbon); }
.gate-eye svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; }
.gate-eye .eye-off { display: none; }
.gate-eye.is-shown .eye-on { display: none; }
.gate-eye.is-shown .eye-off { display: block; }

/* ===== Restyle: tighter corners + neutral outlined chips (revert: delete this block, or copy css/styles.BACKUP-before-restyle.css over styles.css) ===== */
:root { --r-sm: 8px; --r-md: 8px; --r-lg: 12px; --r-xl: 12px; }   /* pills (--r-pill) and circles are unchanged */
.tag, .tag:nth-child(n), .work-card .tag:nth-child(n), .project-card .tag:nth-child(n), .project-card:nth-child(even) .tag:nth-child(n) {
  background: var(--teal-tint); color: var(--teal-dark); border: 0; border-radius: var(--r-sm);
}

/* Mobile nav: hamburger + dropdown */
.nav-toggle { display: none; }
@media (max-width: 600px) {
  .site-header { flex-wrap: nowrap; }
  .brand { min-width: 0; }
  .nav-toggle { display: grid; place-items: center; flex: none; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--stone); color: var(--carbon); cursor: pointer; }
  .nav-toggle-bars { position: relative; width: 20px; height: 14px; display: block; }
  .nav-toggle-bars i { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor; transition: transform 250ms ease, opacity 150ms ease, top 250ms ease; }
  .nav-toggle-bars i:nth-child(1) { top: 0; }
  .nav-toggle-bars i:nth-child(2) { top: 6px; }
  .nav-toggle-bars i:nth-child(3) { top: 12px; }
  .nav-open .nav-toggle-bars i:nth-child(1) { top: 6px; transform: rotate(45deg); }
  .nav-open .nav-toggle-bars i:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle-bars i:nth-child(3) { top: 6px; transform: rotate(-45deg); }
  .nav { display: none; position: absolute; top: calc(100% - 8px); right: 0; z-index: 30; flex-direction: column; flex-wrap: nowrap; gap: 2px; width: min(240px, 100%); padding: 8px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2); }
  .nav-open .nav { display: flex; }
  .nav a, .nav .nav-contact-btn { width: 100%; justify-content: flex-start; padding: 12px 16px; border-radius: var(--r-sm); font-size: 16px; }
  .nav a[aria-current], .nav-contact-btn[aria-expanded="true"] { background: var(--stone); }
}
@media (max-width: 600px) and (prefers-reduced-motion: reduce) { .nav-toggle-bars i { transition: none; } }

/* Work cards when stacked (narrow screens): use a landscape image window so screenshots aren't cropped left/right */
@media (max-width: 760px) {
  .work-card .scroll-hero, .work-card .thumb-locked, .work-card .thumb { flex: 0 0 auto; width: 100%; min-height: 0; aspect-ratio: 3 / 2; }
}

/* Locked Great Yellow thumbnail: petal container + rounded blurred window, matching the other cards */
.work-card .thumb-locked { background: var(--petal); padding: 24px; display: flex; }
.work-card .thumb-locked .lock-window { position: relative; flex: 1; border-radius: var(--r-md); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-2); }
@media (max-width: 600px) { .work-card .thumb-locked { padding: 20px; } }

/* Homepage project cards: every image sits in an identical window (full width, same height). The window is as wide-ratio as the widest image (BuzzSumo, 800x506), so nothing is cropped at the sides; taller images are cropped at the bottom. */
.project-card .thumb img { width: 100%; height: auto; max-width: 100%; max-height: none; aspect-ratio: 800 / 506; object-fit: cover; object-position: top; }

/* Homepage project cards: equal 16px padding on all four sides of the image, and the same soft shadow as other framed images */
.project-card .thumb { height: auto; align-items: flex-start; }
.project-card .thumb img { display: block; box-shadow: var(--shadow-2); }

/* Space under the footer so the floating Netlify badge never covers the content (all screen sizes) */
.site-footer { padding-bottom: 112px; }
