/* ============================================================================
   byarc — Design System v2
   Brand: editorial, restrained, anti-hype. References: Aesop, Apartamento, Monocle.
   Palette: 5 colors. Type: Cormorant Garamond (display), Inter (body), JetBrains Mono (technical).
   ============================================================================ */

/* ---------- TOKENS ------------------------------------------------------- */

:root {
  /* Palette */
  --cream:      #EEEAE4;
  --cream-deep: #E5DFD6;
  --grey:       #A8A09A;
  --grey-soft:  rgba(168, 160, 154, 0.3);
  --terracotta: #C4784A;
  --terracotta-deep: #B36A3F;
  --dark:       #252220;
  --dark-soft:  #3A3633;
  --indigo:     #5C6B9C;
  --indigo-tint: rgba(92, 107, 156, 0.08);

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Spacing scale (8pt) */
  --s-1: 4px;   --s-2: 8px;   --s-3: 16px;  --s-4: 24px;
  --s-5: 32px;  --s-6: 48px;  --s-7: 64px;  --s-8: 96px;
  --s-9: 128px; --s-10: 160px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:  cubic-bezier(0.7, 0, 0.84, 0);
  --dur-fast: 200ms;
  --dur-med:  600ms;
  --dur-slow: 1200ms;

  /* Layout */
  --max-narrow: 720px;
  --max-wide:   1120px;
}

/* ---------- RESET -------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--dark);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Subtle grain texture — SVG noise overlay, ~2% opacity */
  background-image:
    url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.145 0 0 0 0 0.133 0 0 0 0 0.125 0 0 0 0.4 0'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.5'/></svg>");
  background-size: 200px 200px;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { border: none; background: none; font: inherit; color: inherit; cursor: pointer; }

/* ---------- TYPOGRAPHY --------------------------------------------------- */

.label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--indigo);
}
.label--grey      { color: var(--grey); font-size: 10px; }
.label--terracotta { color: var(--terracotta); }

.h-display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(56px, 9vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.012em;
  color: var(--dark);
}

.h-1 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--dark);
}

.h-2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  color: var(--dark);
}

.h-section {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark);
}

.lead {
  font-size: 19px;
  line-height: 1.55;
  font-weight: 300;
  color: var(--dark-soft);
}

p, .body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--dark-soft);
}

/* ---------- LAYOUT ------------------------------------------------------- */

.container       { max-width: var(--max-wide);   margin: 0 auto; padding: 0 var(--s-5); }
.container-narrow { max-width: var(--max-narrow); margin: 0 auto; padding: 0 var(--s-5); }

section { padding: var(--s-8) 0; position: relative; }

/* Hairline divider */
.hairline {
  width: 56px;
  height: 1px;
  background: var(--terracotta);
}
.hairline--long { width: 100%; background: var(--grey-soft); }

/* ---------- HEADER ------------------------------------------------------- */

.site-header {
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--grey-soft);
  position: sticky;
  top: 0;
  background: var(--cream);
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(238, 234, 228, 0.92);
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; }

.logo { display: inline-flex; align-items: baseline; gap: 12px; font-family: var(--font-body); }
.logo .by {
  font-weight: 600; font-size: 13px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--dark);
}
.logo .divider { width: 1px; height: 20px; background: var(--grey); align-self: center; }
.logo .arc {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 28px; color: var(--dark); line-height: 1;
}

.nav {
  display: flex; gap: var(--s-5); align-items: center;
  font-family: var(--font-body); font-size: 13px; font-weight: 400;
}
.nav a { color: var(--dark); position: relative; padding: 4px 0; transition: color var(--dur-fast) var(--ease-out); }
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px; background: var(--terracotta);
  transition: width var(--dur-fast) var(--ease-out);
}
.nav a:hover { color: var(--terracotta); }
.nav a:hover::after { width: 100%; }
.nav a.current::after { width: 100%; }

/* ---------- CTA BUTTONS -------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: var(--s-3);
  padding: 16px 28px;
  background: var(--terracotta);
  color: var(--cream);
  font-family: var(--font-body); font-weight: 500; font-size: 14px;
  letter-spacing: 0.02em;
  border-radius: 0;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  cursor: pointer;
  will-change: transform;
}
.btn:hover { background: var(--terracotta-deep); }
.btn .btn-price {
  font-family: var(--font-mono); font-size: 12px;
  opacity: 0.85;
  padding-left: var(--s-3);
  border-left: 1px solid rgba(238, 234, 228, 0.3);
}

.btn-outline {
  display: inline-flex; align-items: center; gap: var(--s-3);
  padding: 14px 24px;
  background: transparent;
  color: var(--dark);
  border: 1px solid var(--dark);
  font-family: var(--font-body); font-weight: 400; font-size: 14px;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn-outline:hover { background: var(--dark); color: var(--cream); }

.btn-link {
  font-family: var(--font-body); font-size: 14px; color: var(--dark);
  border-bottom: 1px solid var(--dark); padding-bottom: 2px;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn-link:hover { color: var(--terracotta); border-color: var(--terracotta); }

/* ---------- STICKY CTA BAR (bottom) -------------------------------------- */

.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--dark);
  color: var(--cream);
  padding: var(--s-3) var(--s-5);
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
  transform: translateY(100%);
  transition: transform var(--dur-med) var(--ease-out);
  z-index: 99;
}
.sticky-cta.visible { transform: translateY(0); }
.sticky-cta-text {
  font-family: var(--font-body); font-size: 14px;
}
.sticky-cta-text strong { font-weight: 500; }
.sticky-cta-text .price {
  font-family: var(--font-mono); font-size: 13px;
  margin-left: var(--s-3);
  color: var(--terracotta);
}
.sticky-cta .btn {
  padding: 12px 20px;
  font-size: 13px;
  flex-shrink: 0;
}

/* ---------- MOTION ------------------------------------------------------- */

/* Fade-up on scroll enter */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* Stagger delays */
.reveal[data-delay="100"] { transition-delay: 100ms; }
.reveal[data-delay="200"] { transition-delay: 200ms; }
.reveal[data-delay="300"] { transition-delay: 300ms; }
.reveal[data-delay="400"] { transition-delay: 400ms; }
.reveal[data-delay="500"] { transition-delay: 500ms; }

/* Type-in letter reveal */
.type-in span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.2em);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
}
.type-in.in-view span { opacity: 1; transform: translateY(0); }

/* Magnetic button — small JS adds inline transform */

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal, .type-in span { transition: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- PRODUCT CARDS ------------------------------------------------ */

.product-card {
  display: block;
  background: var(--cream);
  border: 1px solid var(--grey-soft);
  padding: var(--s-5);
  transition: border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.product-card:hover {
  border-color: var(--terracotta);
  transform: translateY(-4px);
}
.product-card .product-media {
  width: 100%;
  aspect-ratio: 4/3;
  margin-bottom: var(--s-4);
  background: var(--dark);
  overflow: hidden;
  position: relative;
}
.product-card video, .product-card img {
  width: 100%; height: 100%; object-fit: cover;
}
.product-card .product-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--s-2);
}
.product-card .product-title {
  font-family: var(--font-display); font-style: italic;
  font-size: 28px; color: var(--dark); margin-bottom: var(--s-2);
}
.product-card .product-desc {
  font-size: 14px; color: var(--dark-soft); line-height: 1.6; margin-bottom: var(--s-4);
}
.product-card .product-price {
  font-family: var(--font-mono); font-size: 14px;
  color: var(--terracotta); letter-spacing: 0.05em;
}

/* ---------- VIDEO GRID (with hover-to-play) ------------------------------ */

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
}
.video-grid .video-tile {
  position: relative;
  aspect-ratio: 9/16;
  background: var(--dark);
  overflow: hidden;
  cursor: pointer;
}
.video-grid video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-med) var(--ease-out);
}
.video-grid .video-tile:hover video { transform: scale(1.03); }
.video-grid .video-tile::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.4));
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.video-grid .video-tile:hover::after { opacity: 1; }
.video-grid .video-tile .video-label {
  position: absolute; left: var(--s-3); bottom: var(--s-3);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.15em;
  color: var(--cream); text-transform: uppercase;
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  z-index: 2;
}
.video-grid .video-tile:hover .video-label { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- LIGHTBOX ----------------------------------------------------- */

.lightbox {
  position: fixed; inset: 0;
  background: rgba(37, 34, 32, 0.92);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-out);
  padding: var(--s-5);
}
.lightbox.open { display: flex; opacity: 1; }
.lightbox-inner {
  max-width: 480px; width: 100%;
  background: var(--cream);
  padding: var(--s-5);
  transform: scale(0.96);
  transition: transform var(--dur-med) var(--ease-out);
}
.lightbox.open .lightbox-inner { transform: scale(1); }
.lightbox video {
  width: 100%; aspect-ratio: 9/16; object-fit: cover; background: var(--dark);
}
.lightbox-meta {
  margin-top: var(--s-3);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--grey);
}
.lightbox-title {
  font-family: var(--font-display); font-style: italic; font-size: 24px;
  color: var(--dark); margin-top: var(--s-2);
}
.lightbox-close {
  position: absolute; top: var(--s-5); right: var(--s-5);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em;
  color: var(--cream); text-transform: uppercase; cursor: pointer;
}

/* ---------- DELIVERABLES BLOCK ------------------------------------------- */

.deliverables {
  background: var(--indigo-tint);
  border-left: 2px solid var(--indigo);
  padding: var(--s-5);
}
.deliverables ul { list-style: none; }
.deliverables li {
  font-size: 16px;
  padding: var(--s-2) 0;
  padding-left: var(--s-4);
  position: relative;
  border-bottom: 1px dashed rgba(92, 107, 156, 0.2);
}
.deliverables li:last-child { border-bottom: none; }
.deliverables li::before {
  content: '—';
  position: absolute; left: 0; color: var(--terracotta);
}

/* ---------- FAQ ACCORDION ------------------------------------------------ */

.faq-item {
  border-bottom: 1px solid var(--grey-soft);
}
.faq-q {
  font-family: var(--font-display); font-style: italic; font-size: 22px;
  color: var(--dark);
  padding: var(--s-4) 0;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: baseline;
  user-select: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.faq-q::after {
  content: '+';
  font-family: var(--font-mono); font-size: 20px; color: var(--terracotta);
  font-style: normal;
  transition: transform var(--dur-fast) var(--ease-out);
}
.faq-item.open .faq-q::after { content: '−'; }
.faq-q:hover { color: var(--terracotta); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur-med) var(--ease-out);
  font-size: 16px; line-height: 1.65; color: var(--dark-soft);
}
.faq-item.open .faq-a {
  max-height: 400px;
  padding-bottom: var(--s-4);
}

/* ---------- FOOTER ------------------------------------------------------- */

.site-footer {
  padding: var(--s-6) 0;
  border-top: 1px solid var(--grey-soft);
  margin-top: var(--s-8);
}
.site-footer .container {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s-4);
}
.site-footer-text {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em;
  color: var(--grey); text-transform: uppercase;
}
.site-footer-links { display: flex; gap: var(--s-4); }
.site-footer-links a {
  font-family: var(--font-body); font-size: 13px; color: var(--dark);
  transition: color var(--dur-fast) var(--ease-out);
}
.site-footer-links a:hover { color: var(--terracotta); }
