/* =========================================================
   FEAR STUDIO — agencia de marketing y presencia en internet
   Sistema visual: tech-premium (oscuro, un acento, bento grid)
   ========================================================= */

:root{
  --bg: #09090c;
  --surface: #121216;
  --surface-2: #18181f;
  --border: rgba(255,255,255,.09);
  --border-hover: rgba(255,255,255,.18);
  --text: #f2f2f4;
  --text-dim: #9b9ba3;
  --text-faint: #5c5c64;

  --accent: #6e56cf;
  --accent-hover: #8171dd;
  --accent-soft: rgba(110,86,207,.14);
  --accent-2: #22d3ee;

  --header-bg: rgba(9,9,12,.72);

  --f: "Instrument Sans", sans-serif;
  --f-mono: "JetBrains Mono", monospace;

  --bar-h: 68px;
  --container: 1200px;
  --ease: cubic-bezier(.16,1,.3,1);
}

/* ---------- tema claro (toggle día/noche) ---------- */
:root[data-theme="light"]{
  --bg: #f7f7f9;
  --surface: #ffffff;
  --surface-2: #eeeef2;
  --border: rgba(16,16,22,.10);
  --border-hover: rgba(16,16,22,.20);
  --text: #131316;
  --text-dim: #55555f;
  --text-faint: #86868f;

  --accent: #5b3fc4;
  --accent-hover: #4c34a8;
  --accent-soft: rgba(91,63,196,.10);
  --accent-2: #0e93a8;

  --header-bg: rgba(255,255,255,.78);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

img, svg{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; cursor: pointer; background: none; border: none; }
ul{ list-style: none; margin: 0; padding: 0; }
h1,h2,h3,h4,p{ margin: 0; }

::selection{ background: var(--accent); color: #fff; }
:focus-visible{ outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container{ width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 32px; }

.reveal{ opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible{ opacity: 1; transform: translateY(0); }

.eyebrow{
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .04em; color: var(--accent);
  margin-bottom: 16px;
}
.eyebrow::before{ content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.lede{ font-size: 16.5px; line-height: 1.65; color: var(--text-dim); max-width: 42ch; }

/* ---------- header ---------- */
.site-header{
  position: fixed; top: 0; left: 0; right: 0; z-index: 200; height: var(--bar-h);
  display: flex; align-items: center;
  background: var(--header-bg); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.site-header__inner{ width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 32px; display: flex; align-items: center; gap: 30px; }
.brand{ display: flex; align-items: center; gap: 9px; }
.brand__mark{ width: 26px; height: 26px; flex: none; display: block; }
.brand__mark svg{ display: block; width: 100%; height: 100%; }
.brand__word{ font-family: var(--f); font-weight: 600; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }

.main-nav{ display: flex; align-items: center; gap: 2px; margin-left: 12px; }
.main-nav a{ font-size: 14px; color: var(--text-dim); padding: 8px 14px; border-radius: 7px; transition: color .2s var(--ease), background-color .2s var(--ease); }
.main-nav a:hover{ color: var(--text); background: var(--surface); }
.main-nav a[aria-current="page"]{ color: var(--text); }

.header-cta{ margin-left: auto; display: flex; align-items: center; gap: 18px; }
.header-cta > a:not(.btn){ font-size: 14px; color: var(--text-dim); }
.header-cta > a:not(.btn):hover{ color: var(--text); }

.menu-btn{ display: none; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; align-items: center; justify-content: center; margin-left: auto; }
.menu-btn span{ display: block; width: 15px; height: 1.5px; background: var(--text); position: relative; }
.menu-btn span::before, .menu-btn span::after{ content:""; position: absolute; left: 0; width: 15px; height: 1.5px; background: var(--text); }
.menu-btn span::before{ top: -5px; }
.menu-btn span::after{ top: 5px; }

.mobile-nav{ position: fixed; inset: 0; background: var(--bg); z-index: 260; padding: 24px 28px; display: none; flex-direction: column; gap: 2px; transition: background-color .3s var(--ease); }

/* ---------- theme toggle ---------- */
.theme-toggle{
  flex: none; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--text-dim);
  transition: border-color .2s var(--ease), color .2s var(--ease), background-color .2s var(--ease);
}
.theme-toggle:hover{ border-color: var(--border-hover); color: var(--text); background: var(--surface); }
.theme-toggle svg{ width: 17px; height: 17px; }
.theme-toggle__sun{ display: none; }
.theme-toggle__moon{ display: block; }
:root[data-theme="light"] .theme-toggle__sun{ display: block; }
:root[data-theme="light"] .theme-toggle__moon{ display: none; }
.mobile-nav.is-open{ display: flex; }
.mobile-nav__close{ align-self: flex-end; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); margin-bottom: 22px; }
.mobile-nav a{ font-size: 26px; font-weight: 600; padding: 14px 0; border-bottom: 1px solid var(--border); color: var(--text); }

/* ---------- buttons ---------- */
.btn{
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--f); font-weight: 600;
  font-size: 14px; padding: 11px 20px; border-radius: 9px; border: 1px solid transparent;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
}
.btn--primary{ background: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 4px 14px -6px var(--accent); }
.btn--primary:hover{ background: var(--accent-hover); transform: translateY(-1px); }
.btn--ghost{ border-color: var(--border); color: var(--text); background: var(--surface); }
.btn--ghost:hover{ border-color: var(--border-hover); background: var(--surface-2); }
.btn-row{ display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- hero ---------- */
.hero{ position: relative; padding: calc(var(--bar-h) + 110px) 0 90px; overflow: hidden; text-align: center; }
.hero__glow{
  position: absolute; top: -220px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 560px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(110,86,207,.32), rgba(34,211,238,.10) 55%, transparent 75%);
  filter: blur(10px);
  animation: driftglow 16s ease-in-out infinite;
}
@keyframes driftglow{ 0%,100%{ transform: translateX(-50%) translateY(0); } 50%{ transform: translateX(-48%) translateY(18px); } }
.hero__grid{
  position: absolute; inset: 0; z-index: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 55% at 50% 20%, #000 0%, transparent 72%);
}
.hero__inner{ position: relative; z-index: 1; }
.hero .eyebrow{ justify-content: center; }
.hero h1{ font-family: var(--f); font-weight: 600; font-size: clamp(38px, 6vw, 70px); line-height: 1.06; letter-spacing: -.02em; max-width: 16ch; margin: 0 auto; }
.hero h1 em{ font-style: normal; background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__sub{ font-size: 18px; color: var(--text-dim); max-width: 52ch; margin: 22px auto 0; }
.hero__ctas{ display: flex; justify-content: center; gap: 14px; margin-top: 34px; flex-wrap: wrap; }

/* ---------- stat bar ---------- */
.stat-bar{ border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat-bar__row{ display: flex; flex-wrap: wrap; }
.stat{ flex: 1 1 200px; padding: 30px 28px; border-left: 1px solid var(--border); }
.stat:first-child{ border-left: none; }
.stat__num{ font-family: var(--f-mono); font-weight: 500; font-size: clamp(26px, 2.6vw, 34px); color: var(--text); }
.stat__label{ font-size: 13px; color: var(--text-faint); margin-top: 6px; }

/* ---------- section scaffolding ---------- */
.section{ padding: 100px 0; }
.section--tight{ padding: 64px 0; }
.section-border{ border-top: 1px solid var(--border); }
.section-head{ display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 44px; flex-wrap: wrap; }
.section-head h2{ font-family: var(--f); font-weight: 600; font-size: clamp(28px, 3.2vw, 42px); letter-spacing: -.015em; line-height: 1.1; }

/* ---------- bento grid (servicios) ---------- */
.bento{ display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 172px; gap: 18px; }
.bento-card{
  position: relative; overflow: hidden; border-radius: 18px; border: 1px solid var(--border); background: var(--surface);
  padding: 28px; display: flex; flex-direction: column; transition: border-color .25s var(--ease), background-color .25s var(--ease), transform .25s var(--ease);
}
.bento-card:hover{ border-color: var(--border-hover); background: var(--surface-2); transform: translateY(-2px); }
.bento-card--lg{ grid-column: span 2; grid-row: span 2; }
.bento-card__glow{
  position: absolute; top: -60px; right: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%); pointer-events: none;
}
.bento-card__icon{
  width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 19px; margin-bottom: auto;
}
.bento-card h3{ font-family: var(--f); font-weight: 600; font-size: 19px; margin-top: 20px; letter-spacing: -.01em; }
.bento-card--lg h3{ font-size: 24px; margin-top: 28px; }
.bento-card p{ font-size: 14px; color: var(--text-dim); margin-top: 8px; line-height: 1.55; }
.bento-card__meta{ margin-top: 16px; font-family: var(--f-mono); font-size: 12px; color: var(--text-faint); }

/* ---------- process stepper (estudio) ---------- */
.stepper{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
.stepper::before{ content: ""; position: absolute; top: 17px; left: 6%; right: 6%; height: 1px; background: var(--border); }
.stepper__fill{ position: absolute; top: 17px; left: 6%; height: 1px; background: var(--accent); width: 0%; transition: width 1.2s var(--ease); }
.step{ position: relative; padding-right: 20px; }
.step__dot{ width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg); display: flex; align-items: center; justify-content: center; font-family: var(--f-mono); font-size: 12px; color: var(--text-dim); position: relative; z-index: 1; }
.step.is-active .step__dot{ border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step h3{ font-family: var(--f); font-weight: 600; font-size: 17px; margin-top: 20px; }
.step p{ font-size: 13.5px; color: var(--text-dim); margin-top: 8px; max-width: 30ch; }

/* ---------- work grid (portafolio) ---------- */
.work-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.work-card{ border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); transition: border-color .25s var(--ease), transform .25s var(--ease); }
.work-card:hover{ border-color: var(--border-hover); transform: translateY(-3px); }
.work-card__art{
  aspect-ratio: 16/10; position: relative; overflow: hidden;
  background: var(--surface-2);
}
.work-card__art img{
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.05);
  transition: transform .5s var(--ease);
}
.work-card:hover .work-card__art img{ transform: scale(1.04); }
.work-card__art::after{
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 100% at 20% 0%, var(--mesh-a, var(--accent-soft)), transparent 60%),
              radial-gradient(120% 100% at 90% 100%, var(--mesh-b, rgba(34,211,238,.14)), transparent 60%);
  mix-blend-mode: overlay;
}
.work-card__body{ padding: 18px 20px 22px; }
.work-card__tag{ font-family: var(--f-mono); font-size: 11.5px; color: var(--accent); display: block; margin-bottom: 6px; }
.work-card__body h3{ font-family: var(--f); font-weight: 600; font-size: 18px; }
.work-card__body span.meta{ font-size: 13px; color: var(--text-faint); }

/* ---------- filter chips (trabajo) ---------- */
.filter-row{ display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.filter-btn{ font-size: 13.5px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim); transition: all .2s var(--ease); }
.filter-btn:hover{ border-color: var(--border-hover); color: var(--text); }
.filter-btn.is-active{ background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- team ---------- */
.roster{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.r-item{ border: 1px solid var(--border); border-radius: 16px; padding: 22px; background: var(--surface); transition: border-color .2s var(--ease); }
.r-item:hover{ border-color: var(--border-hover); }
.r-item__media{ width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); margin-bottom: 16px; }
.r-item__role{ font-family: var(--f-mono); font-size: 11.5px; color: var(--accent); margin-bottom: 3px; }
.r-item h3{ font-family: var(--f); font-weight: 600; font-size: 16px; }

/* ---------- CTA panel ---------- */
.cta-panel{
  border: 1px solid var(--border); border-radius: 24px; padding: 80px 40px; text-align: center; position: relative; overflow: hidden;
  background: radial-gradient(120% 160% at 50% 0%, var(--accent-soft), transparent 60%), var(--surface);
}
.cta-panel h2{ font-family: var(--f); font-weight: 600; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.015em; max-width: 20ch; margin: 0 auto 30px; position: relative; }
.cta-panel .btn-row{ justify-content: center; position: relative; }

/* ---------- footer ---------- */
.site-footer{ border-top: 1px solid var(--border); padding: 60px 0 0; margin-top: 60px; }
.footer-grid{ display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 30px; padding-bottom: 44px; }
.footer-brand p{ font-size: 13.5px; color: var(--text-dim); max-width: 30ch; margin-top: 14px; }
.footer-col h4{ font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--text-faint); margin-bottom: 14px; }
.footer-col ul{ display: flex; flex-direction: column; gap: 9px; }
.footer-col a{ font-size: 13.5px; color: var(--text-dim); }
.footer-col a:hover{ color: var(--text); }
.footer-bottom{ border-top: 1px solid var(--border); padding: 20px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--text-faint); }

/* ---------- page hero (subpáginas) ---------- */
.page-hero{ position: relative; padding: calc(var(--bar-h) + 70px) 0 70px; overflow: hidden; }
.page-hero h1{ font-family: var(--f); font-weight: 600; font-size: clamp(34px, 5vw, 56px); letter-spacing: -.02em; line-height: 1.08; max-width: 18ch; }
.page-hero .lede{ margin-top: 16px; }

/* ---------- feature rows (servicios detalle) ---------- */
.feature-row{
  display: grid; grid-template-columns: 60px 1fr 1fr; gap: 32px; padding: 40px 0; border-top: 1px solid var(--border);
}
.feature-row:last-child{ border-bottom: 1px solid var(--border); }
.feature-row__icon{ width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 19px; }
.feature-row h3{ font-family: var(--f); font-weight: 600; font-size: 21px; margin-bottom: 10px; }
.feature-row p{ font-size: 14.5px; color: var(--text-dim); max-width: 44ch; }
.feature-row__specs{ display: flex; flex-direction: column; gap: 8px; align-self: center; }
.spec{ display: flex; justify-content: space-between; gap: 16px; font-size: 13px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.spec span:first-child{ color: var(--text-faint); }
.spec span:last-child{ font-family: var(--f-mono); color: var(--text); }

/* ---------- formulario (contacto) ---------- */
.contact-layout{ display: grid; grid-template-columns: 1.3fr 1fr; gap: 36px; }
.form-panel{ border: 1px solid var(--border); border-radius: 20px; padding: 36px; background: var(--surface); }
.field{ margin-bottom: 18px; }
.field label{ display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 7px; }
.field input, .field select, .field textarea{
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; color: var(--text);
  padding: 11px 13px; font-family: var(--f); font-size: 14.5px; resize: vertical; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus{ border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-foot{ margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.form-foot p{ font-size: 12px; color: var(--text-faint); max-width: 34ch; }

.info-stack{ display: flex; flex-direction: column; gap: 14px; }
.info-card{ border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; background: var(--surface); }
.info-card h4{ font-family: var(--f-mono); font-size: 11.5px; color: var(--text-faint); margin-bottom: 8px; }
.info-card a, .info-card p{ font-size: 16px; font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 980px){
  .main-nav{ display: none; }
  .header-cta > a:not(.btn){ display: none; }
  .menu-btn{ display: flex; }
  .bento{ grid-template-columns: 1fr 1fr; }
  .bento-card--lg{ grid-column: span 2; grid-row: span 1; }
  .work-grid{ grid-template-columns: 1fr 1fr; }
  .roster{ grid-template-columns: 1fr 1fr; }
  .stepper{ grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .stepper::before, .stepper__fill{ display: none; }
  .feature-row{ grid-template-columns: 42px 1fr; }
  .feature-row__specs{ grid-column: 1 / -1; }
  .footer-grid{ grid-template-columns: 1fr 1fr; }
  .footer-brand{ grid-column: 1 / -1; margin-bottom: 8px; }
  .contact-layout{ grid-template-columns: 1fr; }
}

@media (max-width: 640px){
  .container{ padding: 0 20px; }
  .section{ padding: 70px 0; }
  .bento{ grid-template-columns: 1fr; grid-auto-rows: auto; }
  .bento-card--lg{ grid-column: span 1; }
  .bento-card{ min-height: 160px; }
  .work-grid{ grid-template-columns: 1fr; }
  .roster{ grid-template-columns: 1fr 1fr; }
  .stepper{ grid-template-columns: 1fr; }
  .field-row{ grid-template-columns: 1fr; }
  .form-panel{ padding: 24px 20px; }
  .cta-panel{ padding: 56px 24px; }
  .stat{ flex: 1 1 45%; border-left: none; border-top: 1px solid var(--border); padding-top: 20px; }
}
