/* ==========================================================
   Karen Santamaría — sitio portafolio
   Para cambiar colores o tipografías, edita las variables de :root
   ========================================================== */

@font-face { font-family: "Open Sauce Sans"; font-weight: 400; font-display: swap; src: url("fonts/open-sauce-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sauce Sans"; font-weight: 500; font-display: swap; src: url("fonts/open-sauce-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sauce Sans"; font-weight: 600; font-display: swap; src: url("fonts/open-sauce-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sauce Two"; font-weight: 400; font-display: swap; src: url("fonts/open-sauce-two-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sauce Two"; font-weight: 500; font-display: swap; src: url("fonts/open-sauce-two-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sauce Two"; font-weight: 600; font-display: swap; src: url("fonts/open-sauce-two-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #000;
  --card: rgba(30, 30, 30, 0.55);
  --card-solid: #141414;
  --field: #222;
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.5);
  --faint: rgba(255, 255, 255, 0.22);
  --line: rgba(255, 255, 255, 0.1);
  --radius: 32px;
  --gutter: 32px;
  --sans: "Open Sauce Sans", "Inter", system-ui, sans-serif;
  --display: "Open Sauce Two", "Open Sauce Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.02em;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* grano sutil del fondo */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; align-items: center;
  padding: 26px 24px 22px;
  background: linear-gradient(to bottom, rgba(0,0,0,.85), rgba(0,0,0,0));
}
.site-header .left { display: flex; gap: 120px; align-items: center; grid-column: 1 / 3; }
.site-header .back { display: inline-flex; gap: 10px; align-items: center; transition: opacity .2s; }
.site-header .back:hover { opacity: .6; }
.site-header .clock { justify-self: end; margin-right: 48px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.site-header .lang { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.site-header .lang a { padding: 5px 11px; border-radius: 999px; font-size: 13px; letter-spacing: .02em; color: var(--muted); transition: color .2s, background .2s; }
.site-header .lang a:hover { color: #fff; }
.site-header .lang a[aria-current] { background: #fff; color: #000; pointer-events: none; }
.site-header a:focus-visible, .tile:focus-visible, .project:focus-visible, .btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.sp16 { height: 16px; }

/* ---------- Home (bento) ---------- */
.home { height: 100vh; min-height: 720px; position: relative; padding: 80px 16px 16px; }
.home-word {
  position: absolute; left: 0; right: 0; top: 86px; z-index: 0;
  text-align: center; font-family: var(--display); font-weight: 500;
  font-size: clamp(80px, 11vw, 160px); letter-spacing: -0.04em; line-height: 1.1;
  height: 1.15em; overflow: hidden; pointer-events: none;
}
.home-word span { display: block; transition: transform .6s var(--ease), opacity .4s; }
.home-word span.out { transform: translateY(-100%); opacity: 0; }
.home-word span.in-start { transform: translateY(100%); opacity: 0; transition: none; }

.bento {
  position: relative; z-index: 1; height: 100%;
  display: grid; gap: 16px; padding-top: 112px;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.tile {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--card);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  box-shadow: inset 0 1px 0 1px rgba(255,255,255,.06);
  transition: background .4s var(--ease);
}
a.tile:hover { background: rgba(44, 44, 44, .6); }
.tile .label {
  position: absolute; left: 32px; right: 32px; bottom: 30px;
  display: flex; justify-content: space-between; align-items: center; font-size: 18px;
}
.tile .arrow { width: 16px; height: 16px; transition: transform .4s var(--ease); }
a.tile:hover .arrow { transform: translate(3px, -3px); }
.t-about { grid-column: 1; grid-row: 1; }
.t-portfolio { grid-column: 2 / 5; grid-row: 1; }
.t-contact { grid-column: 1 / 3; grid-row: 2; }
.t-photo { grid-column: 3; grid-row: 2; }
.t-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.stack-col { grid-column: 4; grid-row: 2; display: grid; grid-template-rows: auto 1fr; gap: 16px; min-height: 0; }
.t-stack { height: 136px; display: flex; align-items: center; }
.t-stack .track { display: flex; gap: 16px; width: max-content; animation: slide 22s linear infinite; padding-left: 16px; }
.t-stack .logo { width: 72px; height: 72px; border-radius: 18px; background: #232323; display: grid; place-items: center; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.t-stack .logo img { width: 40px; height: 40px; object-fit: contain; }
.t-stack::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, #161616 0%, transparent 18%, transparent 82%, #161616 100%); }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- Títulos grandes ---------- */
.page { padding-top: 120px; }
.mega { font-family: var(--display); font-weight: 500; font-size: clamp(64px, 11vw, 160px); letter-spacing: -0.045em; line-height: 1; }
.h-lead { font-size: clamp(30px, 3.4vw, 48px); line-height: 1.2; letter-spacing: -0.03em; max-width: 1000px; font-weight: 500; }

/* ---------- About ---------- */
.reveal-text {
  margin: 120px 0 200px auto; max-width: 1010px; padding-left: 0;
  font-size: clamp(26px, 2.8vw, 40px); line-height: 1.3; letter-spacing: -0.03em;
}
.reveal-text p + p { margin-top: 1.1em; }
.reveal-text .w { color: var(--faint); transition: color .35s; }
.reveal-text .w.on { color: var(--text); }
.workflow { margin-top: 90px; }
.workflow .row { border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; padding: 44px 0 40px; }
.workflow .num { font-size: 16px; }
.workflow .name { font-size: 20px; }
.workflow .desc { color: var(--muted); font-size: 16px; line-height: 1.5; font-weight: 400; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; padding: 70px 0; white-space: nowrap; }
.marquee .track { display: inline-flex; animation: slide 28s linear infinite; }
.marquee span { font-family: var(--display); font-size: clamp(48px, 6vw, 88px); letter-spacing: -0.035em; padding-right: .35em; }
.marquee.small span { font-family: var(--sans); font-size: 18px; letter-spacing: -0.02em; color: var(--muted); padding-right: 1.4em; }
.marquee.small { padding: 48px 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); padding: 56px 0 80px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px; row-gap: 40px; }
.site-footer .k { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.site-footer .v { font-size: clamp(20px, 1.8vw, 26px); transition: opacity .2s; }
.site-footer a.v:hover { opacity: .6; }
.site-footer .li { grid-column: 3; }

/* ---------- Portfolio ---------- */
.projects { margin-top: 72px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.project { background: var(--card-solid); border-radius: var(--radius); padding: 16px 16px 0; box-shadow: inset 0 1px 0 1px rgba(255,255,255,.05); display: block; }
.project.wide { grid-column: 1 / 3; }
.project .shot { border-radius: 24px; overflow: hidden; aspect-ratio: 683 / 540; background: #1d1d1d; }
.project.wide .shot { aspect-ratio: 1413 / 750; }
.project .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .8s var(--ease); }
.project:hover .shot img { transform: scale(1.04); }
.project .cap { display: flex; justify-content: space-between; padding: 22px 24px 26px; font-size: 18px; }
.project .cap .cat { color: var(--muted); font-size: 16px; }

/* ---------- Caso de estudio ---------- */
.case-head .sub { color: var(--muted); font-size: 20px; margin-top: 10px; }
.case-img { border-radius: var(--radius); overflow: hidden; margin-top: 48px; background: #151515; }
.case-img img { width: 100%; height: 100%; object-fit: cover; }
.case-img { aspect-ratio: 1590 / 1160; }
.halves .case-img { aspect-ratio: 782 / 1162; }
.case-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 110px 48px; }
.case-intro p.lead { max-width: 440px; font-size: 16px; line-height: 1.55; }
.meta dt { color: var(--muted); font-size: 14px; }
.meta dd { margin: 4px 0 18px; }
.cso { padding: 80px 48px 40px; }
.cso .row { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 36px 0; }
.cso .row h3 { font-weight: 500; font-size: 20px; }
.cso .row p { color: var(--muted); line-height: 1.55; font-weight: 400; }
.halves { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.halves .case-img { margin-top: 16px; }
.pager { display: flex; justify-content: space-between; padding: 110px 0 40px; font-size: 18px; }
.pager a { display: inline-flex; gap: 12px; align-items: center; transition: opacity .2s; }
.pager a:hover { opacity: .6; }
.pager .next { margin-left: auto; }
.pager small { display: block; color: var(--muted); font-size: 14px; }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.45fr; gap: 32px; margin-top: 80px; padding-bottom: 80px; }
.contact-info .k { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.contact-info .v { font-size: 26px; display: block; margin-bottom: 28px; }
.contact-info .badge { display: inline-flex; gap: 10px; align-items: center; color: var(--muted); margin-top: 12px; }
.contact-info .badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 4px rgba(61,220,132,.15); }
.form-card { background: var(--card-solid); border-radius: var(--radius); padding: 48px 48px 40px; box-shadow: inset 0 1px 0 1px rgba(255,255,255,.05); }
.form-card label.f { display: block; margin-bottom: 30px; }
.form-card .lt { display: block; margin-bottom: 12px; }
.form-card input[type=text], .form-card input[type=email], .form-card textarea {
  width: 100%; background: var(--field); border: 1px solid transparent; border-radius: 12px; color: #fff;
  font: inherit; font-weight: 400; padding: 15px 18px; outline: none; transition: border-color .2s;
}
.form-card textarea { min-height: 140px; resize: vertical; }
.form-card input::placeholder, .form-card textarea::placeholder { color: rgba(255,255,255,.3); }
.form-card input:focus, .form-card textarea:focus { border-color: rgba(255,255,255,.3); }
.choices { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-bottom: 30px; }
.choices fieldset { border: 0; }
.choices legend { margin-bottom: 14px; }
.opt { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; cursor: pointer; font-weight: 400; color: rgba(255,255,255,.85); }
.opt input { appearance: none; width: 18px; height: 18px; background: var(--field); border: 1px solid rgba(255,255,255,.12); flex: none; display: grid; place-items: center; cursor: pointer; }
.opt input[type=checkbox] { border-radius: 4px; }
.opt input[type=radio] { border-radius: 50%; }
.opt input:checked { background: #fff; }
.opt input[type=checkbox]:checked::after { content: ""; width: 5px; height: 9px; border: solid #000; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); }
.opt input[type=radio]:checked::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #000; }
.btn { width: 100%; padding: 17px; border: 0; border-radius: 12px; background: #fff; color: #000; font: inherit; font-weight: 600; cursor: pointer; transition: opacity .2s; }
.btn:hover { opacity: .85; }
.form-msg { margin-top: 16px; color: var(--muted); text-align: center; min-height: 1.4em; }

/* ---------- Animación de entrada ---------- */
.fade { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.fade.on { opacity: 1; transform: none; }
.zoom img { transform: scale(1.08); transition: transform 1.4s var(--ease); }
.zoom.on img { transform: scale(1); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .site-header .left { gap: 40px; }
  .site-header .clock { margin-right: 24px; }
  .reveal-text { margin-left: 0; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; --radius: 24px; }
  .site-header { grid-template-columns: 1fr auto auto; padding: 18px 16px; font-size: 14px; }
  .site-header .left { grid-column: 1; gap: 0; }
  .site-header .left .role { display: none; }
  .site-header .clock { margin-right: 10px; }
  .home { height: auto; min-height: 0; padding: 70px 16px 16px; }
  .home-word { top: 60px; font-size: 72px; }
  .bento { grid-template-columns: 1fr 1fr; grid-template-rows: auto; padding-top: 76px; }
  .t-about, .t-portfolio, .t-contact, .t-photo, .stack-col { grid-column: auto; grid-row: auto; }
  .t-about, .t-contact { height: 200px; }
  .t-portfolio { grid-column: 1 / 3; height: 220px; order: -1; }
  .t-photo { grid-column: 1 / 3; aspect-ratio: 1; }
  .stack-col { grid-column: 1 / 3; grid-template-rows: auto auto; }
  .stack-col .t-resume { height: 120px; }
  .tile .label { left: 22px; right: 22px; bottom: 20px; font-size: 16px; }
  .page { padding-top: 90px; }
  .reveal-text { margin: 60px 0 110px; }
  .workflow .row { grid-template-columns: 40px 1fr; gap: 8px 16px; padding: 28px 0; }
  .workflow .desc { grid-column: 2; }
  .site-footer { grid-template-columns: 1fr; gap: 24px; }
  .site-footer .li { grid-column: auto; }
  .projects { grid-template-columns: 1fr; margin-top: 40px; }
  .project.wide { grid-column: auto; }
  .project.wide .shot { aspect-ratio: 683 / 540; }
  .case-intro, .cso .row, .halves, .contact-grid { grid-template-columns: 1fr; }
  .case-intro { padding: 56px 8px; gap: 32px; }
  .cso { padding: 40px 8px 16px; }
  .cso .row { gap: 10px; padding: 24px 0; }
  .form-card { padding: 28px 22px; }
  .choices { grid-template-columns: 1fr; }
  .pager { padding-top: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fade { opacity: 1; transform: none; }
  .reveal-text .w { color: var(--text); }
}
