/* === Coopfit Fitness — Rebrand Stylesheet === */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@300;400;500;600;700;800;900&family=Archivo+Narrow:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* --- Palette (champagne gold default) --- */
  --bg-0: #0a0908;
  --bg-1: #11100e;
  --bg-2: #1a1815;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #f5f0e6;
  --ink-mute: #b8b0a0;
  --ink-dim: #6b6359;
  --accent: #c8a96a;       /* champagne gold */
  --accent-hi: #e3c896;
  --accent-lo: #8c7848;
  --accent-ink: #0a0908;   /* text on accent */
  --cream: #f5f0e6;

  /* --- Type --- */
  --ff-display: "Archivo Narrow", "Archivo", -apple-system, sans-serif;
  --ff-body: "Archivo", -apple-system, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, monospace;

  /* --- Motion --- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html, body { margin: 0; padding: 0; background: var(--bg-1); color: var(--ink); width: 100%; max-width: 100%; overflow-x: hidden; overscroll-behavior-x: none; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ff-body);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.005em;
  font-size: 16px;
  position: relative;
}

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

/* --- Typography utilities --- */
.eyebrow {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.display {
  font-family: var(--ff-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 0.92;
  text-transform: uppercase;
}
.display em {
  font-style: italic;
  font-weight: 300;
  font-family: "Archivo", -apple-system, sans-serif;
}
.display .italic {
  font-style: italic;
  font-family: var(--ff-display);
  font-weight: 400;
}

/* --- Buttons --- */
.btn {
  --bg: var(--accent);
  --fg: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: none;
  border-radius: 0;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  transition: background 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.btn:hover { background: var(--accent-hi); }
.btn > * { position: relative; z-index: 1; }
.btn .arrow {
  display: inline-block;
  transition: transform 0.4s var(--ease-out);
}
.btn:hover .arrow { transform: translateX(4px); }

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

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

section { position: relative; }

/* --- Scroll-reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
/* Hero reveal uses CSS animation so it plays on load without needing JS state */
.hero-anim {
  opacity: 0;
  transform: translateY(40px);
  animation: heroIn 1.1s var(--ease-out) forwards;
}
.hero-anim.d1 { animation-delay: 0.15s; }
.hero-anim.d2 { animation-delay: 0.3s; }
.hero-anim.d3 { animation-delay: 0.55s; }
.hero-anim.d4 { animation-delay: 0.8s; }
@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}
.hero-line {
  display: block;
  overflow: hidden;
}
.hero-line > span {
  display: inline-block;
  transform: translateY(110%);
  animation: heroLine 1.1s var(--ease-out) forwards;
}
.hero-line.d1 > span { animation-delay: 0.15s; }
.hero-line.d2 > span { animation-delay: 0.3s; }
.hero-line.d3 > span { animation-delay: 0.45s; }
@keyframes heroLine {
  to { transform: translateY(0); }
}
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal-stagger.in > * {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 0.15s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 0.25s; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 0.35s; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 0.45s; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 0.55s; }

/* --- Mask reveal for images --- */
.img-mask {
  position: relative;
  overflow: hidden;
}
.img-mask::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-0);
  transform-origin: top;
  transform: scaleY(1);
  transition: transform 1.4s var(--ease-in-out);
}
.img-mask.in::after { transform: scaleY(0); transform-origin: bottom; }
.img-mask img, .img-mask video {
  transform: scale(1.15);
  transition: transform 2s var(--ease-out);
}
.img-mask.in img, .img-mask.in video { transform: scale(1); }

/* --- Text reveal (line by line) --- */
.tr-line {
  display: block;
  overflow: hidden;
}
.tr-line > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.1s var(--ease-out);
}
.tr.in .tr-line > span { transform: translateY(0); }
.tr.in .tr-line:nth-child(1) > span { transition-delay: 0.05s; }
.tr.in .tr-line:nth-child(2) > span { transition-delay: 0.15s; }
.tr.in .tr-line:nth-child(3) > span { transition-delay: 0.25s; }
.tr.in .tr-line:nth-child(4) > span { transition-delay: 0.35s; }
.tr.in .tr-line:nth-child(5) > span { transition-delay: 0.45s; }

/* --- Marquee --- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}
.marquee-track {
  display: flex;
  gap: 56px;
  padding: 22px 0;
  white-space: nowrap;
  animation: marquee 38s linear infinite;
  width: max-content;
}
.marquee-item {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 56px;
}
.marquee-item .dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* --- Forms --- */
.field {
  position: relative;
  border-bottom: 1px solid var(--line-strong);
  padding: 22px 0 14px;
  transition: border-color 0.3s;
}
.field:focus-within { border-color: var(--accent); }
.field label {
  display: block;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.field input, .field textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 18px;
  padding: 4px 0;
  resize: none;
}
.field textarea { min-height: 80px; }

/* --- Cursor / interactive --- */
.hover-fade { transition: opacity 0.3s; }
.hover-fade:hover { opacity: 0.6; }

/* ============================================================
   RESPONSIVE — tablet & mobile
   ============================================================ */

/* iOS: keep inputs at 16px+ so focus doesn't trigger zoom */
@media (max-width: 720px) {
  .field input, .field textarea { font-size: 16px; }
}

/* --- Tablet (≤1024px) --- */
@media (max-width: 1024px) {
  .container { padding: 0 36px; }
  /* Trim the generous desktop section rhythm */
  section:not(#top) {
    padding-top: 112px !important;
    padding-bottom: 104px !important;
  }
}

/* --- Small tablet / large phone (≤900px) --- */
@media (max-width: 900px) {
  /* Hero: drop the decorative side rails, they don't align with mobile gutters */
  .hero-rail { display: none !important; }
  .hero-content { padding-top: 104px !important; padding-bottom: 120px !important; }
  /* Hero meta bar pulls in to the gutter */
  .hero-metabar { left: 20px !important; right: 20px !important; bottom: 22px !important; }
}

/* --- Phone (≤720px) --- */
@media (max-width: 720px) {
  section:not(#top) {
    padding-top: 84px !important;
    padding-bottom: 80px !important;
  }
  /* Hero headline scales down so long lines never overflow the gutter */
  #top h1.display { font-size: clamp(44px, 13.5vw, 72px) !important; }
  .hero-content { gap: 24px !important; }
  /* Hero CTAs: stack full-width, comfortable tap targets */
  .hero-content .btn { width: 100%; justify-content: center; padding: 17px 24px; }
  /* Hide coordinate readout on the smallest screens — keep the left credit */
  .hero-meta-r { display: none !important; }

  /* Contact form breathes less aggressively */
  .contact-form { padding: 28px 22px 30px !important; }

  /* Marquee a touch smaller */
  .marquee-item { font-size: 18px !important; }
}

/* --- Small phone (≤420px) --- */
@media (max-width: 420px) {
  .container { padding: 0 18px; }
  #top h1.display { font-size: clamp(40px, 13vw, 60px) !important; }
}

/* Clean up dangling cell borders when grids collapse */
@media (max-width: 900px) {
  .stats-grid > *:nth-child(2n) { border-right: none !important; }
  .pillars-grid > *:nth-child(2n) { border-right: none !important; }
}
@media (max-width: 560px) {
  .pillars-grid > * { border-right: none !important; }
}

/* Larger default tap targets on touch devices */
@media (hover: none) and (pointer: coarse) {
  .nav-drawer-link { padding: 24px 0; }
  .foot-link, .nav-drawer-social a { padding: 4px 0; display: inline-block; }
}

/* Respect reduced-motion: kill decorative loops & long reveals */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  .marquee-track { animation: none !important; }
  .reveal, .reveal-stagger > *, .img-mask img, .img-mask video { transition: none !important; }
}
