/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  /* Dark-mode adaptation of the Crearte Web brand palette — the brand's own
     tokens (marca-oscuro, secundario, acento) drive a dark UI instead of the
     light one they're documented for. --bg/--bg-2/--ink-soft/--mute are the
     only values not lifted 1:1 from the brand sheet, derived to keep AA
     contrast on a dark background. */
  --bg:        #04141b;
  --bg-2:      #0a2530;
  --surface:   #002F3F;   /* Primario oscuro — cards, nav sólido */
  --surface-2: #004156;   /* Primario — hover de superficies */
  --ink:       #F5F7F9;   /* Surface (token de marca) reusado como texto principal */
  --ink-soft:  #AEBBC2;
  --mute:      #82929B;
  --mute-2:    #5C6B74;
  --line:      rgba(116, 196, 199, 0.16);

  --accent:       #E56001;   /* Acento — naranja de marca */
  --accent-dark:  #B84D01;
  --accent-2:     #74C4C7;   /* Secundario — turquesa de marca */
  --accent-2-dark:#0F6E70;

  --gradient-brand:  linear-gradient(135deg, #004156 0%, #74C4C7 100%);
  --gradient-accent: linear-gradient(135deg, #E56001 0%, #FF8533 100%);

  --display: "Space Grotesk", var(--sans);
  --serif-accent: "Instrument Serif", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --ease-crearte: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --nav-h: 76px;
  --container: 1280px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 16px; line-height: 1.6;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip; overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1; letter-spacing: -0.01em; font-family: var(--display); font-weight: 700; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 720px) { .container { padding-inline: 2.5rem; } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.skip-link {
  position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem;
  background: var(--ink); color: var(--bg); z-index: 9999; border-radius: 6px; font-weight: 600;
  transition: top .3s var(--ease-crearte);
}
.skip-link:focus { top: 1rem; }

.mono-tag {
  font-family: var(--display); font-size: .78rem; letter-spacing: .04em;
  color: var(--mute); text-transform: uppercase;
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease-crearte), transform .8s var(--ease-crearte); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
.no-js .micro-intro { display: none; }

/* =============================================================
   4. Nav
   ============================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 500; height: var(--nav-h);
  display: flex; align-items: center;
  border-bottom: 1px solid transparent;
  transition: border-color .5s var(--ease-crearte), background .5s var(--ease-crearte);
}
.nav.is-solid { background: rgba(0, 47, 63, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--line); }
.nav-inner { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; }
.nav-brand img { height: 28px; width: auto; }
.nav-cta {
  font-family: var(--display); font-size: .82rem; font-weight: 600;
  padding: .6rem 1.1rem; border: 1px solid var(--line); border-radius: 100px;
  transition: border-color .4s var(--ease-crearte), color .4s var(--ease-crearte);
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent); }

/* =============================================================
   5. Cursor / grain / micro-intro
   ============================================================= */
.cursor { display: none; position: fixed; top: 0; left: 0; z-index: 800; pointer-events: none; }
.cursor.is-ready { display: block; }
.cursor-dot { position: fixed; top: 0; left: 0; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; pointer-events: none; z-index: 801; transform: translate(-50%,-50%); }
.cursor-ring {
  position: fixed; top: 0; left: 0; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--ink); pointer-events: none; z-index: 800; transform: translate(-50%,-50%);
  mix-blend-mode: difference;
  transition: width .3s var(--ease-crearte), height .3s var(--ease-crearte);
}
.cursor-ring.is-hover { width: 58px; height: 58px; }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot, .cursor-ring { display: none; } }

.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.micro-intro { position: fixed; inset: 0; z-index: 900; background: var(--bg); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.micro-intro-line { width: 1px; height: 40%; background: var(--accent); transform: scaleY(0); transform-origin: center; }

.progress-bar { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 700; pointer-events: none; }
.progress-bar-fill { height: 100%; width: 0%; background: var(--accent); transform-origin: left; }

/* =============================================================
   6. Hero — mouse-reactive gradient
   ============================================================= */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: var(--nav-h); overflow: hidden; }
.hero-gradient {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle 620px at var(--mx, 30%) var(--my, 30%), rgba(116, 196, 199, .24) 0%, transparent 60%),
    radial-gradient(circle 720px at calc(var(--mx, 30%) + 20%) calc(var(--my, 30%) - 10%), rgba(229, 96, 1, .16) 0%, transparent 60%),
    var(--bg);
  filter: blur(10px);
}
.hero-content { position: relative; }
.hero-eyebrow { font-family: var(--display); font-size: .85rem; color: var(--mute); margin-bottom: 1.6rem; display: flex; align-items: center; gap: .6rem; }
.hero-eyebrow .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero-title { font-size: clamp(2.6rem, 9vw, 6.6rem); max-width: 16ch; }
.hero-title .accent-word { font-family: var(--serif-accent); font-style: italic; font-weight: 400; color: var(--accent-2); }
.hero-sub { max-width: 46ch; margin-top: 1.8rem; font-size: 1.05rem; color: var(--mute); }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2.4rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .95rem 1.7rem;
  font-family: var(--display); font-size: .85rem; font-weight: 600; border-radius: 100px;
  transition: transform .4s var(--ease-crearte), background .3s var(--ease-crearte), color .3s var(--ease-crearte), border-color .3s var(--ease-crearte);
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--ink); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.hero-scroll-hint { position: absolute; bottom: 2.4rem; left: 0; font-family: var(--display); font-size: .74rem; color: var(--mute-2); display: flex; align-items: center; gap: .5rem; }
.hero-scroll-hint::after { content: ""; width: 28px; height: 1px; background: var(--mute-2); }

/* =============================================================
   7. Manifiesto
   ============================================================= */
.manifiesto { padding-block: 8rem; border-top: 1px solid var(--line); }
.manifiesto p {
  font-family: var(--display); font-size: clamp(1.15rem, 2.6vw, 1.7rem); line-height: 1.5;
  max-width: 62ch; color: var(--ink);
}
.manifiesto em { font-family: var(--serif-accent); font-style: italic; color: var(--accent-2); }

/* =============================================================
   8. Work grid
   ============================================================= */
.work { padding-block: 4rem 8rem; }
.work-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 2.4rem; }
.work-head h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.work-count { font-family: var(--display); font-size: .82rem; color: var(--mute); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.6rem;
}
@media (min-width: 720px) { .work-grid { gap: 2rem; } }

.work-card {
  display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .5s var(--ease-crearte), border-color .4s var(--ease-crearte), box-shadow .5s var(--ease-crearte);
}
.work-card:hover, .work-card:focus-visible {
  transform: translateY(-6px);
  border-color: var(--cv-bg-2, var(--accent));
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .55);
}

.work-card-cover {
  position: relative; display: block;
  aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--cv-bg);
  color: var(--cv-ink);
}
.work-card-cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.work-card-blob {
  position: absolute; top: -26%; right: -18%;
  width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--cv-ink) 16%, var(--cv-bg-2)) 0%, var(--cv-bg-2) 68%);
  transition: transform .6s var(--ease-crearte);
}
.work-card:hover .work-card-blob { transform: scale(1.06) translate(-3%, 3%); }
.work-card-ghost {
  position: absolute; left: -.03em; bottom: -.16em; z-index: 1;
  font-family: var(--serif-accent); font-style: italic; font-weight: 400; line-height: .68;
  font-size: clamp(6rem, 17vw, 9.5rem);
  color: var(--cv-ink);
  transition: transform .6s var(--ease-crearte);
}
.work-card:hover .work-card-ghost { transform: translateY(-4%); }
.work-card-archetype {
  position: absolute; top: 1.1rem; left: 1.1rem; max-width: calc(100% - 3.6rem); z-index: 3;
  font-family: var(--display); font-size: .68rem; letter-spacing: .05em; text-transform: uppercase;
  opacity: .85;
}
.work-card-arrow {
  position: absolute; top: 1rem; right: 1rem; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--cv-ink) 14%, transparent);
  transition: transform .4s var(--ease-crearte), background .4s var(--ease-crearte);
}
.work-card-arrow svg { width: 14px; height: 14px; transition: transform .3s var(--ease-crearte), color .3s var(--ease-crearte); }
.work-card:hover .work-card-arrow { background: var(--cv-ink); }
.work-card:hover .work-card-arrow svg { transform: translate(2px, -2px); color: var(--cv-bg); }

.work-card-info { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.work-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; }
.work-card-title { font-family: var(--display); font-weight: 700; font-size: 1.3rem; transition: color .3s var(--ease-crearte); }
.work-card:hover .work-card-title { color: var(--accent); }
.work-card-year { font-family: var(--display); font-size: .78rem; color: var(--mute-2); flex-shrink: 0; }
.work-card-rubro { font-family: var(--display); font-size: .78rem; color: var(--mute); text-transform: uppercase; letter-spacing: .03em; }
.work-card-real { display: inline-flex; align-items: center; gap: .35rem; margin-left: .6rem; color: var(--accent); text-transform: none; letter-spacing: 0; }
.work-card-real .live-dot { width: 5px; height: 5px; }
.work-card-desc { color: var(--mute); font-size: .92rem; line-height: 1.5; margin-top: .15rem; }

.work-grid .work-card:nth-child(3n+2) { transition-delay: 90ms; }
.work-grid .work-card:nth-child(3n+3) { transition-delay: 180ms; }

/* =============================================================
   9. Proceso
   ============================================================= */
.proceso { padding-block: 6rem 8rem; border-top: 1px solid var(--line); }
.proceso-grid { display: grid; grid-template-columns: 1fr; gap: 2.4rem; }
.proceso-item .work-num { display: block; margin-bottom: 1rem; font-size: 1.4rem; color: var(--accent); }
.proceso-item h3 { font-size: 1.2rem; font-family: var(--sans); font-weight: 700; margin-bottom: .8rem; }
.proceso-item p { color: var(--mute); font-size: .95rem; max-width: 40ch; }

@media (min-width: 720px) { .proceso-grid { grid-template-columns: repeat(3, 1fr); } }

/* =============================================================
   10. CTA contacto
   ============================================================= */
.contacto { padding-block: 7rem; border-top: 1px solid var(--line); text-align: center; }
.contacto .mono-tag { display: block; margin-bottom: 1.4rem; }
.contacto-title { font-size: clamp(2rem, 6vw, 3.6rem); }
.contacto-actions { margin-top: 2.4rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* =============================================================
   11. Footer
   ============================================================= */
.footer { padding-block: 2.4rem; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; justify-content: space-between; font-family: var(--display); font-size: .78rem; color: var(--mute-2); }
.footer-inner a { color: var(--mute); transition: color .3s var(--ease-crearte); }
.footer-inner a:hover { color: var(--accent); }

@media (min-width: 720px) { .footer-inner { flex-direction: row; align-items: center; } }

/* =============================================================
   12. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .micro-intro { display: none; }
}
