/* demo-base.css — shared structural styles for every industry demo page.
   Each demo page sets its own color/font tokens in a page-level <style> block;
   this file only defines layout + component structure so every demo behaves
   the same way while looking completely different. */

:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
  --text-3xl: clamp(2.25rem, 1rem + 3.5vw, 4.25rem);
  --text-hero: clamp(2.5rem, 0.8rem + 5.5vw, 5.75rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --radius-sm: 0.3rem;
  --radius-md: 0.6rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  --content-default: 1140px;
  --content-narrow: 680px;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 10px 28px oklch(0 0 0 / 0.28);
  --shadow-lg: 0 26px 64px oklch(0 0 0 / 0.32);
}

@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: demo-fade-out 0.35s cubic-bezier(0.4, 0, 1, 1);
}
::view-transition-new(root) {
  animation: demo-fade-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes demo-fade-out {
  to {
    opacity: 0;
    filter: blur(6px);
  }
}
@keyframes demo-fade-in {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: scale(1.01);
  }
}

.wrap {
  width: 100%;
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
section {
  padding-block: clamp(var(--space-16), 9vw, var(--space-28));
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono, var(--font-body));
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--color-primary);
}

/* ---------- back-to-gallery pill (fixed, on every demo) ---------- */
.back-pill {
  position: fixed;
  top: var(--space-5);
  left: var(--space-5);
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-3);
  background: color-mix(in oklab, var(--color-bg) 72%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-xs);
  font-family: var(--font-body);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-interactive), transform var(--transition-interactive), background var(--transition-interactive);
}
.back-pill:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}
.back-pill svg {
  width: 14px;
  height: 14px;
}

/* ---------- header ---------- */
.d-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--color-bg) 80%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
}
.d-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.d-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  margin-left: 96px;
}
.d-brand svg {
  width: 30px;
  height: 30px;
  color: var(--color-primary);
  flex-shrink: 0;
}
.d-brand-word {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: 0.01em;
}
.d-nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.d-nav ul {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}
.d-nav a:not(.btn) {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}
.d-nav a:not(.btn):hover {
  color: var(--color-text);
}
.d-nav-toggle {
  display: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--transition-interactive), color var(--transition-interactive),
    border-color var(--transition-interactive), transform var(--transition-interactive), box-shadow var(--transition-interactive);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary, #16110c);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ---------- hero ---------- */
.d-hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: var(--space-24);
}
.d-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.d-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: d-kenburns 24s ease-in-out infinite alternate;
}
@keyframes d-kenburns {
  from {
    transform: scale(1.03);
  }
  to {
    transform: scale(1.13) translate3d(-1%, 0, 0);
  }
}
.d-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
}
.d-hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}
.d-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: var(--display-weight, 500);
  margin-block: var(--space-6);
  color: var(--hero-text, var(--color-text));
}
.d-hero p {
  font-size: var(--text-lg);
  color: var(--hero-text-muted, var(--color-text-muted));
  max-width: 52ch;
  margin-bottom: var(--space-8);
}
.d-hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ---------- section heads ---------- */
.d-head {
  max-width: 620px;
  margin-bottom: var(--space-12);
}
.d-head h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--display-weight, 500);
  margin-top: var(--space-4);
}
.d-head p {
  color: var(--color-text-muted);
  margin-top: var(--space-4);
}
.d-head--center {
  margin-inline: auto;
  text-align: center;
}
.d-head--center .eyebrow {
  justify-content: center;
}

/* ---------- two column ---------- */
.d-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}
.d-split img {
  width: 100%;
  border-radius: var(--radius-lg);
  aspect-ratio: 4/5;
  object-fit: cover;
}
.d-split.reverse {
  direction: rtl;
}
.d-split.reverse > * {
  direction: ltr;
}

/* ---------- feature grid ---------- */
.d-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}
.d-feature {
  padding: var(--space-8);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: border-color var(--transition-interactive), transform var(--transition-interactive);
}
.d-feature:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
}
.d-feature .num {
  font-family: var(--font-mono, var(--font-body));
  font-size: var(--text-xs);
  color: var(--color-primary);
  display: block;
  margin-bottom: var(--space-4);
}
.d-feature h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--display-weight, 500);
  margin-bottom: var(--space-3);
}
.d-feature p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ---------- stat strip ---------- */
.d-stats {
  padding-block: var(--space-10);
  border-block: 1px solid var(--color-divider);
}
.d-stats .wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
}
.d-stat b {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-primary);
  display: block;
  font-weight: var(--display-weight, 500);
}
.d-stat span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- gallery strip ---------- */
.d-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.d-photo-grid img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius-md);
  transition: transform 0.5s var(--ease-out), filter 0.5s var(--ease-out);
}
.d-photo-grid a {
  overflow: hidden;
  display: block;
  border-radius: var(--radius-md);
}
.d-photo-grid a:hover img {
  transform: scale(1.06);
}

/* ---------- testimonial ---------- */
.d-quote {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}
.d-quote blockquote {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--display-weight, 500);
  line-height: 1.4;
}
.d-quote cite {
  display: block;
  margin-top: var(--space-6);
  font-style: normal;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ---------- CTA band ---------- */
.d-cta {
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: clamp(var(--space-10), 6vw, var(--space-16));
  text-align: center;
}
.d-cta h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--display-weight, 500);
  margin-bottom: var(--space-4);
}
.d-cta p {
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}
.d-cta .d-hero-actions {
  justify-content: center;
}

/* ---------- footer ---------- */
.d-footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-12) var(--space-8);
}
.d-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.d-footer p {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.d-footer .d-brand {
  color: var(--color-text-muted);
}

/* ---------- reveal ---------- */
.reveal {
  opacity: 1;
}
@supports (animation-timeline: view()) {
  .reveal {
    opacity: 0;
    animation: d-fade-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
}
@keyframes d-fade-up {
  from {
    opacity: 0;
    filter: blur(4px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .d-grid-3 {
    grid-template-columns: 1fr;
  }
  .d-stats .wrap {
    grid-template-columns: repeat(2, 1fr);
    row-gap: var(--space-6);
  }
  .d-split {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .d-split.reverse {
    direction: ltr;
  }
  .d-split img {
    order: -1;
  }
}
@media (max-width: 760px) {
  .d-nav ul,
  .d-nav .btn {
    display: none;
  }
  .d-nav-toggle {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }
  .d-nav-toggle svg {
    width: 18px;
    height: 18px;
    color: var(--color-text);
  }
  .d-photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .back-pill span {
    display: none;
  }
  .back-pill {
    padding: var(--space-3);
  }
  .d-brand {
    margin-left: 52px;
  }
  .d-brand-word {
    font-size: var(--text-base);
  }
}

.d-mobile-nav {
  position: fixed;
  inset: 78px 0 0 0;
  background: var(--color-bg);
  background: color-mix(in oklab, var(--color-bg) 96%, transparent);
  backdrop-filter: blur(18px);
  z-index: 90;
  padding: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.d-mobile-nav.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.d-mobile-nav a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  text-decoration: none;
}
