/* ═══════════════════════════════════════════════════════
   FREE FLOW FILMS — DESIGN SYSTEM
   ═══════════════════════════════════════════════════════ */

:root {
  /* Color tokens — Clean white editorial */
  --bg: #FFFFFF;
  --bg-elev: #F6F4EE;
  --bg-card: #FAF8F2;
  --line: rgba(46, 64, 50, 0.10);
  --line-strong: rgba(46, 64, 50, 0.22);
  --fg: #1A1F1B;
  --fg-muted: rgba(26, 31, 27, 0.62);
  --fg-dim: rgba(26, 31, 27, 0.38);
  --gold: #C97A3F;
  --gold-bright: #E09150;
  --warm: #B85C3C;
  --sky: #7BAEC9;
  --meadow: #8AAE6E;
  --rose: #D89B8A;

  /* Type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing scale */
  --gutter: 24px;
  --section-y: clamp(80px, 12vw, 160px);
  --container: 1440px;
}

/* Sepia / dusk theme — Spirited Away bathhouse evening */
[data-theme="sepia"] {
  --bg: #2B2018;
  --bg-elev: #3A2C20;
  --bg-card: #46362A;
  --fg: #F2E4C8;
  --fg-muted: rgba(242, 228, 200, 0.66);
  --fg-dim: rgba(242, 228, 200, 0.40);
  --line: rgba(242, 228, 200, 0.10);
  --line-strong: rgba(242, 228, 200, 0.22);
}

/* Dark / Mononoke night theme */
[data-theme="light"] {
  --bg: #1A2520;
  --bg-elev: #243029;
  --bg-card: #2D3B33;
  --fg: #F2EBD8;
  --fg-muted: rgba(242, 235, 216, 0.66);
  --fg-dim: rgba(242, 235, 216, 0.40);
  --line: rgba(242, 235, 216, 0.08);
  --line-strong: rgba(242, 235, 216, 0.20);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--gold);
  color: var(--bg);
}

/* Typography utilities */
.font-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.font-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
}

/* Container */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 768px) {
  :root { --gutter: 48px; }
}

@media (min-width: 1280px) {
  :root { --gutter: 72px; }
}

/* Section */
.section {
  padding-block: var(--section-y);
  position: relative;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 32px;
  background: var(--gold);
  color: #0A0A0A;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: var(--gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(200, 169, 81, 0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  box-shadow: none;
}

/* Film frame placeholder */
.film-frame {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.film-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      135deg,
      transparent 0,
      transparent 24px,
      rgba(200, 169, 81, 0.04) 24px,
      rgba(200, 169, 81, 0.04) 25px
    );
  pointer-events: none;
}

.film-frame-label {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(8px);
  padding: 6px 10px;
  border: 1px solid rgba(200, 169, 81, 0.2);
  z-index: 2;
  white-space: nowrap;
  max-width: calc(100% - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.film-frame-corners::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid transparent;
  background-image:
    linear-gradient(to right, var(--gold) 16px, transparent 16px, transparent calc(100% - 16px), var(--gold) calc(100% - 16px)),
    linear-gradient(to bottom, var(--gold) 16px, transparent 16px, transparent calc(100% - 16px), var(--gold) calc(100% - 16px));
  background-size: 100% 1px, 1px 100%;
  background-position: 0 0, 0 0;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0.5;
}

/* Hide scrollbar utility */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* Marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee-track {
  display: flex;
  gap: 60px;
  animation: marquee 40s linear infinite;
  width: max-content;
}

/* Gold underline link */
.link-underline {
  position: relative;
  display: inline-block;
  color: inherit;
  text-decoration: none;
  padding-bottom: 2px;
}

.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform-origin: right;
  transform: scaleX(1);
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.link-underline:hover::after {
  transform-origin: left;
  transform: scaleX(0);
  animation: linkUnderline 0.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes linkUnderline {
  0% { transform: scaleX(1); transform-origin: right; }
  50% { transform: scaleX(0); transform-origin: right; }
  51% { transform: scaleX(0); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: left; }
}

/* Section divider */
.divider {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* Number counter */
.metric-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 8vw, 120px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--fg) 0%, var(--fg-muted) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Form */
.input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  padding: 16px 0;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s;
}

.input:focus {
  border-bottom-color: var(--gold);
}

.input::placeholder {
  color: var(--fg-dim);
}

textarea.input {
  resize: vertical;
  min-height: 80px;
}

/* Subtle grain — disabled on white theme */
.grain::before {
  content: none;
}
