/* =========================================================
   Eliezer Duran — dark, orange + lime accents, sticky profile + content column
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #151312;
  --surface: #1d1b1a;
  --surface-2: #262322;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --highlight: rgba(255, 255, 255, 0.07); /* light catching a top edge */

  --text: #ffffff;
  --text-dim: #998f8f;

  --accent: #f46c38;
  --accent-hi: #ff8a5c;
  --accent-ink: #151312;
  --accent-tint: rgba(244, 108, 56, 0.16);
  --lime: #c5ff41;

  /* Poppins everywhere, matching the Framer template. */
  --font-body: "Poppins", system-ui, "Segoe UI", sans-serif;
  --font-display: "Poppins", system-ui, "Segoe UI", sans-serif;

  --card-light: #ffffff;
  --ink: #151312;
  --ink-dim: #6a6b6e;
  --heading-dim: rgba(182, 180, 189, 0.5); /* template tone, lifted to >=3:1 on --bg for WCAG AA large text */

  /* Springs as easing (damping 1.0 / response 0.4s, and damping 0.8 for momentum). */
  --spring: linear(0, 0.058, 0.181, 0.322, 0.456, 0.574, 0.672, 0.751, 0.813, 0.861, 0.897, 0.925, 0.945, 0.96, 0.971, 0.979, 0.985, 0.989, 0.992, 0.995, 0.996, 0.997, 1);
  --spring-bounce: linear(0, 0.032, 0.109, 0.212, 0.325, 0.438, 0.544, 0.64, 0.724, 0.794, 0.852, 0.898, 0.934, 0.962, 0.981, 0.996, 1.005, 1.011, 1.014, 1.015, 1.015, 1.014, 1.013, 1.011, 1.009, 1.008, 1.006, 1.005, 1.004, 1.003, 1);
  --t-spring: 0.54s;
  --t-bounce: 0.58s;

  --radius-card: 28px;
  --gutter: max(1rem, calc((100% - 56rem) / 2));
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-color: #34302e var(--bg);
  accent-color: var(--accent);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
  caret-color: var(--accent);
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* Tracking is size-specific: tighter as type grows. */
h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  text-wrap: balance;
}
h2 { font-size: clamp(2rem, 5.2vw, 3rem); letter-spacing: 0; font-weight: 700; }
h3 { font-size: 1.4rem; letter-spacing: 0; line-height: 1.2; }
h4, h5 { font-size: 1.1rem; letter-spacing: -0.01em; }

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; }

a { color: var(--accent-hi); text-underline-offset: 0.2em; }
a:hover { color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 3px;
  border-radius: 8px;
}

section[id] { scroll-margin-top: 5.5rem; }

/* ---------- Layout: sticky profile card + content column ---------- */
.layout {
  display: grid;
  gap: 3rem;
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding: 6.5rem 1rem 0;
}
main { min-width: 0; }
main > section + section { padding-top: 6rem; }

@media (min-width: 1000px) {
  .layout {
    grid-template-columns: 21rem minmax(0, 1fr);
    gap: 4.5rem;
    padding-inline: 2rem;
    align-items: start;
  }
  .profile { position: sticky; top: 6.5rem; }
}

/* Two-tone display headings: bright first line, dim second line. */
.split {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7.5vw, 4.75rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
  margin-bottom: 1.75rem;
}
.split span { display: block; }
.split .dim { color: var(--heading-dim); }

.section-intro { max-width: 62ch; margin: -0.5rem 0 2.25rem; color: var(--text-dim); }

/* ---------- Profile card ---------- */
.profile {
  display: grid;
  justify-items: center;
  gap: 1rem;
  max-width: 24rem;
  width: 100%;
  margin-inline: auto;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: var(--radius-card);
  background: var(--card-light);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}
.profile-photo {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 4.6;
  overflow: hidden;
  border-radius: 20px;
  background: radial-gradient(120% 90% at 30% 20%, var(--accent-hi), var(--accent) 45%, #7a2a10);
}
.profile-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.profile-initials {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}
.profile-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
}
.profile-bio { max-width: 26ch; color: var(--ink-dim); font-size: 1rem; line-height: 1.45; }
.profile-social { display: flex; gap: 0.5rem; margin-top: 0.25rem; }
.profile-social a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #e0602e; /* accent darkened just enough for 3:1 on the white card */
  transition: background-color 0.2s ease-out, transform var(--t-spring) var(--spring);
}
.profile-social a:hover { background: rgba(244, 108, 56, 0.12); color: #c94e1f; }
.profile-social a:active { transform: scale(0.92); transition-duration: 0.1s; }
.profile-social svg,
.tile svg,
.project-placeholder svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Hero ---------- */
.hero .lead { max-width: 46ch; color: var(--text-dim); font-size: 1.1rem; line-height: 1.55; }

/* Always one row: three equal columns on phones, natural widths from tablet up. */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 2.25rem 0; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(3, max-content); gap: 2.5rem; } }
.stats li { display: grid; align-content: start; gap: 0.3rem; }
.stats strong {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 9vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stats span { color: var(--text-dim); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; line-height: 1.3; text-transform: uppercase; }

.service-tiles { display: grid; gap: 1rem; }
@media (min-width: 640px) { .service-tiles { grid-template-columns: 1fr 1fr; } }
.tile {
  display: grid;
  align-content: space-between;
  gap: 2.5rem;
  min-height: 12rem;
  padding: 1.5rem;
  border-radius: 22px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform var(--t-spring) var(--spring), filter 0.2s ease-out;
}
.tile svg { width: 26px; height: 26px; }
.tile:hover { filter: brightness(1.06); }
.tile:active { transform: scale(0.98); transition-duration: 0.1s; }
.tile-accent { background: var(--accent); color: var(--accent-ink); }
.tile-accent:hover { color: var(--accent-ink); }
.tile-lime { background: var(--lime); color: var(--ink); }
.tile-lime:hover { color: var(--ink); }

/* ---------- Projects: Framer-style rows (130x135 thumb, 26px title, arrow on linked rows) ---------- */
.project-list { display: grid; gap: 40px; }
.project {
  position: relative;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding-right: 2.5rem;
  color: inherit;
  text-decoration: none;
}
.project img,
.project-placeholder {
  width: 130px;
  height: 135px;
  border-radius: 8px;
  object-fit: cover;
  object-position: left top;
  transition: transform var(--t-spring) var(--spring);
}
.project-placeholder { display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); }
.project-placeholder svg {
  width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.project h3 { font-size: 26px; font-weight: 600; line-height: 1.2; color: var(--text); }
.project-text p { margin-top: 4px; color: var(--text-dim); font-size: 16px; line-height: 1.4; }
.project-arrow {
  position: absolute;
  top: 14px;
  right: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--t-spring) var(--spring);
}
a.project:hover h3 { color: var(--accent-hi); }
a.project:hover .project-arrow { transform: translate(3px, -3px); }
a.project:hover img { transform: scale(1.02); }
@media (max-width: 480px) {
  .project { grid-template-columns: 104px minmax(0, 1fr); gap: 16px; padding-right: 1.75rem; }
  .project img, .project-placeholder { width: 104px; height: 108px; }
  .project h3 { font-size: 21px; }
  .project-text p { font-size: 15px; }
}

/* ---------- Buttons: respond on press, settle with a spring ---------- */
.btn, button { font: inherit; cursor: pointer; }

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.97rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 20px -10px rgba(0, 0, 0, 0.7);
  transition: transform var(--t-spring) var(--spring), background-color 0.2s ease-out;
  touch-action: manipulation;
}
.btn:hover { background: var(--accent-hi); color: var(--accent-ink); }
.btn:active { transform: scale(0.96); transition-duration: 0.1s; transition-timing-function: ease-out; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 1px 0 var(--highlight) inset, 0 0 0 1px var(--line);
}
.btn-secondary:hover { background: #302c2a; color: var(--text); }

button:not(.btn) {
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.92rem;
  box-shadow: 0 1px 0 var(--highlight) inset, 0 0 0 1px var(--line-strong);
  transition: transform var(--t-spring) var(--spring), box-shadow 0.2s ease-out, background-color 0.2s ease-out;
  touch-action: manipulation;
}
button:not(.btn):hover:not(:disabled) { box-shadow: 0 1px 0 var(--highlight) inset, 0 0 0 1px var(--accent); }
button:not(.btn):active:not(:disabled) { transform: scale(0.95); transition-duration: 0.1s; transition-timing-function: ease-out; }
button[aria-pressed="true"] {
  background: var(--accent-tint);
  box-shadow: 0 0 0 1px var(--accent);
}
button:disabled { opacity: 0.4; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* ---------- Nav: icon-only pill, like the Framer template (scrolls away) ---------- */
.site-nav {
  position: absolute;
  top: 30px;
  left: 50%;
  z-index: 50;
  transform: translateX(-50%);
}
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 48px;
  padding: 0 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}
.site-nav a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text);
  transition: background-color 0.2s ease-out, transform var(--t-spring) var(--spring);
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.site-nav a:active { transform: scale(0.92); transition-duration: 0.1s; }
.site-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Forms ---------- */
label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; font-weight: 600; }

input, select, textarea {
  width: 100%;
  max-width: 32rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-strong);
  color: var(--text);
  font: inherit;
  transition: box-shadow 0.2s ease-out;
}
input::placeholder, textarea::placeholder { color: #8a8282; }
input:hover, select:hover, textarea:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-hi);
}

#contact-form { display: grid; gap: 1rem; margin-bottom: 2rem; }
#contact-form p { margin: 0; }
#contact-form input, #contact-form select, #contact-form textarea { max-width: 100%; }
.form-row { display: grid; gap: 1rem; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.btn-block { width: 100%; padding-block: 0.9rem; }

/* ---------- Cómo trabajo ---------- */
.steps { display: grid; }
.steps li { display: grid; gap: 0.4rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.steps li:first-child { border-top: 1px solid var(--line); }
.steps h3 { font-size: 1.45rem; }
.steps p { max-width: 52ch; color: var(--text-dim); }
.step-time { color: var(--accent-hi); font-size: 0.92rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- FAQ ---------- */
#faq details { border-bottom: 1px solid var(--line); }
#faq details:first-of-type { border-top: 1px solid var(--line); }
#faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  list-style: none;
}
#faq summary::-webkit-details-marker { display: none; }
#faq summary::after {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform var(--t-spring) var(--spring);
}
#faq details[open] summary::after { transform: rotate(-135deg); }
#faq details p { padding-bottom: 1.25rem; color: var(--text-dim); max-width: 62ch; }

/* ---------- Contact + footer ---------- */
/* Inline text links: exempt from the 44px target rule (WCAG 2.5.8), so the list stays tight. */
.contact-list { display: grid; gap: 0.2rem; color: var(--text-dim); }

footer {
  margin-top: 6rem;
  padding: 2.5rem 1rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.92rem;
  text-align: center;
}

/* ---------- Scroll reveal (JS adds .reveal-on / .reveal / .in) ---------- */
.reveal-on .reveal:not(.in) { opacity: 0; transform: translateY(20px) scale(0.985); }
.reveal-on .reveal {
  transition:
    opacity 0.5s ease-out var(--d, 0ms),
    transform var(--t-spring) var(--spring) var(--d, 0ms);
}

/* ---------- Accessibility preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, button, .tile, .profile-social a { transition: none; }
  .btn:active, button:active, .tile:active, .profile-social a:active { transform: none; }
  .reveal-on .reveal:not(.in) { transform: none; }
  .reveal-on .reveal { transition: opacity 0.3s ease-out; }
}


@media (prefers-contrast: more) {
  :root { --line: rgba(255, 255, 255, 0.3); --line-strong: rgba(255, 255, 255, 0.5); --text-dim: #d2cbcb; }
}

/* Touch: every control gets a 44px hit area (WCAG 2.5.5 target size). */
@media (pointer: coarse), (max-width: 720px) {
  button,
  .btn,
  summary {
    min-height: 44px;
  }
  button:not(.btn) { min-width: 44px; }
}
