/* ═══════════════════════════════════════════════════════════════
   FORM STUDIO — Day 9: Agency Creative Site
   Design System Aligned with Design Skill OS Principles
   ═══════════════════════════════════════════════════════════════
   
   DESIGN PHILOSOPHY:
   - Color Harmony: Lime green (#c8f135) as complementary accent to black,
     creating high-contrast energetic visual identity
   - Typography: Display font (Syne) for bold headlines, body font (Inter)
     for legible content. Humanist sans serif for warmth.
   - Motion: 0.7s ease-out curve for reveal animations (smooth, snappy)
     with staggered delays for sequential entrance.
   - Accessibility: Dark mode optimized, keyboard navigation, skip link,
     ARIA labels, focus management for custom cursor interaction.
   - Spacing: Fibonacci-inspired ratios (0.5, 1, 1.5, 2.5, 4, 6, 10rem)
     for rhythmic, intentional spacing.
   ═══════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ─────────────────────────────────── */
:root {
  /* Color System: High contrast dark theme
     Lime green accent chosen for:
     - Complementary to black (opposite on color wheel ~75°)
     - High energy and innovation signal
     - Strong accessibility contrast (WCAG AAA) */
  --bg: #0a0a0a;                      /* Pure black for maximum contrast */
  --surface: #111111;                 /* Slight lift for depth */
  --surface-2: #181818;               /* Secondary surface */
  --border: rgba(255, 255, 255, 0.08); /* Subtle dividers */
  --text: #f0ece4;                    /* Warm off-white for reduced strain */
  --text-muted: rgba(240, 236, 228, 0.75); /* IMPROVED: 75% opacity for better contrast */
  --accent: #c8f135;                  /* Lime green — complementary, high-energy */
  --accent-dark: #a8d020;             /* Darker shade for hover/active states */

  /* Typography: Pairing contrasting fonts
     - Syne (display): Bold, geometric, modern. For headlines.
     - Inter (body): Humanist sans serif. Warm, readable, contemporary. */
  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing System: Fibonacci-inspired (0.5, 1, 1.5, 2.5, 4, 6, 10)
     Ratios: 1:2:2.5:4 creates rhythmic, proportional layouts. */
  --space-xs: 0.5rem;    /* 8px — Micro spacing */
  --space-sm: 1rem;      /* 16px — Compact spacing */
  --space-md: 1.5rem;    /* 24px — Standard spacing */
  --space-lg: 2.5rem;    /* 40px — Generous spacing */
  --space-xl: 4rem;      /* 64px — Large section spacing */
  --space-2xl: 6rem;     /* 96px — Extra large spacing */
  --space-3xl: 10rem;    /* 160px — Hero/section spacing */

  /* Border Radius: Hierarchy of roundedness */
  --radius-sm: 4px;      /* Subtle rounding on buttons, inputs */
  --radius-md: 12px;     /* Standard UI rounding */
  --radius-lg: 20px;     /* Larger containers, softer look */

  /* Layout */
  --max-w: 1280px;       /* Max content width */
  --header-h: 64px;      /* Fixed header height */

  /* Animation Easing: Crafted curves for personality
     ease-out: Quick initial response, soft landing (0.16, 1, 0.3, 1)
     Used for: Click feedback, scroll reveals, entries
     ease-in-out: Symmetric, balanced motion (0.65, 0, 0.35, 1)
     Used for: Continuous loops, transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  
  /* Motion Duration: 0.7s chosen for balance
     - Fast enough to feel responsive (no lag)
     - Slow enough for elegance and polish
     - Recommended for scroll reveals, staggered entries */
  --duration: 0.7s;
  
  /* Reduced motion support: Respects accessibility preferences */
  @media (prefers-reduced-motion: reduce) {
    --duration: 0.1s;
  }
}

/* ── RESET ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  cursor: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ── SKIP LINK ──────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ── CURSOR ─────────────────────────────────────────── */
.cursor,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s;
}
.cursor {
  width: 8px; height: 8px;
  background: var(--accent);
  transition: transform 0.1s var(--ease-out), opacity 0.2s;
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid rgba(200, 241, 53, 0.4);
  transition: transform 0.22s var(--ease-out), width 0.2s var(--ease-out),
              height 0.2s var(--ease-out), opacity 0.2s;
}
.cursor.is-hovering { transform: translate(-50%, -50%) scale(2); }
.cursor-ring.is-hovering { width: 60px; height: 60px; border-color: var(--accent); }

@media (hover: none) {
  .cursor, .cursor-ring { display: none; }
  body { cursor: auto; }
}

/* ── TYPOGRAPHY HIERARCHY ──────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;  /* IMPROVED: From 1.05 to 1.1 for better readability */
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(3rem, 9vw, 8rem); font-weight: 800; }
h2 { font-size: clamp(2.2rem, 5vw, 4.5rem); font-weight: 700; }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 700; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── BUTTONS & INTERACTIVE ELEMENTS ──────────────── */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.2s, color 0.2s, transform 0.15s var(--ease-out),
              box-shadow 0.2s;
  cursor: none;
  border: none;  /* Explicit border for clarity */
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
/* Keyboard focus state — visible for accessibility */
.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button-primary {
  background: var(--accent);
  color: #000;
}
.button-primary:hover { background: #d6ff3d; box-shadow: 0 8px 24px rgba(200,241,53,0.25); }
.button-primary:focus-visible {
  outline: 2px solid var(--text);
}

.button-outline {
  border: 1.5px solid var(--border);
  color: var(--text);
}
.button-outline:hover {
  border-color: var(--text);
  background: rgba(255,255,255,0.04);
}

.button-large { padding: 1rem 2.5rem; font-size: 1rem; }

/* ── SCROLL REVEAL ──────────────────────────────────── */
.reveal,
.reveal-child {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--duration) var(--ease-out),
              transform var(--duration) var(--ease-out);
}
.reveal.is-visible,
.reveal-child.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-child:nth-child(1) { transition-delay: 0.05s; }
.reveal-child:nth-child(2) { transition-delay: 0.15s; }
.reveal-child:nth-child(3) { transition-delay: 0.25s; }
.reveal-child:nth-child(4) { transition-delay: 0.35s; }
.reveal-child:nth-child(5) { transition-delay: 0.45s; }

/* ── HEADER ─────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  transition: background 0.3s, backdrop-filter 0.3s;
}
.site-header.scrolled {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.site-nav {
  display: flex;
  gap: var(--space-lg);
}
/* ── NAVIGATION LINKS ──────────────────────────────── */
.site-nav a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}
.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease-out);
}
.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after { width: 100%; }
/* Keyboard focus indicator for screen reader users */
.site-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: none;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}
.menu-toggle[aria-expanded="true"] span:first-child {
  transform: rotate(45deg) translate(5.5px, 5.5px);
}
.menu-toggle[aria-expanded="true"] span:last-child {
  transform: rotate(-45deg) translate(5.5px, -5.5px);
}

/* ── HERO ───────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + var(--space-xl)) clamp(1.25rem, 4vw, 3rem) var(--space-xl);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: 'FORM';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + var(--parallax-y, 0)));
  font-family: var(--font-display);
  font-size: clamp(14rem, 35vw, 40rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.035);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.hero-headline {
  margin: var(--space-sm) 0 var(--space-lg);
  display: flex;
  flex-direction: column;
}
.hero-headline .line { display: block; }
.hero-headline .line-accent { color: var(--accent); }

.hero-meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}
.hero-sub {
  max-width: 36ch;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  left: clamp(1.25rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.scroll-line {
  width: 40px; height: 1px;
  background: var(--text-muted);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: var(--accent);
  animation: scroll-line 2s var(--ease-in-out) infinite 1.5s;
}
@keyframes scroll-line {
  0%   { left: -100%; }
  50%  { left: 0; }
  100% { left: 100%; }
}

.hero-stat-strip {
  position: absolute;
  bottom: var(--space-xl);
  right: clamp(1.25rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.stat strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat span {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-divider {
  width: 1px; height: 32px;
  background: var(--border);
}

/* ── MARQUEE ────────────────────────────────────────── */
.marquee-track {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) 0;
  background: var(--surface);
}
.marquee-inner {
  display: flex;
  gap: var(--space-lg);
  white-space: nowrap;
  animation: marquee 30s linear infinite;
  width: max-content;
}
.marquee-inner span {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}
.marquee-inner .dot { color: var(--accent); }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-inner { animation: none; }
}

/* ── WORK ───────────────────────────────────────────── */
.work {
  padding: var(--space-3xl) clamp(1.25rem, 4vw, 3rem);
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-header {
  margin-bottom: var(--space-2xl);
}
.section-header h2 { margin-top: var(--space-xs); }

.case-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.case-item {
  border-top: 1px solid var(--border);
}
.case-item:last-child { border-bottom: 1px solid var(--border); }

/* Case links - keyboard navigation support */
.case-link {
  display: block;
  padding: var(--space-lg) 0;
  transition: padding 0.3s var(--ease-out);
  position: relative;
}
.case-link:hover { padding: var(--space-xl) 0; }
.case-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.case-image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 7;
  margin-bottom: var(--space-md);
}
.case-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.case-link:hover .case-image-wrap img { transform: scale(1.04); }

.case-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.case-link:hover .case-overlay { opacity: 1; }
.case-cta {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.case-meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-lg);
}
.case-number {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}
.case-info { flex: 1; }
.case-info h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.case-info p {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.case-year {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ── SERVICES ───────────────────────────────────────── */
.services {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.services-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-3xl) clamp(1.25rem, 4vw, 3rem);
}
.services-header { margin-bottom: var(--space-2xl); }
.services-header h2 { margin-top: var(--space-xs); }

.service-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-xl) var(--space-2xl);
}
.service-item { display: flex; flex-direction: column; gap: var(--space-sm); }

.service-icon {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}
.service-item h3 { margin-bottom: 0.5rem; }
.service-item p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; }

/* ── PROCESS ────────────────────────────────────────── */
.process {
  padding: var(--space-3xl) clamp(1.25rem, 4vw, 3rem);
  max-width: var(--max-w);
  margin: 0 auto;
}
.process-inner { display: grid; grid-template-columns: 1fr 2fr; gap: var(--space-2xl); }
.process-header { position: sticky; top: calc(var(--header-h) + var(--space-lg)); align-self: start; }
.process-header h2 { margin-top: var(--space-sm); }

.process-steps { display: flex; flex-direction: column; gap: 0; }
.process-step {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--border);
  opacity: var(--step-opacity, 1);
  transition: opacity 0.4s var(--ease-out);
}
.process-step:first-child { border-top: 1px solid var(--border); }

.step-num {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.1em;
  padding-top: 0.3em;
  flex-shrink: 0;
  width: 28px;
}
.step-body h3 { margin-bottom: var(--space-xs); }
.step-body p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; }

/* ── STUDIO ─────────────────────────────────────────── */
.studio {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--space-3xl) clamp(1.25rem, 4vw, 3rem);
}
.studio-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}
.studio-copy { display: flex; flex-direction: column; gap: var(--space-md); }
.studio-copy h2 { margin-bottom: var(--space-xs); }
.studio-copy h2 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}
.studio-copy p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.8; max-width: 44ch; }

.studio-visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.studio-visual img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(60%);
  transition: filter 0.4s;
}
.studio-visual:hover img { filter: grayscale(0%); }

/* ── CONTACT ────────────────────────────────────────── */
.contact {
  padding: var(--space-3xl) clamp(1.25rem, 4vw, 3rem);
  text-align: center;
}
.contact-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}
.contact-inner h2 { margin-top: var(--space-xs); }
.contact-sub { color: var(--text-muted); max-width: 38ch; font-size: 0.95rem; }

/* ── FOOTER ─────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl) clamp(1.25rem, 4vw, 3rem);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.footer-nav { display: flex; gap: var(--space-lg); }
.footer-nav a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--text); }
.footer-legal { font-size: 0.75rem; color: var(--text-muted); }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  .process-inner { grid-template-columns: 1fr; }
  .process-header { position: static; }

  .studio-inner { grid-template-columns: 1fr; }
  .studio-visual { display: none; }

  .hero-stat-strip {
    position: static;
    margin-top: var(--space-xl);
    justify-content: flex-start;
  }
  .hero-scroll-indicator { display: none; }
}

@media (max-width: 640px) {
  .site-nav { display: none; }
  .site-nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 99;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
  }
  .site-nav.is-open a { font-size: 1.5rem; color: var(--text); }
  .menu-toggle { display: flex; }

  .hero-meta { flex-direction: column; align-items: flex-start; }
  .hero-stat-strip { gap: var(--space-md); flex-wrap: wrap; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-nav { gap: var(--space-md); }
}
