/* ============================================================
   Matías Cuestas — Landing
   Design system
   ============================================================ */

:root {
  /* base — warm near-black */
  --bg:        #08080a;
  --bg-1:      #0c0c0f;
  --bg-2:      #111114;
  --surface:   rgba(255,255,255,0.025);
  --surface-2: rgba(255,255,255,0.04);
  --hair:      rgba(255,255,255,0.08);
  --hair-2:    rgba(255,255,255,0.13);

  /* text */
  --ink:       #f6f6f7;
  --ink-soft:  #b4b4be;
  --ink-mute:  #7c7c85;
  --ink-faint: #4a4a52;

  /* champagne brand accent (identidad de marca) */
  --champagne:      #d6c4a0;
  --champagne-soft: #efe2c6;
  --champagne-deep: #9a8762;

  /* functional accent = silver/white, for high-contrast CTAs */
  --accent:    #f4f4f6;
  --accent-ink:#0a0a0c;

  /* ambient glow — champagne, muy tenue: la calidez aparece, no se impone */
  --glow:      214,196,160;    /* champagne rgb for radial atmospheres */
  --glow-2:    154,135,98;     /* oro profundo secundario */

  --radius:    18px;
  --radius-lg: 26px;
  --radius-sm: 12px;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);

  --font-display: "Schibsted Grotesk", system-ui, sans-serif;
  --font-serif: "Cormorant", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);

  --motion: 1; /* tweakable multiplier */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 420;
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(var(--glow), 0.35); color: #fff; }

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

/* visible keyboard focus for all interactive elements */
:focus-visible { outline: 2px solid var(--champagne); outline-offset: 3px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

/* page grain + base atmosphere ------------------------------ */
.bg-fixed {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.bg-fixed::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(1100px 720px at 78% -8%, rgba(var(--glow),0.10), transparent 60%),
    radial-gradient(900px 600px at 8% 6%, rgba(var(--glow-2),0.07), transparent 55%);
}
.grid-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 26%, #000 0%, transparent 72%);
          mask-image: radial-gradient(circle at 50% 26%, #000 0%, transparent 72%);
}
.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { position: relative; z-index: 2; }

/* layout ----------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
section { position: relative; }
/* tighter rhythm: the scroll-scrubbed block transitions carry the separation */
.section-pad { padding-block: clamp(44px, 6vw, 92px); }

/* shared type ------------------------------------------------ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex; align-items: center; gap: 9px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(var(--glow),0.9);
  box-shadow: 0 0 12px 1px rgba(var(--glow),0.8);
}

h1, h2, h3 { font-weight: 560; letter-spacing: -0.03em; line-height: 1.02; margin: 0; }
.display {
  font-size: clamp(40px, 7.2vw, 88px);
  letter-spacing: -0.04em; line-height: 0.98;
}
.h2 { font-size: clamp(30px, 4.6vw, 54px); letter-spacing: -0.035em; line-height: 1.04; }
.lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-soft); line-height: 1.6; font-weight: 420; }

/* champagne accent for the key phrase (single solid color, no gradient-text) */
.accent-text { color: var(--champagne); }

.muted { color: var(--ink-mute); }

/* buttons ---------------------------------------------------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: 999px;
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform .4s var(--ease), background .3s, border-color .3s, box-shadow .4s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 12px 34px -12px rgba(0,0,0,0.8);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 18px 44px -14px rgba(var(--glow),0.5); }
.btn-primary .sweep {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none;
}
.btn-primary .sweep::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-18deg); transition: left .7s var(--ease);
}
.btn-primary:hover .sweep::after { left: 130%; }
.btn-ghost {
  background: var(--surface); color: var(--ink); border-color: var(--hair-2);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: var(--surface-2); border-color: rgba(255,255,255,0.28); transform: translateY(-2px); }
.btn .ico { width: 17px; height: 17px; }

/* glass card ------------------------------------------------- */
.card {
  position: relative; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  border: 1px solid var(--hair);
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}

/* reveal ----------------------------------------------------- */
/* Reveals enhance an already-visible default: content renders without JS.
   The `.js` class (set before first paint) is what opts into the motion,
   so a failed script or a headless render never ships a blank section. */
.js .reveal { opacity: 0; transform: translateY(28px); filter: blur(8px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out), filter 1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js .reveal.in { opacity: 1; transform: none; filter: none; }

/* line-mask reveal — the hero signature. Each .line clips an inner .line-i
   that rises from below with a long expo ease. */
.reveal-lines { line-height: 1.06; }
.js .reveal-lines .line { display: block; overflow: hidden; padding: 0.08em 0 0.18em; }
.js .reveal-lines .line-i { display: block; transform: translateY(108%);
  transition: transform 1.05s var(--ease-out-expo); transition-delay: var(--d, 0ms); }
.js .reveal-lines.in .line-i { transform: none; }

/* media reveal — scale + blur clear, for the portrait */
.js .reveal-media { opacity: 0; transform: scale(1.06); filter: blur(12px);
  transition: opacity 1.1s var(--ease-out), transform 1.2s var(--ease-out-expo), filter 1.1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js .reveal-media.in { opacity: 1; transform: none; filter: none; }

/* fade-only reveal — for elements that also run a transform animation
   (e.g. floating cards with floaty + scroll parallax); avoids transform clash */
.js .reveal-fade { opacity: 0; transition: opacity 1s var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal-fade.in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal-media, .js .reveal-fade { opacity: 1 !important; transform: none !important; filter: none !important; }
  .js .reveal-lines .line-i { transform: none !important; }
}

/* Lenis smooth scroll (initialised only when motion is allowed) */
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; }
