/* Jesús Bravo — the pixel desk. One screen, no scroll: a camera moves across a pixel-art night desk
   and dives into each object, whose surface becomes the content. */
:root {
  --bg: #0f0c09;
  --panel: #1c1712;
  --line: #3a2e24;
  --ink: #f3efe6;
  --ink-2: #cbc3b6;
  --ink-3: #9d9487;
  --gold: #ffcd75;
  --gold-2: #e0a94a;
  --blue: #8d97ff;
  --red: #e0533d;
  --display: "Funnel Display", system-ui, sans-serif;
  --text: "Funnel Sans", system-ui, sans-serif;
  --pixel: "Pixelify Sans", system-ui, sans-serif;
  --hand: "Caveat", cursive;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --cam: cubic-bezier(0.65, 0, 0.25, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--text); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[data-icon] { display: inline-block; line-height: 0; }
[data-icon] svg { width: 100%; height: 100%; shape-rendering: crispEdges; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px; border: 0; cursor: pointer;
  background: var(--gold); color: #1a1208;
  font: 600 16px/1 var(--text); text-decoration: none;
  box-shadow: 0 0 0 2px #1a1208, 4px 4px 0 2px #0a0806;
  transition: translate 140ms var(--ease), box-shadow 140ms var(--ease);
}
.btn:active { translate: 3px 3px; box-shadow: 0 0 0 2px #1a1208, 1px 1px 0 2px #0a0806; }
@media (hover: hover) and (pointer: fine) { .btn:hover { translate: -2px -2px; box-shadow: 0 0 0 2px #1a1208, 6px 6px 0 2px #0a0806; } .btn:hover:active { translate: 3px 3px; } }
.btn--ghost { background: rgb(15 12 9 / .7); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink-3); }
@media (hover: hover) and (pointer: fine) { .btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--gold); } }
.btn--ghost:active { box-shadow: inset 0 0 0 2px var(--gold); }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn--lg { min-height: 54px; padding: 0 26px; font-size: 17px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; }

/* ------------------------------------------------------------------ header */
.top {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; gap: 24px; padding: 14px clamp(16px, 3vw, 40px);
  background: linear-gradient(rgb(15 12 9 / .92), rgb(15 12 9 / 0));
}
.logo { display: inline-flex; align-items: center; gap: 10px; font: 500 19px/1 var(--display); letter-spacing: -0.02em; text-decoration: none; }
.logo__mark { width: 20px; height: 20px; }
.styles { display: flex; gap: 14px; margin-left: auto; font: 500 14px/1 var(--pixel); }
.styles a { color: var(--ink-3); text-decoration: none; padding: 8px 0; }
.styles a[aria-current] { color: var(--gold); }
@media (hover: hover) and (pointer: fine) { .styles a:hover { color: var(--ink); } }
.top__end { display: flex; align-items: center; gap: 14px; }
.lang { display: flex; font: 500 14px/1 var(--pixel); }
.lang button { background: none; border: 0; cursor: pointer; padding: 8px 5px; color: var(--ink-3); font: inherit; }
.lang button[aria-pressed="true"] { color: var(--ink); }

/* ------------------------------------------------------------------ stage + camera */
.stage { position: fixed; inset: 0; overflow: hidden; }
.world {
  position: absolute; left: 0; top: 0; width: 320px; height: 200px;
  transform-origin: 0 0;
  transition: transform 850ms var(--cam);
  will-change: transform;
}
.world.is-instant { transition: none; }
#desk { display: block; width: 320px; height: 200px; image-rendering: pixelated; }
#desk.is-pointer { cursor: pointer; }
.hd { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; z-index: 0; opacity: 0; transition: opacity 700ms var(--ease); }
.hd.is-on { opacity: 1; }
.hd.is-pointer { cursor: pointer; }
/* legibility veil behind the intro; it lifts when the camera dives in */
.stage::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, rgb(15 12 9 / .9) 0, rgb(15 12 9 / .55) 30%, rgb(15 12 9 / 0) 52%);
  transition: opacity 400ms var(--ease);
}
.is-zoomed .stage::after { opacity: 0; }

.tip {
  position: absolute; z-index: 4; translate: -50% -100%; pointer-events: none;
  padding: 6px 10px 5px; background: var(--gold); color: #1a1208;
  font: 600 14px/1 var(--pixel); white-space: nowrap;
  box-shadow: 0 0 0 2px #1a1208, 3px 3px 0 2px #0a0806;
  opacity: 0; transition: opacity 120ms steps(2, end);
}
.tip.is-on { opacity: 1; }

.intro {
  position: absolute; z-index: 5;
  left: clamp(20px, 4vw, 64px); top: clamp(84px, 13vh, 132px);
  width: min(460px, 36vw);
  transition: opacity 300ms var(--ease), translate 400ms var(--ease);
}
.is-zoomed .intro { opacity: 0; translate: -24px 0; pointer-events: none; }
.tag { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 500 15px/1 var(--pixel); color: var(--ink-2); }
.tag__dot { width: 8px; height: 8px; background: #7ee2a8; box-shadow: 0 0 0 2px #1c3b2a; animation: blink 1.6s steps(1, end) infinite; }
@keyframes blink { 50% { opacity: .35; } }
h1 { margin: 0 0 18px; font: 400 clamp(36px, 3.9vw, 58px)/1.02 var(--display); letter-spacing: -0.035em; text-wrap: balance; }
.lead { margin: 0 0 28px; max-width: 42ch; font-size: clamp(16px, 1.2vw, 19px); color: var(--ink-2); }
.hint { margin: 26px 0 0; font: 500 14px/1.3 var(--pixel); color: var(--ink-3); }
.intro > * { animation: rise 500ms var(--ease) both; }
.intro > :nth-child(2) { animation-delay: 90ms; }
.intro > :nth-child(3) { animation-delay: 180ms; }
.intro > :nth-child(4) { animation-delay: 270ms; }
.intro > :nth-child(5) { animation-delay: 900ms; }
@keyframes rise { from { opacity: 0; translate: 0 12px; filter: blur(4px); } to { opacity: 1; translate: 0 0; filter: none; } }
.world { animation: boot 1000ms steps(10, end) both; }
@keyframes boot { from { filter: brightness(0); } to { filter: none; } }

/* ------------------------------------------------------------------ dock */
.dock {
  position: absolute; z-index: 8; left: 50%; bottom: 18px; translate: -50% 0;
  display: flex; gap: 4px; padding: 6px;
  background: var(--panel); box-shadow: 0 0 0 2px var(--line), 0 0 0 4px #0a0806, 6px 6px 0 4px rgb(0 0 0 / .45);
  animation: dock 600ms var(--ease) 600ms both;
}
@keyframes dock { from { translate: -50% 140%; } to { translate: -50% 0; } }
.dock button {
  display: grid; justify-items: center; gap: 6px; min-width: 86px; padding: 8px 10px 7px;
  background: none; border: 0; cursor: pointer; color: var(--ink-2);
  font: 500 13px/1 var(--pixel);
  transition: background-color 120ms, color 120ms;
}
.dock [data-icon] { width: 24px; height: 24px; transition: translate 160ms steps(2, end); }
.dock button.is-hot, .dock button[aria-current="true"] { background: #2a2119; color: var(--ink); }
.dock button[aria-current="true"] { box-shadow: inset 0 -3px 0 var(--gold); }
.dock button.is-hot [data-icon] { translate: 0 -3px; }
@media (hover: hover) and (pointer: fine) { .dock button:hover { background: #2a2119; color: var(--ink); } .dock button:hover [data-icon] { translate: 0 -3px; } }
.dock button:active [data-icon] { translate: 0 1px; }

/* ------------------------------------------------------------------ the panel: the object's surface, grown */
.panel {
  position: absolute; z-index: 6;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--panel); color: var(--ink);
  box-shadow: 0 0 0 2px #0a0806;
  opacity: 0; clip-path: inset(49% 0 49% 0);
}
.panel[hidden] { display: none; }
.panel.is-on { opacity: 1; clip-path: inset(0 0 0 0); transition: clip-path 360ms steps(6, end), opacity 80ms linear; }
.panel.is-off { opacity: 0; clip-path: inset(49% 0 49% 0); transition: clip-path 160ms steps(3, end), opacity 160ms linear 60ms; }
.panel__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-bottom: 2px solid rgb(0 0 0 / .25); }
.pbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; min-width: 36px; justify-content: center; padding: 0 10px; background: rgb(0 0 0 / .18); border: 0; cursor: pointer; font: 500 14px/1 var(--pixel); color: inherit; transition: background-color 120ms; }
.pbtn:active { translate: 0 1px; }
@media (hover: hover) and (pointer: fine) { .pbtn:hover { background: rgb(0 0 0 / .32); } }
.panel__count { font: 500 13px/1 var(--pixel); opacity: .7; }
.panel__nav { display: flex; gap: 6px; }
.panel__nav .pbtn { font-size: 20px; }

.sheet { overflow-y: auto; padding: clamp(18px, 2.6vw, 36px) clamp(18px, 3vw, 44px) clamp(22px, 3vw, 40px); }
.sheet[hidden] { display: none; }
.sheet h2 { margin: 0 0 18px; font: 400 clamp(26px, 2.6vw, 40px)/1.08 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.sheet p { margin: 0 0 14px; max-width: 62ch; }

/* laptop screen */
.panel.skin-screen { background: #0b0e19; color: #e8e6e3; box-shadow: 0 0 0 2px #050608; }
.prompt { font: 500 15px/1.3 var(--pixel); color: #9aa3b2; }
.prompt > span:first-child { color: #7ee2a8; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid4 article { padding: 18px 16px; background: #121729; box-shadow: inset 0 0 0 2px #26304f; transition: box-shadow 160ms; }
@media (hover: hover) and (pointer: fine) { .grid4 article:hover { box-shadow: inset 0 0 0 2px var(--gold-2); } }
.grid4 [data-icon] { width: 34px; height: 34px; margin-bottom: 12px; }
.grid4 h3 { margin: 0 0 8px; font: 500 17px/1.25 var(--text); }
.grid4 p { margin: 0; color: #aeb5c4; font-size: 15px; }
.sheet__foot { margin-top: 18px !important; color: #9aa3b2; font-size: 15px; }

/* tablet -> projects */
.panel.skin-gallery { background: #0b0e19; color: #e8e6e3; box-shadow: 0 0 0 6px #14161c, 0 0 0 8px #0a0806; }
.sheet__lead { color: #9aa3b2; }
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 8px; }
.proj {
  display: grid; gap: 10px; align-content: start; padding: 22px 22px 20px; text-decoration: none;
  background: #121729; box-shadow: inset 0 0 0 2px #26304f;
  transition: box-shadow 160ms var(--ease), translate 160ms var(--ease);
}
@media (hover: hover) and (pointer: fine) { .proj:hover { box-shadow: inset 0 0 0 2px var(--gold-2); translate: 0 -3px; } .proj:hover .proj__go { color: var(--gold); } }
.proj:active { translate: 0 1px; }
.proj__icon { width: 44px; height: 44px; }
.proj__head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.proj__t { font: 500 22px/1.2 var(--text); color: #f3efe6; }
.proj__k { font: 600 15px/1 var(--pixel); color: var(--gold); }
.proj__d { font-size: 15px; color: #aeb5c4; }
.proj__s { font: 400 13px/1.3 var(--pixel); color: #7c8598; }
.proj__go { margin-top: 4px; font: 500 14px/1 var(--pixel); color: #e8e6e3; transition: color 150ms; }

/* phone -> feed */
.panel.skin-phone { background: #1f2a55; color: #f3efe6; box-shadow: 0 0 0 6px #14161c, 0 0 0 8px #0a0806; }
.phone__time { font: 600 14px/1 var(--pixel); text-align: center; opacity: .7; }
.feed { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.feed li { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px; background: #f4efe5; color: #1d1a16; }
.feed strong { display: block; font-weight: 600; margin-bottom: 2px; }
.feed li > span > span { font-size: 15px; color: #4a443d; }
.dot { width: 12px; height: 12px; margin-top: 4px; }
.dot--ig { background: #e1306c; } .dot--meta { background: #0866ff; } .dot--tt { background: #111; box-shadow: 2px 0 0 #25f4ee, -2px 0 0 #fe2c55; }
.feed__tags { font: 500 13px/1.4 var(--pixel); opacity: .75; }
.feed li:nth-child(1) { animation: notif 500ms var(--ease) 300ms both; }
.feed li:nth-child(2) { animation: notif 500ms var(--ease) 500ms both; }
.feed li:nth-child(3) { animation: notif 500ms var(--ease) 700ms both; }
@keyframes notif { from { opacity: 0; translate: 0 -10px; } to { opacity: 1; translate: 0 0; } }

/* notebook -> paper */
.panel.skin-paper {
  background-color: #f4efe5; color: #1f2a55;
  background-image: repeating-linear-gradient(transparent 0 31px, #c9d6ea 31px 32px), linear-gradient(90deg, transparent calc(50% - 2px), #2b2f3a calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px));
}
.panel.skin-paper .pbtn { background: rgb(31 42 85 / .08); }
.hand { font: 600 clamp(36px, 3.4vw, 54px)/1 var(--hand) !important; letter-spacing: 0 !important; color: #1f2a55; box-shadow: inset 0 -4px 0 #e0533d; display: inline-block; }
.pages { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(32px, 5vw, 72px); margin-top: 14px; }
.pages dl { margin: 0; }
.pages dt { font: 700 28px/1.15 var(--hand); color: #1f2a55; margin-top: 12px; }
.pages dd { margin: 2px 0 10px; font-size: 16px; color: #33405f; }

/* gloves -> about */
.panel.skin-dark { background: #1c1712; }
.panel.skin-dark p { color: var(--ink-2); }
.hobbies { display: flex !important; align-items: center; gap: 12px; color: var(--ink) !important; }
.hobbies [data-icon] { width: 32px; height: 32px; }
.facts { margin: 18px 0 0; box-shadow: inset 0 0 0 2px var(--line); }
.facts div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 12px 18px; border-bottom: 2px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font: 500 14px/1.5 var(--pixel); color: var(--ink-3); }
.facts dd { margin: 0; }

/* card -> contact */
.panel.skin-card { background: #efe9dc; color: #16130f; }
.panel.skin-card .pbtn { background: rgb(22 19 15 / .07); }
.card__name { font: 400 clamp(34px, 3.4vw, 52px)/1 var(--display); letter-spacing: -0.035em; margin-bottom: 4px !important; }
.card__role { font: 500 15px/1 var(--pixel); color: #6b645a; margin-bottom: 26px !important; }
.skin-card h2 { font-size: clamp(22px, 2vw, 30px) !important; }
.skin-card p { color: #4a443d; }
.skin-card .actions { margin: 18px 0 20px; }
.card__links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.card__links a { padding: 8px 0; text-decoration: none; color: #16130f; font-weight: 500; }
.card__legal { font: 400 13px/1 var(--pixel); color: #8a8378; margin-top: 10px !important; }

/* ------------------------------------------------------------------ phone layout */
@media (max-width: 760px) {
  .styles { display: none; }
  .top { padding: 10px 14px; }
  .top__end { margin-left: auto; }
  .top .btn--sm { display: none; }
  .stage::after { background: linear-gradient(rgb(15 12 9 / .9) 0, rgb(15 12 9 / .55) 34%, rgb(15 12 9 / 0) 46%); }
  .intro { left: 18px; right: 18px; top: 64px; width: auto; }
  h1 { font-size: clamp(30px, 8.6vw, 38px); margin-bottom: 12px; }
  .lead { font-size: 15px; margin-bottom: 18px; }
  .tag { margin-bottom: 12px; }
  .hint { display: none; }
  .actions .btn { flex: 1; }
  .dock { left: 8px; right: 8px; translate: none; bottom: 10px; justify-content: space-between; gap: 0; padding: 4px; animation-name: dock-m; }
  @keyframes dock-m { from { translate: 0 140%; } to { translate: 0 0; } }
  .dock button { min-width: 0; flex: 1; padding: 7px 2px 6px; font-size: 11px; }
  .dock button > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .actions .btn { padding: 0 12px; font-size: 15px; white-space: nowrap; }
  .dock [data-icon] { width: 20px; height: 20px; }
  .grid4, .projects, .pages { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 1100px) and (min-width: 761px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .styles { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .world, .intro > *, .sheet > *, .dock, .feed li { animation: none; }
  .world { transition: none; }
  .panel.is-on, .panel.is-off { transition: opacity 150ms linear; clip-path: none; }
  .tag__dot { animation: none; }
}
