/* weststringfellow.com — single-page, modern grammar:
   tight sans display + serif italic accents, mono details,
   stats band, scroll reveal, sticky blurred nav, dark-mode aware. */

:root {
  /* dark is the default theme */
  --bg: #0f1013;
  --ink: #f0f1f3;
  --muted: #9ba1ab;
  --hair: #24262b;
  --accent: #6ea8ff;
  --grad: linear-gradient(92deg, #7ab1ff, #3e7eff);
  --display: "Inter Tight", "Inter", -apple-system, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
}

:root[data-theme="light"] {
  --bg: #fbfbfa;
  --ink: #111418;
  --muted: #5b6066;
  --hair: #e6e7e8;
  --accent: #1d4ed8;
  --grad: linear-gradient(92deg, #1d4ed8, #3b82f6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 52px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { max-width: 1120px; margin: 0 auto; padding-inline: 32px; }

::selection { background: var(--accent); color: #fff; }

/* ---------- sticky header ---------- */

header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  background: var(--bg); /* fallback for browsers without color-mix */
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

header.scrolled { border-bottom-color: var(--hair); }

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 18px;
  gap: 24px;
}

.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

nav { display: flex; gap: 26px; flex-wrap: wrap; }

nav a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.005em;
  transition: color 0.15s ease;
  padding-block: 4px;
}

nav a:hover { color: var(--ink); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 14px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle svg { width: 14px; height: 14px; }
.theme-toggle .tt-dark { display: none; }
.theme-toggle .tt-light { display: inline-flex; align-items: center; gap: 7px; }
:root[data-theme="light"] .theme-toggle .tt-light { display: none; }
:root[data-theme="light"] .theme-toggle .tt-dark { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- hero ---------- */

.hero {
  padding-block: 90px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
}

.portrait {
  width: clamp(230px, 23vw, 285px);
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
  border: 1px solid var(--hair);
  background: #fff;
  box-shadow: 0 32px 64px -36px rgba(0, 0, 0, 0.35);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.3rem, 5vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  max-width: 24ch;
  text-wrap: balance;
}

.hero h1 .accent-phrase {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 450;
  letter-spacing: -0.01em;
}

.hero .sub {
  margin-top: 28px;
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 46ch;
}

.logos-eyebrow {
  margin-top: 110px;
  border-top: 1px solid var(--hair);
  padding-top: 56px;
  margin-bottom: 0;
}

.logo-row {
  margin-block: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 36px;
  flex-wrap: wrap;
  color: var(--muted);
}

.logo-row .logo {
  display: block;
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.logo-row .logo:hover { opacity: 1; color: var(--ink); }

.logo-amazon { height: 44px; width: auto; }
.logo-paypal { height: 44px; width: auto; }
.logo-target { height: 44px; width: auto; }
.logo-visa { height: 52px; width: auto; }
.logo-rosetta {
  display: block;
  height: 38px;
  aspect-ratio: 1280 / 548;
  background-color: currentColor;
  -webkit-mask: url(rosetta-logo.png) center / contain no-repeat;
  mask: url(rosetta-logo.png) center / contain no-repeat;
}


/* ---------- stats band ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 24px;
}

.stat .num {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.2vw, 2.9rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat .label {
  margin-top: 6px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- sections ---------- */

.section {
  margin-top: 110px;
  border-top: 1px solid var(--hair);
  padding-top: 56px;
}

/* bands (label + one row) sit tighter so the credential strips read as one block */
.section.band { margin-top: 72px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 18px;
}

.section h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.section .lede {
  margin-top: 20px;
  max-width: 56ch;
  font-size: 1.15rem;
  color: var(--muted);
}

/* ---------- case studies ---------- */

.case { padding-top: 64px; max-width: 720px; }

.case h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.case .meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 8px 0 22px;
}

.case p + p { margin-top: 1.1em; }
.case p.promoted { margin-top: 1.4em; color: var(--ink); }

strong { font-weight: 600; }

a.cite {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

a.cite:hover { text-decoration-color: var(--accent); }

.howdo-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
  white-space: nowrap;
}

.howdo-link:hover { text-decoration-color: var(--accent); }
.howdo-link .arrow { display: inline-block; transition: transform 0.2s ease; }
.howdo-link:hover .arrow { transform: translate(4px, -3px); }

.rec-list { margin-top: 24px; display: grid; gap: 16px; max-width: 720px; }

.rec-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 36px;
}

.rec-year {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--muted);
  padding-top: 2px;
}

.rec-row .ctx { color: var(--muted); }

.press-row {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  flex-wrap: wrap;
  color: var(--muted);
}

.press-logo {
  display: block;
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.press-logo:hover { opacity: 1; color: var(--ink); }
.press-fortune { height: 26px; width: auto; }
.press-wsj { height: 20px; width: auto; }
.press-wired { height: 22px; width: auto; }
.press-fastcompany { height: 20px; width: auto; }
.press-sfchronicle { height: 22px; width: auto; }

/* ---------- timeline ---------- */

.timeline { margin-top: 34px; position: relative; max-width: 760px; }

.tl-entry {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 36px;
  padding-block: 30px;
  padding-left: 28px;
}

.tl-entry::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--hair);
}

.tl-entry::after {
  content: "";
  position: absolute;
  left: 0;
  top: 44px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.tl-entry:last-child { padding-bottom: 0; }
.tl-entry:first-child::before { top: 40px; }
.tl-entry:last-child::before { bottom: auto; height: 48px; }

.tl-year {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding-top: 2px;
}

.tl-body { max-width: 580px; }

.tl-body p + p { margin-top: 0.8em; }

.tl-body .who {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: 4px;
}

/* ---------- capabilities ---------- */

.cap-grid {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.cap {
  border: 1px solid var(--hair);
  border-radius: 16px;
  padding: 26px 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.cap:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--hair)); transform: translateY(-2px); }

.cap h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.cap p { font-size: 0.95rem; color: var(--muted); line-height: 1.6; }

.peer-validation {
  margin-top: 36px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 450;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.4;
  max-width: 26ch;
  letter-spacing: -0.01em;
}

.availability { margin-top: 40px; color: var(--muted); max-width: 56ch; }

/* ---------- contact / footer ---------- */

.contact {
  margin-top: 110px;
  border-top: 1px solid var(--hair);
  padding-top: 56px;
  padding-bottom: 110px;
}

.contact .big-link {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.4vw, 3.4rem);
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
  margin-top: 16px;
}

.contact .big-link .arrow { display: inline-block; transition: transform 0.2s ease; }
.contact .big-link:hover .arrow { transform: translate(6px, -4px); }
.contact .big-link:hover { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

footer {
  border-top: 1px solid var(--hair);
  padding-block: 32px 56px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); }

/* ---------- section navigation arrows ---------- */

.scroll-nav {
  position: fixed;
  bottom: 20px;
  right: 24px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scroll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--hair);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  color: var(--muted);
  cursor: pointer;
  transition: opacity 0.35s ease, transform 0.35s ease, color 0.2s ease, border-color 0.2s ease;
}

.scroll-btn:hover { color: var(--ink); border-color: var(--muted); }
.scroll-btn svg { width: 14px; height: 14px; }

#nav-up { opacity: 0; pointer-events: none; transform: translateY(6px); }
.scroll-nav.show-up #nav-up { opacity: 1; pointer-events: auto; transform: none; }
.scroll-nav.at-end #nav-down { opacity: 0; pointer-events: none; }
.scroll-nav.at-top #nav-down svg { animation: cue-bob 1.6s ease-in-out infinite; }

@keyframes cue-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ---------- scroll reveal ---------- */

/* Elements are visible by default (no-JS and deep-link safe).
   JS adds .pre only to below-fold elements, then removes it on intersect. */
.reveal {
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.reveal.pre { opacity: 0; transform: translateY(20px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-nav svg { animation: none; }
  .reveal { transition: none; }
  .reveal.pre { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  html { scroll-padding-top: 86px; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 8px; padding-block: 12px; position: relative; }
  .theme-toggle { position: absolute; top: 10px; right: 32px; padding: 5px 12px; }
  nav { gap: 0 20px; }
  nav a { padding-block: 10px; }
  footer a { padding-block: 10px; display: inline-block; }
  .hero { padding-top: 130px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .portrait { width: min(220px, 58%); order: -1; }
  .logo-row { margin-block: 20px 0; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .cap-grid { grid-template-columns: 1fr; }
  .section, .contact, .logos-eyebrow { margin-top: 80px; padding-top: 44px; }
  .section.band { margin-top: 56px; }
  .tl-entry { grid-template-columns: 1fr; gap: 6px; }
  .tl-entry::after { top: 36px; }
  .rec-row { grid-template-columns: 1fr; gap: 2px; }
  .press-row { justify-content: flex-start; gap: 18px 36px; }
}

@media (max-width: 560px) {
  nav { gap: 0 16px; }
  .theme-toggle { right: 22px; }
  nav a { font-size: 0.78rem; }
  .container { padding-inline: 22px; }
}
