/* Site-level layout + page helpers. Pairs with styles.css (the design-system
   tokens & components). Consolidated from the original page prototypes. */

body { margin: 0; text-wrap: pretty; }

a { color: var(--color-accent-700); text-underline-offset: 3px; }
a:hover { color: var(--color-accent); }
a.btn-primary, a.btn-primary:hover, a.btn-primary:active { color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-800); border-color: var(--color-accent-800); }
.btn-primary:active { background: var(--color-accent-900); border-color: var(--color-accent-900); }

/* — sticky nav — */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  padding-inline: max(clamp(20px,5vw,72px), calc((100% - 1200px)/2 + clamp(20px,5vw,72px)));
}
.nav-brand { white-space: nowrap; }
/* phones: Home has 5 links, too many beside the name; Approach & Experience are reached by scrolling */
@media (max-width: 560px) { .nav a[href="#stance"], .nav a[href="#experience"] { display: none; } }

/* — key-figures strip — */
.figs { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); }
@media (max-width: 1000px) {
  .figs { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .figs > div:nth-child(3) { border-right: 0 !important; }
  .figs > div:nth-child(n+4) { border-top: 1px solid var(--color-divider); }
}
@media (max-width: 640px) {
  .figs { grid-template-columns: 1fr; }
  .figs > div { border-right: 0 !important; border-top: 1px solid var(--color-divider); }
  .figs > div:first-child { border-top: 0; }
}

/* — home: capabilities / duality / work / gantt / experience — */
.caps li + li { border-top: 1px dashed var(--color-divider); }
.work-item { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 24px clamp(24px,4vw,64px); align-items: start; }
.work-side { border-left: 1px solid var(--color-divider); padding-left: 24px; }
.duality { display: grid; grid-template-columns: 1fr 1fr; }
.duality .design { border-right: 1px solid var(--color-divider); }
.gantt-row { display: grid; grid-template-columns: minmax(140px,220px) minmax(0,1fr); gap: 0 16px; align-items: center; }
@media (max-width: 880px) { .gantt-row { grid-template-columns: 1fr; gap: 4px; } .gantt-lbl { text-align: left !important; } }
.xp { display: grid; grid-template-columns: 170px 1fr; }
.xp-when { border-top: 1px solid var(--color-divider); }
.xp-what { border-top: 1px solid var(--color-divider); }
.pillars, .caps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(20px,3vw,48px); }
.work-link:hover .work-arrow { transform: translateX(6px); }
@media (max-width: 860px) {
  .work-item { grid-template-columns: 1fr; }
  .work-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--color-divider); padding-top: 20px; }
  .duality { grid-template-columns: 1fr; }
  .duality .design { border-right: 0; border-bottom: 1px solid var(--color-divider); }
  .pillars, .caps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) { .xp { grid-template-columns: 1fr; } .xp-what { border-top: 0; padding-top: 0 !important; } }

/* — case-study layout — */
@media (min-width: 881px) { .lbl-grid > h2, .lbl-grid > .cs-h2 { position: sticky; top: 88px; align-self: start; } }
.lbl-grid { display: grid; grid-template-columns: minmax(120px,200px) minmax(0,1fr); gap: 24px clamp(24px,4vw,72px); }
.li { position: relative; padding-left: 20px; font-size: 16px; line-height: 24px; margin: 0; color: var(--color-neutral-800); }
.li::before { content: ""; position: absolute; left: 0; top: 12px; width: 10px; height: 1px; background: var(--color-accent-700); }
.cs-p { font-size: 16px; line-height: 24px; margin: 0 0 24px; }
.cs-h2 { font-family: var(--font-heading); font-weight: 600; font-size: 16px; line-height: 24px; letter-spacing: 0.08em; text-transform: uppercase; margin: 0; }
.cs-h3 { font-family: var(--font-heading); font-weight: 600; font-size: 22px; line-height: 24px; letter-spacing: 0.02em; text-transform: uppercase; margin: 0 0 12px; }
.cs-ul { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--color-accent-800); background: var(--color-accent-100); padding: 1px 5px; }
.node { position: relative; border: 1px solid var(--color-divider); padding: 8px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 20px; white-space: nowrap; }
.seq { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 16px; }
.span { grid-column: 1 / -1; }
.col2 { grid-column: 2; }
.outcomes { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1100px) {
  .seq { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .outcomes { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .outcomes > div:nth-child(3) { border-right: 0 !important; }
  .outcomes > div:nth-child(n+4) { border-top: 1px solid var(--color-divider); }
}
@media (max-width: 880px) {
  .lbl-grid { grid-template-columns: 1fr; gap: 12px; }
  .col2 { grid-column: auto; }
  .seq { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .outcomes { grid-template-columns: 1fr; }
  .outcomes > div { border-right: 0 !important; border-top: 1px solid var(--color-divider); }
  .outcomes > div:first-child { border-top: 0; }
}

/* — before/after row (case studies) — */
.ba { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 640px) { .ba { grid-template-columns: 1fr; } .ba > .ba-arrow { transform: rotate(90deg); justify-content: center; } }

/* — vertical step list (case studies) — */
.step { position: relative; padding-left: 40px; }
.step::before { content: ""; position: absolute; left: 6px; top: 0; bottom: -40px; width: 1px; background: var(--color-divider); }
.step:last-child::before { display: none; }
.step::after { content: ""; position: absolute; left: 0; top: 6px; width: 11px; height: 11px; border: 1px solid var(--color-accent-700); background: var(--color-bg); }
.step.done::after { background: var(--color-accent-700); }
.step > h3, .step > p { max-width: 72ch; }

/* — motion — */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  [data-reveal] { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
}
@keyframes fadeup { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero-in { animation: fadeup .8s cubic-bezier(.2,.7,.2,1) both; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.live-dot { animation: pulse 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { [data-reveal], .hero-in, .live-dot { animation: none !important; } }

/* — cross-document view transitions — */
@view-transition { navigation: auto; }
.nav { view-transition-name: site-nav; }
::view-transition-old(root) { animation: vt-out .22s cubic-bezier(.2,.7,.2,1) both; }
::view-transition-new(root) { animation: vt-in .36s cubic-bezier(.2,.7,.2,1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root), ::view-transition-group(*) { animation: none !important; }
}
