/* ===== TOKENS ===== */
:root {
  --bg: #FFFFFF;
  --sidebar: #F7F7F7;
  --text: #111111;
  --muted: #535353;
  /* AAA on #FFF (7.69:1), #F7F7F7 (7.18:1), #F5F5F5 (7.06:1) */
  --border: #E8E8E8;
  --sidebar-w: 216px;
  --font: 'Inter', system-ui, sans-serif;
  --accent: #111111;
  /* overridden per case study */
}

/* ===== RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ===== SKIP LINK ===== */
.skip-link {
  position: fixed;
  top: -100%;
  left: 16px;
  background: var(--text);
  color: var(--bg);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  z-index: 1000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 8px;
}

/* ===== PROGRESS BAR ===== */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  z-index: 200;
  width: 0%;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 40px 28px;
  z-index: 100;
}

.sidebar-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sidebar-role {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 48px;
  line-height: 1.5;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  margin-bottom: auto;
}

.sidebar-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 7px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.15s;
}

.sidebar-nav a::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--border);
  transition: width 0.2s, background 0.2s;
  flex-shrink: 0;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--text);
}

.sidebar-nav a:hover::before,
.sidebar-nav a.active::before {
  width: 24px;
  background: var(--text);
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

.sidebar-meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-meta-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-meta-value {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}

.sidebar-copy {
  margin-top: 24px;
  font-size: 11px;
  color: var(--muted);
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  align-items: center;
  justify-content: space-between;
}

.mobile-header-name {
  font-size: 14px;
  font-weight: 600;
}

.mobile-header-links {
  display: flex;
  gap: 24px;
}

.mobile-header-links a {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* ===== MAIN & FOOTER ===== */
main {
  margin-left: var(--sidebar-w);
  animation: fadeIn 0.35s ease both;
}

footer {
  margin-left: var(--sidebar-w);
  border-top: 1px solid var(--border);
  padding: 24px 56px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* ===== INDEX: SECTIONS ===== */
.section {
  padding: 64px 56px;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
  display: block;
}

/* ===== INDEX: WORK GRID ===== */
.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.work-tile {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 32px;
  min-height: 240px;
  transition: background 0.2s, color 0.2s;
}

.work-tile:hover {
  background: var(--text);
  color: var(--bg);
}

.work-tile:hover .tile-cat,
.work-tile:hover .tile-role,
.work-tile:hover .tile-period {
  color: rgba(255, 255, 255, 0.6);
  /* 7.28:1 on #111 tile — AAA */
}

.work-tile:hover .tile-arrow {
  opacity: 1;
}

.work-tile--featured {
  grid-column: 1 / -1;
  min-height: 280px;
}

.tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: auto;
  padding-bottom: 32px;
}

.tile-cat {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.tile-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.work-tile--featured .tile-title {
  font-size: 26px;
}

.tile-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: auto;
}

.work-tile:hover .tile-bottom {
  border-top-color: rgba(255, 255, 255, 0.15);
}

.tile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tile-role {
  font-size: 12px;
  color: var(--muted);
}

.tile-period {
  font-size: 12px;
  color: var(--muted);
}

.tile-arrow {
  font-size: 18px;
  opacity: 0.15;
  transition: opacity 0.2s;
}

.tile-logo {
  height: 20px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.work-tile:hover .tile-logo {
  filter: brightness(0) invert(1);
}

.work-tile:hover .tile-logo--solid {
  filter: none;
  opacity: 0.9;
}

.tile--hilo {
  border-top: 3px solid #0E4D6B;
}

.tile--amazon {
  border-top: 3px solid #FF9900;
}

.tile--sq {
  border-top: 3px solid #F47B20;
}

.tile--imd {
  border-top: 3px solid #1E3A8A;
}

.tile--yoti {
  border-top: 3px solid #00A8D6;
}

/* ===== INDEX: ABOUT ===== */
.about-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.about-body p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}

.about-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 48px;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.fact-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fact-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fact-list li,
.fact-list p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.65;
}

.fact-links {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

.fact-link {
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: border-color 0.15s;
}

.fact-link:hover {
  border-color: var(--text);
}

/* ===== INDEX: CONTACT ===== */
.contact-section {
  padding: 64px 56px 96px;
}

.contact-section h2 {
  font-size: clamp(40px, 5.5vw, 72px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.0;
  margin-bottom: 20px;
}

.contact-section p {
  font-size: 16px;
  color: var(--muted);
  max-width: 42ch;
  margin-bottom: 32px;
  line-height: 1.6;
}

.contact-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.contact-link {
  font-size: 13px;
  font-weight: 600;
  padding: 11px 22px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.contact-link.primary {
  background: var(--text);
  color: var(--bg);
}

.contact-link.primary:hover {
  background: #333;
}

.contact-link.secondary {
  border: 1px solid var(--border);
  color: var(--muted);
}

.contact-link.secondary:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ===== CASE STUDY: BACK BAR ===== */
.cs-back-bar {
  padding: 20px 56px;
  border-bottom: 1px solid var(--border);
}

.cs-back {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}

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

/* ===== CASE STUDY: HERO ===== */
.cs-hero {
  padding: 48px 56px 48px;
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--accent);
}

.cs-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.cs-logo {
  height: 24px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.cs-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 4px;
}

.cs-hero h1 {
  font-size: clamp(28px, 3.8vw, 48px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 16px;
}

.cs-hero-sub {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 58ch;
  margin-bottom: 40px;
}

.cs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.cs-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-meta-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.cs-meta-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* ===== CASE STUDY: BODY ===== */
.cs-body {
  max-width: 740px;
  padding: 64px 56px 96px;
}

/* ===== CASE STUDY: SECTIONS ===== */
.cs-section {
  margin-bottom: 64px;
}

.cs-section:last-child {
  margin-bottom: 0;
}

.cs-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}

.cs-section h2 {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 20px;
}

.cs-section p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 16px;
}

.cs-section p:last-child {
  margin-bottom: 0;
}

.cs-section p strong {
  color: var(--text);
  font-weight: 600;
}

.cs-section ul {
  list-style: disc;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.cs-section ul li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

.cs-section ul li strong {
  color: var(--text);
}

.cs-section em {
  font-style: italic;
}

/* ===== CASE STUDY: FIGURES ===== */
.cs-figure {
  margin: 0 0 64px;
}

.cs-figure img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.cs-figure figcaption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
}

.fig-placeholder {
  display: flex;
  width: 100%;
  aspect-ratio: 16/9;
  background: #F5F5F5;
  border-radius: 8px;
  border: 1px dashed var(--border);
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

/* ===== CASE STUDY: STAT ===== */
.cs-stat {
  border-left: 3px solid var(--accent);
  padding: 24px 28px;
  margin: 32px 0;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 0 6px 6px 0;
}

.stat-num {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.stat-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ===== CASE STUDY: CHALLENGE BLOCKS ===== */
.challenge-block {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  margin-bottom: 12px;
}

.challenge-block h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.challenge-block p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.65;
}

/* ===== CASE STUDY: PROCESS TAGS ===== */
.process-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.process-tag {
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 99px;
  color: var(--muted);
}

/* ===== CASE STUDY: OUTCOME LIST ===== */
.outcome-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.outcome-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  align-items: start;
}

.outcome-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.outcome-item h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.outcome-item p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.65;
}

/* ===== CASE STUDY: FOOTER NAV ===== */
.cs-footer-nav {
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.cs-nav-prev,
.cs-nav-next {
  padding: 40px 56px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.15s;
}

.cs-nav-prev:hover,
.cs-nav-next:hover {
  background: #F9F9F9;
}

.cs-nav-next {
  border-left: 1px solid var(--border);
  text-align: right;
}

.cs-nav-dir {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.cs-nav-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  transition: color 0.15s;
}

.cs-nav-prev:hover .cs-nav-name,
.cs-nav-next:hover .cs-nav-name {
  color: var(--accent);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
  }

  main {
    margin-left: 0;
  }

  footer {
    margin-left: 0;
    padding-left: 24px;
    padding-right: 24px;
  }

  .section,
  .contact-section {
    padding-left: 24px;
    padding-right: 24px;
  }

  .about-facts {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .cs-back-bar {
    padding-left: 24px;
    padding-right: 24px;
  }

  .cs-hero {
    padding-left: 24px;
    padding-right: 24px;
    padding-top: 36px;
  }

  .cs-body {
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 64px;
  }

  .cs-nav-prev,
  .cs-nav-next {
    padding: 32px 24px;
  }

  .cs-meta {
    gap: 24px;
  }
}

@media (max-width: 600px) {
  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-tile--featured {
    grid-column: 1;
    min-height: 200px;
  }

  .section {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .contact-section {
    padding-top: 48px;
    padding-bottom: 64px;
  }

  .cs-footer-nav {
    grid-template-columns: 1fr;
  }

  .cs-nav-next {
    border-left: none;
    border-top: 1px solid var(--border);
    text-align: left;
  }

  .cs-hero h1 {
    font-size: 26px;
  }
}