/* ==========================================================================
   Portfolio: full-screen worlds
   Each app fills the screen in its own colours. JS sets --bg, --ink and --hdr
   on <html> for the current app; everything else follows.
   ========================================================================== */

:root {
  --bg: #F5F3EC;
  --ink: #2E4A3B;
  --hdr: rgba(245, 243, 236, 0.9);
  --topbar: 76px;
  --font-display: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-text: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease-out: cubic-bezier(.2, .9, .3, 1);
  --ease-spring: cubic-bezier(.3, 1.4, .5, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html.locked, html.locked body { overflow: hidden; }

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .9s ease, color .9s ease;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; border-radius: 10px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.noscript { position: relative; z-index: 5; margin: 0; padding: 120px 28px; font-size: 20px; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 clamp(16px, 3vw, 28px);
  transition: background-color .5s ease;
}
.topbar.is-scrolled {
  background-color: var(--hdr);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.brand { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; }
.topnav { display: flex; align-items: center; gap: 6px; }
.topbtn { min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; font-size: 15px; cursor: pointer; }
.topbtn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  border: 2px solid transparent; border-radius: 999px;
  font-weight: 800; font-size: 16px; line-height: 1; text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--ease-spring), background-color .9s ease, color .9s ease, border-color .9s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-small { min-height: 44px; padding: 0 16px; font-size: 15px; font-weight: 700; }
.btn-solid { background-color: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-outline { background: transparent; border-color: currentColor; }
.btn .icon-arrow-down { animation: nudge-down 1.6s ease-in-out infinite; }
.btn.is-nudging { animation: nudge .9s var(--ease-spring); }
@keyframes nudge-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes nudge { 0%, 100% { transform: none; } 30% { transform: translateY(7px) scale(1.06); } 60% { transform: translateY(-3px); } }

/* ---------- Hero: scenes and content blocks ---------- */
.hero { position: relative; height: 100vh; height: 100dvh; min-height: 560px; overflow: hidden; }

.scene {
  position: absolute; inset: 0;
  opacity: 0; transform: scale(1.05);
  pointer-events: none;
  transition: opacity .9s ease, transform 1.4s cubic-bezier(.2, .8, .2, 1);
}
html.is-ready .scene.is-on { opacity: 1; transform: none; }
.scene:not(.is-on) * { animation-play-state: paused !important; }
.scene-fill { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.block { position: absolute; inset: 0; visibility: hidden; transition: visibility 0s linear .45s; }
.block.is-on { visibility: visible; transition-delay: 0s; }
.s { opacity: 0; transform: translateY(22px); transition: opacity .35s ease, transform .45s ease; }
html.is-ready .block.is-on .s { opacity: 1; transform: none; transition: opacity .7s ease, transform .9s var(--ease-out); }
html.is-ready .block.is-on .s1 { transition-delay: .3s; }
html.is-ready .block.is-on .s2 { transition-delay: .38s; }
html.is-ready .block.is-on .s3 { transition-delay: .46s; }
html.is-ready .block.is-on .s4 { transition-delay: .54s; }
html.is-ready .block.is-on .s5 { transition-delay: .62s; }

.hero-copy {
  position: absolute; left: 7%; top: max(calc(var(--topbar) + 16px), 15%);
  width: min(640px, 86%);
  display: flex; flex-direction: column; gap: 16px;
}
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.hero-name { margin: 0; font-weight: 800; font-size: clamp(72px, 11vw, 160px); line-height: .92; letter-spacing: -0.05em; }
.hero-line { margin: 6px 0 0; font-size: clamp(22px, 2.8vw, 36px); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.hero-sub { margin: 0; font-size: 18px; line-height: 1.55; max-width: 42ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.status-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 2px solid currentColor; border-radius: 999px; font-size: 14px; font-weight: 700; }

/* ---------- Mirna hero ---------- */
.mirna-copy { top: max(calc(var(--topbar) + 8px), 12%); gap: 14px; font-family: var(--font-text); }
.mirna-wordmark { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: clamp(88px, 14vw, 184px); line-height: .9; letter-spacing: -0.035em; }
.idot { position: relative; display: inline-block; }
.idot > span { position: absolute; left: 50%; top: .1em; width: .15em; height: .15em; margin-left: -.075em; border-radius: 50%; background: #E3B23C; }
.mistline { display: flex; width: 210px; height: 3px; border-radius: 2px; overflow: hidden; }
.mistline span { flex: 3; background: #A9B8A3; }
.mistline span:nth-child(2) { flex: 1; background: #B4532F; }
.mirna-tagline { margin: 12px 0 0; font-family: var(--font-serif); font-size: clamp(28px, 3.4vw, 44px); line-height: 1.1; color: #2F3431; }
.mirna-copy .hero-sub { color: #3E4541; }

.mirna-demo { position: absolute; right: 7%; top: 24%; width: 360px; font-family: var(--font-text); }
.demo-card { background: #FFFFFF; border-radius: 20px; padding: 18px; box-shadow: 0 30px 60px rgba(46, 74, 59, .2); display: flex; flex-direction: column; gap: 10px; color: #2F3431; }
.demo-head { display: flex; align-items: center; gap: 10px; }
.demo-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #2E4A3B; }
.demo-time { margin-left: auto; font-size: 13px; font-variant-numeric: tabular-nums; color: #4A514D; }
.demo-line { margin: 0; font-size: 14px; line-height: 1.4; }
.demo-line b { color: #2E4A3B; }
.demo-notes { margin-top: 4px; padding: 12px 14px; border-radius: 14px; background: #DCE3D6; display: flex; flex-direction: column; gap: 7px; }
.demo-notes-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.demo-writing { font-size: 12px; font-weight: 600; color: #2E4A3B; }
.demo-note { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.demo-note .dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #B4532F; }
.demo-note .box { flex: none; width: 13px; height: 13px; border: 2px solid #2E4A3B; border-radius: 4px; }
.demo-card .icon { width: 13px; height: 13px; fill: currentColor; stroke: none; }

.wave { display: flex; align-items: center; gap: 3px; height: 22px; }
.wave span { display: block; width: 4px; height: 100%; border-radius: 2px; background: #2E4A3B; animation: wave 1.1s ease-in-out infinite; }
@keyframes wave { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

.l1 { animation: l1 12s ease infinite; }
.l2 { animation: l2 12s ease infinite; }
.l3 { animation: l3 12s ease infinite; }
.n0 { opacity: 0; animation: n0 12s ease infinite; }
.n1 { animation: n1 12s ease infinite; }
.n2 { animation: n2 12s ease infinite; }
.n3 { animation: n3 12s ease infinite; }
@keyframes l1 { 0%, 3% { opacity: 0; transform: translateY(8px); } 7%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
@keyframes l2 { 0%, 12% { opacity: 0; transform: translateY(8px); } 16%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
@keyframes l3 { 0%, 21% { opacity: 0; transform: translateY(8px); } 25%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
@keyframes n0 { 0%, 30% { opacity: 0; } 33%, 44% { opacity: 1; } 47%, 100% { opacity: 0; } }
@keyframes n1 { 0%, 46% { opacity: 0; transform: translateX(-8px); } 50%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
@keyframes n2 { 0%, 55% { opacity: 0; transform: translateX(-8px); } 59%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
@keyframes n3 { 0%, 64% { opacity: 0; transform: translateX(-8px); } 68%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }

/* ---------- Scene motion ---------- */
.pan { animation: pan linear infinite; }
@keyframes pan { to { transform: translateX(-1280px); } }
.mistband { animation: mistband 16s ease-in-out infinite; }
@keyframes mistband { 0%, 100% { transform: translateX(-70px); } 50% { transform: translateX(70px); } }
.sunbob { animation: sunbob 7s ease-in-out infinite; }
@keyframes sunbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.halo { transform-box: fill-box; transform-origin: center; animation: halo 4s ease-out infinite; }
@keyframes halo { from { transform: scale(.9); opacity: .8; } to { transform: scale(1.5); opacity: 0; } }
.petal { transform-box: fill-box; transform-origin: center; animation: petalfall 10s linear infinite; }
@keyframes petalfall { 0% { transform: translate(0, 0) rotate(0deg); opacity: 0; } 8% { opacity: 1; } 100% { transform: translate(-560px, 640px) rotate(600deg); opacity: 0; } }
.float { animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.rot { transform-box: view-box; animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.flow { animation: flow 2.4s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -100; } }
.bobr { transform-box: fill-box; transform-origin: center; animation: bobr 5s ease-in-out infinite; }
@keyframes bobr { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-24px) rotate(30deg); } }
.spinf { transform-box: fill-box; transform-origin: center; animation: spin 12s linear infinite; }
.tilt { animation: tilt 6s ease-in-out infinite; }
@keyframes tilt { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-10px); } }
.orb { transform-box: view-box; animation: spin 20s linear infinite; }
.tw { animation: tw 3s ease-in-out infinite; }
@keyframes tw { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.halo2 { transform-box: fill-box; transform-origin: center; animation: halo 3.2s ease-out infinite; }
.blob { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; animation: blob 9s ease-in-out infinite; }
@keyframes blob { 0%, 100% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; transform: rotate(0deg); } 50% { border-radius: 63% 37% 38% 62% / 58% 63% 37% 42%; transform: rotate(25deg); } }
.bounce { animation: bounce .9s cubic-bezier(.3, 0, .5, 1) infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-120px); } }

.shot-wrap { position: absolute; right: 11%; top: 31%; }
.shot { width: 320px; height: 230px; border-radius: 22px; border: 3px solid #1A1010; background: #FFFFFF; box-shadow: 14px 14px 0 #1A1010; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: #1A1010; }

/* ---------- Corner fan ---------- */
.fan { position: absolute; right: 0; bottom: 0; z-index: 40; width: 270px; height: 130px; }
.fan[hidden] { display: none; }
.fan-pad {
  position: absolute; right: 0; bottom: 0;
  width: 640px; height: 600px; padding: 0; border: 0;
  border-top-left-radius: 100%;
  background: radial-gradient(circle at 100% 100%, rgba(0, 0, 0, .26), rgba(0, 0, 0, 0) 72%);
  opacity: 0; pointer-events: none; cursor: default;
  transition: opacity .4s ease;
}
.fan.is-open .fan-pad { opacity: 1; pointer-events: auto; }
.deck {
  position: absolute; right: 10px; bottom: 10px;
  width: 250px; height: 108px; padding: 0 0 14px 10px;
  border: 0; border-radius: 22px; background: transparent; cursor: pointer;
  display: flex; align-items: flex-end; justify-content: flex-start;
}
.deck-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  background-color: var(--bg); color: var(--ink);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  font-weight: 800; font-size: 14px;
  transition: opacity .3s ease, background-color .9s ease, color .9s ease;
}
.fan.is-open .deck-label { opacity: 0; }

.fan-card {
  position: absolute; right: 0; bottom: 0;
  width: 170px; height: 224px; padding: 0; border: 0;
  background: transparent; cursor: pointer; pointer-events: none;
  transition: transform .55s cubic-bezier(.3, 1.3, .5, 1);
}
.fan.is-open .fan-card { pointer-events: auto; }
.fan-card-in {
  display: flex; flex-direction: column;
  width: 100%; height: 100%; padding: 14px;
  border-radius: 20px; overflow: hidden; text-align: left;
  background: var(--card-bg); color: var(--card-ink);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .28);
  transition: transform .25s var(--ease-spring);
}
.fan-card.is-current .fan-card-in { box-shadow: 0 0 0 3px var(--ink), 0 14px 32px rgba(0, 0, 0, .28); }
.fan:not(.is-open) .fan-card-in { animation: peekbob 4s ease-in-out infinite; }
@keyframes peekbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.fan.is-open .fan-card:hover .fan-card-in,
.fan.is-open .fan-card:focus-visible .fan-card-in { transform: translateY(-12px) scale(1.05); }
.fan-card:focus-visible { outline: none; }
.fan-card:focus-visible .fan-card-in { outline: 3px solid var(--card-ink); outline-offset: -6px; }
.fan-card-top { display: flex; justify-content: space-between; align-items: center; min-height: 22px; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.fan-here { display: none; padding: 3px 8px; border-radius: 999px; font-size: 11px; letter-spacing: .04em; background: var(--card-ink); color: var(--card-bg); }
.fan-card.is-current .fan-here { display: inline-flex; }
.fan-card-art { position: relative; display: block; flex: 1; margin: 10px 0; border-radius: 12px; overflow: hidden; }
.fan-card-art svg { display: block; width: 100%; height: 100%; }
.fan-card-name { display: block; font-weight: 800; font-size: 22px; line-height: 1.05; letter-spacing: -0.02em; }
.fan-card-line { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; line-height: 1.3; }

/* ---------- Details (below the fold) ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.section { padding: 112px 0 88px; }
.stack { display: flex; flex-direction: column; gap: 64px; }
.intro { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.feature { border-radius: 22px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.feature p { margin: 0; font-size: 15px; line-height: 1.55; }
.tag { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.d-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.d-lead { margin: 0; font-size: 19px; line-height: 1.6; }

/* Mirna details */
.details-mirna { background: #FBFAF6; color: #2E4A3B; font-family: var(--font-text); }
.details-mirna h2, .details-mirna h3, .details-mirna h4 { margin: 0; font-family: var(--font-serif); font-weight: 400; }
.details-mirna .d-lead { color: #3E4541; }
.m-h2 { font-size: clamp(36px, 4.6vw, 56px); line-height: 1.05; letter-spacing: -0.02em; }
.m-h3 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.1; }
.m-feature { background: #F5F3EC; border: 1px solid #DCE3D6; }
.m-feature h3 { font-size: 22px; font-weight: 500; }
.m-feature p { color: #3E4541; }
.m-feature .icon { width: 26px; height: 26px; stroke-width: 2; }
.m-options { display: flex; flex-direction: column; gap: 22px; }
.m-option { border-radius: 22px; padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.m-option h4 { font-size: 24px; font-weight: 500; }
.m-option p { margin: 0; font-size: 15px; line-height: 1.55; }
.m-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; font-size: 14px; }
.m-rows span { display: flex; justify-content: space-between; gap: 8px; }
.opt-local { background: #2E4A3B; color: #F5F3EC; }
.opt-local p { color: #DCE3D6; }
.opt-notes { background: #DCE3D6; color: #2E4A3B; }
.opt-stt { background: #E3B23C; color: #2E4A3B; }
.opt-notes p, .opt-stt p { color: #2F3431; }
.tag-gold { background: #E3B23C; color: #2E4A3B; }
.tag-serra { background: #2E4A3B; color: #F5F3EC; }
.tag-moss { background: #DCE3D6; color: #2E4A3B; }
.pill-done { background: #2E4A3B; color: #F5F3EC; }
.pill-next { background: #DCE3D6; color: #2E4A3B; }
.pill-later { border: 1.5px solid #A9B8A3; color: #2E4A3B; }
.btn-serra { background: #2E4A3B; border-color: #2E4A3B; color: #FBFAF6; }

/* Generic (placeholder) details: colours come from --d-* set inline */
.details-generic { background: var(--d-bg); color: var(--d-ink); }
.g-h2 { margin: 0; font-weight: 800; font-size: clamp(36px, 4.6vw, 56px); line-height: 1.02; letter-spacing: -0.03em; }
.g-feature { background: var(--d-card); color: var(--d-card-ink); }
.g-feature h3 { margin: 0; font-weight: 800; font-size: 22px; }
.g-shot { height: 200px; border-radius: 22px; border: 2px dashed currentColor; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.btn-inverse { background: var(--d-ink); border-color: var(--d-ink); color: var(--d-bg); }

/* ---------- About (footer) ---------- */
.about { background: #16181D; color: #F5F3EC; padding: 72px 0 56px; }
.about-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; }
.about-copy { max-width: 620px; display: flex; flex-direction: column; gap: 14px; }
.about-eyebrow { color: #C9CCD3; font-size: 13px; }
.about-title { margin: 0; font-weight: 800; font-size: clamp(32px, 4vw, 52px); line-height: 1; letter-spacing: -0.03em; }
.about-text { margin: 0; font-size: 18px; line-height: 1.55; color: #C9CCD3; }
.about-text a { color: #F5F3EC; text-underline-offset: 3px; }
.about-links { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-light { background: #F5F3EC; border-color: #F5F3EC; color: #16181D; }
.btn-ghost-light { background: transparent; border-color: #F5F3EC; color: #F5F3EC; }

/* ---------- Small screens ---------- */
@media (max-width: 1100px) {
  .mirna-demo { display: none; }
}
@media (max-width: 900px) {
  .hide-sm { display: none !important; }
  .hero-copy { left: 24px; right: 24px; width: auto; }
}
@media (max-width: 700px) {
  .fan { transform: scale(.66); transform-origin: 100% 100%; }
  .section { padding: 96px 0 72px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  body, .scene, .block, .s, .btn, .fan-card, .fan-card-in, .fan-pad, .topbar { transition-duration: .01ms !important; transition-delay: 0s !important; }
}
