/* Site-level overrides + helpers layered on top of Runwai tokens */

html, body { margin: 0; padding: 0; background: var(--color-canvas); }
*, *::before, *::after { box-sizing: border-box; }

/* Keep anchored scroll targets clear of the 88px sticky nav */
html { scroll-behavior: smooth; }
:target,
section[id],
[id] { scroll-margin-top: 104px; }

button { font-family: var(--font-sans); }
input, textarea, select { font-family: var(--font-sans); }
a { color: inherit; }
img { display: block; max-width: 100%; }

::selection { background: var(--color-ink); color: var(--color-on-primary); }

/* ---------- Layout container ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 48px;
  width: 100%;
}

/* ---------- Editorial display — outsized headline a la John Doe ---------- */
.t-display-mega {
  font-family: var(--font-sans);
  font-size: clamp(72px, 12vw, 192px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-weight: 500;
  color: var(--color-ink);
  margin: 0;
  text-transform: uppercase;
  text-wrap: balance;
}

.t-display-mega--light {
  color: var(--color-on-primary);
}

.t-display-xl {
  font-family: var(--font-sans);
  font-size: clamp(48px, 6vw, 96px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin: 0;
}

/* ---------- Section padding ---------- */
.section { padding: var(--sp-section-lg) 0; }
.section-tight { padding: var(--sp-section) 0; }

/* ---------- Dark band ---------- */
.band-dark {
  background: var(--color-scrim);
  color: var(--color-on-primary);
}
.band-dark .t-meta,
.band-dark .t-eyebrow { color: var(--color-stone); }
.band-dark p, .band-dark .t-body { color: var(--color-stone); }

/* ---------- Pill button extensions ---------- */
.btn-with-arrow {
  padding-right: 4px;
  gap: 0;
}
.btn-with-arrow .arrow {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: var(--color-on-primary);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 16px;
  flex-shrink: 0;
}
.btn-with-arrow.btn-ghost .arrow {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.btn-with-arrow.btn-primary-on-dark .arrow {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

/* When ghost is hovered (inverted), keep arrow contrast */
.btn-ghost.btn-with-arrow:hover .arrow {
  background: var(--color-on-primary);
  color: var(--color-primary);
}

/* ---------- Card with arrow corner (expertise / case study tiles) ---------- */
.tile {
  position: relative;
  background: var(--color-canvas-warm);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 32px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 160ms ease, border-color 160ms ease;
  text-decoration: none;
  color: inherit;
}
.tile:hover {
  background: var(--color-hairline);
  border-color: var(--color-hairline-soft);
}
.tile .tile-corner {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--color-canvas);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
}
.tile:hover .tile-corner {
  background: var(--color-ink);
  color: var(--color-on-primary);
  border-color: var(--color-ink);
}

/* ---------- Case study gallery tile (hover zoom on photographic media) ---------- */
.case-gallery-tile { transition: transform 400ms cubic-bezier(0.16,1,0.3,1); }
.case-gallery-tile img { transition: transform 700ms cubic-bezier(0.16,1,0.3,1); }
.case-gallery-tile:hover img { transform: scale(1.04); }
.case-carousel:hover img { transform: none; }

/* ---------- Carousel tile arrows ---------- */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 200ms ease, background 160ms ease;
}
.case-carousel:hover .carousel-arrow,
.carousel-arrow:focus-visible { opacity: 1; }
.carousel-arrow:hover { background: rgba(0,0,0,0.65); }
@media (hover: none) {
  .carousel-arrow { opacity: 1; }
}

/* ---------- Brand wall cells ---------- */
.brand-cell {
  color: var(--color-ash);
  transition: color 220ms ease, background 220ms ease;
}
.brand-cell:hover {
  color: var(--color-ink);
  background: var(--color-canvas-warm);
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
  background: var(--color-footer);
  color: var(--color-on-primary);
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 48px;
  padding: 28px 24px;
  animation: marquee 30s linear infinite;
  white-space: nowrap;
  will-change: transform;
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  font-size: clamp(56px, 8vw, 96px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 500;
  color: var(--color-on-primary);
  opacity: 0.6;
}
.marquee-item .glyph {
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-on-primary);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Hairline list rows (experience table) ---------- */
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 48px;
  padding: 28px 0;
  border-top: 1px solid var(--rule-strong);
}
.row:last-child { border-bottom: 1px solid var(--rule-strong); }

/* ---------- Stats bar chart (dark) ---------- */
.bars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
  align-items: end;
  padding-top: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding-bottom: 0;
}
.bar-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  position: relative;
}
.bar-value {
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--color-on-primary);
  margin-bottom: 12px;
}
.bar-stick {
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.08);
  border-top-left-radius: var(--r-sm);
  border-top-right-radius: var(--r-sm);
}
.bar-label {
  padding-top: 20px;
  color: var(--color-stone);
  font-size: 15px;
  letter-spacing: -0.01em;
}

/* ---------- Testimonial card ---------- */
.testimonial-card {
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  break-inside: avoid;
  margin-bottom: 24px;
}
.testimonial-card.light {
  background: var(--color-canvas);
  border-color: var(--rule);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--color-surface-cool);
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Image placeholder ---------- */
.media-ph {
  background: var(--color-surface-cool);
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  color: var(--color-graphite);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: -0.01em;
}
.media-ph img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Form ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-size: 13px;
  color: var(--color-graphite);
  letter-spacing: -0.01em;
}
.field input,
.field textarea,
.field select {
  background: var(--color-canvas);
  border: 0;
  border-bottom: 1px solid var(--color-hairline-soft);
  padding: 12px 0;
  font-size: 18px;
  color: var(--color-ink);
  outline: none;
  border-radius: 0;
  width: 100%;
  resize: none;
}
.field textarea {
  padding-top: 12px;
  line-height: 1.5;
  vertical-align: top;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--color-stone); }
.field input:focus,
.field textarea:focus { border-bottom-color: var(--color-ink); }

/* ---------- Quoting glyph circle ---------- */
.quote-glyph {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--color-ink);
  color: var(--color-on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.quote-glyph svg {
  stroke: var(--color-on-primary);
  fill: var(--color-on-primary);
  stroke-width: 2.25;
}

/* ---------- Scroll progress (decorative) ---------- */
.scroll-progress {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: var(--color-hairline);
  z-index: 100;
}
.scroll-progress > div {
  height: 100%;
  background: var(--color-ink);
  width: 0%;
  transition: width 80ms linear;
}
.scroll-progress::before {
  content: '';
  position: absolute;
  left: 24px;
  bottom: 18px;
  width: 56px; height: 56px;
  border-radius: var(--r-full);
  background: var(--color-ink);
  color: var(--color-on-primary);
}

/* ---------- Misc ---------- */
.divider-strong { border: 0; border-top: 1px solid var(--rule-strong); }
.tag-num {
  font-size: 14px;
  color: var(--color-graphite);
  letter-spacing: -0.01em;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-full);
  font-size: 13px;
  color: var(--color-graphite);
  letter-spacing: -0.01em;
}
.eyebrow-pill::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: var(--r-full);
  background: var(--color-ink);
}
.eyebrow-pill.on-dark {
  border-color: rgba(255,255,255,0.18);
  color: var(--color-stone);
}
.eyebrow-pill.on-dark::before { background: var(--color-on-primary); }

/* ---------- About photo slideshow ---------- */
.slideshow { --ss-fade: 900ms; }
.ss-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none;
  border-radius: var(--r-full);
  background: rgba(0,0,0,0.42);
  color: var(--color-on-primary);
  cursor: pointer;
  opacity: 0;
  transition: opacity 220ms ease, background 160ms ease;
}
.ss-prev { left: 14px; }
.ss-next { right: 14px; }
.slideshow:hover .ss-arrow,
.ss-arrow:focus-visible { opacity: 1; }
.ss-arrow:hover { background: rgba(0,0,0,0.62); }
.ss-arrow:focus-visible { outline: 2px solid var(--color-on-primary); outline-offset: 2px; }

.ss-dots {
  position: absolute;
  bottom: 16px; right: 16px; z-index: 3;
  display: flex; gap: 7px;
}
.ss-dot {
  width: 7px; height: 7px;
  padding: 0;
  border: none;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease;
}
.ss-dot:hover { background: rgba(255,255,255,0.8); }
.ss-dot.is-on { background: var(--color-on-primary); transform: scale(1.25); }
.ss-dot:focus-visible { outline: 2px solid var(--color-on-primary); outline-offset: 2px; }

/* touch devices: keep arrows visible since there's no hover */
@media (hover: none) {
  .ss-arrow { opacity: 1; background: rgba(0,0,0,0.5); }
}
@media (prefers-reduced-motion: reduce) {
  .slideshow img, .slideshow > div { transition: none !important; }
}
