/*
VOICE   warm, unhurried, a little playful: a summer evening in Lisbon, finished like a good product
IDEA    the CV is a painting on show in Terreiro do Paço; the career stands around it
PICTURE the 3D square itself, full bleed, at golden hour
COLOUR  sunset sky and ochre arcades in the scene; UI in warm paper, azulejo navy ink, tram-yellow accent
TYPE    Instrument Serif for names and titles, Manrope for everything you read or tap
*/
:root {
  --ink: #13294b;
  --ink-2: #56627a;
  --paper: #fbf7ef;
  --paper-2: #f2eadb;
  --paper-3: #e9dfcb;
  --yellow: #f5c400;
  --line: rgba(19, 41, 75, .12);
  --glass: rgba(251, 247, 239, .86);
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 24px 60px -12px rgba(40, 24, 10, .35), 0 2px 8px rgba(40, 24, 10, .08);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: Manrope, system-ui, -apple-system, sans-serif;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.2, .9, .25, 1);
  color-scheme: light;
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f3b98a; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body { font: 16px/1.5 var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* nothing in the square is selectable (no text loupe while walking); only what you'd want to copy is */
.log .msg, .cv-read, .textLayer span, input, textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
kbd { font: 700 11px/1 var(--sans); padding: 4px 7px; border-radius: 6px; background: rgba(19, 41, 75, .1); }
svg { display: block; }
[hidden] { display: none !important; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; outline: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

/* ---------- name tags over heads ---------- */
.label {
  position: absolute; left: 0; top: 0; opacity: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; will-change: transform, opacity;
}
.tag {
  display: flex; align-items: center; gap: 7px; padding: 5px 11px 5px 8px; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(30, 20, 10, .16); white-space: nowrap; font-size: 12.5px; font-weight: 700;
}
.tag i { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.tag .ok { display: none; width: 14px; height: 14px; color: #2f8a4b; }
.label.met .tag .ok { display: block; }
.label.met .tag i { display: none; }
.tag em.now, #journey-list b em.now { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 999px; background: #2f6bff; color: #fff; vertical-align: 2px; white-space: nowrap; }
#journey-list b img.flag, .tag img.flag { width: 18px; height: 12px; border-radius: 2px; flex: none; object-fit: cover; box-shadow: 0 0 0 1px rgba(19, 41, 75, .15); }
.hook {
  order: -1; max-width: 220px; padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: #fff; color: var(--ink);
  font-size: 13.5px; font-weight: 600; line-height: 1.35; white-space: normal; text-align: left;
  box-shadow: 0 10px 26px rgba(30, 20, 10, .18); transform: translateY(6px) scale(.94); opacity: 0;
  transition: opacity .35s var(--ease), transform .45s var(--ease);
}
.label.teasing .hook { opacity: 1; transform: none; }
.dots { display: none; gap: 3px; padding: 0 2px; }
.label.typing .dots { display: inline-flex; }
.dots em { width: 4px; height: 4px; border-radius: 50%; background: var(--ink); animation: dot 1s infinite; }
.dots em:nth-child(2) { animation-delay: .15s; } .dots em:nth-child(3) { animation-delay: .3s; }
.label.cv .tag { background: var(--yellow); color: var(--ink); padding: 7px 14px 7px 10px; font-size: 13px; }
.label.cv .tag i { background: var(--ink); animation: pulse 1.8s infinite; }
@keyframes dot { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }

/* ---------- intro ---------- */
.intro {
  position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(28px + var(--st)) max(6vw, 22px) calc(30px + var(--sb));
  background: linear-gradient(180deg, rgba(24, 22, 44, 0) 30%, rgba(24, 22, 44, .58) 100%), linear-gradient(90deg, rgba(24, 22, 44, .28), rgba(24, 22, 44, 0) 60%);
  color: #fff; transition: opacity 1s ease, transform 1s var(--ease);
}
@media (max-width: 700px) { .intro { background: linear-gradient(180deg, rgba(24, 22, 44, 0) 28%, rgba(24, 22, 44, .5) 55%, rgba(24, 22, 44, .78) 100%); } }
.intro.out { opacity: 0; transform: translateY(16px); pointer-events: none; }
.intro-copy > * { opacity: 0; transform: translateY(14px); transition: opacity 1.1s ease, transform 1.2s var(--ease); }
.intro.shown .intro-copy > * { opacity: 1; transform: none; }
.intro.shown .intro-copy > :nth-child(2) { transition-delay: .12s; }
.intro.shown .intro-copy > :nth-child(3) { transition-delay: .3s; }
.intro.shown .intro-copy > :nth-child(4) { transition-delay: .45s; }
.intro.shown .intro-copy > :nth-child(5) { transition-delay: .6s; }
.intro-copy { max-width: 760px; }
.kicker { margin: 0 0 6px; font-size: 14px; font-weight: 600; opacity: .9; }
.intro h1 { margin: 0; font: 400 clamp(60px, 10.5vw, 156px)/.9 var(--serif); letter-spacing: -.015em; text-shadow: 0 8px 50px rgba(70, 25, 0, .3); }
.intro h1 .w { display: inline-block; white-space: nowrap; }
.intro h1 .ch { display: inline-block; opacity: 0; transform: translateY(.18em); filter: blur(6px); transition: opacity .9s ease, transform 1.1s var(--ease), filter 1s ease; }
.intro.shown h1 .ch { opacity: 1; transform: none; filter: none; }
.lede { margin: 18px 0 26px; font-size: clamp(16px, 1.55vw, 19px); max-width: 35em; line-height: 1.55; text-shadow: 0 1px 14px rgba(20, 10, 0, .35); }
.intro-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.enter {
  display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 22px 0 28px; border: 0; border-radius: 999px;
  background: var(--yellow); color: var(--ink); font-weight: 800; font-size: 17px;
  box-shadow: 0 14px 36px -6px rgba(245, 196, 0, .55), inset 0 -2px 0 rgba(0, 0, 0, .08);
  transition: transform .25s var(--ease), box-shadow .25s, opacity .3s;
}
.enter:disabled { opacity: .55; }
.enter:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 18px 44px -6px rgba(245, 196, 0, .7); }
.ghost { min-height: 56px; padding: 0 22px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .08); color: #fff; font-weight: 700; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ghost:hover { background: rgba(255, 255, 255, .18); }
.online { margin: 18px 0 0; display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(245, 196, 0, .7); } 70% { box-shadow: 0 0 0 10px rgba(245, 196, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 196, 0, 0); } }
.loader { display: flex; align-items: center; gap: 14px; margin-top: 26px; font-size: 13px; opacity: .9; transition: opacity .6s; }
.intro.ready .loader { opacity: 0; }
.track { width: 160px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.bar { height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }

/* ---------- HUD ---------- */
.hud { opacity: 0; transition: opacity .9s ease .8s; }
.hud.in { opacity: 1; }
.top {
  position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + var(--st)) calc(16px + var(--sr)) 0 calc(22px + var(--sl)); pointer-events: none;
}
.brand { font: 400 28px/1 var(--serif); color: #fff; text-shadow: 0 2px 18px rgba(70, 25, 0, .45); }
.top nav { display: flex; gap: 8px; pointer-events: auto; }
.top nav button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-weight: 700; font-size: 14px; box-shadow: 0 8px 24px -6px rgba(30, 20, 10, .25); transition: background .2s, transform .2s var(--ease);
}
.top nav button:hover { background: #fff; transform: translateY(-1px); }
.top nav .icon { width: 44px; padding: 0; justify-content: center; }
.icon svg { width: 22px; height: 22px; }
.icon .mute { display: none; }
.icon[aria-pressed="false"] .mute { display: block; }
.icon[aria-pressed="false"] .wave { display: none; }
.ring { width: 22px; height: 22px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .track { stroke: rgba(19, 41, 75, .14); }
.ring .fill { stroke: var(--ink); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; transition: stroke-dashoffset .8s var(--ease); }
#met { font-weight: 800; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; top: calc(72px + var(--st)); transform: translate(-50%, -10px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 600; box-shadow: 0 14px 40px -8px rgba(19, 41, 75, .5); transition: opacity .35s, transform .5s var(--ease); white-space: nowrap;
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.toast img { width: 28px; height: 28px; border-radius: 50%; }

.hint {
  position: fixed; left: 50%; bottom: calc(100px + var(--sb)); transform: translate(-50%, 8px); margin: 0; max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: 14px; background: rgba(19, 41, 75, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; font-size: 13px; text-align: center; opacity: 0; transition: opacity .6s, transform .6s var(--ease); pointer-events: none;
}
.hint.in { opacity: 1; transform: translate(-50%, 0); }
.mob { display: none; }
body.touch .mob { display: inline; } body.touch .desk { display: none; }
body.touch .hint { bottom: calc(172px + var(--sb)); }
body.touch .enter kbd { display: none; }

.action {
  position: fixed; left: 50%; bottom: calc(26px + var(--sb)); transform: translate(-50%, 24px) scale(.96); opacity: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 14px 0 8px; border: 0; border-radius: 999px;
  background: var(--paper); color: var(--ink); font-weight: 800; font-size: 16px; box-shadow: var(--shadow);
  transition: opacity .2s, transform .35s var(--ease);
}
.action.in { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.action img { width: 44px; height: 44px; border-radius: 50%; background: var(--paper-2); }
.action img:not([src]) { visibility: hidden; width: 8px; }
.action kbd { background: var(--yellow); }
body.touch .action kbd { display: none; }
body.touch .action { left: auto; right: calc(18px + var(--sr)); transform: translateY(24px); padding-right: 22px; min-height: 64px; }
body.touch .action.in { transform: none; }

.joy {
  display: none; position: fixed; left: calc(22px + var(--sl)); bottom: calc(22px + var(--sb)); width: 128px; height: 128px; border-radius: 50%;
  background: rgba(251, 247, 239, .22); border: 1.5px solid rgba(255, 255, 255, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); touch-action: none;
}
body.touch .joy { display: block; }
.joy .knob {
  position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%;
  background: var(--paper); box-shadow: 0 8px 20px rgba(30, 20, 10, .25); transition: transform .18s var(--ease);
}
.joy.on .knob { transition: none; }

/* ---------- journey ---------- */
.journey {
  position: fixed; top: calc(68px + var(--st)); right: calc(16px + var(--sr)); width: min(380px, calc(100vw - 32px)); max-height: calc(100dvh - 90px - var(--st) - var(--sb));
  display: flex; flex-direction: column; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden;
  opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top right; transition: opacity .2s, transform .3s var(--ease);
}
.journey.in { opacity: 1; transform: none; }
.journey header { padding: 18px 20px 10px; }
.journey h2 { margin: 0; font: 400 28px/1.05 var(--serif); }
.journey header p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.journey-list { overflow-y: auto; padding: 0 10px 12px; overscroll-behavior: contain; }
.journey-list h3 { margin: 14px 10px 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.journey-list button {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 7px 10px; border: 0; border-radius: 16px;
  background: transparent; text-align: left; transition: background .15s;
}
.journey-list button:hover { background: var(--paper-2); }
.journey-list img { width: 44px; height: 44px; border-radius: 50%; flex: none; background: var(--paper-2); }
.journey-list span { flex: 1; display: flex; flex-direction: column; }
.journey-list b { font-size: 15px; line-height: 1.25; }
.journey-list small { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.journey-list .state { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); }
.journey-list .met .state { background: #2f8a4b; border-color: #2f8a4b; color: #fff; }
.journey-list .state svg { width: 14px; height: 14px; opacity: 0; }
.journey-list .met .state svg { opacity: 1; }

/* ---------- chat ---------- */
.chat {
  position: fixed; top: calc(72px + var(--st)); right: calc(16px + var(--sr)); bottom: calc(16px + var(--sb)); width: min(420px, calc(100vw - 32px));
  display: flex; flex-direction: column; border-radius: 26px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden;
  opacity: 0; transform: translateX(28px) scale(.985); transition: opacity .25s ease, transform .45s var(--ease);
}
.chat.in { opacity: 1; transform: none; }
.grab { display: none; }
.chat header { display: flex; align-items: center; gap: 14px; padding: 16px 14px 14px 16px; border-bottom: 1px solid var(--line); }
.face { flex: none; width: 58px; height: 58px; border-radius: 50%; background: var(--paper-2); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--accent, var(--yellow)); }
.who { flex: 1; }
.who h2 { margin: 0; font: 400 26px/1.05 var(--serif); }
.who p { margin: 3px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.who .when { font-weight: 700; color: var(--ink); }
.x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--paper-2); transition: background .15s, transform .2s var(--ease); }
.x svg { width: 18px; height: 18px; }
.x:hover { background: var(--paper-3); transform: rotate(90deg); }
.log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; scroll-behavior: smooth; }
.msg { max-width: 86%; padding: 11px 15px; border-radius: 20px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.msg.assistant { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(30, 20, 10, .06); }
.msg.user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.msg.typing { display: flex; gap: 4px; padding: 15px 16px; }
.msg.typing::before, .msg.typing::after, .msg.typing .d { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); animation: dot 1s infinite; }
.msg.typing::after { animation-delay: .3s; } .msg.typing .d { animation-delay: .15s; }
.go {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 5px 16px 5px 5px; border: 1.5px solid var(--line);
  border-radius: 999px; background: transparent; font-size: 13.5px; font-weight: 700; animation: rise .4s var(--ease); transition: background .15s, border-color .15s;
}
.go:hover { background: #fff; border-color: var(--ink); }
.links { align-self: stretch; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; animation: rise .4s var(--ease); }
.lk {
  display: flex; align-items: center; gap: 11px; min-height: 56px; padding: 8px 12px 8px 8px; border-radius: 16px; background: #fff; color: var(--ink);
  text-decoration: none; box-shadow: 0 1px 2px rgba(30, 20, 10, .06), 0 0 0 1px var(--line) inset; transition: transform .2s var(--ease), box-shadow .2s;
}
.lk:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(30, 20, 10, .25), 0 0 0 1.5px var(--ink) inset; }
.lk img, .lk .ic { flex: none; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.lk .ic { display: grid; place-items: center; background: var(--ink); color: #fff; font: 800 15px/1 var(--sans); }
.lk span { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.lk b { font-size: 14px; line-height: 1.2; }
.lk small { font-size: 12px; color: var(--ink-2); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk svg { flex: none; width: 16px; height: 16px; color: var(--ink-2); }
.go img { width: 32px; height: 32px; border-radius: 50%; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 16px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 701px) { .chips { flex-wrap: wrap; overflow: visible; } }
.chips button {
  flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent;
  font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .15s, border-color .15s, transform .2s var(--ease);
}
.chips button:hover { border-color: var(--ink); background: #fff; transform: translateY(-1px); }
.ask { display: flex; gap: 8px; padding: 4px 14px 8px; }
.ask input {
  flex: 1; min-height: 50px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff;
  font: 16px var(--sans); color: var(--ink); transition: border-color .15s, box-shadow .2s;
}
.ask input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(19, 41, 75, .08); }
.ask button { width: 50px; height: 50px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: #fff; transition: transform .2s var(--ease); }
.ask button svg { width: 20px; height: 20px; }
.ask button:hover { transform: scale(1.06); }
.note { margin: 0; padding: 0 18px 14px; font-size: 13px; color: var(--ink-2); }

/* ---------- CV ---------- */
.modal {
  position: fixed; inset: 0; display: grid; place-items: center; padding: calc(16px + var(--st)) 16px calc(16px + var(--sb));
  background: rgba(20, 18, 34, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s;
}
.modal.in { opacity: 1; }
.sheet {
  width: min(780px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 26px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden;
  transform: translateY(14px) scale(.985); transition: transform .45s var(--ease);
}
.modal.in .sheet { transform: none; }
.sheet-bar { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 24px; border-bottom: 1px solid var(--line); }
.sheet-bar h2 { flex: 1; margin: 0; font: 400 28px/1 var(--serif); }
.tabs { display: flex; padding: 4px; border-radius: 999px; background: var(--paper-2); }
.tabs button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(30, 20, 10, .1); }
.cv-read { overflow-y: auto; padding: 26px clamp(20px, 5vw, 48px) 30px; }
.cv-head h3 { margin: 0; font: 400 clamp(40px, 7vw, 56px)/1 var(--serif); }
.cv-head p { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.cv-head a { color: var(--ink); font-weight: 700; }
.cv-sec { margin-top: 28px; }
.cv-sec h4 { margin: 0 0 10px; padding-bottom: 8px; font-size: 13px; font-weight: 800; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.cv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 9px 0; }
.cv-row b { font-size: 15.5px; }
.cv-row .t { color: var(--ink-2); font-size: 14px; }
.cv-row .w { font-size: 13px; font-weight: 700; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-row ul { grid-column: 1 / -1; margin: 4px 0 0; padding-left: 18px; font-size: 14px; color: #34405a; }
.cv-row li + li { margin-top: 3px; }
.cv-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-tags span { padding: 5px 11px; border-radius: 999px; background: var(--paper-2); font-size: 13px; font-weight: 600; }
/* the CV as the real PDF */
#cv-modal .sheet { height: min(1100px, 100%); }
.pdfwrap { position: relative; flex: 1; min-height: 0; display: flex; background: var(--paper-3); }
.pdfwrap[hidden] { display: none; }
.pdfdoc { flex: 1; min-width: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; outline: none; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; width: max-content; min-width: 100%; box-sizing: border-box; }
.pdf-page { position: relative; flex: none; background: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 10px 30px rgba(30, 20, 10, .18); animation: pdf-in .45s var(--ease) both; }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.pdf-link { position: absolute; z-index: 2; border-radius: 3px; transition: background .2s; }
.pdf-link:hover, .pdf-link:focus-visible { background: rgba(255, 196, 60, .3); }
.pdf-fallback { padding: 18px; }
.pdf-fallback img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 10px 30px rgba(30, 20, 10, .18); }
.pdfdoc.loading .pdf-pages { min-height: 100%; }
.pdfdoc.loading .pdf-pages::before {
  content: ""; width: min(560px, 82%); aspect-ratio: 612 / 792; margin: 24px auto; border-radius: 4px;
  background: linear-gradient(100deg, #fff 30%, #f4efe4 50%, #fff 70%) 0 0 / 250% 100%; animation: pdf-shimmer 1.4s linear infinite;
  box-shadow: 0 10px 30px rgba(30, 20, 10, .12);
}
@keyframes pdf-shimmer { to { background-position: -250% 0; } }
@keyframes pdf-in { from { opacity: 0; transform: translateY(6px); } }
.pdf-zoom {
  position: absolute; right: 14px; bottom: 14px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 4px;
  border-radius: 999px; background: rgba(255, 255, 255, .94); box-shadow: 0 6px 20px rgba(30, 20, 10, .16);
}
.pdf-zoom button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 19px; line-height: 1; cursor: pointer; }
.pdf-zoom button:hover:not(:disabled) { background: var(--paper-2); }
.pdf-zoom button:disabled { opacity: .3; cursor: default; }
.pdf-zoom span { min-width: 44px; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* pdf.js text layer: invisible text over the drawing, so it can be selected */
.textLayer { position: absolute; inset: 0; overflow: clip; opacity: 1; line-height: 1; text-align: initial; -webkit-text-size-adjust: none; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; caret-color: CanvasText; z-index: 0; }
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; }
.textLayer span.markedContent { top: 0; height: 0; }
.textLayer ::selection { background: rgba(40, 110, 255, .25); }
.textLayer br::selection { background: transparent; }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; user-select: none; }
.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--yellow); color: var(--ink); font-weight: 800; font-size: 14px; text-decoration: none; }
.ghost-dark { background: transparent; border: 1.5px solid var(--line); }
.ghost-dark:hover { border-color: var(--ink); }
.mono-ish { font-size: 14px; color: var(--ink-2); font-weight: 600; }

.fade { position: fixed; inset: 0; background: #1b1610; opacity: 0; pointer-events: none; transition: opacity .3s; }
.fade.in { opacity: 1; }

/* ---------- phones ---------- */
@media (max-width: 700px) {
  .brand { font-size: 23px; }
  .top nav button:not(.icon) { padding: 0 13px; }
  .top nav #btn-journey > span { font-size: 13px; }
  .chat {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: min(66dvh, 580px);
    border-radius: 26px 26px 0 0; padding-bottom: var(--sb); transform: translateY(40px);
  }
  .grab { display: block; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 5px; background: var(--paper-3); }
  .chat header { padding-top: 8px; }
  .face { width: 50px; height: 50px; }
  .who h2 { font-size: 23px; }
  .journey { left: 12px; right: 12px; width: auto; }
  .sheet { border-radius: 22px; }
  .sheet-bar { padding-left: 18px; }
  .sheet-bar h2 { font-size: 23px; }
  .cv-row { grid-template-columns: minmax(0, 1fr); }
  .cv-row .w { text-align: left; }
}
@media (max-width: 420px) { .brand { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; }
}

/* reading the CV up close, in the square */
.reader { position: fixed; left: 50%; bottom: calc(18px + var(--sb)); transform: translate(-50%, 12px); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; transition: opacity .3s, transform .4s var(--ease); pointer-events: none; }
.reader.in { opacity: 1; transform: translate(-50%, 0); }
.reader.in .reader-bar { pointer-events: auto; }
.reader p { margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(19, 41, 75, .72); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.reader-bar { display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.reader-bar button { min-width: 44px; height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--paper-2); color: var(--ink); font: 700 14px/1 var(--sans); display: inline-flex; align-items: center; gap: 8px; justify-content: center; transition: background .15s; }
.reader-bar button:hover { background: var(--paper-3); }
.reader-bar #rd-out, .reader-bar #rd-in { padding: 0; font-size: 20px; }
.reader-bar .primary { background: var(--yellow); }
.reader-bar .primary:hover { background: #ffd21f; }
.reader-bar kbd { font: 700 10px/1 var(--sans); padding: 3px 5px; border-radius: 5px; background: rgba(19, 41, 75, .1); }
.touch .reader-bar kbd { display: none; }
@media (max-width: 520px) { .reader p { font-size: 11.5px; } .reader-bar button { padding: 0 12px; } }

/* ---------- language ---------- */
.lang { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.lang label { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px 0 11px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; }
.lang label svg { width: 18px; height: 18px; flex: none; }
.lang select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.lang label:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }
.intro .lang { position: absolute; top: calc(18px + var(--st)); right: calc(18px + var(--sr)); flex-direction: row-reverse; opacity: 0; transition: opacity 1s ease .9s; }
.intro.shown .lang { opacity: 1; }
.intro .lang label { color: #fff; border: 1.5px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .1); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.intro .lang label:hover { background: rgba(255, 255, 255, .2); }
.lang .offer { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--yellow); color: var(--ink); font-weight: 800; font-size: 14px; box-shadow: 0 10px 26px -8px rgba(245, 196, 0, .6); }
.top .lang label { min-height: 44px; padding: 0 13px 0 12px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 8px 24px -6px rgba(30, 20, 10, .25); font-size: 13px; letter-spacing: .02em; }
.top .lang label:hover { background: #fff; }
@media (max-width: 700px) { .top .lang label span { display: none; } .top .lang label { width: 44px; padding: 0; justify-content: center; } }

/* ---------- tram 28 ---------- */
.ghost.tram { display: inline-flex; align-items: center; gap: 9px; padding: 0 20px 0 16px; }
.ghost.tram svg { width: 22px; height: 22px; color: var(--yellow); }
.ghost:disabled { opacity: .5; }
.journey-list button.tram { background: #fff6d6; margin-bottom: 4px; }
.journey-list button.tram:hover { background: #ffefb8; }
.journey-list .tram .ic { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--ink); }
.journey-list .tram .ic svg { width: 24px; height: 24px; }
body.touring .hint, body.touring .action, body.touring .joy, body.touring #labels { display: none !important; }

.tour { position: fixed; left: 50%; bottom: calc(18px + var(--sb)); width: min(600px, calc(100vw - 24px)); transform: translate(-50%, 24px); opacity: 0; transition: opacity .45s ease, transform .55s var(--ease); z-index: 6; }
.tour.in { opacity: 1; transform: translate(-50%, 0); }
.tour.paused { opacity: 0; transform: translate(-50%, 24px); pointer-events: none; }
.tour-card { position: relative; overflow: hidden; padding: 14px 16px 16px; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.tour-card.swap .tc-head, .tour-card.swap .tc-text { animation: tcIn .5s var(--ease); }
@keyframes tcIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tour-line { display: flex; list-style: none; margin: 0 0 12px; padding: 0 2px; counter-reset: st; }
.tour-line li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--ink-2); text-align: center; line-height: 1.2; }
.tour-line li::before { content: ''; position: absolute; top: 5px; left: -50%; right: 50%; height: 3px; background: var(--paper-3); }
.tour-line li:first-child::before { display: none; }
.tour-line li.done::before, .tour-line li.cur::before, .tour-line li.next::before { background: var(--yellow); }
.tour-line li.next::before { background: linear-gradient(90deg, var(--yellow), var(--paper-3)); background-size: 200% 100%; animation: rail 1.2s linear infinite; }
@keyframes rail { from { background-position: 100% 0; } to { background-position: 0 0; } }
.tour-line i { position: relative; z-index: 1; width: 13px; height: 13px; border-radius: 50%; background: var(--paper); border: 3px solid var(--paper-3); transition: background .3s, border-color .3s, transform .3s var(--ease); }
.tour-line .done i { background: var(--yellow); border-color: var(--yellow); }
.tour-line .cur i { background: var(--ink); border-color: var(--yellow); transform: scale(1.35); }
.tour-line .cur { color: var(--ink); }
.tour-line span { max-width: 9em; }
.tc-head { display: flex; align-items: center; gap: 12px; }
.tc-head .face { width: 52px; height: 52px; border-radius: 50%; flex: none; background: var(--paper-2); box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--yellow); }
.tc-tram { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); }
.tc-tram svg { width: 28px; height: 28px; }
.tc-body { flex: 1; }
.tc-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #a07800; }
.tour-card h3 { margin: 0; font: 400 26px/1.1 var(--serif); }
.tc-role { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.tc-off { flex: none; align-self: flex-start; min-height: 34px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 999px; background: transparent; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.tc-off:hover { border-color: var(--ink); color: var(--ink); }
.tc-text { display: none; margin: 12px 2px 0; font-size: 15.5px; line-height: 1.5; min-height: 3em; -webkit-user-select: text; user-select: text; }
.has-text .tc-text { display: block; }
.tc-btns { display: flex; gap: 10px; margin-top: 14px; }
.tc-btns button { flex: 1; min-height: 46px; border-radius: 999px; font-weight: 800; font-size: 15px; border: 0; }
.tc-talk { background: var(--paper-2); color: var(--ink); }
.tc-talk:hover { background: var(--paper-3); }
.tc-next { background: var(--ink); color: #fff; }
.tc-next.on { background: var(--yellow); color: var(--ink); }
.tc-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--yellow); transform-origin: left; transform: scaleX(0); }
@media (max-width: 700px) {
  .tour { bottom: calc(10px + var(--sb)); }
  .tour-card { padding: 12px 12px 12px; border-radius: 22px; }
  .tour-line li span { display: none; }
  .tour-line li.cur span, .tour-line li.next span { display: block; position: absolute; top: 16px; white-space: nowrap; }
  .tour-line { margin-bottom: 22px; }
  .tc-head .face, .tc-tram { width: 44px; height: 44px; }
  .tour-card h3 { font-size: 22px; }
  .tc-text { font-size: 14.5px; margin-top: 8px; }
  .tc-btns { margin-top: 10px; }
}

/* ---------- the visitor's sky ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.sky { font: 700 12px/1 var(--sans); padding: 7px 10px; border-radius: 999px; background: rgba(20, 16, 30, .28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; text-shadow: none; white-space: nowrap; pointer-events: auto; }
.sky:empty { display: none; }
@media (max-width: 700px) { .sky { display: none; } }

/* ---------- certificates and prizes ---------- */
.badges { align-self: stretch; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; animation: rise .4s var(--ease); }
.badge { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 11px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px var(--line) inset, 0 6px 16px -10px rgba(30, 20, 10, .3); overflow: hidden; }
.badge::after { content: ''; position: absolute; inset: 4px; border-radius: 12px; border: 1px dashed rgba(160, 120, 0, .22); pointer-events: none; }
.badge .marks { display: flex; align-items: center; gap: 6px; }
.badge .mark { width: 38px; height: 38px; flex: none; display: grid; place-items: center; }
.badge .mark svg { width: 100%; height: 100%; display: block; }
.badge.cert .mark { width: 34px; height: 34px; }
.badge .seal { margin-left: auto; padding: 3px 8px; border-radius: 999px; background: #fff6d6; color: #8a6700; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.badge.prize .seal { background: #fdecc8; }
.badge b { font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.badge small { font-size: 11.5px; color: var(--ink-2); line-height: 1.3; }

/* ---------- night → sunset switch ---------- */
.light-pill { display: inline-flex; align-items: center; gap: 8px; margin: -4px 0 14px; padding: 8px 14px 8px 10px; border-radius: 999px; border: 0; background: rgba(255, 214, 102, .16); box-shadow: 0 0 0 1px rgba(255, 214, 102, .45) inset; color: #ffe39a; font: 700 13px/1 var(--sans); cursor: pointer; pointer-events: auto; transition: background .2s, transform .2s; }
.light-pill:hover { background: rgba(255, 214, 102, .28); transform: translateY(-1px); }
.light-pill svg, .top nav .light svg { width: 18px; height: 18px; flex: none; }
.light-pill[hidden], .top nav .light[hidden] { display: none; }
.light .moon, .light-pill .moon { display: none; }
.light.golden .moon, .light-pill.golden .moon { display: inline; }
.light.golden .sun, .light-pill.golden .sun { display: none; }
.top nav .light:not(.golden) { color: #b07a00; }
.top nav .light.nudge { animation: nudge 1s ease-in-out 3; box-shadow: 0 0 0 3px rgba(255, 196, 0, .55); }
@keyframes nudge { 50% { transform: translateY(-2px) scale(1.08); } }
