/* ============================================================
   DIRECTION A — Editorial / Typographic
   Serif display, generous whitespace, premium consultancy tone
   ============================================================ */

[data-dir="A"] {
  --display: var(--serif);
}

[data-dir="A"] .hero {
  padding: clamp(80px, 14vh, 160px) 0 clamp(60px, 10vh, 120px);
  position: relative;
}
[data-dir="A"] .hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
[data-dir="A"] .hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(52px, 9vw, 136px);
  line-height: 0.92;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
[data-dir="A"] .hero h1 em {
  font-style: italic;
  color: var(--accent);
}
[data-dir="A"] .hero .sub {
  font-size: 19px;
  color: var(--muted);
  max-width: 54ch;
  line-height: 1.5;
  margin-top: 32px;
}
[data-dir="A"] .hero-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
[data-dir="A"] .hero-meta .cell .k {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px;
}
[data-dir="A"] .hero-meta .cell .v {
  font-family: var(--serif); font-size: 28px; letter-spacing: -0.01em;
}

[data-dir="A"] .hero-cta { display: flex; gap: 14px; margin-top: 40px; }

[data-dir="A"] .section-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(36px, 5vw, 64px); line-height: 1;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
[data-dir="A"] .section-head h2 em { font-style: italic; color: var(--accent); }

[data-dir="A"] .service h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; }
[data-dir="A"] .step h4 { font-family: var(--serif); font-weight: 400; font-size: 26px; }
[data-dir="A"] .case h4 { font-family: var(--serif); font-weight: 400; font-size: 28px; }
[data-dir="A"] .quote blockquote { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.25; }

@media (max-width: 780px) {
  [data-dir="A"] .hero-meta { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   DIRECTION B — Technical / Code-flavoured
   Monospace system, grid lines, muted + single accent
   ============================================================ */

[data-dir="B"] {
  --display: var(--mono);
}

/* Grid overlay — subtle vertical guides in hero only */
[data-dir="B"] .hero {
  padding: clamp(64px, 10vh, 120px) 0 clamp(56px, 9vh, 100px);
  position: relative;
  border-bottom: 1px solid var(--line);
}
[data-dir="B"] .hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
  pointer-events: none; opacity: 0.6;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 90%);
}

[data-dir="B"] .hero-grid { position: relative; z-index: 2; }
[data-dir="B"] .hero .tag-line {
  font-family: var(--mono); font-size: 12px;
  color: var(--muted); letter-spacing: 0.1em;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; margin-bottom: 48px;
}
[data-dir="B"] .hero .tag-line .live {
  width: 6px; height: 6px; border-radius: 50%;
  background: #2ecc71; box-shadow: 0 0 0 4px rgba(46,204,113,0.2);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(46,204,113,0.2); }
  50% { box-shadow: 0 0 0 8px rgba(46,204,113,0); }
}

[data-dir="B"] .hero h1 {
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(40px, 6.2vw, 88px);
  line-height: 1.02; letter-spacing: -0.04em;
  max-width: 18ch;
}
[data-dir="B"] .hero h1 .accent { color: var(--accent); }
[data-dir="B"] .hero h1 .caret {
  display: inline-block; width: 0.5em; height: 0.9em;
  background: var(--ink); vertical-align: -0.08em;
  animation: blink 1.1s step-end infinite; margin-left: 4px;
}
@keyframes blink { 50% { background: transparent; } }

[data-dir="B"] .hero .sub {
  font-size: 16px; color: var(--muted); max-width: 60ch;
  margin-top: 32px; line-height: 1.6;
}

[data-dir="B"] .hero-cta { display: flex; gap: 12px; margin-top: 36px; }

[data-dir="B"] .hero-meta {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 64px;
  border-top: 1px solid var(--line);
}
[data-dir="B"] .hero-meta .cell {
  padding: 28px 24px 28px 0;
  border-right: 1px solid var(--line);
}
[data-dir="B"] .hero-meta .cell:last-child { border-right: 0; }
[data-dir="B"] .hero-meta .cell .k {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px;
}
[data-dir="B"] .hero-meta .cell .v {
  font-family: var(--mono); font-size: 20px; letter-spacing: -0.01em;
  font-weight: 500;
}

[data-dir="B"] .section-head h2 {
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08;
  letter-spacing: -0.03em; max-width: 18ch;
}
[data-dir="B"] .section-head h2 .accent { color: var(--accent); }

[data-dir="B"] .service h3 { font-family: var(--mono); font-weight: 500; font-size: 19px; letter-spacing: -0.02em; }
[data-dir="B"] .step h4 { font-family: var(--mono); font-weight: 500; font-size: 18px; letter-spacing: -0.02em; }
[data-dir="B"] .case h4 { font-family: var(--mono); font-weight: 500; font-size: 20px; letter-spacing: -0.02em; }
[data-dir="B"] .quote blockquote { font-family: var(--mono); font-weight: 500; font-size: 22px; line-height: 1.4; letter-spacing: -0.02em; }

@media (max-width: 780px) {
  [data-dir="B"] .hero-meta { grid-template-columns: 1fr 1fr; }
  [data-dir="B"] .hero-meta .cell:nth-child(2n) { border-right: 0; }
}

/* ============================================================
   Direction visibility — CSS-driven (no flash before JS runs).
   The active style block is chosen by [data-dir] on <html>, which a
   tiny inline head script sets pre-paint from the saved preference.
   ============================================================ */
[data-dir="A"] .only-b,
[data-dir="B"] .only-a { display: none; }

/* ---------- Visual style switcher (customer-facing) ---------- */
.dir-switch {
  position: fixed; top: 80px; right: 20px;
  z-index: 50;
  display: inline-flex; align-items: center; gap: 4px;
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 4px 4px 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.dir-switch-label {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin-right: 6px;
}
@media (max-width: 640px) {
  .dir-switch { top: auto; bottom: 16px; right: 16px; }
  .dir-switch-label { display: none; }
}
.dir-switch button {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: color .2s ease, background .2s ease;
}
.dir-switch button:hover { color: var(--ink); }
.dir-switch button.on { background: var(--ink); color: var(--paper); }
