/* =========================================================
   ATMAN — Global Styles
   Design System v3 (Blue)
   Single source of truth: ATMAN_Master_Brief.md
   ========================================================= */


/* ---------------------------------------------------------
   1. Design Tokens (CSS Variables)
   --------------------------------------------------------- */
:root {
  /* Background Layers */
  --bg-main: #05060B;
  --bg-card: #0E1018;
  --bg-elevated: #14172A;
  --border: #1F2332;
  --border-subtle: #15182A;

  /* Blue System */
  --blue-deepest: #151A5C;
  --blue-deep: #2A3491;
  --blue: #3843F2;
  --blue-bright: #5B68F5;
  --blue-muted: #7A88B5;
  --blue-fade: #4D5478;

  /* Text Colors */
  --text-primary: #FFFFFF;
  --text-secondary: #E2E5EE;
  --text-dim: #A2A9C0;
  --text-faint: #767E9D;
  --text-very-faint: #4C526B;

  /* Font Families — Syne + Korean fallback (IBM Plex Sans KR) */
  --font-display: 'Syne', 'IBM Plex Sans KR', sans-serif;
  --font-body: 'IBM Plex Sans KR', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Font Weights */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;

  /* Type Scale — fluid clamp() for display tiers, fixed for body tiers */
  --text-hero:    clamp(56px, 6.25vw, 120px);
  --text-display: clamp(40px, 4.2vw,  80px);
  --text-h1:      clamp(34px, 2.9vw,  56px);
  --text-h2:      clamp(28px, 2.1vw,  40px);
  --text-h3: 21px; /* Tagline */
  --text-h4: 17px; /* Body Strong */
  --text-body-lg: 24px; /* Lead */
  --text-body: 17px; /* Apple Reading Pace */
  --text-body-sm: 14px; /* Caption */
  --text-caption: 12px; /* Fine Print */

  /* Line Heights — bumped tight for Korean (받침 clipping prevention) */
  --lh-tight: 1.07;
  --lh-snug: 1.19;
  --lh-normal: 1.47;
  --lh-relaxed: 1.5;

  /* Letter Spacing */
  --ls-tight: -0.015em; /* Apple Tight */
  --ls-normal: 0;
  --ls-wide: 0.01em;

  /* Spacing (8px Grid) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  --space-5xl: 120px;
  --space-6xl: 160px;

  --section-py: 120px;
  --section-px: 80px;

  /* Layout */
  --max-w-content: 1280px;
  --max-w-narrow: 720px;
  --max-w-wide: 1440px;
  --grid-gap: 24px;

  /* Radius */
  --radius-sm: 8px; /* Utility */
  --radius-md: 11px; /* Capsule */
  --radius-lg: 18px; /* Cards */
  --radius-full: 9999px; /* Pill */

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-glow-blue: 0 0 24px rgba(56, 67, 242, 0.3);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 600ms;

  /* Z-index */
  --z-base: 0;
  --z-card: 10;
  --z-overlay: 100;
  --z-modal: 1000;
  --z-tooltip: 2000;
  --z-nav: 5000;
}

/* Mobile token overrides — display tiers handled by clamp() above */
@media (max-width: 768px) {
  :root {
    --text-hero: clamp(32px, 8vw, 56px);
    --text-display: clamp(28px, 6vw, 40px);
    --text-h1: clamp(24px, 5vw, 34px);
    --text-h2: clamp(20px, 4vw, 28px);
    --text-h3: 21px;
    --text-h4: 17px;
    --text-body-lg: 17px;
    --text-body: 17px; /* Maintain 17px on mobile for reading pace */
    --text-body-sm: 14px;
    --text-caption: 12px;

    --section-py: 80px;
    --section-px: 24px;
    --grid-gap: 16px;
  }
}


/* ---------------------------------------------------------
   2. Reset & Base
   --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body, h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  letter-spacing: var(--ls-normal);
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--blue-bright);
}

::selection {
  background-color: var(--blue-deep);
  color: var(--text-primary);
}

/* Lenis smooth scroll baseline */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}


/* ---------------------------------------------------------
   3. Typography
   --------------------------------------------------------- */
.t-hero,
.t-display,
.t-h1,
.t-h2,
.t-h3,
.t-h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  color: var(--text-primary);
  /* Korean: keep words intact, break only at spaces */
  word-break: keep-all;
  overflow-wrap: break-word;
}

.t-hero {
  font-size: var(--text-hero);
}
.t-display {
  font-size: var(--text-display);
}
.t-h1 {
  font-size: var(--text-h1);
}
.t-h2 {
  font-size: var(--text-h2);
}
.t-h3 {
  font-size: var(--text-h3);
  line-height: var(--lh-snug);
}
.t-h4 {
  font-size: var(--text-h4);
  line-height: var(--lh-snug);
}

.t-body-lg {
  font-size: var(--text-body-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}
.t-body {
  font-size: var(--text-body);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}
.t-body-sm {
  font-size: var(--text-body-sm);
  line-height: var(--lh-normal);
  color: var(--text-dim);
}
.t-caption {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  line-height: var(--lh-normal);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-faint);
}

.t-mono {
  font-family: var(--font-mono);
}

.text-dim   { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-blue  { color: var(--blue); }
.text-blue-bright { color: var(--blue-bright); }
.text-nowrap { white-space: nowrap; }


/* ---------------------------------------------------------
   4. Layout Utilities
   --------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w-content);
  margin-inline: auto;
  padding-inline: var(--section-px);
}

.container--wide {
  max-width: var(--max-w-wide);
}

.container--narrow {
  max-width: var(--max-w-narrow);
}

.section {
  padding-block: var(--section-py);
}

.section--tight {
  padding-block: var(--space-4xl);
}

.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--blue-muted);
  margin-bottom: var(--space-lg);
}

.divider {
  height: 1px;
  background-color: var(--border);
  border: none;
}

.divider--subtle {
  background-color: var(--border-subtle);
}


/* ---------------------------------------------------------
   5. Buttons & CTA
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 11px 22px; /* Apple Pill CTA Padding */
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-full); /* Apple Pill Shape */
  transition:
    background-color var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-out);
  white-space: nowrap;
  cursor: pointer;
}

.btn--primary {
  background-color: var(--blue-deep);
  color: var(--text-primary);
}

.btn--primary:hover {
  background-color: var(--blue);
  color: var(--text-primary);
  transform: scale(0.98); /* System-wide micro-interaction */
}

.btn--ghost {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--blue-bright);
  color: var(--blue-bright);
}

.btn--lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--text-body-lg);
}

.btn-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-body-sm);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-primary);
  transition: color var(--duration-fast) var(--ease-out);
}

.btn-arrow::after {
  content: "→";
  transition: transform var(--duration-normal) var(--ease-out);
}

.btn-arrow:hover {
  color: var(--blue-bright);
}

.btn-arrow:hover::after {
  transform: translateX(4px);
}


/* ---------------------------------------------------------
   6. Navigation
   --------------------------------------------------------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--section-px);
  background-color: rgba(5, 6, 11, 0.35);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition:
    background-color var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

.site-nav__brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  color: var(--text-primary);
}

.site-logo {
  display: block;
  height: 28px;
  width: auto;
}

.site-footer__brand-block .site-logo {
  height: 48px;
}

@media (max-width: 768px) {
  .site-logo { height: 22px; }
  .site-footer__brand-block .site-logo { height: 38px; }
}

.site-nav__brand:hover {
  color: var(--blue-bright);
}

.site-nav__menu {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.site-nav__link {
  font-family: var(--font-mono);
  font-size: var(--text-body-sm);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-dim);
  position: relative;
  padding: var(--space-xs) 0;
  transition: color var(--duration-fast) var(--ease-out);
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--text-primary);
}

.site-nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 0 -2px 0;
  height: 1px;
  background-color: var(--blue);
}

.site-nav__toggle {
  display: none;
  width: 32px;
  height: 32px;
  position: relative;
}

.site-nav__toggle span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background-color: var(--text-primary);
  transition: transform var(--duration-normal) var(--ease-out);
}
.site-nav__toggle span:nth-child(1) { top: 10px; }
.site-nav__toggle span:nth-child(2) { top: 20px; }

@media (max-width: 768px) {
  .site-nav {
    padding: var(--space-md) var(--section-px);
  }

  .site-nav__toggle {
    display: block;
  }

  .site-nav__menu {
    position: fixed;
    inset: 0;
    background-color: var(--bg-main);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-2xl);
    padding: var(--section-px);
    transform: translateX(100%);
    transition: transform var(--duration-normal) var(--ease-out);
  }

  .site-nav.is-open .site-nav__menu {
    transform: translateX(0);
  }

  .site-nav.is-open .site-nav__toggle span:nth-child(1) {
    top: 15px;
    transform: rotate(45deg);
  }
  .site-nav.is-open .site-nav__toggle span:nth-child(2) {
    top: 15px;
    transform: rotate(-45deg);
  }

  .site-nav__link {
    font-size: var(--text-h3);
    font-family: var(--font-display);
    text-transform: none;
    letter-spacing: var(--ls-tight);
    color: var(--text-primary);
  }
}


/* ---------------------------------------------------------
   7. Footer
   --------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-4xl) var(--space-xl);
}

.site-footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3xl);
  flex-wrap: wrap;
}

.site-footer__brand-block {
  max-width: 360px;
}

.site-footer__statement {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: var(--fw-medium);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
  margin-top: var(--space-md);
}

.site-footer__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3xl);
}

.site-footer__col-title {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--space-md);
}

.site-footer__col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.site-footer__col a {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
}

.site-footer__col a:hover {
  color: var(--blue-bright);
}

.site-footer__meta {
  margin-top: var(--space-3xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  font-size: var(--text-caption);
  font-family: var(--font-mono);
  color: var(--text-faint);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .site-footer__inner {
    flex-direction: column;
    gap: var(--space-2xl);
  }

  .site-footer__columns {
    width: 100%;
  }

  .site-footer__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
}


/* ---------------------------------------------------------
   8. Hero (shared)
   --------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 120px;
  padding-bottom: var(--space-4xl);
}

.hero__inner {
  width: 100%;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--blue-muted);
  margin-bottom: var(--space-lg);
  text-shadow: 0 2px 10px rgba(5, 6, 11, 0.4);
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
  word-break: keep-all;
  overflow-wrap: break-word;
  text-shadow: 0 4px 30px rgba(5, 6, 11, 0.8), 0 0 10px rgba(5, 6, 11, 0.4);
}

.hero__title .accent {
  color: var(--blue);
}

.hero__sub {
  margin-top: var(--space-2xl);
  max-width: 56ch;
  font-size: var(--text-body-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}

.hero__actions {
  margin-top: var(--space-2xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Video background variant */
.hero--video {
  overflow: hidden;
}

.hero--video .hero__inner {
  position: relative;
  z-index: 2;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,6,11,0.45) 0%, rgba(5,6,11,0.65) 55%, rgba(5,6,11,0.92) 100%),
    radial-gradient(ellipse 70% 50% at center, transparent 30%, rgba(5,6,11,0.35) 75%);
}

@media (prefers-reduced-motion: reduce) {
  .hero__video { display: none; }
}

/* Center variant (Home) */
.hero--center {
  text-align: center;
}
.hero--center .hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle, rgba(5, 6, 11, 0.55) 0%, rgba(5, 6, 11, 0) 70%);
  padding-block: var(--space-xl);
  border-radius: var(--radius-lg);
}
.hero--center .hero__title,
.hero--center .hero__sub {
  margin-inline: auto;
}
.hero--center .hero__actions {
  justify-content: center;
}


/* ---------------------------------------------------------
   9. Media Embed (16:9)
   --------------------------------------------------------- */
.media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.media-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.media-frame--portrait {
  aspect-ratio: 9 / 16;
  max-width: 480px;
  margin-inline: auto;
}


/* ---------------------------------------------------------
   10. Cards (shared)
   --------------------------------------------------------- */
.card {
  position: relative;
  background-color: rgba(14, 16, 24, 0.5);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition:
    border-color var(--duration-normal) var(--ease-out),
    background-color var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.card:hover {
  border-color: rgba(91, 104, 245, 0.35);
  background-color: rgba(20, 23, 42, 0.6);
  transform: translateY(-3px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(91, 104, 245, 0.08);
}

.card--elevated {
  background-color: rgba(20, 23, 42, 0.6);
}

.card__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--blue-muted);
  margin-bottom: var(--space-md);
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--fw-medium);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.card__body {
  font-size: var(--text-body);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}


/* ---------------------------------------------------------
   11. Grids
   --------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .grid--3,
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }
}


/* ---------------------------------------------------------
   12. Section Header (shared)
   --------------------------------------------------------- */
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
  flex-wrap: wrap;
}

.sec-head__title {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
  max-width: 22ch;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.sec-head__sub {
  max-width: 44ch;
  font-size: var(--text-body);
  line-height: var(--lh-relaxed);
  color: var(--text-dim);
}


/* ---------------------------------------------------------
   13. Form Elements (Contact page baseline)
   --------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.field__label {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-faint);
}

.field__input,
.field__textarea,
.field__select {
  width: 100%;
  padding: var(--space-md);
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-body);
  transition: border-color var(--duration-normal) var(--ease-out);
}

.field__input:focus,
.field__textarea:focus,
.field__select:focus {
  outline: none;
  border-color: var(--blue-bright);
}

.field__textarea {
  min-height: 160px;
  resize: vertical;
  font-family: inherit;
}


/* ---------------------------------------------------------
   14. Reveal Helpers (scroll-driven entry with depth + stagger)
   --------------------------------------------------------- */

/* Perspective on main provides 3D context for Z-axis entries.
   Smaller value = stronger depth effect (camera closer to subject) */
main { perspective: 1100px; perspective-origin: 50% 50%; transform-style: preserve-3d; }

/* Default reveal — pronounced fade-up + Z depth (visible 3D) */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 100px, -180px) scale(0.9);
  transform-style: preserve-3d;
  transition:
    opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Deep — strong Z entry with subtle rotateX for cinematic tilt */
[data-reveal-deep] {
  opacity: 0;
  transform: translate3d(0, 140px, -520px) scale(0.7) rotateX(8deg);
  transform-style: preserve-3d;
  transition:
    opacity 1.3s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}
[data-reveal-deep].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1) rotateX(0deg);
}

/* Stagger — children with clear depth + cascade gaps */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translate3d(0, 100px, -120px) scale(0.88);
  transform-style: preserve-3d;
  transition:
    opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}
[data-reveal-stagger].is-visible > * {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}
[data-reveal-stagger].is-visible > *:nth-child(1) { transition-delay: 0s;    }
[data-reveal-stagger].is-visible > *:nth-child(2) { transition-delay: 0.12s; }
[data-reveal-stagger].is-visible > *:nth-child(3) { transition-delay: 0.24s; }
[data-reveal-stagger].is-visible > *:nth-child(4) { transition-delay: 0.36s; }
[data-reveal-stagger].is-visible > *:nth-child(5) { transition-delay: 0.48s; }
[data-reveal-stagger].is-visible > *:nth-child(6) { transition-delay: 0.60s; }
[data-reveal-stagger].is-visible > *:nth-child(7) { transition-delay: 0.72s; }
[data-reveal-stagger].is-visible > *:nth-child(8) { transition-delay: 0.84s; }
[data-reveal-stagger].is-visible > *:nth-child(9) { transition-delay: 0.96s; }

/* Stagger with Z — children fly in from far back with extra depth */
[data-reveal-stagger="depth"] > * {
  transform: translate3d(0, 120px, -440px) scale(0.72) rotateX(6deg);
  transform-style: preserve-3d;
}
[data-reveal-stagger="depth"].is-visible > * {
  transform: translate3d(0, 0, 0) scale(1) rotateX(0deg);
}

/* Mask reveal — clip-path sweep for headlines */
[data-reveal-mask] {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s cubic-bezier(0.65, 0, 0.35, 1);
}
[data-reveal-mask].is-visible {
  clip-path: inset(0 0 0 0);
}

/* Slide-in from side */
[data-reveal-slide="left"]  { transform: translate3d(-80px, 0, 0); opacity: 0; transition: opacity 0.95s cubic-bezier(0.16,1,0.3,1), transform 1s cubic-bezier(0.16,1,0.3,1); }
[data-reveal-slide="right"] { transform: translate3d( 80px, 0, 0); opacity: 0; transition: opacity 0.95s cubic-bezier(0.16,1,0.3,1), transform 1s cubic-bezier(0.16,1,0.3,1); }
[data-reveal-slide].is-visible { transform: translate3d(0, 0, 0); opacity: 1; }

/* Scroll-driven parallax (set by JS via GSAP) */
[data-scroll-y] {
  will-change: transform;
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal-deep],
  [data-reveal-stagger] > *,
  [data-reveal-mask],
  [data-reveal-slide] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }
}


/* ---------------------------------------------------------
   15. Misc
   --------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--blue-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

/* Icons — minimal line SVG, inherits color */
.icon {
  flex-shrink: 0;
  display: block;
  width: 32px;
  height: 32px;
  color: var(--blue-bright);
  margin-bottom: var(--space-md);
}

.icon--sm     { width: 20px; height: 20px; margin-bottom: 0; }
.icon--lg     { width: 48px; height: 48px; }
.icon--inline { display: inline-block; vertical-align: middle; margin-bottom: 0; }

.card .icon { color: var(--blue-bright); }
.card:hover .icon { color: var(--blue); transition: color var(--duration-normal) var(--ease-out); }


/* ---------------------------------------------------------
   15b. Cinematic Loading Intro (first-visit, 1.5s)
   --------------------------------------------------------- */
.cinematic-intro {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}

.cinematic-intro__inner {
  text-align: center;
  padding: var(--space-xl);
  max-width: 720px;
}

.cinematic-intro__brand {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 96px);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.cinematic-intro__msg {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: var(--fw-regular);
  color: var(--text-secondary);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  word-break: keep-all;
}

.cinematic-intro__bar {
  position: absolute;
  left: 50%;
  bottom: var(--space-3xl);
  width: 1px;
  height: 0;
  background-color: var(--blue-bright);
  transform: translateX(-50%);
}

/* Curtains for split-out exit */
.cinematic-intro__curtain {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background-color: var(--bg-main);
  will-change: transform;
}
.cinematic-intro__curtain--top    { top: 0; }
.cinematic-intro__curtain--bottom { bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .cinematic-intro { display: none; }
}


/* ---------------------------------------------------------
   15c. Custom Cursor System
   --------------------------------------------------------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99998;
  border-radius: 50%;
  will-change: transform;
  mix-blend-mode: difference;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background-color: #FFFFFF;
  transform: translate(-50%, -50%);
  transition: transform var(--duration-fast) var(--ease-out);
}

.cursor-ring {
  width: 32px;
  height: 32px;
  border: 1px solid var(--blue-bright);
  transform: translate(-50%, -50%);
  transition:
    width  var(--duration-normal) var(--ease-out),
    height var(--duration-normal) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
  background-color: rgba(91, 104, 245, 0.0);
}

.cursor-ring.is-hover {
  width: 64px;
  height: 64px;
  border-color: rgba(255, 255, 255, 0.6);
  background-color: rgba(91, 104, 245, 0.08);
}

.cursor-ring.is-hover-link {
  width: 56px;
  height: 56px;
  background-color: rgba(255, 255, 255, 0.08);
}

.cursor-dot.is-hover { transform: translate(-50%, -50%) scale(0.4); }

.cursor-hide .cursor-dot,
.cursor-hide .cursor-ring { opacity: 0; }

/* Hide native cursor only on devices likely to support custom cursor */
@media (hover: hover) and (pointer: fine) {
  .has-custom-cursor,
  .has-custom-cursor a,
  .has-custom-cursor button,
  .has-custom-cursor [data-cursor] { cursor: none; }
}

@media (prefers-reduced-motion: reduce),
       (hover: none),
       (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}


/* ---------------------------------------------------------
   15d. Vimeo Thumbnail (oEmbed) + Lightbox
   --------------------------------------------------------- */
.vimeo-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
}

.vimeo-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.vimeo-thumb__img.is-loaded { opacity: 1; }
.vimeo-thumb:hover .vimeo-thumb__img { transform: scale(1.04); }

.vimeo-thumb__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
}

.vimeo-thumb__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  background-color: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

/* Show play button only when card / parent is hovered */
.vimeo-thumb:hover .vimeo-thumb__play,
.card:hover .vimeo-thumb__play,
.marquee-thumb:hover .vimeo-thumb__play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  background-color: var(--blue);
}

.vimeo-thumb__play::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 14px solid var(--bg-main);
  margin-left: 4px;
  transition: border-left-color var(--duration-fast) var(--ease-out);
}

.vimeo-thumb:hover .vimeo-thumb__play::after { border-left-color: white; }

.vimeo-thumb--error .vimeo-thumb__img,
.vimeo-thumb--error .vimeo-thumb__overlay,
.vimeo-thumb--error .vimeo-thumb__play { display: none; }

.vimeo-thumb--error::after {
  content: 'Vimeo 영상을 찾을 수 없습니다';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: center;
  padding: var(--space-md);
}

/* When a dotted card has a Vimeo/YouTube ID set, become a normal card */
.card.card--dotted[data-vimeo-id]:not([data-vimeo-id=""]),
.card.card--dotted[data-youtube-id]:not([data-youtube-id=""]) {
  border-style: solid;
  border-color: var(--border-subtle);
  background-color: rgba(14, 16, 24, 0.5);
  cursor: pointer;
}
.card.card--dotted[data-vimeo-id]:not([data-vimeo-id=""]) .card__title,
.card.card--dotted[data-youtube-id]:not([data-youtube-id=""]) .card__title {
  color: var(--text-primary);
}
.card.card--dotted[data-vimeo-id]:not([data-vimeo-id=""]) .card__eyebrow,
.card.card--dotted[data-youtube-id]:not([data-youtube-id=""]) .card__eyebrow {
  color: var(--blue-muted);
}

/* When .vimeo-thumb is injected as direct child of .card, add margin */
.card > .vimeo-thumb {
  margin-bottom: var(--space-md);
}


/* Vimeo Lightbox Modal */
.vimeo-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background-color: rgba(5, 6, 11, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.vimeo-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.vimeo-modal__inner {
  position: relative;
  width: 100%;
  max-width: 1280px;
  aspect-ratio: 16 / 9;
}

.vimeo-modal__close {
  position: absolute;
  top: -56px;
  right: 0;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font-body);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.vimeo-modal__close:hover {
  border-color: var(--blue-bright);
  background-color: rgba(91, 104, 245, 0.12);
}

.vimeo-modal__iframe-wrap {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: black;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.vimeo-modal__iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 768px) {
  .vimeo-modal { padding: var(--space-md); }
  .vimeo-modal__close { top: -48px; }
}


/* ---------------------------------------------------------
   15e. Section Rail (right-side section navigator)
   --------------------------------------------------------- */
.section-rail {
  position: fixed;
  right: var(--space-xl);
  top: 50%;
  transform: translateY(-50%);
  z-index: 4500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  pointer-events: none;
  /* Glass shell */
  padding: var(--space-md);
  background-color: rgba(5, 6, 11, 0.4);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
}

.section-rail__item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.section-rail__label {
  opacity: 0;
  transform: translateX(8px);
  transition:
    opacity var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
  max-width: 0;
  overflow: hidden;
}

.section-rail__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-faint);
  flex-shrink: 0;
  transition:
    width var(--duration-normal) var(--ease-out),
    height var(--duration-normal) var(--ease-out),
    background-color var(--duration-normal) var(--ease-out),
    border-radius var(--duration-normal) var(--ease-out);
}

/* Hover: expand label */
.section-rail__item:hover { color: var(--text-primary); }
.section-rail__item:hover .section-rail__dot { background-color: var(--text-primary); }
.section-rail__item:hover .section-rail__label {
  opacity: 1;
  transform: translateX(0);
  max-width: 240px;
}

/* Active: blue + pill dot + label visible */
.section-rail__item.is-active {
  color: var(--blue-bright);
}
.section-rail__item.is-active .section-rail__dot {
  width: 24px;
  height: 6px;
  border-radius: 3px;
  background-color: var(--blue-bright);
}
.section-rail__item.is-active .section-rail__label {
  opacity: 1;
  transform: translateX(0);
  max-width: 240px;
  color: var(--blue-bright);
}

/* Hide on tablet/mobile (Nav already provides high-level nav) */
@media (max-width: 1280px) {
  .section-rail { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .section-rail__item,
  .section-rail__label,
  .section-rail__dot { transition: none; }
}


/* ---------------------------------------------------------
   16. Background Blobs (ambient depth for glassmorphism)
   --------------------------------------------------------- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint;
}

.bg-blob {
  position: absolute;
  width: 65vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  will-change: transform;
}

.bg-blob--1 {
  background: radial-gradient(circle, var(--blue-deep) 0%, transparent 65%);
  top: -25vmax;
  left: -15vmax;
  animation: blob-drift-1 38s var(--ease-in-out) infinite alternate;
}

.bg-blob--2 {
  background: radial-gradient(circle, var(--blue-deepest) 0%, transparent 65%);
  bottom: -30vmax;
  right: -20vmax;
  opacity: 0.45;
  animation: blob-drift-2 46s var(--ease-in-out) infinite alternate;
}

.bg-blob--3 {
  background: radial-gradient(circle, var(--blue-deepest) 0%, transparent 70%);
  top: 35vh;
  right: -20vmax;
  opacity: 0.3;
  width: 50vmax;
  animation: blob-drift-3 54s var(--ease-in-out) infinite alternate;
}

@keyframes blob-drift-1 {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(18vw, 14vh, 0) scale(1.15); }
}
@keyframes blob-drift-2 {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-14vw, -10vh, 0) scale(1.1); }
}
@keyframes blob-drift-3 {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-12vw, 8vh, 0) scale(1.2); }
}

/* Stack content above blobs */
main,
.site-footer {
  position: relative;
  z-index: 1;
}


/* ---------------------------------------------------------
   17. SplitText helpers (char/word entrance)
   --------------------------------------------------------- */
.split-line {
  display: block;
  overflow: hidden;
}

.split-unit {
  display: inline-block;
  will-change: transform, opacity;
}

[data-split] {
  visibility: hidden;
}
[data-split].is-split {
  visibility: visible;
}


/* ---------------------------------------------------------
   18. Magnetic / Parallax hooks
   --------------------------------------------------------- */
[data-magnetic] {
  display: inline-flex;
  will-change: transform;
  transition: transform var(--duration-slow) var(--ease-out);
}

[data-parallax] {
  will-change: transform;
}


/* ---------------------------------------------------------
   19. Performance & accessibility fallbacks
   --------------------------------------------------------- */

/* Mobile: kill heavy backdrop-filter / animated blobs for FPS */
@media (max-width: 768px) {
  .card {
    background-color: var(--bg-card);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .card--elevated {
    background-color: var(--bg-elevated);
  }
  .site-nav {
    background-color: rgba(5, 6, 11, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .bg-blob {
    filter: blur(80px);
    opacity: 0.35;
  }
  .bg-blob--3 { display: none; }
}

/* Browsers without backdrop-filter support */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background-color: var(--bg-card); }
  .card--elevated { background-color: var(--bg-elevated); }
  .site-nav { background-color: rgba(5, 6, 11, 0.95); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bg-blob { animation: none; }
  [data-magnetic],
  [data-parallax] { transform: none !important; transition: none; }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .split-unit { transform: none !important; opacity: 1 !important; }
  [data-split] { visibility: visible; }
}

/* Proof cards duotone treatment */
.card--proof {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card--proof__media {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--bg-main);
}
.card--proof__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  filter: grayscale(1) brightness(0.65) contrast(1.15);
  transition: filter var(--duration-normal) var(--ease-out), opacity var(--duration-normal) var(--ease-out), transform var(--duration-slow) var(--ease-out);
}
.card--proof:hover .card--proof__media img {
  filter: grayscale(0) brightness(0.9) contrast(1);
  opacity: 0.95;
  transform: scale(1.03);
}
