/* ============================================
   Ahmadsyah Zhafrie - Portfolio
   ============================================ */
:root {
  --bg: #ffffff;
  --bg-card: #f7f9fc;
  --ink: #101321;
  --ink-soft: #3a3f4e;
  --line: #e4e7ee;
  --accent: #1d4ed8;        /* 6.3:1 on white, safe for text and borders */
  --accent-bright: #6695ff; /* 5.5:1 on dark surfaces only */
  --radius: 20px;
  --gutter: clamp(20px, 4vw, 64px);
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #fff; }

img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }

.container { width: 100%; max-width: 1440px; margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- Eyebrow / labels ---------- */
.eyebrow {
  font-family: var(--font-display);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft);
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; flex: none; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; top: -100px; left: 16px; z-index: 200;
  background: var(--ink); color: var(--bg);
  padding: 12px 20px; border-radius: 8px;
  font-family: var(--font-display); font-size: 14px;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  transition: background .4s, backdrop-filter .4s, box-shadow .4s;
}
.nav.scrolled { background: rgba(255,255,255,.85); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.nav__logo { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; z-index: 102; }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 32px; align-items: center; }
.nav__links a { font-size: 14px; font-weight: 500; position: relative; }
.nav__links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1.5px; width: 100%;
  background: var(--ink); transform: scaleX(0); transform-origin: right; transition: transform .35s cubic-bezier(.65,0,.35,1);
}
.nav__links a:not(.btn):hover::after { transform: scaleX(1); transform-origin: left; }
.nav__toggle { display: none; }

/* scroll progress line: fills left to right as you read the page */
.nav__progress {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: #8f2600;
  transform: scaleX(0); transform-origin: left;
  pointer-events: none;
}

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-display); font-size: 14px; font-weight: 500;
  padding: 12px 24px; border-radius: 100px; border: 1.5px solid var(--ink);
  transition: background .3s, color .3s, transform .3s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: auto; display: flex; align-items: center; padding: 104px 0 40px; overflow: hidden; }
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
[data-fx] { position: relative; }
[data-fx] > :not(.fx-canvas) { position: relative; z-index: 1; }
.hero__grid {
  display: grid; grid-template-columns: 1.3fr 1fr;
  gap: clamp(36px, 5vw, 88px); align-items: center;
}
.hero__eyebrow { margin-bottom: 20px; }
.hero__title {
  font-size: clamp(26px, 2.5vw, 38px);
  letter-spacing: -0.03em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.hero__title .line > span { display: inline-block; }
.hero__specialties {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(17px, 1.7vw, 22px); letter-spacing: -0.01em; line-height: 1.4;
  color: var(--ink); margin-top: 16px; min-height: 2.8em;
}
@media (min-width: 480px) { .hero__specialties { min-height: 1.4em; } }
.hero__intro { max-width: 560px; color: var(--ink-soft); font-size: clamp(16px, 1.3vw, 19px); margin-top: 20px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero__cta .btn { font-size: 15px; padding: 15px 30px; }

/* rotating headline word */
.rotate-word {
  display: inline-block; vertical-align: bottom;
  color: var(--accent); text-align: left;
}
.rotate-word__inner {
  display: inline-block; white-space: nowrap;
  background-image: linear-gradient(0deg, rgba(29,78,216,.14) 0 .14em, transparent .14em);
  padding-inline: .06em;
}
.rotate-word__inner .ch { display: inline-block; }
/* fixed footprint so the line never reflows as the phrase changes (desktop/tablet) */
@media (min-width: 480px) { .rotate-word { min-width: 13.5em; } }

/* portrait card */
.hero__photo-wrap { display: flex; justify-content: center; }
.hero__photo {
  position: relative; width: 100%; max-width: 372px; aspect-ratio: 4 / 5;
  border-radius: 28px; overflow: hidden; transform: rotate(2.5deg);
  background: repeating-linear-gradient(45deg, #eef1f6, #eef1f6 14px, #e5e9f1 14px, #e5e9f1 28px);
  box-shadow: 0 40px 80px -32px rgba(16,19,33,.35);
  transition: transform .5s cubic-bezier(.22,1,.36,1);
}
.hero__photo:hover { transform: rotate(0deg) scale(1.02); }
.hero__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.hero__photo img.img-missing { display: none; }
.hero__photo-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-display); font-size: 13px; color: var(--ink-soft); text-align: center; padding: 16px;
}
.hero__photo-fallback b { font-size: 15px; color: var(--ink); }

/* ---------- Sections ---------- */
.section { padding: clamp(80px, 11vw, 160px) 0; }
.section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: clamp(40px, 5vw, 72px); }
.section__title { font-size: clamp(34px, 5.5vw, 80px); text-transform: uppercase; letter-spacing: -0.025em; }
.section__count { font-family: var(--font-display); color: var(--ink-soft); font-size: 14px; }

section[id] { scroll-margin-top: 90px; }
#work { padding-top: clamp(40px, 5vw, 72px); }

/* ---------- Trusted by logos ---------- */
.logos { padding: clamp(28px, 3.5vw, 48px) var(--gutter); text-align: center; }
.logos__label {
  font-family: var(--font-display); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 28px;
}
.logos__row {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: clamp(28px, 5vw, 64px);
}
.logos__row img {
  height: 44px; width: auto; max-width: 140px; object-fit: contain;
  filter: grayscale(1); opacity: .8; transition: filter .3s, opacity .3s;
}
.logos__row img:hover { filter: grayscale(0); opacity: 1; }
.logos__row img.img-missing { display: none; }
.logos__row .logo--tall { height: 58px; } /* portrait-format logos need extra height to feel optically equal */
@media (min-width: 769px) {
  .logos__row img { height: 64px; max-width: 200px; }
  .logos__row .logo--tall { height: 84px; }
}

/* ---------- Work grid ---------- */
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 2.5vw, 36px); }
.work-card {
  position: relative; display: block; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 2vw, 28px); overflow: hidden;
  transition: transform .45s cubic-bezier(.22,1,.36,1), box-shadow .45s;
}
.work-card:hover { transform: translateY(-6px); box-shadow: 0 24px 60px -28px rgba(20,19,15,.25); }
.work-card__media {
  border-radius: calc(var(--radius) - 8px); overflow: hidden; aspect-ratio: 16 / 10;
  margin-bottom: 22px; position: relative;
}
.work-card__media .ph { position: absolute; inset: 0; }
.work-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.22,1,.36,1); }
.work-card:hover .work-card__media img { transform: scale(1.05); }
.work-card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.work-card__client { font-family: var(--font-display); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.work-card__arrow {
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; transition: background .3s, color .3s, transform .45s cubic-bezier(.22,1,.36,1);
  flex: none;
}
.work-card:hover .work-card__arrow { background: var(--accent); color: #fff; border-color: var(--accent); transform: rotate(45deg); }
.work-card h3 { font-size: clamp(20px, 1.9vw, 28px); margin-bottom: 12px; }
.work-card__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.work-card__tags li { font-size: 12px; font-weight: 500; padding: 6px 14px; border: 1px solid var(--line); border-radius: 100px; color: var(--ink-soft); }
.work-card__outcome {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  display: inline-flex; align-items: baseline; gap: 8px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-radius: 100px; padding: 8px 18px;
  font-family: var(--font-display); font-size: 13px; font-weight: 500; color: var(--ink-soft);
  box-shadow: 0 8px 24px -10px rgba(16,19,33,.35);
}
.work-card__outcome strong { font-size: 19px; font-weight: 600; color: var(--accent); letter-spacing: -0.02em; white-space: nowrap; }
.work-card__note { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 13.5px; }

/* ---------- Stats band ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.stats__item { padding: clamp(28px, 3.5vw, 56px) clamp(16px, 2vw, 32px); border-left: 1px solid var(--line); }
.stats__item:first-child { border-left: none; }
.stats__item strong { display: block; font-family: var(--font-display); font-size: clamp(34px, 4.5vw, 72px); letter-spacing: -0.03em; line-height: 1; margin-bottom: 10px; color: var(--accent); white-space: nowrap; }
.stats__item > span { color: var(--ink-soft); font-size: 14px; }
/* result cards: metric + bold title + description (first band only) */
.stats--result .stats__item strong { font-size: clamp(28px, 3.5vw, 52px); margin-bottom: 14px; }
.stats--result .stats__title { display: block; font-family: var(--font-display); font-size: clamp(15px, 1.2vw, 17px); font-weight: 600; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 6px; }
.stats--result .stats__desc { display: block; color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }

/* ---------- About teaser ---------- */
.about-teaser { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.about-teaser__big { font-family: var(--font-display); font-size: clamp(24px, 3.2vw, 44px); line-height: 1.2; letter-spacing: -0.02em; font-weight: 500; }
.about-teaser__big em { font-style: normal; color: var(--accent); }
.about-teaser__body p { color: var(--ink-soft); margin-bottom: 18px; }

/* ---------- Skills tags ---------- */
.skills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.skills li {
  font-family: var(--font-display); font-size: 14px; padding: 10px 20px;
  border: 1px solid var(--line); border-radius: 100px; background: var(--bg-card);
  transition: background .3s, color .3s, border-color .3s;
}
.skills li:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- CTA / Footer ---------- */
.cta { background: linear-gradient(180deg, #0b1020 0%, #06080f 100%); color: var(--bg); border-radius: var(--radius); padding: clamp(56px, 7vw, 110px) var(--gutter); text-align: center; position: relative; overflow: hidden; }
.cta .eyebrow { justify-content: center; color: #9aa3b8; }
.cta h2 { font-size: clamp(36px, 6.5vw, 96px); text-transform: uppercase; margin: 24px 0 36px; letter-spacing: -0.03em; }
.cta h2 em { font-style: normal; color: var(--accent-bright); }
.cta .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); font-size: 16px; padding: 16px 34px; }
.cta .btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.cta .cta__email { background: transparent; color: var(--bg); border-color: rgba(255,255,255,.35); }
.cta .cta__email:hover { background: var(--bg); color: var(--ink); border-color: var(--bg); }

.footer { padding: 48px 0 32px; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding-top: 32px; }
.footer__links { display: flex; gap: 24px; font-size: 14px; font-weight: 500; }
.footer__links a { display: inline-block; padding: 12px 4px; }
.footer small { color: var(--ink-soft); font-size: 13px; }

/* ---------- Image placeholders (replace with real assets) ---------- */
.ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: repeating-linear-gradient(45deg, #eef1f6, #eef1f6 14px, #e5e9f1 14px, #e5e9f1 28px);
  color: var(--ink-soft); text-align: center; width: 100%; height: 100%;
  font-family: var(--font-display); font-size: 13px; padding: 16px;
}
.ph b { font-size: 15px; color: var(--ink); }
.ph--block { aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; }
.ph--portrait { aspect-ratio: 4/5; border-radius: var(--radius); overflow: hidden; }

/* ---------- Case study pages ---------- */
/* fixed project panel, top left, fades in once the reader scrolls */
.case-panel {
  position: fixed; top: 104px; left: 20px; width: 218px; z-index: 80;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
}
.case-panel.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.case-panel__label {
  font-family: var(--font-display); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; padding-left: 14px;
}
.case-panel a {
  display: block; padding: 12px 14px; border-radius: 12px;
  transition: background .25s;
}
.case-panel a:hover { background: var(--bg-card); }
.case-panel a[aria-current="page"] { background: rgba(29,78,216,.07); }
.case-panel a[aria-current="page"] strong { color: var(--accent); }
.case-panel .num {
  display: block; font-family: var(--font-display); font-size: 11px;
  color: var(--ink-soft); margin-bottom: 4px; letter-spacing: .08em;
}
.case-panel strong {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: 14px; line-height: 1.3; color: var(--ink);
}
.case-panel small {
  display: block; font-family: var(--font-display); font-size: 11.5px;
  color: var(--ink-soft); margin-top: 4px; letter-spacing: .04em;
}

@media (max-width: 1279px) {
  .case-panel { display: none; }
}

.case-hero { padding: 160px 0 64px; }
.case-hero h1 { font-size: clamp(34px, 5.5vw, 84px); letter-spacing: -0.03em; margin: 24px 0 0; max-width: 18ch; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: clamp(36px, 5vw, 64px); }
.facts > div { background: var(--bg-card); padding: 24px; }
.facts h4 { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 10px; font-weight: 500; }
.facts p { font-size: 15px; line-height: 1.5; }
.facts p strong { font-family: var(--font-display); }

.case-body { max-width: 880px; margin: 0 auto; padding-bottom: clamp(80px, 10vw, 140px); }
.case-body section { margin-top: clamp(56px, 7vw, 96px); }
.case-body h2 { font-size: clamp(26px, 3.2vw, 44px); margin-bottom: 24px; letter-spacing: -0.02em; }
.case-body h3 { font-size: 20px; margin: 32px 0 14px; }
.case-body p { color: var(--ink-soft); margin-bottom: 18px; }
.case-body ul { margin: 0 0 18px; padding-left: 4px; }
.case-body ul li { position: relative; padding-left: 24px; margin-bottom: 10px; color: var(--ink-soft); }
.case-body ul li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-family: var(--font-display); }
.case-body blockquote {
  font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 30px); line-height: 1.35; letter-spacing: -0.01em;
  border-left: 3px solid var(--accent); padding: 8px 0 8px 28px; margin: 36px 0; color: var(--ink);
}
.case-body blockquote cite { display: block; font-family: var(--font-body); font-style: normal; font-size: 14px; color: var(--ink-soft); margin-top: 12px; }
.case-body figure { margin: 36px 0; }
.case-body figure img, .case-hero figure img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.case-body figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 10px; }
.case-callout { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; margin: 32px 0; }
.case-callout h4 { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.case-callout p:last-child { margin-bottom: 0; }
.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0; }
.results-grid > div { background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 28px 24px; }
.results-grid strong { display: block; font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 48px); color: var(--accent-bright); letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 8px; }
.results-grid span { font-size: 13px; color: #c3c9d9; }

/* before/after comparison slider */
.ba-slider { margin: 36px 0; }
.ba-slider__frame {
  --pos: 50%;
  position: relative; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line);
  cursor: ew-resize;
}
.ba-slider__frame img { width: 100%; height: auto; border: 0 !important; border-radius: 0 !important; }
.ba-slider__before-wrap {
  position: absolute; inset: 0; z-index: 1;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.ba-slider__before-wrap img { position: absolute; inset: 0; height: 100%; object-fit: cover; }
.ba-slider__divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; z-index: 2;
  background: #fff; box-shadow: 0 0 0 1px rgba(16,19,33,.2);
  transform: translateX(-1px); pointer-events: none;
}
.ba-slider__handle {
  position: absolute; top: 50%; left: var(--pos); z-index: 3;
  transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 12px 32px -8px rgba(16,19,33,.55);
  pointer-events: none;
  transition: background .25s;
}
.ba-slider__frame:hover .ba-slider__handle { background: var(--accent); }
.ba-slider__tag {
  position: absolute; top: 14px; z-index: 2;
  font-family: var(--font-display); font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 100px;
  background: rgba(16,19,33,.78); color: #fff;
  pointer-events: none;
}
.ba-slider__tag--before { left: 14px; }
.ba-slider__tag--after { right: 14px; }
.ba-slider__range {
  position: absolute; inset: 0; z-index: 4;
  width: 100%; height: 100%; margin: 0; opacity: 0;
  -webkit-appearance: none; appearance: none;
  cursor: ew-resize; touch-action: none;
}
.ba-slider__frame:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }

/* next-project nav */
.case-next { border-top: 1px solid var(--line); }
.case-next a { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: clamp(40px, 6vw, 72px) 0; }
.case-next .eyebrow { margin-bottom: 12px; }
.case-next h2 { font-size: clamp(28px, 4.5vw, 64px); text-transform: uppercase; letter-spacing: -0.025em; transition: color .3s; }
.case-next a:hover h2 { color: var(--accent); }

/* single-line hero variant: fluid size so the line never wraps */
.hero__title--inline { font-size: clamp(18px, 5vw, 64px); }
.hero__title--inline .line { white-space: nowrap; }

/* ---------- Contact page ---------- */
.contact-hero { padding: 170px 0 0; }
.contact-links { margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }
.contact-links a {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: clamp(28px, 4vw, 48px) 0; border-bottom: 1px solid var(--line);
}
.contact-links .eyebrow { margin-bottom: 12px; }
.contact-links h2 { font-size: clamp(22px, 4vw, 56px); letter-spacing: -0.025em; transition: color .3s; overflow-wrap: anywhere; }
.contact-links a:hover h2 { color: var(--accent); }
.contact-links p { color: var(--ink-soft); font-size: 14px; margin-top: 10px; }
.contact-links .work-card__arrow { width: 56px; height: 56px; }
.contact-links a:hover .work-card__arrow { background: var(--accent); color: #fff; border-color: var(--accent); transform: rotate(45deg); }

/* ---------- About page ---------- */
.about-hero { padding: 170px 0 40px; }
/* dots stay behind the title only: halved opacity, faded out before the body copy */
.about-hero .fx-canvas {
  opacity: .7;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 320px, transparent 720px);
  mask-image: linear-gradient(to bottom, #000 0, #000 320px, transparent 720px);
}
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(32px, 5vw, 80px); align-items: start; margin-top: clamp(36px, 5vw, 64px); }
.about-grid__sticky { position: sticky; top: 110px; }
.about-grid h2 { font-size: clamp(24px, 2.6vw, 36px); margin: 48px 0 18px; }
.about-grid h2:first-child { margin-top: 0; }
.about-grid .reveal + .reveal { margin-top: 48px; }
.about-grid p { color: var(--ink-soft); margin-bottom: 18px; }
.about-portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.timeline { border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.timeline time { font-family: var(--font-display); font-size: 14px; color: var(--ink-soft); }
.timeline strong { display: block; font-family: var(--font-display); font-weight: 600; }
.timeline span { font-size: 14px; color: var(--ink-soft); }

/* ---------- Reveal helpers ---------- */
.reveal { opacity: 0; transform: translateY(36px); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .work-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats__item:nth-child(3) { border-left: none; }
  .stats__item { border-top: 1px solid var(--line); }
  .stats__item:nth-child(-n+2) { border-top: none; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__photo { max-width: 320px; }
  .about-teaser, .about-grid { grid-template-columns: 1fr; }
  .about-grid__sticky { position: static; max-width: 420px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .results-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav__toggle {
    display: grid; place-items: center; width: 44px; height: 44px;
    background: none; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; z-index: 102; color: var(--ink);
  }
  .nav__links {
    position: fixed; inset: 0; background: var(--bg); z-index: 101;
    flex-direction: column; justify-content: center; gap: 28px;
    opacity: 0; pointer-events: none; visibility: hidden;
    transition: opacity .35s, visibility .35s;
  }
  .nav__links.open { opacity: 1; pointer-events: auto; visibility: visible; }
  .nav__links a { font-size: 26px; font-family: var(--font-display); }
  .hero__meta { flex-direction: column; align-items: flex-start; }
  .section__head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .facts { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .case-next h2 { font-size: 30px; }
}

/* ---------- Screen gallery + lightbox ---------- */
.shot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(14px, 2vw, 22px);
  margin: 32px 0 8px;
}
.shot-thumb {
  display: flex; flex-direction: column;
  padding: 0; margin: 0; text-align: left; cursor: zoom-in;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  font: inherit; color: inherit;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.shot-thumb:hover, .shot-thumb:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(16,19,33,0.10);
  outline: none;
}
.shot-thumb__frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #eef0f4; }
.shot-thumb__frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.shot-thumb__frame::after {
  content: "⤢"; position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: rgba(16,19,33,0.62); color: #fff; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: opacity .25s ease;
}
.shot-thumb:hover .shot-thumb__frame::after, .shot-thumb:focus-visible .shot-thumb__frame::after { opacity: 1; }
.shot-thumb__cap {
  padding: 12px 14px; font-size: 13px; line-height: 1.45; color: var(--ink-soft);
  border-top: 1px solid var(--line);
}
.shot-thumb__cap strong { color: var(--ink); font-weight: 600; }

/* lightbox overlay */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  background: rgba(8,10,18,0.86); backdrop-filter: blur(3px);
  padding: clamp(12px, 4vw, 48px);
}
.lightbox.open { display: flex; }
.lightbox__stage {
  position: relative;
  max-width: min(1100px, 94vw); max-height: 88vh;
  overflow: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius); background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,0.5);
}
.lightbox__stage img { width: 100%; height: auto; display: block; }
.lightbox__cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  margin: 0; padding: 14px 18px; font-size: 13px; color: #fff;
  background: linear-gradient(to top, rgba(8,10,18,0.82), rgba(8,10,18,0));
  pointer-events: none;
}
.lightbox__btn {
  position: absolute; z-index: 2;
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(20,24,38,0.9); color: #fff; border: 1px solid rgba(255,255,255,0.16);
  cursor: pointer; transition: background .2s ease, transform .2s ease;
}
.lightbox__btn:hover, .lightbox__btn:focus-visible { background: var(--accent); outline: none; transform: scale(1.06); }
.lightbox__close { top: clamp(10px, 3vw, 24px); right: clamp(10px, 3vw, 24px); }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav:hover, .lightbox__nav:focus-visible { transform: translateY(-50%) scale(1.06); }
.lightbox__prev { left: clamp(8px, 2vw, 20px); }
.lightbox__next { right: clamp(8px, 2vw, 20px); }
.lightbox__count {
  position: absolute; top: clamp(10px, 3vw, 24px); left: clamp(10px, 3vw, 24px); z-index: 2;
  padding: 6px 12px; border-radius: 20px; font-size: 12px; letter-spacing: .04em;
  background: rgba(20,24,38,0.9); color: #fff; font-family: var(--font-display);
}
@media (max-width: 600px) {
  .shot-gallery { grid-template-columns: repeat(2, 1fr); }
  .lightbox__stage { max-width: 100vw; max-height: 82vh; }
  .lightbox__nav { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .shot-thumb { transition: none; }
  .shot-thumb:hover, .shot-thumb:focus-visible { transform: none; }
}

/* ---------- Portfolio chatbot widget ---------- */
.chat-fab {
  position: fixed; bottom: 22px; right: 22px; z-index: 95;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--ink); color: var(--bg); border: none;
  box-shadow: 0 14px 34px -10px rgba(16,19,33,.5);
  transition: transform .25s ease, background .25s ease;
}
.chat-fab:hover { transform: translateY(-2px); background: var(--accent); }
.chat-fab__close { display: none; }
.chat-fab.is-open .chat-fab__open { display: none; }
.chat-fab.is-open .chat-fab__close { display: block; }
.chat-fab.is-open { background: var(--accent); }

/* attention: a periodic wobble + a one-time speech bubble inviting a click.
   The wobble animates the individual `rotate` property so it layers on top of
   the hover lift instead of replacing it, and both are off under reduced-motion. */
@keyframes chat-fab-wobble {
  0% { rotate: 0deg; }
  1.5% { rotate: -12deg; }
  3% { rotate: 9deg; }
  4.5% { rotate: -6deg; }
  6% { rotate: 3deg; }
  7%, 100% { rotate: 0deg; }
}
.chat-fab--attract { animation: chat-fab-wobble 30s ease-in-out infinite; }
.chat-fab--attract.is-open { animation: none; }

.chat-nudge {
  position: fixed; right: 22px; bottom: 92px; z-index: 94;
  max-width: 232px; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border: none; border-radius: 16px; border-bottom-right-radius: 5px;
  background: var(--ink); color: var(--bg);
  box-shadow: 0 14px 34px -12px rgba(16,19,33,.5);
  font-family: var(--font-display); font-weight: 500; font-size: 13.5px; line-height: 1.35;
  opacity: 0; transform: translateY(8px) scale(.96); transform-origin: bottom right;
  transition: opacity .28s ease, transform .28s ease;
}
.chat-nudge.is-in { opacity: 1; transform: translateY(0) scale(1); }
.chat-nudge:hover { background: var(--accent); }
.chat-nudge__text { flex: 1; }
.chat-nudge__x { flex: none; font-size: 17px; line-height: 1; opacity: .55; }
.chat-nudge:hover .chat-nudge__x { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .chat-fab--attract { animation: none; }
  .chat-nudge, .chat-nudge.is-in { transform: none; }
}

.chat-panel {
  position: fixed; bottom: 92px; right: 22px; z-index: 130;
  width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 30px 70px -20px rgba(16,19,33,.45);
}
.chat-panel[hidden] { display: none; }
.chat-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); background: var(--bg-card); }
.chat-head__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chat-head__id { min-width: 0; }
.chat-head__title { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin: 0; }
.chat-head__who { display: block; font-size: 11.5px; color: var(--ink-soft); margin-top: 1px; }
.chat-head__who:empty { display: none; }
.chat-head__controls { display: flex; align-items: center; gap: 2px; flex: none; }
.chat-ctrl {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 40px; min-width: 40px;
  background: none; border: none; cursor: pointer; color: var(--ink-soft);
  padding: 6px 8px; border-radius: 10px;
  font-family: var(--font-display); font-weight: 500; font-size: 12.5px;
}
.chat-ctrl--restart { min-width: 0; }
.chat-ctrl svg { display: block; }
.chat-ctrl:hover { color: var(--ink); background: var(--bg); }
.chat-ctrl--restart { color: var(--accent); }
.chat-ctrl--restart:hover { color: var(--accent); background: rgba(29,78,216,.08); }
/* persona-switch chip in the starters row */
.chat-chip--switch { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.chat-chip--switch:hover { background: rgba(29,78,216,.08); }

.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; flex-direction: column; gap: 6px; max-width: 88%; }
.chat-msg--user { align-self: flex-end; align-items: flex-end; }
.chat-msg--bot { align-self: flex-start; }
.chat-bubble {
  padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5;
  background: var(--bg-card); color: var(--ink); border: 1px solid var(--line);
}
.chat-msg--user .chat-bubble { background: var(--ink); color: var(--bg); border-color: var(--ink); border-bottom-right-radius: 5px; }
.chat-msg--bot .chat-bubble { border-bottom-left-radius: 5px; }
.chat-bubble--typing { display: inline-flex; gap: 4px; align-items: center; }
.chat-bubble--typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-soft); opacity: .5; animation: chatdot 1s infinite ease-in-out; }
.chat-bubble--typing span:nth-child(2) { animation-delay: .15s; }
.chat-bubble--typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatdot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: .9; } }
.chat-links { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-link {
  font-family: var(--font-display); font-size: 12.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line);
  color: var(--accent); background: var(--bg); transition: background .2s, border-color .2s;
}
.chat-link:hover { background: rgba(29,78,216,.07); border-color: var(--accent); }

.chat-starters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.chat-chip {
  font-family: var(--font-display); font-size: 12.5px; cursor: pointer;
  padding: 7px 12px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink-soft); transition: all .2s ease;
}
.chat-chip:hover { color: var(--accent); border-color: var(--accent); }
/* a starter that's already been used: clearly "spent", dimmed and struck
   through. JS also sets `disabled`/`aria-disabled`, so it leaves the tab
   order and screen readers announce it as unavailable. */
.chat-chip--done,
.chat-chip--done:hover {
  opacity: .45; cursor: default;
  color: var(--ink-soft); border-color: var(--line);
  text-decoration: line-through;
}

/* quick-reply buttons inside the conversation (auntie/uncle, show photo) */
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 90%; }
.chat-quick__btn {
  font-family: var(--font-display); font-size: 12.5px; cursor: pointer;
  padding: 8px 14px; border-radius: 20px;
  border: 1px solid var(--accent); background: rgba(29,78,216,.07); color: var(--accent);
  transition: background .2s ease;
}
.chat-quick__btn:hover { background: rgba(29,78,216,.15); }
/* feeling-rating faces in the exit survey: bigger so they read + tap easily */
.chat-quick__btn--rate { font-size: 22px; line-height: 1; padding: 7px 13px; }
/* inline free-text field: the exit survey's "what was your experience?" box */
.chat-quick--form { flex-direction: column; align-items: stretch; gap: 8px; width: 100%; max-width: 100%; }
.chat-feedback { display: flex; gap: 8px; }
.chat-feedback__input {
  flex: 1; min-width: 0; padding: 9px 14px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 14px;
}
.chat-feedback__input:focus { outline: none; border-color: var(--accent); }
.chat-feedback__send {
  flex: none; cursor: pointer; font-family: var(--font-display); font-size: 12.5px; font-weight: 500;
  padding: 8px 16px; border-radius: 20px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; transition: filter .2s ease;
}
.chat-feedback__send:hover { filter: brightness(.92); }
.chat-feedback__skip { align-self: flex-start; }

/* per-answer 👍/👎 shown under a bot answer, so a specific answer can be rated */
.chat-vote { display: flex; align-items: center; gap: 6px; margin-top: 7px; padding-left: 2px; }
.chat-vote__label { font-family: var(--font-display); font-size: 11.5px; color: var(--ink-soft); }
.chat-vote__btn {
  cursor: pointer; font-size: 13px; line-height: 1; padding: 4px 7px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg);
  transition: background .2s ease, border-color .2s ease, opacity .2s ease;
}
.chat-vote__btn:hover:not(:disabled) { background: rgba(29,78,216,.1); border-color: var(--accent); }
.chat-vote__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chat-vote__btn:disabled { cursor: default; }
.chat-vote--done .chat-vote__btn:not(.chat-vote__btn--chosen) { opacity: .35; }
.chat-vote__btn--chosen { border-color: var(--accent); background: rgba(29,78,216,.12); }

/* photo reply (the round-glasses "Potter look") */
.chat-bubble--photo { padding: 6px; display: flex; flex-direction: column; gap: 8px; max-width: 220px; }
.chat-photo { width: 100%; height: auto; display: block; border-radius: 12px; }
.chat-photo-cap { font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); padding: 0 6px 4px; }
.chat-photo-fallback { font-size: 13px; color: var(--ink-soft); padding: 10px; }

.chat-input { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg-card); }
.chat-input input {
  flex: 1; padding: 10px 14px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 14px;
}
.chat-input input:focus { outline: none; border-color: var(--accent); }
.chat-input button {
  flex: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: var(--ink); color: var(--bg); border: none;
  transition: background .2s ease;
}
.chat-input button:hover { background: var(--accent); }
.chat-disclaimer { margin: 0; padding: 0 16px 10px; font-size: 10.5px; line-height: 1.3; text-align: center; color: var(--ink-soft); background: var(--bg-card); }

/* EU/EEA analytics consent banner (centered along the bottom, sits below content) */
.consent {
  position: fixed; left: 0; right: 0; bottom: 18px; margin: 0 auto; z-index: 200;
  width: fit-content; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 18px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 50px -16px rgba(16,19,33,.42);
  padding: 13px 16px 13px 20px; font-family: var(--font-body);
}
.consent__text { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink); max-width: 460px; }
.consent__actions { display: flex; gap: 8px; flex: none; }
.consent__btn {
  cursor: pointer; font-family: var(--font-display); font-weight: 500; font-size: 13px; white-space: nowrap;
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.consent__btn--no { background: var(--bg); color: var(--ink-soft); }
.consent__btn--no:hover { color: var(--ink); border-color: var(--ink-soft); }
.consent__btn--yes { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.consent__btn--yes:hover { background: var(--accent); border-color: var(--accent); }
@media (max-width: 560px) {
  .consent { left: 12px; right: 12px; margin: 0; width: auto; max-width: none; bottom: 88px; flex-direction: column; align-items: stretch; gap: 12px; }
  .consent__text { max-width: none; }
  .consent__actions { justify-content: flex-end; }
}
@media (prefers-reduced-motion: no-preference) { .consent { animation: consent-in .3s ease both; } }
@keyframes consent-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 480px) {
  .chat-panel { right: 12px; left: 12px; width: auto; bottom: 88px; height: calc(100vh - 110px); }
  .chat-fab { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-fab, .chat-link, .chat-chip, .chat-input button { transition: none; }
  .chat-bubble--typing span { animation: none; }
}
