:root{color-scheme:light}body{margin:0;font-family:system-ui,sans-serif}img{max-width:100%}[hidden]{display:none!important}

/* Layout: tablero perforado blanco (un solo aspecto claro, a propósito) (paso 40 mm, ranuras al tresbolillo); cada bloque cuelga de un gancho encajado en una ranura real del patrón */
:root {
  --board: #FFFFFF;
  --hole: #CFD0CA;
  --hole-lip: #F2F2EF;
  --paper: #F7F7F4;
  --fg: #1B1C19;
  --muted: #62655C;
  --line: #D9D9D2;
  --metal: #8A8D88;
  --metal-hi: #E2E4DF;
  --accent: #113C51;
  --brand: #113C51;
  --shadow: rgba(40, 38, 30, .14);
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--board); color: var(--fg); font-family: var(--body); font-size: 17px; line-height: 1.6; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* Tablero */
.board { position: relative; min-height: 100vh; }
.holes, .holes-lip { position: absolute; inset: 0; pointer-events: none; z-index: 0;
  -webkit-mask-image: var(--pattern); mask-image: var(--pattern);
  -webkit-mask-size: 40px 40px; mask-size: 40px 40px; }
.holes-lip { background: var(--hole-lip); transform: translate(0, 1px); }
.holes { background: var(--hole); }

.wrap { position: relative; z-index: 2; max-width: 1120px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 48px; }

/* Cabecera */
header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6; background: var(--paper); border-bottom: 1px solid var(--line); }
.head-in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 14px; }
.mark { display: inline-flex; color: var(--brand); text-decoration: none; }
.logo-h { height: 20px; width: auto; display: block; }
.logo-v { width: min(260px, 70%); height: auto; display: block; color: var(--brand); margin: 4px 0 28px; }
.logo-m { height: 14px; width: auto; color: var(--brand); }
nav { display: flex; gap: 22px; flex-wrap: wrap; }
nav a { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--fg); }

.head-contact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head-contact .email { font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.head-contact .ig { font-family: var(--mono); font-size: 13px; color: var(--brand); text-decoration: none; }
.head-contact .ig:hover { text-decoration: underline; }
.head-contact .sep { color: var(--line); }
.head-contact .btn { padding: 6px 10px; font-size: 11px; }
.head-in nav { margin-left: auto; }

.lang { display: inline-flex; border: 1px solid var(--line); }
.lang button { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; padding: 5px 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--brand); color: #FFFFFF; }

.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; }

/* Piezas colgadas */
.hang { position: relative; padding-top: 38px; }
.hook { position: absolute; top: 0; left: var(--hx, 50%); width: 24px; height: 60px; margin-left: -12px; z-index: 3; overflow: visible; pointer-events: none; }
.hook .eye { fill: var(--board); stroke: var(--line); }
.hook .rod { stroke: var(--metal); }
.hook .hi { stroke: var(--metal-hi); }
.plate { position: relative; display: block; background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 14px 22px -12px var(--shadow), 0 2px 4px var(--shadow);
  transform-origin: 50% -12px; transform: rotate(var(--tilt, 0deg)); transition: transform .5s cubic-bezier(.3,.7,.3,1.4); }
.hang.one .plate:hover, .hang.one .plate:focus-visible { animation: swing 1.4s ease-in-out; }
@keyframes swing { 0% { transform: rotate(var(--tilt,0deg)); } 25% { transform: rotate(3deg); } 55% { transform: rotate(-2deg); } 80% { transform: rotate(.8deg); } 100% { transform: rotate(var(--tilt,0deg)); } }

.eyebrow { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
h1 { font-family: var(--display); font-weight: 800; font-size: clamp(42px, 7vw, 86px); line-height: .94; letter-spacing: -.045em; margin: 12px 0 20px; text-wrap: balance; }
h1 em { font-style: normal; color: var(--accent); }
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; line-height: 1; margin: 0; }
.lead { max-width: 34em; font-size: 18px; color: var(--muted); margin: 0; }
.lead strong { color: var(--fg); font-weight: 600; }
.todo { color: var(--muted); font-style: italic; }

/* Portada */
.hero { padding-block: 72px 24px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.logo-link { display: block; width: min(520px, 90%); color: var(--brand); transition: transform .4s cubic-bezier(.3,.7,.3,1.4), filter .4s;
  filter: drop-shadow(0 3px 2px rgba(17,60,81,.22)) drop-shadow(0 14px 14px rgba(17,60,81,.12)); }
.logo-link .logo-v { width: 100%; margin: 0; color: inherit; }
.logo-link-unused { transform: translateY(-4px) rotate(-1deg); filter: drop-shadow(0 6px 4px rgba(17,60,81,.2)) drop-shadow(0 22px 20px rgba(17,60,81,.14)); }
.sheet { padding: 36px 36px 32px; }

/* Rótulos de sección */
.label-row { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-top: 72px; }
.label { padding: 14px 22px; display: inline-flex; gap: 14px; align-items: baseline; }

/* Proyectos */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; margin-top: 24px; }
.card { text-decoration: none; padding: 14px 14px 20px; display: flex; flex-direction: column; gap: 14px; }
.frame { position: relative; aspect-ratio: 4 / 3; max-width: 100%; background: var(--board); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.frame svg { width: 62%; height: 62%; color: var(--muted); transition: color .3s; }
.card:hover .frame svg, .card:focus-visible .frame svg { color: var(--accent); }
.tag { position: absolute; top: 12px; left: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); }
.tag.live { color: var(--accent); border-color: var(--accent); }
.note { position: absolute; bottom: 12px; right: 12px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.card-meta { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding-inline: 4px; }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: -.02em; margin: 0; }
.card p { margin: 0; color: var(--muted); padding-inline: 4px; }
.idx { font-family: var(--mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Pegatinas */
.stickers { display: flex; flex-wrap: wrap; gap: 48px 64px; margin-top: 24px; }
.sticker { width: 184px; aspect-ratio: 1; max-width: 100%; border-radius: 50%; background: var(--brand); color: #FFFFFF;
  border: 6px solid #FFFFFF; text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 26px 18px 14px; overflow: hidden; }
.sticker::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.22), transparent 45%); }
.sticker svg { width: 62%; height: auto; }
.st-name { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -.01em; line-height: 1.1; }
.st-idx { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.st-dot { position: absolute; right: -4px; bottom: 10px; transform: rotate(-12deg); background: #FFFFFF; color: var(--brand);
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--brand); }
.sticker:hover, .sticker:focus-visible { box-shadow: 0 22px 26px -14px var(--shadow), 0 3px 6px var(--shadow); }
.linkbtn { font: inherit; color: var(--brand); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.hint { font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--board); display: inline-block; padding: 2px 6px; margin: 20px 0 0; }

.sticker-cut { background: none; border: 0; box-shadow: none; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sticker-cut img, .sticker-cut .st-draw { display: block; width: auto; max-width: 100%; height: auto;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.18)) drop-shadow(0 12px 12px rgba(40,38,30,.16)); }
.sticker-cut:hover img, .sticker-cut:focus-visible img, .sticker-cut:hover .st-draw, .sticker-cut:focus-visible .st-draw { filter: drop-shadow(0 2px 2px rgba(0,0,0,.18)) drop-shadow(0 20px 18px rgba(40,38,30,.2)); }
.st-cap { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #FFFFFF; background: var(--brand); padding: 4px 10px; border-radius: 999px; }
.stickers { align-items: flex-start; }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.proj-head { display: flex; justify-content: space-between; align-items: center; gap: 20px 32px; flex-wrap: wrap; }
.proj-head h2 { min-width: 0; }
.client-hero { margin: 0 0 32px; padding-block: 8px 24px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.client-hero .client-logo { height: clamp(80px, 14vw, 150px); width: auto; max-width: 100%; display: block; }

.logo-st .logo-sticker { display: block; width: min(460px, 84vw); height: auto;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.16)) drop-shadow(0 14px 14px rgba(40,38,30,.16)); }
.hang.drag { touch-action: none; cursor: grab; z-index: 2; }
.hang.drag .plate { cursor: inherit; -webkit-user-drag: none; user-select: none; }
.hang.drag img, .hang.drag svg { -webkit-user-drag: none; pointer-events: none; }
.hang.drag .hook { transition: opacity .2s; }
.hang.dragging { cursor: grabbing; z-index: 8; transition: none; }
.hang.dragging .hook { opacity: 0; }
.hang.dragging .plate { animation: none !important; transform: rotate(var(--tilt,0deg)) scale(1.04); }
.hang.dragging .sticker-cut svg, .hang.dragging .sticker-cut img { filter: drop-shadow(0 4px 3px rgba(0,0,0,.18)) drop-shadow(0 30px 24px rgba(40,38,30,.22)); }
.hang.settle { transition: transform .35s cubic-bezier(.3,.7,.3,1.3); }

.gal-title { font-family: var(--mono); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin: 40px 0 16px; }
.gallery { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gallery figure.wide { grid-column: 1 / -1; }
.gallery figure { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gallery img, .gallery video { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: var(--board); border: 1px solid var(--line); }
.gallery figcaption { font-size: 14px; line-height: 1.4; color: var(--muted); }
.gallery figcaption span { display: block; font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .08em; margin-bottom: 2px; }

.about-row { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; margin-top: 32px; }
.about-main { flex: 1 1 520px; max-width: 800px; min-width: 0; }
.about-side { flex: 0 1 240px; min-width: 200px; margin-top: 40px; display: flex; flex-direction: column; gap: 32px; }
.mini { padding: 10px; }
.mini-ph { aspect-ratio: 4 / 5; max-width: 100%; background: var(--board); border: 1px dashed var(--line); display: grid; place-items: center; padding: 12px; text-align: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.mini-logo { border-style: solid; background: #FFFFFF; }
.mini-logo .logo-v { width: 78%; height: auto; margin: 0; color: var(--brand); }

.contact-sheet p { font-size: 18px; color: var(--muted); }
.contact-list li { align-items: center; padding-block: 16px; }
.contact-list li > span:first-child { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.contact-list .c-val { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; font-family: var(--body) !important; font-size: 17px !important; color: var(--fg) !important; }
.contact-list .email { font-family: var(--display); font-weight: 600; font-size: 20px; overflow-wrap: anywhere; user-select: all; }
.contact-list .ig { font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--brand); text-decoration: none; }
.contact-list .ig:hover { text-decoration: underline; }
.contact-list .btn { padding: 7px 12px; font-size: 11px; text-decoration: none; }
@media (max-width: 560px) { .contact-list li { flex-direction: column; align-items: flex-start; gap: 8px; } .contact-list .c-val { justify-content: flex-start; } }

/* Móvil */
.touch #reset { display: none; }
.touch .hang.drag, .touch .hang { touch-action: auto; }
@media (max-width: 700px) {
  .head-in { padding-block: 10px; gap: 8px 12px; }
  .head-in nav { gap: 14px; }
  nav a { font-size: 12px; }
  .hero { padding-block: 36px 8px; gap: 14px; }
  .logo-link { width: min(300px, 78%); }
  .hint { font-size: 11px; text-align: center; }
  .stickers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 12px; justify-items: center; margin-top: 16px; }
  .stickers > .hang:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .sticker-cut .st-draw { width: min(100%, 158px) !important; height: auto; }
  .st-cap { font-size: 10px; padding: 3px 8px; white-space: nowrap; }
  .board-tag { gap: 4px 14px; padding: 10px 14px; }
  .board-tag .back, .board-tag .eyebrow { font-size: 11px; }
  .label-row { gap: 0 16px !important; }
  .sheet, .about, .detail .sheet { padding: 22px 18px; }
  .client-hero .client-logo { height: 72px; }
  .detail h2 { font-size: 40px; }
  .gallery { gap: 12px; }
}

.bio-sub { font-family: var(--mono); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin: 28px 0 0; }

/* Cambio de tablero */
.board-in { animation: slideIn .55s cubic-bezier(.2,.7,.2,1); }
@keyframes slideIn { from { transform: translateX(6%); opacity: .2; } to { transform: none; opacity: 1; } }
.board-tag { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 12px 18px; }
.board-tag .eyebrow { color: var(--fg); }

/* Sobre mí y contacto */
.lower { display: grid; grid-template-columns: minmax(0, 380px); justify-content: end; margin-top: 24px; }
.about { padding: 32px; }
.about p { margin: 16px 0 0; max-width: 60ch; }
.interests { list-style: none; padding: 0; margin: 20px 0 0; }
.interests li { display: flex; justify-content: space-between; gap: 12px; padding-block: 10px; border-top: 1px solid var(--line); }
.interests li span:last-child { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.contact { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.email { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -.01em; overflow-wrap: anywhere; user-select: all; }
.btn { align-self: start; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding: 10px 16px; border: 1px solid var(--fg); background: transparent; color: var(--fg); cursor: pointer; }
.btn:hover { background: var(--fg); color: var(--paper); }

/* Detalle */
.detail { padding-top: 40px; }
.detail .sheet { padding: 40px; }
.back { font-family: var(--mono); font-size: 13px; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--accent); }
.detail h2 { font-size: clamp(40px, 7vw, 76px); margin: 18px 0 12px; }
.detail .frame { aspect-ratio: 16 / 9; margin-block: 28px; }
.detail .frame.photo { aspect-ratio: 3 / 4; max-width: 560px; margin-inline: auto; }
.spec { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0; }
.spec div { padding: 14px 16px 14px 0; min-width: 0; }
.spec dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.spec dd { margin: 4px 0 0; font-weight: 500; }
.chapters { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 26px 40px; margin-top: 40px; }
.chapters h4 { font-family: var(--mono); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; margin: 4px 0 0; color: var(--accent); }
.chapters p { margin: 0; max-width: 62ch; }

footer { margin-top: 64px; display: flex; justify-content: center; }
footer .label { align-items: center; font-family: var(--mono); font-size: 12px; color: var(--muted); }

@media (max-width: 760px) {
  .grid, .lower { grid-template-columns: 1fr; }
  .hero { padding-block: 40px 16px; }
  .lower { justify-content: stretch; grid-template-columns: 1fr; }
  .sheet, .about, .detail .sheet { padding: 24px; }
  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapters { grid-template-columns: 1fr; gap: 6px; }
  .chapters p { margin-bottom: 18px; }
  nav { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .hang.one .plate:hover, .board-in, .logo-link { animation: none !important; }
  .plate { transition: none; }
  html { scroll-behavior: auto; }
}
