/* ==========================================================================
   Webscale DS — tokens (mirrors Figma variables, "ws-" prefix)
   ========================================================================== */
:root {
  /* colour */
  --ws-bg-canvas: #ffffff;
  --ws-bg-subtle: #fafafa;
  --ws-bg-muted: #f4f4f5;
  --ws-bg-inverse: #09090b;
  --ws-surface-default: #ffffff;
  --ws-text-primary: #09090b;
  --ws-text-secondary: #52525b;
  --ws-text-tertiary: #71717a;
  --ws-text-inverse: #ffffff;
  --ws-text-link: #4f46e5;
  --ws-accent-default: #6366f1;
  --ws-border-subtle: #f4f4f5;
  --ws-border-default: #e4e4e7;
  --ws-border-strong: #d4d4d8;
  --ws-border-inverse: #09090b;

  /* component aliases */
  --ws-nav-bg: #ffffff;
  --ws-nav-fg: #52525b;
  --ws-nav-border: #f4f4f5;
  --ws-footer-bg: #fafafa;
  --ws-footer-fg: #52525b;
  --ws-footer-border: #e4e4e7;
  --ws-accordion-fg: #09090b;
  --ws-accordion-icon: #71717a;
  --ws-accordion-border: #e4e4e7;
  --ws-button-primary-bg: #09090b;
  --ws-button-primary-fg: #ffffff;
  --ws-button-secondary-bg: #ffffff;
  --ws-button-secondary-fg: #09090b;
  --ws-button-secondary-border: #e4e4e7;
  --ws-button-radius: 8px;

  /* radius */
  --ws-radius-chip: 4px;
  --ws-radius-field: 6px;
  --ws-radius-control: 8px;
  --ws-radius-surface: 12px;

  /* spacing */
  --ws-space-xs: 8px;
  --ws-space-sm: 12px;
  --ws-space-md: 16px;
  --ws-space-lg: 24px;
  --ws-space-xl: 32px;
  --ws-space-2xl: 48px;
  --ws-space-3xl: 64px;
  --ws-space-4xl: 96px;

  /* layout (responsive overrides below) */
  --ws-gutter: 120px;
  --ws-section: 96px;
  --ws-section-lg: 128px;
  --ws-nav-h: 72px;

  /* type */
  --ws-font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ws-font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ws-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04), 0 1px 3px 0 rgba(0, 0, 0, 0.06);
}

@media (max-width: 1279px) {
  :root { --ws-gutter: 64px; }
}
@media (max-width: 1023px) {
  :root { --ws-gutter: 56px; --ws-section: 80px; --ws-section-lg: 96px; --ws-nav-h: 64px; }
}
@media (max-width: 639px) {
  :root { --ws-gutter: 24px; --ws-section: 64px; --ws-section-lg: 80px; }
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ws-bg-canvas);
  color: var(--ws-text-primary);
  font-family: var(--ws-font-sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ws-accent-default); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--ws-bg-inverse); color: var(--ws-text-inverse);
  padding: 8px 16px; border-radius: var(--ws-radius-control);
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   Typography (Figma text styles)
   ========================================================================== */
.t-display-xl { font-weight: 700; font-size: 72px; line-height: 76px; letter-spacing: -3px; }
.t-display-l  { font-weight: 700; font-size: 60px; line-height: 64px; letter-spacing: -3px; }
.t-h1         { font-weight: 700; font-size: 56px; line-height: 60px; letter-spacing: -2.4px; }
.t-h2         { font-weight: 600; font-size: 40px; line-height: 48px; letter-spacing: -1.6px; }
.t-h3         { font-weight: 600; font-size: 32px; line-height: 40px; letter-spacing: -1px; }
.t-h4         { font-weight: 600; font-size: 24px; line-height: 32px; letter-spacing: -0.6px; }
.t-h5         { font-weight: 600; font-size: 20px; line-height: 28px; letter-spacing: -0.6px; }
.t-h6         { font-weight: 600; font-size: 18px; line-height: 24px; letter-spacing: -0.6px; }
.t-body-lg    { font-size: 18px; line-height: 28px; }
.t-body       { font-size: 16px; line-height: 24px; }
.t-body-sm    { font-size: 14px; line-height: 20px; }
.t-body-xs    { font-size: 13px; line-height: 18px; }
.t-label-lg   { font-weight: 500; font-size: 16px; line-height: 24px; }
.t-label      { font-weight: 500; font-size: 14px; line-height: 20px; }
.t-label-sm   { font-weight: 500; font-size: 13px; line-height: 18px; }
.t-overline   { font-family: var(--ws-font-mono); font-weight: 500; font-size: 12px; line-height: 16px; letter-spacing: 1.8px; text-transform: uppercase; }
.t-mono-label { font-family: var(--ws-font-mono); font-weight: 500; font-size: 11px; line-height: 14px; letter-spacing: 1.2px; }
.t-mono-sm    { font-family: var(--ws-font-mono); font-size: 13px; line-height: 18px; }

.c-primary   { color: var(--ws-text-primary); }
.c-secondary { color: var(--ws-text-secondary); }
.c-tertiary  { color: var(--ws-text-tertiary); }
.c-link      { color: var(--ws-text-link); }

@media (max-width: 1023px) {
  .t-display-xl { font-size: 64px; line-height: 68px; }
  .t-display-l  { font-size: 48px; line-height: 52px; letter-spacing: -2px; }
}
@media (max-width: 639px) {
  .t-display-xl { font-size: 44px; line-height: 48px; letter-spacing: -1.8px; }
  .t-display-l  { font-size: 36px; line-height: 40px; letter-spacing: -1.4px; }
  .t-h1         { font-size: 40px; line-height: 44px; letter-spacing: -1.6px; }
  .t-h2         { font-size: 32px; line-height: 38px; letter-spacing: -1.2px; }
  .t-h3         { font-size: 26px; line-height: 32px; letter-spacing: -0.8px; }
  .t-body-lg    { font-size: 17px; line-height: 26px; }
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--ws-gutter); }
.section { padding-block: var(--ws-section); }
.section--subtle { background: var(--ws-bg-subtle); }
.rule { height: 1px; background: var(--ws-border-default); border: 0; margin: 0; }

/* Section header: overline → 20 → heading → 16 → lede */
.sh { display: flex; flex-direction: column; align-items: flex-start; }
.sh__title { margin-top: 20px; max-width: 820px; }
.sh__lede  { margin-top: 16px; max-width: 680px; color: var(--ws-text-secondary); }
.sh + .stack-56 { margin-top: 56px; }

/* Two-column split used by "Why", FAQ etc. */
.split { display: flex; gap: var(--ws-space-4xl); align-items: flex-start; }
.split__left { flex: 0 0 var(--split-left, 480px); min-width: 0; }
.split__right { flex: 1 1 0; min-width: 0; }
@media (max-width: 1023px) {
  .split { flex-direction: column; gap: 48px; }
  .split__left { flex-basis: auto; width: 100%; }
  .split__right { width: 100%; }
}

/* ==========================================================================
   Button (sizes: md 40 / lg 48)
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ws-space-xs);
  height: 40px; padding-inline: var(--ws-space-md);
  border-radius: var(--ws-button-radius); border: 1px solid transparent;
  font-weight: 500; font-size: 14px; line-height: 20px; white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.btn--lg { height: 48px; padding-inline: var(--ws-space-lg); font-size: 16px; line-height: 24px; }
.btn--primary { background: var(--ws-button-primary-bg); color: var(--ws-button-primary-fg); }
.btn--primary:hover { background: #27272a; }
.btn--secondary { background: var(--ws-button-secondary-bg); color: var(--ws-button-secondary-fg); border-color: var(--ws-button-secondary-border); }
.btn--secondary:hover { background: var(--ws-bg-subtle); border-color: var(--ws-border-strong); }

.link-arrow { font-weight: 500; font-size: 14px; line-height: 20px; color: var(--ws-text-link); }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Chips */
.chip {
  display: inline-flex; align-items: flex-start; padding: 3px 8px; border-radius: var(--ws-radius-chip);
  font-weight: 500; font-size: 13px; line-height: 18px; white-space: nowrap;
}
.chip--filled { background: var(--ws-bg-muted); color: var(--ws-text-secondary); }
.chip--outline { border: 1px solid var(--ws-border-default); color: var(--ws-text-tertiary); padding: 2px 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav { position: sticky; top: 0; z-index: 50; background: var(--ws-nav-bg); border-bottom: 1px solid var(--ws-nav-border); }
.nav__bar { display: flex; align-items: center; height: var(--ws-nav-h); }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 20px; letter-spacing: -0.6px; color: var(--ws-text-primary); }
.nav__links { display: flex; align-items: center; gap: var(--ws-space-xl); margin-left: auto; margin-right: 40px; }
.nav__link { font-weight: 500; font-size: 14px; line-height: 20px; color: var(--ws-nav-fg); transition: color 150ms ease; }
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--ws-text-primary); }
.nav__toggle { display: none; margin-left: auto; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: var(--ws-radius-control); }
.nav__icon, .nav__icon::before, .nav__icon::after {
  display: block; width: 18px; height: 1.5px; background: var(--ws-text-primary); position: relative; transition: transform 200ms ease, background-color 200ms ease;
}
.nav__icon::before, .nav__icon::after { content: ""; position: absolute; left: 0; }
.nav__icon::before { top: -6px; }
.nav__icon::after { top: 6px; }
.nav[data-open="true"] .nav__icon { background: transparent; }
.nav[data-open="true"] .nav__icon::before { transform: translateY(6px) rotate(45deg); }
.nav[data-open="true"] .nav__icon::after { transform: translateY(-6px) rotate(-45deg); }

/* full-screen sheet below md */
.nav__sheet { display: none; }
@media (max-width: 1023px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav__sheet {
    position: fixed; inset: calc(var(--ws-nav-h) + 1px) 0 0 0; background: var(--ws-nav-bg);
    display: flex; flex-direction: column; padding: 24px var(--ws-gutter) 32px;
    opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 0s linear 200ms;
  }
  .nav[data-open="true"] .nav__sheet { opacity: 1; visibility: visible; transition: opacity 200ms ease; }
  .nav__sheet a.nav__sheet-link {
    font-weight: 600; font-size: 28px; line-height: 36px; letter-spacing: -0.8px; color: var(--ws-text-primary);
    padding-block: 14px; border-bottom: 1px solid var(--ws-border-subtle);
  }
  .nav__sheet .btn { margin-top: auto; width: 100%; }
  body.nav-open { overflow: hidden; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background: var(--ws-footer-bg); border-top: 1px solid var(--ws-footer-border); }
.footer__content { display: flex; align-items: flex-start; gap: 48px; padding-top: var(--ws-space-3xl); padding-bottom: var(--ws-space-xl); }
.footer__brand { flex: 0 0 360px; }
.footer__tagline { margin-top: 14px; font-size: 14px; line-height: 20px; color: var(--ws-footer-fg); }
.footer__cols { display: flex; gap: var(--ws-space-2xl); margin-left: auto; }
.footer__col { width: 190px; }
.footer__col h2 { color: var(--ws-text-tertiary); margin-bottom: 14px; }
.footer__col li + li { margin-top: 10px; }
.footer__col a, .footer__col span { font-size: 14px; line-height: 20px; color: var(--ws-footer-fg); }
.footer__col a:hover { color: var(--ws-text-primary); }
.footer__bottom { border-top: 1px solid var(--ws-footer-border); }
.footer__bottom .container { display: flex; gap: 8px; align-items: center; padding-block: var(--ws-space-lg); font-size: 13px; line-height: 18px; color: var(--ws-text-tertiary); }
.footer__bottom p:first-child { flex: 1 1 0; }
.footer__bottom a:hover { color: var(--ws-text-primary); }
@media (max-width: 1023px) {
  .footer__brand { flex-basis: 190px; }
  .footer__cols { flex: 1 1 0; gap: 24px; }
  .footer__col { flex: 1 1 0; width: auto; }
}
@media (max-width: 639px) {
  .footer__content { flex-direction: column; gap: 40px; }
  .footer__brand { flex-basis: auto; }
  .footer__cols { flex-direction: column; gap: 32px; margin-left: 0; }
  .footer__bottom .container { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ==========================================================================
   Accordion (FAQ)
   ========================================================================== */
.accordion { width: 100%; }
.acc-item { border-bottom: 1px solid var(--ws-accordion-border); }
.acc-trigger {
  display: flex; width: 100%; align-items: center; gap: 16px; padding-block: 20px; text-align: left;
  font-weight: 600; font-size: 18px; line-height: 24px; letter-spacing: -0.6px; color: var(--ws-accordion-fg);
}
.acc-trigger span { flex: 1 1 0; }
.acc-trigger img { width: 16px; height: 16px; flex: none; transition: transform 200ms ease; }
.acc-trigger[aria-expanded="true"] img { transform: rotate(180deg); }
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 200ms ease; }
.acc-panel > div { overflow: hidden; visibility: hidden; transition: visibility 0s linear 200ms; }
.acc-panel p { color: var(--ws-text-secondary); font-size: 16px; line-height: 24px; padding-bottom: 20px; }
.acc-item:has(.acc-trigger[aria-expanded="true"]) .acc-panel { grid-template-rows: 1fr; }
.acc-item:has(.acc-trigger[aria-expanded="true"]) .acc-panel > div { visibility: visible; transition: none; }
@media (prefers-reduced-motion: reduce) { .acc-panel, .acc-trigger img { transition: none; } }

/* ==========================================================================
   Final CTA (inverse surface)
   ========================================================================== */
.final-cta { background: var(--ws-bg-inverse); color: #fafafa; padding-block: var(--ws-section-lg); }
.final-cta .t-overline { color: var(--ws-text-tertiary); }
.final-cta__title { margin-top: 24px; max-width: 900px; color: #fafafa; }
.final-cta__lede { margin-top: 20px; max-width: 600px; color: #a1a1aa; }
.final-cta__actions { margin-top: 40px; display: flex; align-items: center; gap: var(--ws-space-lg); flex-wrap: wrap; }
.final-cta .btn--primary { background: #ffffff; color: #09090b; }
.final-cta .btn--primary:hover { background: #e4e4e7; }
.final-cta__alt { color: #a1a1aa; font-size: 16px; line-height: 24px; }
.final-cta__alt a { color: #fafafa; }
.final-cta__alt a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   Shared content blocks
   ========================================================================== */
/* Top-ruled feature column (value prop) */
.ruled-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ws-space-lg); }
.ruled-col { padding-top: 28px; }
.ruled-col__rule { height: 1px; background: var(--ws-border-inverse); }
.ruled-col__meta { display: flex; align-items: center; gap: 12px; color: var(--ws-text-tertiary); }
.ruled-col__meta img { width: 20px; height: 20px; }
.ruled-col h3 { margin-top: 20px; }
.ruled-col p { margin-top: 12px; color: var(--ws-text-secondary); }
@media (max-width: 1023px) { .ruled-cols { gap: 20px; } }
@media (max-width: 639px) { .ruled-cols { grid-template-columns: 1fr; gap: 8px; } }

/* Card surface */
.card { background: var(--ws-surface-default); border: 1px solid var(--ws-border-default); border-radius: var(--ws-radius-surface); overflow: hidden; }

/* Numbered list rows (why / principles) */
.num-rows > li { display: flex; gap: 28px; padding-block: 24px; }
.num-rows > li + li { border-top: 1px solid var(--ws-border-default); }
.num-rows__n { flex: 0 0 28px; color: var(--ws-text-tertiary); }
.num-rows__c p { margin-top: 8px; color: var(--ws-text-secondary); }
@media (max-width: 639px) {
  .num-rows > li { flex-direction: column; gap: 12px; }
}

/* Bullet list w/ 4px dot */
.dot-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 20px; color: var(--ws-text-secondary); }
.dot-list li + li { margin-top: 10px; }
.dot-list img { width: 4px; height: 4px; flex: none; }

/* Icon tile */
.icon-tile { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: var(--ws-bg-muted); border-radius: var(--ws-radius-field); flex: none; }
.icon-tile img { width: 20px; height: 20px; }

/* Wireframe skeleton bits (abstract UI mockups) */
.sk { border-radius: 3px; background: var(--ws-border-default); }
.sk--strong { background: var(--ws-border-strong); }
.sk--subtle { background: var(--ws-border-subtle); }
.sk--muted { background: var(--ws-bg-muted); border-radius: 6px; }

/* Project card */
.project { display: flex; flex-direction: column; }
.project__shot { position: relative; background: var(--ws-bg-subtle); height: 368px; padding: 48px 40px 0; overflow: hidden; }
.project__shot .sk-title { width: 160px; height: 14px; border-radius: 4px; }
.project__shot .sk-l1 { width: 240px; height: 10px; margin-top: 14px; }
.project__shot .sk-l2 { width: 190px; height: 10px; margin-top: 8px; }
.project__shot .sk-btn { width: 110px; height: 32px; border-radius: 8px; margin-top: 22px; }
.project__shot .sk-cards { display: flex; gap: 20px; margin-top: 42px; }
.project__shot .sk-card { width: 150px; height: 120px; background: var(--ws-surface-default); border: 1px solid var(--ws-border-default); border-radius: var(--ws-radius-field); padding: 14px; flex: none; }
.project__shot .sk-card .sk--muted { width: 20px; height: 20px; }
.project__shot .sk-card .sk { width: 70px; height: 8px; margin-top: 12px; }
.project__url { position: absolute; left: 40px; bottom: 10px; color: var(--ws-text-tertiary); }
.project__info { padding: var(--ws-space-xl); display: flex; flex-direction: column; align-items: flex-start; flex: 1 1 auto; }
.project__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ws-text-tertiary); }
.project__info h3 { margin-top: 16px; }
.project__info > p { margin-top: 10px; color: var(--ws-text-secondary); }
.project__info .chips { margin-top: 20px; }
.project__info .link-arrow { margin-top: 20px; }
@media (max-width: 639px) {
  .project__shot { height: 280px; padding: 32px 24px 0; }
  .project__shot .sk-l1 { width: 70%; }
  .project__shot .sk-l2 { width: 55%; }
  .project__shot .sk-cards { gap: 12px; margin-top: 28px; }
  .project__shot .sk-card { width: 120px; height: 90px; }
  .project__url { left: 24px; }
  .project__info { padding: 24px; }
}

/* Page header (inner pages) */
.page-header { padding-top: 96px; padding-bottom: 96px; }
@media (max-width: 1023px) { .page-header { padding-top: 72px; padding-bottom: 72px; } }
@media (max-width: 639px) { .page-header { padding-top: 48px; padding-bottom: 56px; } }
