/* Sistema visual de iaportafolio.com: papel + navy + naranja, Manrope y DM Serif Display */
:root {
  --navy: #071a3d;
  --navy-soft: #0f2d69;
  --blue: #143a8d;
  --orange: #f16a1b;
  --orange-bright: #ff7a22;
  --orange-contrast: #b54708;
  --paper: #f3efe6;
  --paper-deep: #e8e0d2;
  --cream: #fffaf1;
  --ink: #08152e;
  --muted: #5e6471;
  --line: rgba(8, 21, 46, 0.16);
  --line-dark: rgba(255, 255, 255, 0.13);
  --sheet: rgba(7, 26, 61, 0.86);
  --sheet-fg: #ffffff;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "DM Serif Display", Georgia, serif;
  --container: min(1280px, calc(100% - 48px));
  color-scheme: light;
  font-family: var(--sans);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.6; }
::selection { background: var(--orange); color: #fff; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--orange) 75%, white); outline-offset: 3px; }
a { color: var(--orange-contrast); }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.tiny { font-size: 0.75rem; }
.pad { padding: 0 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.buttons { justify-content: flex-start; flex-wrap: wrap; margin-top: 12px; }
.container { width: var(--container); margin: 0 auto; }

/* botones */
button, .btn {
  font: inherit; font-size: 0.85rem; font-weight: 800; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.7rem 1.1rem; border-radius: 0.8rem; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); background: var(--cream); color: var(--navy);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}
.btn:hover, button:hover { transform: translateY(-2px); border-color: rgba(241, 106, 27, 0.54); }
.btn.primary, button.primary {
  background: var(--orange-contrast); color: #fff; border-color: var(--orange-contrast);
  box-shadow: 0 15px 38px rgba(241, 106, 27, 0.27);
}
.btn.primary:hover, button.primary:hover { box-shadow: 0 20px 45px rgba(241, 106, 27, 0.34); }
.btn.navy { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.navy:hover { background: var(--navy-soft); }
.btn.ghost { background: rgba(255, 255, 255, 0.04); color: rgba(255, 255, 255, 0.86); border-color: rgba(255, 255, 255, 0.22); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.46); }
.btn .arrow { color: var(--orange); }
button.link { background: none; border: none; color: inherit; text-decoration: underline; padding: 0; min-height: 0; font-weight: 600; }
button.link:hover { transform: none; }

/* navbar cápsula */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; padding: 12px 12px 0; }
.nav-inner {
  width: var(--container); margin: 0 auto; min-height: 64px; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-radius: 1.2rem; border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 250, 241, 0.95); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 10px 35px rgba(7, 26, 61, 0.1);
}
.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 40px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a:not(.btn) { color: var(--navy); font-size: 14px; font-weight: 600; text-decoration: none; }
.nav-links a:not(.btn):hover { color: var(--orange-contrast); }
@media (max-width: 700px) {
  .nav-links a:not(.btn) { display: none; }
  .nav-logo img { height: 32px; }
}

/* kicker / títulos */
.kicker {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 20px;
  font-size: 0.73rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
}
.kicker::before { content: ""; width: 28px; height: 3px; border-radius: 2px; background: var(--orange); box-shadow: 0 0 18px rgba(241, 106, 27, 0.8); }
.display { margin: 0; font-weight: 680; letter-spacing: -0.06em; line-height: 0.95; text-wrap: balance; }
.display em, .display .serif { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.035em; color: var(--orange-bright); }

/* hero navy */
.hero {
  position: relative; overflow: hidden; color: #fff; padding: 9rem 0 4.5rem;
  background:
    radial-gradient(circle at 71% 40%, rgba(27, 70, 150, 0.62), transparent 30%),
    radial-gradient(circle at 15% 8%, rgba(241, 106, 27, 0.13), transparent 24%),
    var(--navy);
}
.hero::before, .site-footer::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.14;
  background-image: linear-gradient(rgba(255, 255, 255, 0.8) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.8) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 83%); mask-image: linear-gradient(to bottom, black, transparent 83%);
}
.hero .contour {
  position: absolute; width: 520px; height: 420px; right: -120px; top: 60px; pointer-events: none;
  border: 1px solid rgba(241, 106, 27, 0.3); border-radius: 43% 57% 61% 39% / 45% 40% 60% 55%; transform: rotate(18deg);
}
.hero .contour.b { width: 680px; height: 560px; right: -220px; top: 10px; border-color: rgba(255, 255, 255, 0.12); transform: rotate(31deg); }
.hero > .container { position: relative; }
.hero .kicker { color: rgba(255, 255, 255, 0.86); }
.hero .display { font-size: clamp(2.6rem, 5.5vw, 5.2rem); max-width: 14ch; }
.hero .lead { max-width: 620px; margin: 24px 0 0; font-size: clamp(1rem, 1.4vw, 1.15rem); line-height: 1.75; color: rgba(255, 255, 255, 0.73); }
.hero .lead a { color: var(--orange-bright); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.pill { padding: 0.48rem 0.75rem; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px; font-size: 0.7rem; color: rgba(255, 255, 255, 0.78); }
.pill b { color: var(--orange-bright); font-weight: 800; }

/* home */
.section { padding: 4rem 0 5rem; }
.section-head { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1rem 4rem; align-items: end; margin-bottom: 2.5rem; }
.section-head .kicker { color: var(--orange-contrast); }
.section-head h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 700; letter-spacing: -0.055em; line-height: 1; }
.section-head h2 em { font-family: var(--serif); font-weight: 400; letter-spacing: -0.03em; color: var(--orange-contrast); }
.section-head p { margin: 0; color: var(--muted); font-size: 1.02rem; line-height: 1.75; }
@media (max-width: 880px) { .section-head { grid-template-columns: 1fr; } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card {
  position: relative; background: var(--cream); border: 1px solid var(--line); border-radius: 1.35rem; overflow: hidden;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.card::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 5px; border-radius: 0 6px 6px 0; background: var(--orange); z-index: 1; transition: width 220ms ease; }
.card:hover { transform: translateY(-5px); border-color: rgba(241, 106, 27, 0.54); box-shadow: 0 24px 60px rgba(7, 26, 61, 0.12); }
.card:hover::before { width: 8px; }
.viewport { position: relative; aspect-ratio: 1 / 1; background: var(--paper-deep); }
.viewport canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.card-body { padding: 18px 20px 20px; }
.card-body h3 { margin: 0 0 6px; font-size: 1.25rem; font-weight: 720; letter-spacing: -0.035em; line-height: 1.25; }
.card-body p { margin: 0 0 6px; line-height: 1.6; }
.card-body .stats {
  display: inline-block; margin-top: 4px; padding: 0.35rem 0.65rem; border: 1px solid rgba(241, 106, 27, 0.3); border-radius: 999px;
  color: var(--orange-contrast); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.62rem;
}

/* footer */
.site-footer {
  position: relative; overflow: hidden; color: #fff; padding: 4rem 0 0;
  background:
    radial-gradient(circle at 12% 96%, rgba(241, 106, 27, 0.14), transparent 24%),
    radial-gradient(circle at 88% 7%, rgba(30, 72, 157, 0.38), transparent 30%),
    var(--navy);
}
.site-footer > .container { position: relative; }
.site-footer .kicker { color: rgba(255, 255, 255, 0.7); }
.site-footer .display { font-size: clamp(2.2rem, 5vw, 4.4rem); font-weight: 650; max-width: 16ch; }
.footer-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 40px; }
.rail { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.16em; color: rgba(255, 255, 255, 0.6); }
.rail .track { flex: 1; height: 1px; background: rgba(255, 255, 255, 0.2); position: relative; }
.rail .track::after { content: ""; position: absolute; left: 50%; top: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 7px rgba(241, 106, 27, 0.1), 0 0 20px rgba(241, 106, 27, 0.8); }
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 32px 0; }
.logo-card { display: inline-flex; padding: 0.9rem 1.05rem; border-radius: 1rem; background: var(--paper); box-shadow: 0 14px 35px rgba(0, 0, 0, 0.17); }
.logo-card img { height: 44px; width: auto; display: block; }
.footer-brand p { margin: 0; max-width: 460px; color: rgba(255, 255, 255, 0.62); font-size: 0.9rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-dark); font-size: 0.66rem; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.56); }
.footer-bottom a { color: rgba(255, 255, 255, 0.72); text-decoration: none; }
.footer-bottom a:hover { color: var(--orange-bright); }

/* try-on (pantalla completa, sobre cámara) */
body.tryon { background: var(--navy); color: var(--sheet-fg); overflow: hidden; height: 100dvh; }
#stage { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); touch-action: none; }
#stage.mirror { transform: translate(-50%, -50%) scaleX(-1); }
#stage canvas { width: 100%; height: 100%; display: block; }
.hint { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); background: var(--sheet); padding: 10px 16px; border-radius: 0.8rem; font-weight: 600; border: 1px solid var(--line-dark); }
#stage.mirror .hint { transform: translateX(-50%) scaleX(-1); }
.topbar { position: fixed; top: 0; left: 0; right: 0; display: flex; gap: 10px; align-items: center; padding: 10px 12px; z-index: 5; }
.topbar .brand { display: inline-flex; flex: none; padding: 6px 10px; border-radius: 0.8rem; background: rgba(255, 250, 241, 0.95); box-shadow: 0 10px 35px rgba(7, 26, 61, 0.25); }
.topbar .brand img { height: 22px; width: auto; display: block; }
.back {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 0.8rem;
  color: #fff; background: var(--sheet); border: 1px solid var(--line-dark); text-decoration: none; font-size: 1.2rem;
}
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { background: var(--sheet); color: var(--sheet-fg); border: 1px solid var(--line-dark); border-radius: 999px; padding: 6px 14px; min-height: 36px; flex: none; font-size: 0.8rem; font-weight: 700; }
.chip:hover { transform: none; }
.chip.active { background: var(--orange-contrast); border-color: var(--orange); box-shadow: 0 0 18px rgba(241, 106, 27, 0.5); }
.status { position: fixed; top: 64px; left: 16px; right: 16px; background: var(--sheet); padding: 10px 14px; border-radius: 0.8rem; z-index: 5; font-size: 0.9rem; border: 1px solid var(--line-dark); }
.status.error { background: #8b1f15; }
.status-link { position: fixed; top: 120px; left: 16px; z-index: 5; color: var(--orange-bright); font-weight: 700; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); max-height: 55dvh; overflow-y: auto; z-index: 5; }
.panel { background: var(--sheet); border: 1px solid var(--line-dark); border-radius: 1rem; padding: 12px 14px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.panel strong { font-weight: 800; letter-spacing: -0.01em; }
.panel p { margin: 6px 0; }
.panel .muted { color: rgba(255, 255, 255, 0.68); }
.panel summary { cursor: pointer; font-weight: 700; }
.panel input[type=range] { flex: 1; max-width: 55%; accent-color: var(--orange); }
.panel input[type=checkbox] { accent-color: var(--orange); }
.panel input[type=number] { width: 80px; font: inherit; border-radius: 0.6rem; border: none; padding: 4px 8px; }
.panel button { background: rgba(255, 255, 255, 0.1); color: var(--sheet-fg); border: 1px solid rgba(255, 255, 255, 0.18); min-height: 36px; padding: 0.4rem 0.8rem; }
.panel button.link { background: none; border: none; color: var(--orange-bright); min-height: 0; padding: 0; }
.progress { height: 4px; background: rgba(255, 255, 255, 0.15); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--orange); box-shadow: 0 0 12px rgba(241, 106, 27, 0.8); transition: width 0.2s; }
@media (min-width: 900px) { .sheet { left: auto; width: 360px; top: 64px; max-height: none; } }

/* AR */
body.ar-page { padding-top: 92px; }
.ar-wrap { width: var(--container); margin: 0 auto; }
.ar-wrap .kicker { color: var(--orange-contrast); margin-bottom: 10px; }
.ar-wrap h1 { margin: 0 0 16px; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -0.05em; line-height: 1.05; }
model-viewer { width: 100%; height: 64dvh; background: var(--cream); border: 1px solid var(--line); border-radius: 1.35rem; }
.ar-btn { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); }
.ar-btn:hover { transform: translateX(-50%) translateY(-2px); }
.ar-wrap .note { max-width: 640px; margin: 16px 0 40px; color: var(--muted); font-size: 0.92rem; }

@media (max-width: 700px) {
  :root { --container: calc(100% - 32px); }
  .hero { padding-top: 7.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 420px) { .topbar .brand { display: none; } }
