/* ==========================================================================
   Portafolio CyberLink Store - estilos públicos
   Claro y editorial. Un solo acento (azul de marca). Radios: botones en píldora,
   tarjetas 16px, campos 10px. Movimiento: solo transform y opacity, < 300 ms en UI.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f6f8fb;
  --bg-2: #eef2f7;
  --surface: #ffffff;
  --ink: #0f1622;
  --ink-2: #344052;
  --muted: #5a6679;
  --line: #e1e6ee;
  --line-2: #cfd7e3;
  --accent: #0b4f8f;
  --accent-hover: #093f73;
  --accent-soft: #e7f0f9;
  --accent-ink: #0a3a6b;
  --success: #12734a;
  --success-soft: #e5f4ec;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fdf3dc;

  --radius-card: 16px;
  --radius-field: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 36, 70, .06), 0 1px 1px rgba(16, 36, 70, .04);
  --shadow-md: 0 12px 32px -12px rgba(16, 36, 70, .18), 0 2px 6px rgba(16, 36, 70, .05);
  --shadow-lg: 0 30px 60px -24px rgba(16, 36, 70, .28), 0 6px 16px rgba(16, 36, 70, .06);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --wrap: 1200px;
  --gutter: max(20px, env(safe-area-inset-left), env(safe-area-inset-right));
  --header-h: 64px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 650; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }
main:focus { outline: none; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 112px); }
.section-tight { padding-block: 24px 80px; }
.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; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-field); transition: transform 160ms var(--ease-out); }
.skip:focus { transform: translateY(72px); }

.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 46px); }
.section-head p { margin-top: 14px; color: var(--muted); font-size: 17px; max-width: 60ch; }

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--btn-bg);
  font-weight: 560; font-size: 15px; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  user-select: none; -webkit-user-select: none;
  transition: transform 140ms var(--ease-out), background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}
.btn:active { transform: scale(0.97); }
.btn i { font-size: 18px; }
.btn-primary { --btn-bg: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 16px -8px rgba(11, 79, 143, .6); }
.btn-ghost { color: var(--ink); border-color: var(--line-2); --btn-bg: var(--surface); }
.btn-danger { --btn-bg: var(--danger); color: #fff; }
.btn-icon { width: 44px; padding: 0; color: var(--ink); border-color: var(--line-2); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .7; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { --btn-bg: var(--accent-hover); }
  .btn-ghost:hover, .btn-icon:hover { border-color: var(--ink-2); }
  .btn-danger:hover { --btn-bg: #8f1c13; }
}
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 560; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-danger { color: var(--danger); font-size: 14px; margin-top: 14px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 560; text-decoration: none; }
.link-arrow i { transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .link-arrow:hover i { transform: translateX(3px); } }

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 248, 251, .86);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background-color 200ms ease;
  padding-top: env(safe-area-inset-top);
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(246, 248, 251, .94); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; flex-shrink: 0; }
.brand img { border-radius: 50%; }
.brand b { font-weight: 600; color: var(--accent); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { display: block; padding: 8px 12px; border-radius: var(--radius-pill); color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; transition: background-color 160ms ease, color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { background: var(--bg-2); color: var(--ink); } }
.nav-tools { display: flex; align-items: center; gap: 10px; }
.lang-switch, .nav-login, .nav-account { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 10px; border-radius: var(--radius-pill); color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.lang-switch i { font-size: 18px; }
.lang-short { display: none; }
.nav-account img, .avatar-mini { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatar-mini { display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 650; }
@media (hover: hover) and (pointer: fine) { .lang-switch:hover, .nav-login:hover, .nav-account:hover { background: var(--bg-2); color: var(--ink); } }

.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: var(--surface); position: relative; cursor: pointer; }
.nav-toggle span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--ink); border-radius: 2px; transition: transform 240ms var(--ease-out); }
.nav-toggle span:first-child { transform: translateY(-4px); }
.nav-toggle span:last-child { transform: translateY(4px); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

@media (max-width: 1060px) {
  .lang-long { display: none; }
  .lang-short { display: inline; }
  .nav { gap: 12px; }
  .nav-links a { padding: 8px 9px; font-size: 14px; }
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: calc(var(--header-h) + env(safe-area-inset-top)) 0 0 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px var(--gutter) calc(24px + env(safe-area-inset-bottom));
    background: var(--bg);
    overflow-y: auto; overscroll-behavior: contain;
    opacity: 0; transform: translateY(-8px); visibility: hidden;
    transition: opacity 200ms var(--ease-out), transform 240ms var(--ease-out), visibility 0s linear 240ms;
  }
  .nav.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity 200ms var(--ease-out), transform 240ms var(--ease-out), visibility 0s; }
  .nav-links { flex-direction: column; gap: 0; }
  .nav-links a { font-size: 22px; font-weight: 560; padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--line); color: var(--ink); }
  .nav-tools { flex-wrap: wrap; margin-top: 24px; gap: 10px; }
  .nav-tools .btn { width: 100%; min-height: 50px; font-size: 16px; order: -1; }
  .lang-long { display: inline; }
  .lang-short { display: none; }
  .lang-switch, .nav-login, .nav-account { border: 1px solid var(--line-2); padding: 0 16px; min-height: 44px; }
  body.nav-open { overflow: hidden; }
}

/* ---------- Avisos ---------- */
.toasts { position: fixed; z-index: 60; top: calc(var(--header-h) + env(safe-area-inset-top) + 12px); left: 50%; transform: translateX(-50%); width: min(520px, calc(100% - 32px)); display: grid; gap: 8px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md); font-size: 15px; transition: opacity 240ms ease, transform 240ms var(--ease-out); }
@starting-style { .toast { opacity: 0; transform: translateY(-8px); } }
.toast.is-leaving { opacity: 0; transform: translateY(-8px); }
.toast > i { font-size: 20px; margin-top: 1px; }
.toast p { flex: 1; }
.toast-success > i { color: var(--success); }
.toast-error > i { color: var(--danger); }
.toast-close { border: 0; background: none; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: var(--muted); display: grid; place-items: center; margin: -4px 0; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(36px, 6vw, 72px) clamp(40px, 6vw, 64px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero-title { font-size: clamp(38px, 5vw, 60px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 680; max-width: 16ch; }
.hero-sub { margin-top: 20px; font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 44ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-visual { position: relative; padding: 0 0 40px 48px; }
.hero-browser { display: block; text-decoration: none; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: rotate(0.4deg); }
.hero-browser img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; width: 100%; }
.hero-phone { position: absolute; left: 0; bottom: 0; width: 29%; border-radius: 26px; overflow: hidden; border: 6px solid #0f1622; background: #0f1622; box-shadow: var(--shadow-lg); transform: rotate(-3deg); }
.hero-phone img { aspect-ratio: 9 / 19.5; object-fit: cover; object-position: top; width: 100%; border-radius: 20px; }
.browser-bar { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; background: #f1f4f8; border-bottom: 1px solid var(--line); }
.browser-bar > span { width: 9px; height: 9px; border-radius: 50%; background: #d4dbe5; }
.browser-bar em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 2px 12px; flex: 1; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise 640ms var(--ease-out) both; }
  .hero-copy > :nth-child(2) { animation-delay: 70ms; }
  .hero-copy > :nth-child(3) { animation-delay: 140ms; }
  .hero-browser { animation: rise-browser 800ms var(--ease-out) 120ms both; }
  .hero-phone { animation: rise-phone 800ms var(--ease-out) 260ms both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes rise-browser { from { opacity: 0; transform: translateY(24px) rotate(0.4deg); } }
@keyframes rise-phone { from { opacity: 0; transform: translateY(32px) rotate(-3deg); } }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-title { max-width: 16ch; }
  .hero-visual { padding: 0 0 28px 28px; max-width: 640px; }
  .hero-phone { width: 30%; border-width: 4px; border-radius: 20px; }
  .hero-phone img { border-radius: 16px; }
}
@media (max-width: 520px) {
  .hero-actions .btn { flex: 1 1 100%; }
}

/* ---------- Proyectos ---------- */
.work { padding-top: clamp(40px, 6vw, 80px); }
.work-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 16px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 520; cursor: pointer; transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 140ms var(--ease-out); white-space: nowrap; }
.chip:active { transform: scale(0.97); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (hover: hover) and (pointer: fine) { .chip:not(.is-active):hover { border-color: var(--ink-2); color: var(--ink); } }
.search { position: relative; display: block; width: min(300px, 100%); }
.search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; pointer-events: none; }
.search input { width: 100%; height: 44px; padding: 0 16px 0 42px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: var(--surface); font-size: 16px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.search input::placeholder { color: #7b8698; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.work-count { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

.work-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 40px 24px; }
.work-card { grid-column: span 2; }
.work-card.is-featured { grid-column: span 3; }
.work-card[hidden] { display: none; }
.work-card a { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; border-radius: var(--radius-card); }
.work-media { display: block; position: relative; overflow: hidden; border-radius: var(--radius-card); background: var(--bg-2); border: 1px solid var(--line); aspect-ratio: 16 / 10; box-shadow: var(--shadow-sm); transition: box-shadow 240ms ease; }
.work-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 500ms var(--ease-out); }
.work-media-empty { display: grid; place-items: center; height: 100%; color: var(--line-2); font-size: 48px; }
.work-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 4px 0; }
.work-cat { font-size: 13px; color: var(--muted); font-weight: 500; }
.work-title { font-size: 20px; font-weight: 640; letter-spacing: -0.015em; line-height: 1.25; }
.is-featured .work-title { font-size: 24px; }
.work-summary { color: var(--ink-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.work-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--accent); font-weight: 560; font-size: 15px; }
.work-more i { transition: transform 220ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .work-card a:hover .work-media { box-shadow: var(--shadow-md); }
  .work-card a:hover .work-media img { transform: scale(1.025); }
  .work-card a:hover .work-more i { transform: translateX(3px); }
}
.work-empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius-card); color: var(--muted); display: grid; justify-items: center; gap: 12px; }
.work-empty i { font-size: 32px; }

@media (max-width: 1000px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-card, .work-card.is-featured { grid-column: span 1; }
}
@media (max-width: 680px) {
  .work-tools { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .chips { max-width: calc(100% + var(--gutter) * 2); }
  .chips { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { scroll-snap-align: start; }
  .search { width: 100%; }
  .work-grid { grid-template-columns: 1fr; gap: 36px; }
  .is-featured .work-title { font-size: 21px; }
}

/* ---------- Servicios ---------- */
.services { background: var(--surface); border-block: 1px solid var(--line); }
.services-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.services-intro { position: sticky; top: calc(var(--header-h) + 32px); }
.services-intro h2 { font-size: clamp(30px, 4.4vw, 46px); }
.services-intro p { margin: 14px 0 28px; color: var(--muted); font-size: 17px; }
.service-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 36px; }
.service { display: grid; gap: 10px; align-content: start; }
.service-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 24px; margin-bottom: 4px; }
.service h3 { font-size: 19px; }
.service p { color: var(--ink-2); font-size: 15px; }
.service-price { font-size: 13px; color: var(--muted); font-weight: 500; }
@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr; }
  .services-intro { position: static; }
}
@media (max-width: 560px) { .service-list { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Proceso + FAQ ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; counter-reset: step; position: relative; }
.steps::before { content: ""; position: absolute; top: 23px; left: 23px; right: 12%; height: 1px; background: var(--line-2); }
.step { position: relative; display: grid; gap: 10px; align-content: start; padding-right: 12px; }
.step-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); color: var(--accent); font-size: 22px; position: relative; }
.step h3 { font-size: 19px; margin-top: 6px; }
.step p { color: var(--ink-2); font-size: 15px; }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps::before { top: 23px; bottom: 23px; left: 23px; right: auto; width: 1px; height: auto; }
  .step { grid-template-columns: 46px 1fr; column-gap: 16px; }
  .step h3 { margin-top: 10px; }
  .step p { grid-column: 2; }
}
.faq { max-width: 760px; margin-top: clamp(56px, 8vw, 96px); }
.faq-title { font-size: clamp(24px, 3vw, 30px); margin-bottom: 16px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 2px; font-size: 17px; font-weight: 560; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary i { flex-shrink: 0; font-size: 18px; color: var(--muted); transition: transform 240ms var(--ease-out); }
.faq-item[open] summary i { transform: rotate(45deg); }
.faq-answer { padding: 0 2px 22px; color: var(--ink-2); max-width: 65ch; }
@media (prefers-reduced-motion: no-preference) {
  .faq-item[open] .faq-answer { animation: fade-down 260ms var(--ease-out); }
}
@keyframes fade-down { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Opiniones ---------- */
.reviews { background: var(--surface); border-block: 1px solid var(--line); }
.review-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 380px); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); overscroll-behavior-x: contain; }
.review-masonry { columns: 3 300px; column-gap: 20px; }
.review-masonry .review { break-inside: avoid; margin-bottom: 20px; }
.review { margin: 0; display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: var(--radius-card); background: var(--bg); border: 1px solid var(--line); scroll-snap-align: start; }
.review-stars { display: flex; gap: 2px; color: #d99a00; font-size: 17px; }
.review-stars .ph { color: var(--line-2); }
.review blockquote { margin: 0; font-size: 16px; color: var(--ink); line-height: 1.6; flex: 1; }
.review figcaption { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-initials { display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; font-size: 15px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.review-who { display: grid; font-size: 14px; color: var(--muted); line-height: 1.4; }
.review-who strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.review-who a { font-size: 13px; text-decoration: none; }
.reviews-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 28px; }
.reviews-empty { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 32px; border-radius: var(--radius-card); background: var(--bg); border: 1px solid var(--line); }
.reviews-empty-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 26px; }
.reviews-empty h2, .reviews-empty h3 { font-size: 20px; }
.reviews-empty p { color: var(--muted); margin-top: 4px; }
@media (max-width: 680px) {
  .reviews-empty { grid-template-columns: 1fr; text-align: left; padding: 24px; }
  .review-track { grid-auto-columns: 86%; }
}

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact-intro h2 { font-size: clamp(30px, 4.4vw, 46px); }
.contact-intro > p { margin-top: 14px; color: var(--muted); font-size: 17px; max-width: 44ch; }
.channels { margin-top: 32px; display: grid; gap: 4px; }
.channels a { display: flex; align-items: center; gap: 14px; padding: 12px 8px; margin-inline: -8px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 520; transition: background-color 160ms ease; overflow-wrap: anywhere; }
.channels i { width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); font-size: 20px; color: var(--accent); }
.channels small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
@media (hover: hover) and (pointer: fine) { .channels a:hover { background: var(--bg-2); } }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Formularios ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-sm); }
.contact-form { padding: clamp(20px, 3.4vw, 32px); display: grid; gap: 18px; }
.stack { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.field label, .field legend { font-size: 14px; font-weight: 560; color: var(--ink); padding: 0; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label-row a { font-size: 14px; }
.opt { color: var(--muted); font-weight: 400; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  font-size: 16px; /* evita el zoom automático de iOS */
  border-radius: var(--radius-field); border: 1px solid var(--line-2); background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease;
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.field ::placeholder { color: #7b8698; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: 14px; }
.field-error:empty { display: none; }
.field-hint { color: var(--muted); font-size: 13px; }
.form-note { font-size: 13px; color: var(--muted); }
.select { position: relative; }
.select select { padding-right: 40px; cursor: pointer; }
.select i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.password { position: relative; }
.password input { padding-right: 52px !important; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 42px; height: 40px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 20px; display: grid; place-items: center; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; font-weight: 400 !important; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.check-sm { font-size: 14px; margin-top: 6px; }
.form-status:empty { display: none; }
.form-status { padding: 12px 14px; border-radius: var(--radius-field); font-size: 15px; display: flex; gap: 10px; align-items: center; }
.form-status.is-ok { background: var(--success-soft); color: var(--success); }
.form-status.is-error { background: var(--danger-soft); color: var(--danger); }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-field); font-size: 15px; margin-bottom: 18px; }
.alert i { font-size: 20px; flex-shrink: 0; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert form { margin-top: 6px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Páginas internas ---------- */
.page-head { padding-top: clamp(32px, 5vw, 56px); padding-bottom: 24px; }
.page-head h1 { font-size: clamp(32px, 4.6vw, 48px); margin-top: 8px; }
.page-head > p { color: var(--muted); font-size: 17px; margin: 12px 0 24px; max-width: 60ch; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; min-height: 44px; }
@media (hover: hover) and (pointer: fine) { .back-link:hover { color: var(--ink); } }
.prose { max-width: 760px; color: var(--ink-2); }
.prose h2 { font-size: 22px; color: var(--ink); margin: 32px 0 10px; }
.prose p, .prose ul { margin-bottom: 14px; }
.prose ul { list-style: disc; padding-left: 22px; }
.prose li { margin-bottom: 6px; }

/* ---------- Proyecto ---------- */
.project-head { padding-top: clamp(16px, 3vw, 32px); }
.project-head-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 24px 48px; align-items: end; margin-top: 12px; }
.project-cat { color: var(--accent); font-weight: 560; font-size: 15px; margin-bottom: 10px; }
.project-head h1 { font-size: clamp(34px, 5.4vw, 60px); letter-spacing: -0.035em; font-weight: 680; }
.project-summary { margin-top: 16px; font-size: clamp(17px, 1.7vw, 20px); color: var(--ink-2); max-width: 56ch; }
.project-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.draft-note { display: inline-flex; gap: 8px; align-items: center; background: var(--warn-soft); color: var(--warn); padding: 8px 14px; border-radius: var(--radius-pill); font-size: 14px; margin-top: 8px; }
@media (max-width: 900px) {
  .project-head-grid { grid-template-columns: 1fr; }
  .project-actions { justify-content: flex-start; }
}

.viewer { margin-top: clamp(32px, 5vw, 56px); }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.segmented { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--radius-pill); background: var(--bg-2); border: 1px solid var(--line); }
.segmented button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 16px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 540; cursor: pointer; transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease; }
.segmented button i { font-size: 17px; }
.segmented button[aria-selected="true"], .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented-soft button[aria-pressed="true"] { color: var(--accent); }

.viewer-stage { position: relative; display: grid; justify-items: center; padding: clamp(16px, 4vw, 48px); border-radius: 24px; background: linear-gradient(180deg, var(--bg-2), #e6ecf4); border: 1px solid var(--line); overflow: hidden; }
.device { display: none; }
.viewer-stage[data-device-current="desktop"] .device-desktop,
.viewer-stage[data-device-current="mobile"] .device-mobile { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .device { animation: device-in 320ms var(--ease-out); }
}
@keyframes device-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } }
.device-desktop { width: 100%; max-width: 1040px; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.device-desktop .device-screen { aspect-ratio: 16 / 10; }
.device-mobile { width: min(340px, 82vw); padding: 10px; border-radius: 46px; background: #0f1622; box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,.08); position: relative; }
.device-mobile .device-screen { aspect-ratio: 9 / 19.5; border-radius: 36px; }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 84px; height: 22px; background: #0f1622; border-radius: var(--radius-pill); z-index: 2; }
.device-screen { position: relative; overflow-y: auto; overflow-x: hidden; background: var(--surface); overscroll-behavior: contain; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.device-screen .shot { width: 100%; height: auto; }
.device-screen .live { display: none; position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--surface); }
.viewer-stage[data-mode-current="live"] .device-screen .shot { display: none; }
.viewer-stage[data-mode-current="live"] .device-screen .live { display: block; }
.viewer-stage[data-mode-current="live"] .device-screen { overflow: hidden; }
.viewer-hint { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 14px; text-align: center; }
@media (max-width: 680px) {
  .viewer-stage { border-radius: 18px; margin-inline: calc(var(--gutter) * -0.5); }
  .device-desktop .device-screen { aspect-ratio: 4 / 3.4; }
  .device-desktop .browser-bar { height: 26px; }
}

.case { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); padding-block: clamp(56px, 8vw, 96px); align-items: start; }
.case-story { display: grid; gap: 40px; }
.story-block h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; margin-bottom: 12px; }
.story-block h2 i { color: var(--accent); font-size: 24px; }
.story-block p { font-size: 17px; color: var(--ink-2); max-width: 62ch; line-height: 1.7; }
.case-facts { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 28px; padding: 28px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line); }
.facts-block h2 { font-size: 17px; margin-bottom: 14px; }
.check-list { display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; font-size: 15px; color: var(--ink-2); }
.check-list i { color: var(--success); font-size: 18px; margin-top: 2px; flex-shrink: 0; }
.facts-meta { margin: 0; display: grid; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.facts-meta dt { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.facts-meta dd { margin: 0; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink-2); }
@media (max-width: 900px) {
  .case { grid-template-columns: 1fr; }
  .case-facts { position: static; padding: 22px; }
}

.gallery h2, .project-reviews h2 { font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 24px; }
.gallery-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; align-items: start; }
.gallery-desktop { grid-column: span 8; }
.gallery-mobile { grid-column: span 4; }
.gallery-item button { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; background: var(--surface); cursor: zoom-in; box-shadow: var(--shadow-sm); transition: box-shadow 220ms ease, transform 140ms var(--ease-out); }
.gallery-item button:active { transform: scale(0.99); }
.gallery-item img { width: 100%; }
.gallery-desktop img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.gallery-mobile img { aspect-ratio: 9 / 16; object-fit: cover; object-position: top; }
.gallery-item p { font-size: 14px; color: var(--muted); margin-top: 10px; }
@media (hover: hover) and (pointer: fine) { .gallery-item button:hover { box-shadow: var(--shadow-md); } }
@media (max-width: 680px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .gallery-desktop { grid-column: span 2; }
  .gallery-mobile { grid-column: span 1; }
}
.project-reviews { padding-top: clamp(56px, 8vw, 96px); }

.next-project { padding-block: clamp(56px, 8vw, 96px); }
.next-project a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 32px; align-items: center; padding: clamp(20px, 3vw, 32px); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: box-shadow 240ms ease; }
.next-copy { display: grid; gap: 10px; }
.next-label { color: var(--muted); font-size: 15px; }
.next-title { display: inline-flex; align-items: center; gap: 12px; font-size: clamp(26px, 3.6vw, 40px); font-weight: 660; letter-spacing: -0.03em; line-height: 1.1; }
.next-title i { font-size: 0.8em; color: var(--accent); transition: transform 240ms var(--ease-out); }
.next-summary { color: var(--ink-2); }
.next-project img { border-radius: 12px; border: 1px solid var(--line); aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
@media (hover: hover) and (pointer: fine) {
  .next-project a:hover { box-shadow: var(--shadow-md); }
  .next-project a:hover .next-title i { transform: translateX(4px); }
}
@media (max-width: 760px) { .next-project a { grid-template-columns: 1fr; } .next-project img { order: -1; } }

/* Barra fija de acciones en celular (página de proyecto) */
.mobile-actions { display: none; }
@media (max-width: 760px) {
  .page-project .mobile-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: rgba(246, 248, 251, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .page-project .mobile-actions .btn { min-height: 48px; padding: 0 12px; }
  .page-project .wa-float { display: none; }
  .page-project .site-footer { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* Lightbox */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(9, 14, 22, .94); color: #fff; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] figure { animation: lb-in 240ms var(--ease-out); }
}
@keyframes lb-in { from { opacity: 0; transform: scale(0.97); } }
.lightbox figure { margin: 0; max-width: min(1200px, 92vw); max-height: 86dvh; display: grid; gap: 12px; justify-items: center; overflow: auto; overscroll-behavior: contain; }
.lightbox img { max-height: 80dvh; width: auto; border-radius: 10px; touch-action: pan-y; }
.lightbox figcaption { font-size: 14px; color: #c4ccd8; }
.lb-btn { position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font-size: 22px; display: grid; place-items: center; cursor: pointer; transition: background-color 160ms ease, transform 140ms var(--ease-out); }
.lb-btn:active { transform: scale(0.95); }
.lb-close { top: calc(16px + env(safe-area-inset-top)); right: 16px; }
.lb-prev { left: 16px; top: 50%; translate: 0 -50%; }
.lb-next { right: 16px; top: 50%; translate: 0 -50%; }
@media (hover: hover) and (pointer: fine) { .lb-btn:hover { background: rgba(255,255,255,.16); } }
@media (max-width: 680px) { .lb-prev, .lb-next { top: auto; bottom: calc(20px + env(safe-area-inset-bottom)); translate: none; } .lb-prev { left: calc(50% - 60px); } .lb-next { right: calc(50% - 60px); } }

/* ---------- Cuenta y acceso ---------- */
.auth { min-height: calc(100dvh - var(--header-h) - 200px); display: grid; place-items: center; padding-block: 40px 80px; }
.auth-card { width: min(440px, 100%); padding: clamp(24px, 5vw, 36px); }
.auth-card h1 { font-size: 28px; }
.auth-sub { color: var(--muted); margin: 8px 0 24px; }
.auth-switch { text-align: center; margin-top: 20px; color: var(--muted); font-size: 15px; }
.auth-center { text-align: center; }
.auth-center .btn { margin-top: 8px; }
.auth-icon { width: 60px; height: 60px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 28px; margin-bottom: 16px; }

.account-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.account-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.account-id h1 { font-size: clamp(26px, 4vw, 36px); margin: 0; }
.account-id p { color: var(--muted); overflow-wrap: anywhere; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.panel { padding: clamp(20px, 3.4vw, 28px); }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.panel-head h2 { font-size: 20px; }
.panel-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.panel-danger { border-color: #f3c9c4; }
#opinion { grid-row: span 2; }
@media (max-width: 900px) { .account-grid { grid-template-columns: 1fr; } #opinion { grid-row: auto; } }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 560; white-space: nowrap; }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-approved { background: var(--success-soft); color: var(--success); }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }
.avatar-field { display: flex; gap: 18px; align-items: center; }
.avatar-preview img, .avatar-preview .avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; font-size: 24px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.stars-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; justify-self: start; }
.stars-input input { position: absolute; opacity: 0; pointer-events: none; }
.stars-input label { font-size: 30px; color: var(--line-2); cursor: pointer; transition: color 120ms ease, transform 140ms var(--ease-out); line-height: 1; padding: 4px; }
.stars-input label:active { transform: scale(0.9); }
.stars-input input:checked ~ label, .stars-input label:hover, .stars-input label:hover ~ label { color: #d99a00; }
.stars-input input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-top: 48px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 2fr auto; gap: 32px; align-items: start; }
.footer-brand p { color: var(--muted); font-size: 14px; margin-top: 12px; max-width: 34ch; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; min-height: 36px; display: inline-flex; align-items: center; }
@media (hover: hover) and (pointer: fine) { .footer-nav a:hover { color: var(--ink); text-decoration: underline; } }
.footer-social span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.footer-social div { display: flex; gap: 8px; }
.footer-social a { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); color: var(--ink); font-size: 20px; text-decoration: none; transition: border-color 160ms ease, transform 140ms var(--ease-out); }
.footer-social a:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) { .footer-social a:hover { border-color: var(--ink-2); } }
.footer-bottom { padding-block: 0 calc(28px + env(safe-area-inset-bottom)); margin-top: 32px; color: var(--muted); font-size: 14px; }
.footer-bottom p { padding-top: 24px; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .footer-inner { grid-template-columns: 1fr; } }

/* Botón flotante de WhatsApp (oculto en formularios de cuenta en celular para no tapar botones) */
@media (max-width: 760px) { .page-form .wa-float { display: none; } }
.wa-float { position: fixed; z-index: 30; right: max(18px, env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #1f9d55; color: #fff; font-size: 30px; text-decoration: none; box-shadow: 0 10px 24px -8px rgba(18, 90, 50, .55); transition: transform 160ms var(--ease-out); }
.wa-float:active { transform: scale(0.94); }
@media (prefers-reduced-motion: no-preference) { .wa-float { animation: rise 500ms var(--ease-out) 800ms both; } }

/* ---------- Aparición al hacer scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); transition-delay: var(--d, 0ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
