/* =========================================================
   STYLES - layout, type and animation.
   Colours come from css/theme.css (var(--...)).
   ========================================================= */

/* ---------- base ---------- */
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* smooth colour fades on theme/niche switch */
  transition: --bg .35s ease, --text .35s ease, --accent .35s ease, --btn .35s ease, --surface .35s ease, --surface-2 .35s ease;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Figtree', 'Helvetica Neue', Arial, sans-serif;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
a { color: inherit; }
button { font-family: inherit; color: inherit; }
img, video { display: block; }
.wrap { max-width: 940px; margin: 0 auto; padding: 0 18px; }
.poppins { font-family: 'Poppins', sans-serif; }
.hand { font-family: 'Caveat', cursive; color: var(--accent); }
.muted { color: var(--muted); }
/* handwritten note + hand-drawn arrow (js: note()) */
.pt { display: inline-flex; align-items: center; gap: .2em; line-height: 1.1; }
.pt-up { align-items: flex-end; }
.arw { flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.arw-left { width: 1.7em; height: 1em; }
.arw-up { width: 1.05em; height: 1.55em; margin-bottom: .3em; }
.pt-down { align-items: flex-start; }
.arw-down { width: 1.05em; height: 1.55em; margin-top: .3em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; padding: 11px 14px;
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active, .pill:active, .ghost:active, .round:active, .want:active, .dm button:active { transform: scale(.97); }
.btn-main { background: var(--btn); color: var(--btn-text); }
.btn-alt { background: var(--surface-2); color: var(--text); }

.h2 { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 26px; letter-spacing: -1px; }
section.block { padding: 0 0 52px; display: flex; flex-direction: column; gap: 20px; }
.row-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.hrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.hrow .hand { font-size: 22px; transform: rotate(-2deg); }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(16px + env(safe-area-inset-top, 0)) 0 6px; }
.pill {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 13px; cursor: pointer;
  transition: transform .15s ease;
}
.pill svg { transition: transform .5s ease; }
.pill:hover svg { transform: rotate(40deg); }

/* ---------- profile ---------- */
.profile { padding: 14px 0 6px; display: flex; flex-direction: column; gap: 14px; }
.prow { display: flex; align-items: center; gap: clamp(16px, 5vw, 40px); }
.avatar {
  flex: 0 0 auto; width: clamp(84px, 22vw, 136px); aspect-ratio: 1; border-radius: 50%;
  background: var(--surface-2); border: 3px solid var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.name h1 { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: clamp(22px, 4vw, 30px); letter-spacing: -1px; }
.stats { display: flex; gap: clamp(16px, 5vw, 36px); }
.stat b { display: block; font-family: 'Poppins', sans-serif; font-size: 19px; letter-spacing: -1px; }
.stat span { font-size: 13px; color: var(--muted); }
.pbtns { display: flex; gap: 8px; }
.pbtns .btn { flex: 1; }
.pbtns .btn-main { max-width: 200px; }
.pbtns .btn-alt { max-width: 140px; }
.bio { display: flex; flex-direction: column; gap: 4px; max-width: 560px; }
.bio p { margin: 0; font-size: 15px; line-height: 1.5; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fact { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.fact svg { flex: 0 0 auto; }
.facts .hand { line-height: 1; transform: rotate(-2deg); }

/* ---------- story highlights ---------- */
.highlights { padding: 8px 0 16px; display: flex; gap: 18px; overflow-x: auto; }
.hl { flex: 0 0 auto; background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; }
.hl-ring { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--accent); padding: 3px; display: flex; transition: transform .2s ease; }
.hl-ring span { flex: 1; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-family: 'Caveat', cursive; font-weight: 700; font-size: 20px; }
.hl:hover .hl-ring { transform: scale(1.06); }
.hl:active .hl-ring { transform: scale(.95); }
.highlights .pt { flex: 0 0 auto; align-self: flex-start; margin-top: 20px; white-space: nowrap; }

/* ---------- tabs ---------- */
.tabs { display: flex; justify-content: center; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.tab {
  position: relative; flex: 1; max-width: 170px; min-height: 52px; background: none; border: 0;
  color: var(--faint); font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: -.3px; cursor: pointer;
  transition: color .2s ease;
}
.tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform .25s ease;
}
.tab.on { color: var(--text); }
.tab.on::after { transform: scaleX(1); }

/* ---------- video grid ---------- */
.gridnote { display: flex; justify-content: flex-end; padding: 10px 4px 6px; font-size: 22px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-bottom: 48px; }
.cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile {
  position: relative; width: 100%; aspect-ratio: 9 / 16; border: 0; padding: 0; border-radius: 12px; overflow: hidden;
  cursor: pointer; color: #fff; text-align: left; background: var(--cover-1);
  transition: box-shadow .25s ease, transform .2s ease;
}
.cell:nth-child(3n+2) .tile { background: var(--cover-2); }
.cell:nth-child(3n)   .tile { background: var(--cover-3); }
.tile:hover { transform: translateY(-2px); }
.tile:active { transform: scale(.98); }
.tile.is-active { box-shadow: 0 0 0 3px var(--accent); }
.tile img, .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tile:hover img, .tile:hover video { transform: scale(1.04); }
.badge {
  position: absolute; top: 8px; left: 8px; max-width: calc(100% - 16px); z-index: 2;
  display: flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: #1A1A1A; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge .pin { flex: 0 0 auto; display: flex; }
.badge .lbl { overflow: hidden; text-overflow: ellipsis; }
.play {
  position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; z-index: 2;
  border-radius: 50%; border: 2px solid #fff; display: flex; align-items: center; justify-content: center;
  transition: opacity .25s ease, transform .25s ease;
}
.tile:hover .play { transform: scale(1.1); }
.tile.has-video.is-active .play { opacity: 0; }
.scrim { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); z-index: 1; }
.tmeta { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; z-index: 2; }
.tmeta b { font-size: 14px; line-height: 1.25; }
.tmeta span { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #E8E8E8; }
.tdl { align-self: flex-start; margin-bottom: 8px; display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; transition: color .2s ease, border-color .2s ease, transform .15s ease; }
.tdl svg { width: 13px; height: 13px; color: var(--accent); }
.tdl:hover { color: var(--text); border-color: var(--accent); }
.tdl:active { transform: scale(.97); }

/* ---------- following + comments ---------- */
.brands { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 6px; }
.brand { flex: 0 0 auto; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); text-align: center; }
.circle {
  width: 72px; height: 72px; border-radius: 50%; background: var(--chip); color: var(--chip-text);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -1px;
}
.circle img { width: 100%; height: 100%; object-fit: cover; }
.comment { display: flex; flex-direction: column; gap: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.crow { display: flex; gap: 14px; align-items: flex-start; }
.cav { flex: 0 0 auto; width: 44px; height: 44px; font-size: 16px; }
.cbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.who { font-size: 14px; color: var(--muted); }
.who b { color: var(--text); }
.txt { font-size: 16px; line-height: 1.5; }
.when { font-size: 13px; color: var(--faint); }
.likes { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.likes svg { transition: transform .2s ease; }
.comment:hover .likes svg { transform: scale(1.15); }
.reply { display: flex; gap: 12px; align-items: flex-start; margin-left: 58px; }
.reply .who { font-size: 13px; }
.reply .txt { font-size: 15px; line-height: 1.45; }
.rav { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--accent); }

/* ---------- deliverables + Q&A ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.card { background: var(--surface); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 10px; transition: transform .2s ease; }
.card:hover { transform: translateY(-3px); }
.card b { font-family: 'Poppins', sans-serif; font-size: 22px; letter-spacing: -1px; }
.card span { font-size: 14px; line-height: 1.45; color: var(--muted); }
.qs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.q { border-radius: 16px; overflow: hidden; background: var(--chip); color: var(--chip-text); text-align: center; transition: transform .2s ease; }
.q:hover { transform: translateY(-3px); }
.qh { background: var(--accent); color: var(--accent-text); padding: 10px 16px; font-size: 13px; font-weight: 700; }
.qq { padding: 18px; font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 18px; letter-spacing: -.5px; }
.qa { padding: 0 18px 20px; font-size: 15px; line-height: 1.5; color: var(--chip-muted); }

/* ---------- DM ---------- */
.dm { margin: 0; display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.dmrow2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field span { font-size: 13px; font-weight: 700; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
  font-family: inherit; font-size: 16px; line-height: 1.5; color: var(--text); outline: none; transition: border-color .2s ease;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:hover, .field textarea:hover, .field input:focus, .field textarea:focus { border-color: var(--accent); }
.dm button { align-self: flex-end; border: 0; cursor: pointer; padding: 12px 22px; border-radius: 999px; background: var(--btn); color: var(--btn-text); font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 15px; transition: transform .15s ease, filter .15s ease; }
.dm button:hover { filter: brightness(1.06); }
.dmrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ghost { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: none; font-size: 14px; font-weight: 700; cursor: pointer; transition: transform .15s ease; }
footer { padding: 0 0 44px; text-align: center; font-size: 14px; color: var(--faint); }
footer .hand { display: block; margin-bottom: 6px; font-size: 22px; transform: rotate(-1.5deg); }

/* ---------- pop-ups ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--overlay); overflow-y: auto; overflow-x: hidden; color: #fff; animation: fade .2s ease both; }
.x { position: fixed; top: calc(14px + env(safe-area-inset-top, 0)); right: 14px; z-index: 3; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #3A3A3A; color: #fff; font-size: 22px; cursor: pointer; transition: transform .2s ease; }
.x:hover { transform: rotate(90deg); }
.mwrap { min-height: 100%; padding: 64px 16px 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px; }
.mwrap > * { animation: rise .3s cubic-bezier(.2, .8, .2, 1) both; }
.mwrap > *:nth-child(2) { animation-delay: .06s; }
/* ‹ › switch between videos: new screen tweens in */
.mwrap.in-right  { animation: inR .35s cubic-bezier(.2, .8, .2, 1) both; }
.mwrap.in-left   { animation: inL .35s cubic-bezier(.2, .8, .2, 1) both; }
.mwrap.in-right > *, .mwrap.in-left > * { animation: none; }
.player { position: relative; height: min(78vh, 720px); max-width: 100%; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--cover-1); }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 3; }
.pcap { position: absolute; left: 16px; right: 16px; bottom: 18px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.pcap span { font-size: 14px; line-height: 1.4; color: #EEE; }
.bigplay { width: 70px; height: 70px; border-radius: 50%; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; }
.minfo { flex: 1 1 300px; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.minfo .meta { font-size: 13px; color: #BBB; }
.minfo h3 { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 26px; letter-spacing: -1px; line-height: 1.15; }
.mlist { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; border-top: 1px solid #444; }
.mlist b { display: block; font-size: 14px; }
.mlist p { margin: 0; font-size: 15px; line-height: 1.5; color: #CCC; }
.mlist p.skill { color: var(--accent-on-dark); }
.mnav { display: flex; gap: 10px; padding-top: 6px; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 0; background: #3A3A3A; color: #fff; font-size: 20px; cursor: pointer; transition: transform .15s ease, background .2s ease; }
.round:hover { background: #4A4A4A; }
.want { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 999px; background: #fff; color: #262626; font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 15px; text-decoration: none; transition: transform .15s ease; }
.mnote { font-size: 22px; line-height: 1.15; color: var(--accent-on-dark); transform: rotate(-1.5deg); }
.dl { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid #666; color: #fff; font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 14px; text-decoration: none; transition: transform .15s ease, border-color .2s ease; }
.dl svg { color: var(--accent-on-dark); }
.dl:hover { border-color: var(--accent-on-dark); }
.dl:active { transform: scale(.97); }
.receipt { width: 100%; max-width: 360px; background: #F4F4F4; color: #262626; padding: 28px 24px 30px; font-family: 'Courier Prime', 'Courier New', monospace; font-size: 15px; display: flex; flex-direction: column; gap: 10px; }
.mwrap > .receipt { animation: print .45s cubic-bezier(.2, .8, .2, 1) both; }
.receipt .r { display: flex; justify-content: space-between; gap: 12px; }
.receipt hr { border: 0; border-top: 2px dashed #262626; margin: 6px 0; width: 100%; }
.receipt .c { text-align: center; }
.receipt .s { font-size: 13px; color: #555; }
.receipt .tier { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.tier .tn { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tier .tn b { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 16px; letter-spacing: -.3px; }
.tier .tn span { font-size: 13px; color: #777; }
.tier .tp { flex: 0 0 auto; text-align: right; }
.tier .tp small { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #777; }
.tier .tp b { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -.5px; color: var(--receipt-accent); }
.receipt .hand { font-size: 21px; line-height: 1.15; color: var(--receipt-accent); transform: rotate(-2deg); }
.panel { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.panel h3 { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 28px; letter-spacing: -1px; }
.panel .body { font-size: 17px; line-height: 1.6; color: #DDD; }
.panel .hand { font-size: 24px; color: var(--accent-on-dark); }
.step { background: #333; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.step span { color: #CCC; font-size: 15px; }

/* ---------- animations ---------- */
@keyframes fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise  { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes print { from { opacity: 0; transform: translateY(-24px) rotate(1deg); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: rotate(1deg); clip-path: inset(0 0 0 0); } }
@keyframes pop   { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes inR   { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes inL   { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
@keyframes swap  { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* entrance: profile on first load */
.intro .avatar, .intro .pinfo, .intro .bio, .intro .facts, .intro .highlights { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.intro .pinfo { animation-delay: .06s; }
.intro .bio, .intro .facts { animation-delay: .12s; }
.intro .highlights { animation-delay: .18s; }
.intro .name svg { animation: pop .45s .35s ease both; }

/* niche switch: header copy fades in */
.swapping .swap { animation: swap .3s ease both; }

/* scroll reveal: sections and tiles fade up as they enter */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }

/* phones: smaller video in the pop-up so the details peek out, plus a scroll hint */
.mhint { display: none; }
@media (max-width: 640px) {
  .mwrap { padding: 60px 16px 28px; gap: 14px; }
  .player { height: min(52vh, 460px); }
  .mhint { display: inline-flex; flex: 0 0 100%; justify-content: center; font-size: 21px; }
  .minfo { gap: 14px; }
  .minfo h3 { font-size: 22px; }
}

/* ---------- small screens ---------- */
@media (max-width: 480px) {
  .badge { font-size: 10.5px; padding: 4px 7px; top: 6px; left: 6px; max-width: calc(100% - 12px); }
  .tmeta b { font-size: 12.5px; }
  .play { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
}

/* ---------- respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
