/* juancr.dev — shared by /es/ and /en/ */

/* ---------- Tokens ---------- */
:root {
  /* Color */
  --bg: #0B0A0F;            /* matches the photos' backdrop — do not change */
  --surface: #13121A;
  --surface-deep: #0E0D13;
  --line: #23212D;
  --line-soft: #1E1C27;
  --line-strong: #2A2836;
  --line-button: #34313F;
  --text: #EDEBF2;
  --heading: #F5F3FA;
  --muted: #B6B3C2;
  --subtle: #8F8BA0;
  --faint: #807C93;         /* AA contrast on --bg and --surface */
  --accent: #7A86FF;
  --accent-soft: rgba(122, 134, 255, 0.12);
  --link: #A9B1FF;
  --link-hover: #D4D8FF;

  /* Type */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Geist', system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --fs-body: 17px;
  --fs-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --fs-small: 15px;
  --fs-mono: 14px;
  --fs-eyebrow: 13px;
  --fs-display: clamp(2.5rem, 6.2vw, 5.25rem);
  --fs-h2: clamp(1.875rem, 4vw, 3.375rem);
  --fs-h2-contact: clamp(2rem, 4.4vw, 3.75rem);
  --fs-card-title: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);

  /* Space & shape */
  --max: 1240px;
  --gutter: clamp(20px, 5vw, 24px);
  --section-space: clamp(80px, 10vw, 128px);
  --card-pad: clamp(24px, 4vw, 40px);
  --radius-card: 20px;
  --radius-pill: 999px;
  --tap: 44px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
h1, h2, h3, h4, p { margin: 0; }
:target, section[id] { scroll-margin-top: 24px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.btn:focus-visible { border-radius: var(--radius-pill); outline-offset: 3px; }
.card:focus-visible { border-radius: var(--radius-card); }

[tabindex="-1"]:focus { outline: none; }
.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: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 16px; color: var(--bg); }

.page { overflow: hidden; }
.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Shared pieces ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 15px 26px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: #939DFF; color: var(--bg); }
.btn-ghost { color: var(--text); font-weight: 500; border: 1px solid var(--line-button); }
.btn-ghost:hover { color: var(--heading); border-color: #4A4659; }
.btn-light { background: var(--text); color: var(--bg); padding: 10px 18px; }
.btn-light:hover { background: #fff; color: var(--bg); }

.eyebrow {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.h2 {
  max-width: 760px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--heading);
  text-wrap: balance;
}
.section { padding-top: var(--section-space); }
.actions { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; }
.mono-note { font-family: var(--font-mono); font-size: var(--fs-mono); color: var(--faint); }
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.text-link:hover { color: var(--link-hover); }

/* ---------- Header ---------- */
.site-header {
  padding-block: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--heading); }
.monogram {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}
.brand-name { font-weight: 600; font-size: 16px; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 8px 28px; font-size: var(--fs-small); margin-left: auto; }
.nav-link { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap); color: var(--muted); text-decoration: none; }
.nav-link:hover { color: var(--heading); }

.header-tools { display: flex; align-items: center; gap: 12px; }

/* Language switch */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 13px;
}
.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 10px;
  border-radius: var(--radius-pill);
  color: var(--subtle);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.lang-switch a:hover { color: var(--heading); }
.lang-switch a[aria-current="page"] { background: var(--line-strong); color: var(--heading); }

.menu-btn {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 16px;
  border: 1px solid var(--line-button);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font: 500 var(--fs-small)/1 var(--font-body);
  cursor: pointer;
}
.menu-btn:hover { border-color: #4A4659; color: var(--heading); }

/* Drawer (native <dialog>: focus trap, Esc and inert page come for free) */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(100%, 420px);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  padding: 28px var(--gutter) 32px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  flex-direction: column;
  gap: 32px;
  overflow-y: auto;
}
.drawer[open] { display: flex; }
.drawer::backdrop { background: rgba(5, 5, 8, 0.7); backdrop-filter: blur(4px); }
.drawer-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.drawer-close { display: inline-flex; justify-content: center; padding: 0; }
.drawer-nav { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.drawer-nav a {
  display: flex;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--heading);
  text-decoration: none;
}
.drawer-nav a:hover { color: var(--accent); }
.drawer-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
@media (prefers-reduced-motion: no-preference) {
  .drawer[open] { animation: drawer-in .22s ease-out; }
  .drawer[open]::backdrop { animation: fade-in .22s ease-out; }
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
body.drawer-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 32px;
}
.hero-copy { flex: 1 1 520px; min-width: 0; padding-bottom: 96px; position: relative; z-index: 2; }
.eyebrow-muted {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--subtle);
}
.pulse { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-display);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--heading);
  text-wrap: balance;
}
.accent { color: var(--accent); }
.lead { margin-top: 32px; max-width: 540px; font-size: var(--fs-lead); line-height: 1.6; color: var(--muted); }

.stats {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: flex;
}
.stats li { flex: 0 1 auto; min-width: 0; padding-right: 28px; }
.stats li + li { padding-left: 28px; border-left: 1px solid var(--line-strong); }
.stats li:last-child { padding-right: 0; }
.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--heading);
}
.stat-label { display: block; margin-top: 6px; font-size: 14px; line-height: 1.45; color: var(--subtle); max-width: 12rem; text-wrap: balance; }

.hero-media { flex: 1 1 420px; min-width: 0; position: relative; display: flex; justify-content: center; }
.hero-glow {
  position: absolute;
  right: 4%;
  top: 18%;
  width: 70%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(110, 124, 255, 0.22), rgba(110, 124, 255, 0));
  filter: blur(30px);
}
.hero-media picture { position: relative; width: 100%; max-width: 520px; }
.hero-img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 6%, #000 70%, transparent 100%), linear-gradient(to right, transparent 0%, #000 14%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 6%, #000 70%, transparent 100%), linear-gradient(to right, transparent 0%, #000 14%, #000 88%, transparent 100%);
  mask-composite: intersect;
}

/* ---------- Stack strip ---------- */
.stack { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.stack-inner {
  padding-block: 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 40px;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  color: var(--faint);
}
.stack-label { color: var(--muted); }

/* ---------- Cards (services + resources) ---------- */
.cards {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.card-title { font-family: var(--font-display); font-size: var(--fs-card-title); font-weight: 600; line-height: 1.2; color: var(--heading); }
.card-text { color: var(--muted); }
.sub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 8px; }
.sub { border-top: 1px solid var(--line-strong); padding-top: 16px; }
.sub-title { font-size: inherit; font-weight: 600; color: var(--text); }
.sub p { margin-top: 6px; font-size: var(--fs-small); color: var(--subtle); }
.card-foot {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 12px;
}

/* Resources */
#recursos .cards, #resources .cards { margin-top: 0; }
.res-card { gap: 16px; color: inherit; text-decoration: none; transition: border-color .15s, background-color .15s; }
.res-card:hover { color: inherit; border-color: var(--line-button); background: #16151E; }
.res-label { font-family: var(--font-mono); font-size: var(--fs-eyebrow); color: var(--faint); }
.res-title { font-family: var(--font-display); font-size: var(--fs-card-title); font-weight: 600; line-height: 1.15; color: var(--heading); text-wrap: balance; }
.res-text { color: var(--muted); }
.res-link { color: var(--accent); font-weight: 600; }

/* ---------- Process ---------- */
.steps {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.step { padding: 32px 28px 32px; border-right: 1px solid var(--line-soft); }
.step:first-child { padding-left: 0; }
.step:last-child { padding-right: 0; border-right: 0; }
.step-num { display: block; font-family: var(--font-mono); font-size: var(--fs-mono); color: var(--accent); }
.step-title { margin: 14px 0 8px; font-size: 21px; font-weight: 600; line-height: 1.3; color: var(--heading); }
.step p { font-size: var(--fs-small); color: var(--subtle); }

/* ---------- About ---------- */
.about { display: flex; flex-wrap: wrap; gap: 64px; align-items: center; }
.about-media {
  flex: 1 1 380px;
  min-width: 0;
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line-soft);
}
.about-media img { display: block; width: 100%; height: 620px; object-fit: cover; object-position: center 20%; }
.about-copy { flex: 1 1 480px; min-width: 0; }
.about-text { margin-top: 28px; color: var(--muted); }
.timeline { list-style: none; margin: 40px 0 0; padding: 0; border-bottom: 1px solid var(--line); }
.timeline li { display: flex; gap: 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.t-date { flex: 0 0 120px; font-family: var(--font-mono); font-size: var(--fs-mono); line-height: 1.7; color: var(--faint); }
.t-now { color: var(--accent); }

/* ---------- Contact ---------- */
.contact { margin-top: var(--section-space); }
.contact-card {
  position: relative;
  background: var(--surface-deep);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
.contact-copy { flex: 1 1 520px; min-width: 0; padding: clamp(40px, 6vw, 72px) clamp(24px, 4.5vw, 56px); position: relative; z-index: 2; }
.h2-contact { font-size: var(--fs-h2-contact); line-height: 1.05; }
.contact-lead { margin-top: 24px; max-width: 480px; }
.contact-meta { margin-top: 28px; font-family: var(--font-mono); font-size: var(--fs-mono); color: var(--faint); overflow-wrap: anywhere; }
.contact-meta a { color: var(--muted); }
.contact-meta a:hover { color: var(--heading); }
.contact-media { flex: 1 1 340px; min-width: 0; min-height: 420px; position: relative; }
.contact-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 30%);
  mask-image: linear-gradient(to right, transparent 0%, #000 30%);
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 56px 48px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--faint);
}
.site-footer a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--subtle); }
.site-footer a:hover { color: var(--heading); }

/* =========================================================
   Responsive
   ========================================================= */

/* Large screens: content is capped by --max; just keep the hero photo in check */
@media (min-width: 1600px) {
  .hero { align-items: center; }
  .hero-copy { padding-block: 48px 120px; }
}

/* Below desktop: collapse the nav into the drawer */
@media (max-width: 959px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .site-header { padding-block: 20px; }
}
@media (min-width: 960px) {
  .drawer { display: none !important; }
}

/* Hero, services, about and contact stack */
@media (max-width: 979px) {
  .hero { gap: 0; }
  .hero-copy { padding-bottom: 8px; }
  .hero-media { margin-top: 8px; }
  .hero-media picture { max-width: 380px; }
  .hero-glow { right: 15%; width: 70%; }

  .services-grid { grid-template-columns: 1fr; }

  .about { gap: 40px; }
  .about-media img { height: auto; aspect-ratio: 4 / 5; max-height: 620px; }

  .contact-media { flex-basis: 100%; min-height: 0; aspect-ratio: 4 / 3; margin-top: -48px; }
  .contact-media img {
    object-position: center 18%;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
  }
}

/* Process: 2 × 2 */
@media (max-width: 1023px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(odd) { padding-left: 0; }
  .step:nth-child(even) { padding-right: 0; border-right: 0; }
  .step:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
}

/* Phones */
@media (max-width: 599px) {
  :root { --fs-body: 16px; }
  .eyebrow-muted { margin-bottom: 20px; font-size: 12px; }
  .lead { margin-top: 24px; }
  .actions { margin-top: 32px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }

  /* Stats become tidy rows */
  .stats { margin-top: 40px; flex-direction: column; gap: 0; }
  .stats li, .stats li + li {
    padding: 14px 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 8.75rem 1fr;
    align-items: baseline;
    gap: 12px;
  }
  .stats li:last-child { border-bottom: 1px solid var(--line); }
  .stat-value { font-size: 26px; }
  .stat-label { margin-top: 0; max-width: none; }

  .hero-media { margin-top: 24px; }
  .hero-media picture { max-width: 360px; }

  .stack-inner { gap: 10px 24px; font-size: 13px; }
  .stack-label { flex-basis: 100%; }

  .cards { margin-top: 40px; }
  .card-foot { flex-direction: column; align-items: flex-start; }

  /* Process: vertical list, no vertical dividers */
  .steps { margin-top: 40px; grid-template-columns: 1fr; }
  .step, .step:nth-child(n) {
    padding: 24px 0;
    border-right: 0;
    border-top: 0;
    border-bottom: 1px solid var(--line-soft);
    display: grid;
    grid-template-columns: 44px 1fr;
    column-gap: 8px;
  }
  .step-num { grid-row: 1 / span 2; padding-top: 3px; }
  .step-title { margin: 0 0 6px; font-size: 19px; }

  .timeline li { flex-direction: column; gap: 2px; }
  .t-date { flex-basis: auto; }

  .contact-card { border-radius: 22px; }
  .contact-media { aspect-ratio: 1 / 1; margin-top: -24px; }

  .site-footer { padding-block: 40px 32px; flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* The header language switch moves into the drawer on small phones */
@media (max-width: 479px) {
  .header-tools .lang-switch { display: none; }
  .brand-name { font-size: 15px; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
