:root {
  --bg: #0a0c10;
  --bg-alt: #0e1117;
  --card: #141821;
  --border: #232937;
  --text: #e8ebf2;
  --muted: #8a93a6;
  --accent: #5eead4;
  --accent-2: #818cf8;
  --up: #34d399;
  --down: #f87171;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.container { width: min(1120px, 100% - 48px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { text-align: right; font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px max(24px, calc((100vw - 1120px) / 2));
  background: rgba(10, 12, 16, .7); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.scrolled { border-color: var(--border); }
.brand { font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.nav nav { display: flex; gap: 28px; align-items: center; font-size: 14px; color: var(--muted); }
.nav nav a:hover { color: var(--text); }
.btn-small { border: 1px solid var(--border); padding: 6px 14px; border-radius: 999px; color: var(--text); }
.btn-small:hover { border-color: var(--accent); }

/* Hero */
.hero {
  padding: 180px 0 100px;
  background:
    radial-gradient(700px 400px at 80% 0%, rgba(129, 140, 248, .18), transparent 60%),
    radial-gradient(600px 400px at 10% 20%, rgba(94, 234, 212, .12), transparent 60%);
}
.eyebrow {
  font: 500 13px "JetBrains Mono", monospace; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
h1 { font-size: clamp(40px, 7vw, 76px); line-height: 1.05; letter-spacing: -.035em; font-weight: 700; }
h1 em, h2 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.025em; line-height: 1.15; margin-bottom: 8px; }
h3 { font-size: 18px; letter-spacing: -.01em; }
.lede { color: var(--muted); font-size: 19px; max-width: 620px; margin-top: 22px; }
.cta { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 15px;
  background: var(--accent); color: #04110e; transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(94, 234, 212, .25); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { border-color: var(--accent); box-shadow: none; }
.btn.big { font-size: 18px; padding: 16px 30px; margin-top: 28px; }
.stats { display: flex; gap: 48px; margin-top: 70px; flex-wrap: wrap; }
.stats strong { display: block; font-size: 30px; letter-spacing: -.02em; }
.stats span { color: var(--muted); font-size: 14px; }

/* Sections */
.section { padding: 100px 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.about { display: grid; grid-template-columns: 1fr 1.6fr; gap: 60px; }
.about-body p { color: #c3c9d6; margin-bottom: 16px; font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chips li { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--muted); }

/* Cards & Portfolio */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.section.tight { padding-top: 20px; }
.up { color: var(--up); } .down { color: var(--down); }
.flash-up { animation: fu 1s; } .flash-down { animation: fd 1s; }
@keyframes fu { from { background: rgba(52, 211, 153, .25); } }
@keyframes fd { from { background: rgba(248, 113, 113, .25); } }

.folio {
  padding: clamp(24px, 4vw, 48px);
  background:
    radial-gradient(600px 260px at 50% 0%, rgba(94, 234, 212, .09), transparent 70%),
    var(--card);
}
.folio-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.folio-top .eyebrow { margin: 0; }
.folio-hero { text-align: center; margin: 28px 0 12px; }
.folio-value {
  font: 600 clamp(48px, 10vw, 112px)/1 "JetBrains Mono", monospace; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.folio-sub { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin-top: 16px; font: 500 16px "JetBrains Mono", monospace; color: var(--muted); }
.folio-sub b { font-weight: 500; }

.chart-wrap { position: relative; height: clamp(200px, 30vw, 320px); margin-top: 24px; }
#chart { width: 100%; height: 100%; display: block; overflow: visible; }
#chart .grid-line { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 5; }
#chart .line { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
#chart .cursor { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.tip {
  position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; z-index: 2;
  background: #0b0e14; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
  font: 500 13px "JetBrains Mono", monospace; white-space: nowrap;
}
.tip small { display: block; color: var(--muted); font-size: 11px; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 8px; font: 12px "JetBrains Mono", monospace; color: var(--muted); }

.folio-body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: 36px; margin-top: 28px; align-items: stretch; }
.main-col { display: flex; flex-direction: column; min-width: 0; }
.main-col .chart-wrap { flex: 1; min-height: 300px; margin-top: 0; height: auto; }
.htable { border-top: 1px solid var(--border); align-self: start; }
.hrow { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); }
.hrow.head { padding: 8px 2px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hrow .w { font: 500 13px "JetBrains Mono", monospace; color: var(--muted); font-variant-numeric: tabular-nums; }
.hrow .asset { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; font-size: 14px; }
.hrow .ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 700 12px "Inter", sans-serif; color: #fff; }
.hrow .ico.emoji { background: rgba(255, 255, 255, .08); font-size: 14px; }
.hrow img.ico { object-fit: contain; background: rgba(255, 255, 255, .06); }
.hrow .ret { font: 600 13px "JetBrains Mono", monospace; text-align: right; font-variant-numeric: tabular-nums; }
.hrow.head > :last-child { text-align: right; }
.status { font-size: 13px; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 10px; color: #ef4444; font: 700 14px "JetBrains Mono", monospace; letter-spacing: .14em; }
.live-dot { position: relative; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #ef4444; animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
.live.off { color: var(--muted); }
.live.off .live-dot, .live.off .live-dot::after { background: var(--muted); animation: none; }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(3); opacity: 0; } }
#updated { margin-top: 28px; text-align: center; }

/* Project grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-top: 36px; }
.project {
  padding: 26px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.project::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: 0; transition: opacity .2s;
}
.project:hover { transform: translateY(-4px); border-color: #35405a; }
.project:hover::before { opacity: 1; }
.project .tag { font: 500 12px "JetBrains Mono", monospace; color: var(--accent); }
.project p { color: var(--muted); font-size: 15px; flex: 1; }
.project .tech { display: flex; flex-wrap: wrap; gap: 6px; }
.project .tech span { font-size: 12px; padding: 3px 10px; background: rgba(255, 255, 255, .05); border-radius: 999px; color: #b4bccb; }
.project .links { display: flex; gap: 16px; font-size: 14px; font-weight: 500; }
.project .links a { color: var(--accent); }
.project .links a:hover { text-decoration: underline; }

/* Contact */
.contact { text-align: center; }
.contact .lede { margin-inline: auto; }
.socials { display: flex; justify-content: center; gap: 28px; margin-top: 34px; color: var(--muted); }
.socials a:hover { color: var(--accent); }

.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: 14px; }
.footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; gap: 28px; }
  .folio-body { grid-template-columns: 1fr; gap: 28px; }
  .main-col .chart-wrap { min-height: 220px; }
  .nav nav a:not(.btn-small) { display: none; }
  .section { padding: 72px 0; }
  .hero { padding-top: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .hrow { grid-template-columns: 46px 1fr auto; }
}

/* One-screen first view (laptops): intro + live card + links */
.intro { padding: 0; }
.intro .eyebrow { margin-bottom: 4px; }
.intro h1, .intro h2 { font-size: clamp(24px, 3.4vw, 42px); letter-spacing: -.03em; line-height: 1.1; }
.folio-links { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 14px; }
.folio-links .btn { padding: 10px 22px; font-size: 14px; }
.link-row { display: flex; gap: 24px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.link-row a:hover { color: var(--accent); }
.first-screen { padding-top: 84px; padding-bottom: 18px;
  background: radial-gradient(700px 400px at 80% 0%, rgba(129, 140, 248, .14), transparent 60%), radial-gradient(600px 400px at 10% 10%, rgba(94, 234, 212, .09), transparent 60%); }
.first-screen .section.tight { padding: 14px 0 0; }

@media (min-width: 861px) and (min-height: 600px) {
  .first-screen { display: flex; flex-direction: column; height: 100svh; }
  .first-screen #folio { flex: 1; min-height: 0; display: flex; }
  .first-screen #folio > .container { flex: 1; min-height: 0; display: flex; }
  .first-screen .folio { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: clamp(14px, 2.2vh, 26px) clamp(20px, 3vw, 40px); }
  .first-screen .folio-hero { margin: clamp(2px, 1.2vh, 12px) 0 0; }
  .first-screen .folio-value { font-size: clamp(38px, 10.5vh, 92px); }
  .first-screen .folio-sub { margin-top: clamp(6px, 1.2vh, 14px); font-size: clamp(13px, 1.9vh, 16px); }
  .first-screen .folio-body { flex: 1; min-height: 0; margin-top: clamp(8px, 1.8vh, 20px); }
  .first-screen .main-col .chart-wrap { min-height: 0; }
  .first-screen .htable { display: flex; flex-direction: column; min-height: 0; align-self: stretch; }
  .first-screen .hrow { flex: 1 1 0; min-height: 0; max-height: 42px; padding-block: 0; }
  .first-screen .hrow.head { flex: 0 0 auto; padding-block: 6px; max-height: none; }
  .first-screen #updated { margin-top: clamp(4px, 1vh, 12px); font-size: 11px; }
}
@media (max-width: 860px), (max-height: 599px) {
  .first-screen { padding-top: 96px; }
}
@media (min-width: 861px) and (min-height: 600px) {
  .first-screen .hrow .ico { width: clamp(18px, 3.3vh, 26px); height: clamp(18px, 3.3vh, 26px); font-size: clamp(9px, 1.5vh, 12px); }
  .first-screen .hrow .asset, .first-screen .hrow .ret, .first-screen .hrow .w { font-size: clamp(11px, 1.75vh, 14px); }
}
@media (min-width: 861px) and (min-height: 600px) {
  .first-screen #folio > .container { flex: 0 1 auto; }
  .first-screen .folio { width: 100%; }
  .first-screen .folio-body { grid-template-rows: minmax(0, 1fr); }
  .first-screen .hrow { line-height: 1.2; }
}

/* LIVE badge sits on the card's top edge, outside the card body */
.folio { position: relative; }
.folio > .live {
  position: absolute; top: 0; left: clamp(20px, 3vw, 40px); transform: translateY(-50%);
  padding: 8px 18px 8px 16px; gap: 12px; font-size: 18px; border-radius: 999px;
  background: var(--bg); border: 1px solid rgba(239, 68, 68, .45); z-index: 3;
}
.folio > .live.off { border-color: var(--border); }
.folio > .live .live-dot { width: 14px; height: 14px; }
.folio-sub { font-size: clamp(18px, 3vh, 28px); }
.first-screen .section.tight { padding-top: 26px; }

.hrow span.ico { font-weight: 800; }

/* Strategies dropdown (opens upward: the button sits at the bottom of the first screen) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; user-select: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu .caret { display: inline-block; font-size: 12px; transition: transform .2s; }
.menu[open] .caret { transform: rotate(180deg); }
.menu-list {
  position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 20; min-width: 280px; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.menu-list a { display: block; padding: 11px 14px; border-radius: 9px; font-size: 14px; font-weight: 500; }
.menu-list a:hover, .menu-list a:focus-visible { background: rgba(94, 234, 212, .1); color: var(--accent); outline: none; }

.menu .caret { font-size: 16px; font-weight: 700; line-height: 1; }
.menu-list a { display: flex; align-items: center; gap: 10px; }

/* Project cards with a photo on top */
.project.has-img { padding-top: 0; }
.project .proj-img { display: block; width: calc(100% + 52px); max-width: none; margin: 0 -26px 6px; aspect-ratio: 4 / 3; object-fit: cover; background: #0b0e14; }
.project.has-img:hover .proj-img { filter: brightness(1.06); }

/* A wide project card spans two columns (side-by-side CAD views etc.) */
.grid { grid-auto-flow: dense; }
@media (min-width: 861px) { .project.wide { grid-column: span 2; } }

.project .proj-img.fit-contain { object-fit: contain; background: #000; }

/* Clickable card images + full-size viewer */
.project .img-btn { display: block; position: relative; width: calc(100% + 52px); margin: 0 -26px 6px; padding: 0; border: 0; background: #0b0e14; cursor: zoom-in; overflow: hidden; }
.project .img-btn .proj-img { width: 100%; margin: 0; }
.project .img-btn::after {
  content: "⤢"; position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(10, 12, 16, .7); color: #fff; font-size: 16px; opacity: 0; transition: opacity .2s;
}
.project .img-btn:hover::after, .project .img-btn:focus-visible::after { opacity: 1; }
.project .img-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.lb { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px; background: rgba(5, 7, 10, .93); backdrop-filter: blur(6px); }
.lb[hidden] { display: none; }
.lb-stage { margin: 0; max-width: min(1400px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; }
.lb-stage img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 10px; background: #000; cursor: pointer; }
.lb-stage figcaption { color: var(--muted); font-size: 13px; text-align: center; max-width: 80ch; }
.lb button { background: rgba(255, 255, 255, .08); border: 1px solid var(--border); color: #fff; cursor: pointer; border-radius: 50%; width: 44px; height: 44px; font-size: 26px; line-height: 1; flex: none; }
.lb button:hover { background: rgba(94, 234, 212, .2); border-color: var(--accent); }
.lb-close { position: absolute; top: 16px; right: 16px; }
.lb.single .lb-prev, .lb.single .lb-next { display: none; }
@media (max-width: 640px) {
  .lb { padding: 12px; gap: 6px; }
  .lb button { width: 38px; height: 38px; }
  .lb-stage img { max-height: 70vh; }
}

/* About: portrait + statement */
.about { grid-template-columns: minmax(240px, 380px) 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.about-photo { margin: 0; }
.about-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 22%; border-radius: 20px; border: 1px solid var(--border); background: #000; }
.about-statement { font-size: clamp(32px, 5vw, 62px); line-height: 1.08; letter-spacing: -.035em; font-weight: 700; max-width: 16em; }
.about-statement span { color: var(--muted); }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about-photo { max-width: 320px; }
}

.project .links { flex-wrap: wrap; row-gap: 6px; }
.project .links a.dl { color: #4ade80; }

/* Hero: portrait left, silent looping video right (bleeds off the edge), name underneath. Everything is feathered into the page. */
.hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 100svh; background: var(--bg);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center;
  padding: 76px 0 56px clamp(16px, 3vw, 56px);
}
.hero-glow {
  position: absolute; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(760px 540px at 80% 46%, rgba(94, 234, 212, .12), transparent 62%),
    radial-gradient(640px 560px at 12% 78%, rgba(129, 140, 248, .16), transparent 62%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(-2%, 2%, 0) scale(1.06); } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }

.hero-photo {
  grid-column: 1 / 6; grid-row: 1; align-self: end; justify-self: start; margin: 0;
  width: min(100%, calc(84svh * .75)); aspect-ratio: 1086 / 1448;
  animation: rise 1s cubic-bezier(.2, .7, .2, 1) .1s both; mix-blend-mode: lighten;
}
.hero-photo img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: radial-gradient(ellipse 50% 58% at 50% 44%, #000 56%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 58% at 50% 44%, #000 56%, transparent 100%);
}

.hero-main { grid-column: 5 / 13; grid-row: 1; display: flex; flex-direction: column; min-width: 0; align-self: center; }

.hero-video {
  position: relative; width: min(100%, calc((100svh - 76px - 56px - 150px) * 16 / 9)); align-self: flex-end; aspect-ratio: 16 / 9;
  pointer-events: none; user-select: none; -webkit-user-select: none;
  animation: rise 1.1s cubic-bezier(.2, .7, .2, 1) .25s both;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30%, #000 70%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 30%, #000 70%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask-composite: intersect;
}
.hero-video video, .hero-video .hero-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.86) saturate(1.05);
}
/* the still sits underneath the video: it is what you see until playback starts (or if a browser refuses to autoplay) */

.hero-copy { position: relative; z-index: 2; margin-top: clamp(-84px, -6vw, -36px); padding-left: clamp(8px, 9%, 140px); animation: rise 1s cubic-bezier(.2, .7, .2, 1) .45s both; }
.hero-copy::before {
  content: ""; position: absolute; z-index: -1; inset: -40px -80px -20px -50px; pointer-events: none;
  background: radial-gradient(ellipse closest-side at 38% 56%, rgba(10, 12, 16, .85) 0%, rgba(10, 12, 16, .5) 55%, transparent 100%);
}
.hero-name { text-shadow: 0 2px 28px rgba(0, 0, 0, .55); font-size: clamp(38px, 5.4vw, 84px); line-height: 1; letter-spacing: -.04em; font-weight: 700; }
.hero-tag { margin-top: 12px; max-width: 30ch; color: var(--muted); font-size: clamp(15px, 1.5vw, 20px); line-height: 1.45; }
.hero-tag::before { content: ""; display: block; width: 44px; height: 3px; margin-bottom: 14px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.hero-scroll {
  position: absolute; left: 50%; bottom: clamp(14px, 3vh, 28px); translate: -50% 0; width: 40px; height: 40px;
  display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--muted);
  background: rgba(10, 12, 16, .5); backdrop-filter: blur(6px); animation: bob 2.4s ease-in-out infinite; transition: color .2s, border-color .2s;
}
.hero-scroll:hover { color: var(--accent); border-color: var(--accent); }
@keyframes bob { 50% { transform: translateY(6px); } }

@media (max-width: 860px) {
  .hero { display: flex; flex-direction: column; align-items: stretch; min-height: auto; padding: 88px 0 64px; }
  .hero-photo { align-self: center; width: min(74%, 330px); }
  .hero-main { display: contents; }
  .hero-copy { order: 2; margin: -6px 0 0; padding: 0 22px; text-align: center; }
  .hero-tag { margin-inline: auto; }
  .hero-tag::before { margin-inline: auto; }
  .hero-video { order: 3; width: 100%; margin-top: -2%; align-self: stretch; }
  .hero-scroll { display: none; }
}


/* Portfolio headline: whole title in the accent gradient, italic */
.intro-title em { font-style: italic; padding-right: .12em; }

/* Portfolio screen: a little wider and shorter (title, card and links share one width; extra bottom space keeps it off the screen edge) */
.first-screen .container { width: min(1200px, 100% - 48px); }
@media (min-width: 861px) and (min-height: 600px) {
  .first-screen { padding-bottom: calc(18px + 5.5svh); }
}

/* About: four-photo mosaic on the left, text on the right */
.about { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.about-mosaic {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 12px;
}
.about-mosaic figure { margin: 0; overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background: #0b0e14; }
.about-mosaic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.about-mosaic figure:hover img { transform: scale(1.04); }
.m-check, .m-award { aspect-ratio: 4 / 5; }
.m-team, .m-talk { aspect-ratio: 16 / 9; }
.m-check img { object-position: 22% 50%; }
.m-award img { object-position: 46% 50%; }
.m-team img { object-position: 45% 50%; }
.m-talk img { object-position: 40% 50%; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* About: lede, stats, "right now", skill chips */
.about-statement { font-size: clamp(28px, 3.6vw, 48px); }
.about-lede { margin-top: 22px; max-width: 46ch; color: #c3c9d6; font-size: 17px; line-height: 1.65; }
.about-stats { display: flex; gap: clamp(18px, 3vw, 40px); margin-top: 26px; flex-wrap: wrap; }
.about-stats li { display: grid; gap: 2px; }
.about-stats strong { font: 600 clamp(26px, 3vw, 36px) "JetBrains Mono", monospace; letter-spacing: -.03em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.about-stats span { color: var(--muted); font-size: 13px; }
.about-now { margin-top: 24px; padding: 12px 16px; max-width: 46ch; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; background: rgba(255, 255, 255, .02); color: #c3c9d6; font-size: 15px; }
.about-now b { color: var(--accent); font: 500 12px "JetBrains Mono", monospace; letter-spacing: .1em; text-transform: uppercase; margin-right: 10px; }
.about-text .chips { margin-top: 22px; }

/* ---- One screen per section (laptops): every section fills the viewport, the arrow jumps to the next one ---- */
.next-arrow, .hero-scroll {
  position: absolute; left: 50%; bottom: clamp(10px, 2.2svh, 22px); translate: -50% 0; width: 40px; height: 40px; z-index: 5;
  display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--muted);
  background: rgba(10, 12, 16, .6); backdrop-filter: blur(6px); animation: bob 2.4s ease-in-out infinite; transition: color .2s, border-color .2s;
}
.next-arrow:hover { color: var(--accent); border-color: var(--accent); }
.screen, .first-screen { position: relative; }
@media (max-width: 860px), (max-height: 599px) { .next-arrow { display: none; } }

@media (min-width: 861px) and (min-height: 600px) {
  html { scroll-snap-type: y proximity; }
  .hero, .first-screen, .screen { scroll-snap-align: start; scroll-snap-stop: normal; }
  .screen { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 72px 0 64px; }
  .screen > .container { width: min(1200px, 100% - 48px); }
  /* project sections are as tall as their cards; the arrow sits under the last row */
  #engineering.screen, #finance.screen { min-height: auto; justify-content: flex-start; padding: 100px 0 110px; scroll-snap-align: none; }
  #engineering.screen > .container, #finance.screen > .container { width: min(1120px, 100% - 48px); }

  /* about */
  .about-statement { font-size: clamp(24px, 5.4svh, 48px); }
  .about-lede { margin-top: clamp(10px, 2svh, 22px); font-size: clamp(14px, 2.1svh, 17px); line-height: 1.55; }
  .about-stats { margin-top: clamp(12px, 2.4svh, 26px); }
  .about-stats strong { font-size: clamp(22px, 4svh, 36px); }
  .about-now { margin-top: clamp(10px, 2.2svh, 24px); padding: 10px 14px; font-size: clamp(13px, 1.9svh, 15px); }
  .about-text .chips { margin-top: clamp(10px, 2svh, 22px); }
  .about-text .chips li { padding: 4px 12px; font-size: 12px; }
  .about-mosaic { gap: 10px; }

}

/* Portfolio card taller: the card now uses the old bottom gap; the arrow sits in the links row (centre) instead of below it */
@media (min-width: 861px) and (min-height: 600px) {
  .first-screen { padding-top: 76px; padding-bottom: 18px; }
  #portfolio > .next-arrow { bottom: 24px; }
}

/* About: red chess.com challenge button */
.chess-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: clamp(10px, 2svh, 18px); padding: 9px 18px; border-radius: 999px;
  background: #dc2626; color: #fff; font-weight: 600; font-size: 14px; letter-spacing: .01em;
  box-shadow: 0 6px 22px rgba(220, 38, 38, .28); transition: transform .15s, background .15s, box-shadow .15s;
}
.chess-cta:hover { background: #ef4444; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(239, 68, 68, .4); }
.chess-cta:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.chess-cta .chess-ico { flex: none; margin-left: -2px; }

/* LIVE badge: inside the card, top-left, a little bigger */
.folio > .live {
  top: clamp(14px, 2.4svh, 24px); left: clamp(16px, 2.4vw, 32px); transform: none;
  padding: 10px 22px 10px 18px; gap: 14px; font-size: 22px; background: rgba(10, 12, 16, .55);
}
.folio > .live .live-dot { width: 18px; height: 18px; }
@media (max-width: 560px) { .folio > .live { font-size: 17px; padding: 8px 16px 8px 14px; } .folio > .live .live-dot { width: 14px; height: 14px; } }

/* Project popup: a centred card, about 1.5x the size of a project card, over a light dim */
.lb { padding: 20px; background: rgba(5, 7, 10, .62); backdrop-filter: blur(3px); }
.lb-card {
  position: relative; width: min(560px, 100%); max-height: calc(100svh - 40px); overflow: auto; margin: 0;
  background: var(--card); border: 1px solid #35405a; border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: pop .22s cubic-bezier(.2, .7, .2, 1);
}
@keyframes pop { from { opacity: 0; transform: scale(.94); } }
.lb-media { position: relative; background: #000; line-height: 0; }
.lb-media img { display: block; width: 100%; height: auto; max-height: min(46svh, 420px); object-fit: contain; cursor: pointer; border-radius: 0; background: #000; }
.lb-body { padding: 20px 24px 24px; display: grid; gap: 10px; }
.lb-body h3 { font-size: 22px; line-height: 1.25; }
.lb-body p { color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.lb-body .links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; font-weight: 500; margin-top: 4px; }
.lb-body .links a { color: var(--accent); } .lb-body .links a:hover { text-decoration: underline; }
.lb-body .links a.dl { color: #4ade80; }
.lb-body .links:empty { display: none; }
.lb-close { position: absolute; top: 10px; right: 10px; z-index: 3; width: 36px; height: 36px; font-size: 22px; background: rgba(10, 12, 16, .7); }
.lb-prev, .lb-next { position: absolute; top: 50%; translate: 0 -50%; z-index: 2; width: 38px; height: 38px; font-size: 24px; background: rgba(10, 12, 16, .65); line-height: 1; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
.lb-count { position: absolute; left: 12px; bottom: 10px; z-index: 2; padding: 2px 9px; border-radius: 999px; background: rgba(10, 12, 16, .7); font: 12px "JetBrains Mono", monospace; line-height: 1.6; color: #fff; }
.lb-count:empty { display: none; }
.project { cursor: pointer; }
.project .links a { cursor: pointer; }

.lb-body p:empty { display: none; }

/* Long finance descriptions: three-line preview on the card, full text in the popup */
#finGrid .project p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Nav "Let's talk": filled in the accent blue */
.nav .btn-small { background: var(--accent); border-color: var(--accent); color: #04110e; font-weight: 600; padding: 7px 16px; transition: transform .15s, box-shadow .15s; }
.nav .btn-small:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(94, 234, 212, .3); }

/* Contact: friendlier and more engaging */
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,.03); color: #c3c9d6; font-size: 14px; margin-bottom: 18px; }
.status-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2s infinite; }
.contact h2 { font-size: clamp(40px, 6.4svh, 64px); letter-spacing: -.035em; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; padding-bottom: .08em; }
.contact-ask { margin-top: clamp(14px, 3svh, 30px); color: var(--muted); font-size: 14px; letter-spacing: .02em; }
.reasons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 12px auto 0; max-width: 720px; }
.reasons a { padding: 10px 18px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--text); font-size: 15px; font-weight: 500; transition: transform .15s, border-color .15s, background .15s, color .15s; }
.reasons a:hover, .reasons a:focus-visible { transform: translateY(-2px); border-color: var(--accent); background: rgba(94,234,212,.08); color: var(--accent); outline: none; }
.email-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: clamp(16px, 3.4svh, 34px); flex-wrap: wrap; }
.email-row .btn.big { margin-top: 0; }
.copy-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: 600 15px "Inter", sans-serif; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.done { border-color: var(--up); color: var(--up); background: rgba(52,211,153,.08); }
.socials { gap: 12px; margin-top: clamp(16px, 3.2svh, 32px); flex-wrap: wrap; }
.socials a { display: inline-flex; align-items: center; gap: 9px; padding: 9px 18px; border: 1px solid var(--border); border-radius: 999px; color: #c3c9d6; font-size: 15px; transition: border-color .15s, color .15s, transform .15s; }
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }



/* ---- Phone optimisation ---- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
.nav { padding-top: max(16px, env(safe-area-inset-top)); }

/* touch screens: no sticky hover effects */
@media (hover: none) {
  .project:hover, .reasons a:hover, .socials a:hover, .btn:hover, .chess-cta:hover, .nav .btn-small:hover { transform: none; box-shadow: none; }
  .project:hover { border-color: var(--border); }
  .project:hover::before { opacity: 0; }
  .project .img-btn::after { display: none; }
  .about-mosaic figure:hover img { transform: none; }
}

@media (max-width: 860px) {
  html { scroll-padding-top: 64px; }
  .container { width: calc(100% - 32px); }
  .section { padding: 56px 0; }
  .section-head, h2 { scroll-margin-top: 64px; }

  /* bigger tap targets (44px guideline) */
  .brand { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; }
  .nav .btn-small { min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px; }
  .project .links { gap: 6px 18px; }
  .project .links a { display: inline-flex; align-items: center; min-height: 44px; }
  .copy-btn, .chess-cta, .socials a, .btn { min-height: 44px; }
  .summary-fix, .menu > summary { min-height: 48px; }
  .menu-list a { padding: 14px 16px; }

  /* cards: one column, a little tighter */
  .grid { grid-template-columns: 1fr; gap: 16px; margin-top: 24px; }

  /* about */
  .about { gap: 24px; }
  .about-statement { font-size: clamp(26px, 8vw, 34px); }
  .about-lede { font-size: 16px; }

  /* portfolio card */
  .folio { padding: 18px 14px 20px; }
  .folio > .live { position: static; transform: none; width: fit-content; margin-bottom: 4px; }
  .folio-hero { margin-top: 6px; }
  .folio-value { font-size: clamp(40px, 14vw, 60px); }
  .chart-wrap { height: 220px; }
  .folio-links { padding-top: 12px; }
  .folio-links .btn { width: 100%; justify-content: space-between; }
  .menu, .menu > summary { width: 100%; }
  .menu-list { left: 0; right: 0; min-width: 0; }

  /* contact */
  .contact h2 { font-size: 40px; }
  .status-pill { font-size: 13px; padding: 6px 12px; margin-bottom: 12px; }
  .email-row { flex-direction: column; gap: 10px; }
  .email-row .btn.big { font-size: 17px; padding: 14px 22px; width: min(100%, 340px); text-align: center; }
  .socials a { padding: 10px 18px; }

  /* popup: bottom-sheet style, full width, safe areas */
  .lb { align-items: flex-end; padding: 0; }
  .lb-card { width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet .25s cubic-bezier(.2, .7, .2, 1); overscroll-behavior: contain; }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
  .lb-media img { max-height: 42dvh; }
  .lb-close { width: 44px; height: 44px; }
  .lb-prev, .lb-next { width: 44px; height: 44px; }
  .lb-body { padding: 16px 18px 22px; }
}

/* very small phones */
@media (max-width: 360px) {
  .about-mosaic { gap: 8px; }
  .hero-name { font-size: 34px; }
  .folio-value { font-size: 38px; }
}

/* ---- Phone: compact intro (video at the bottom), shorter project cards, one-row social links ---- */
@media (max-width: 860px) {
  /* intro fits one screen on any phone: sizes follow the screen height */
  .hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: calc(60px + env(safe-area-inset-top)) 0 18px; gap: 0; }
  .hero-photo { width: calc(30svh * .75); max-width: 56%; flex: none; align-self: center; }
  .hero-copy { order: 2; margin: -4px 0 0; padding: 0 16px; text-align: center; }
  .hero-name { font-size: clamp(24px, 4.4svh, 34px); }
  .hero-tag { margin-top: 6px; font-size: clamp(12px, 1.9svh, 15px); max-width: 28ch; }
  .hero-tag::before { width: 32px; height: 2px; margin-bottom: 8px; }
  .hero-video { order: 3; width: min(100%, calc(28svh * 16 / 9)); align-self: center; margin-top: clamp(6px, 1.6svh, 14px); }

  /* project cards: shorter */
  .project .img-btn .proj-img, .project .proj-img { aspect-ratio: 16 / 9 !important; height: auto !important; max-height: 190px; object-fit: cover; }
  .project { padding: 14px 16px 12px; gap: 6px; }
  .project.has-img { padding-top: 0; }
  .project .img-btn { margin-bottom: 2px; }
  .project h3 { font-size: 16px; }
  .project p { font-size: 13.5px; line-height: 1.5; -webkit-line-clamp: 2; }
  .project .links a { min-height: 40px; }
  .grid { gap: 12px; }

  /* contact: centred on screen, three links in one row */
  #contact.screen { min-height: calc(100svh - 80px); display: flex; flex-direction: column; justify-content: center; padding: 72px 0 40px; }
  .socials { flex-wrap: nowrap; gap: 8px; justify-content: center; margin-top: 22px; }
  .socials li { min-width: 0; }
  .socials a { padding: 0 12px; min-height: 44px; font-size: 14px; gap: 7px; white-space: nowrap; }
  .socials a svg { width: 16px; height: 16px; flex: none; }
  .email-row { margin-top: 20px; }
}
@media (max-width: 360px) { .socials { gap: 6px; } .socials a { padding: 0 9px; font-size: 13px; gap: 5px; } }

/* ---- Phone: About fits one screen ---- */
@media (max-width: 860px) {
  #about.screen { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: calc(60px + env(safe-area-inset-top)) 0 20px; }
  #about .about { gap: clamp(10px, 2svh, 18px); }
  #about .about-mosaic { height: clamp(150px, 31svh, 270px); grid-template-rows: 1.55fr 1fr; gap: 6px; }
  #about .about-mosaic figure { aspect-ratio: auto; border-radius: 12px; }
  #about .about-mosaic img { height: 100%; }
  #about .about-text .eyebrow { margin-bottom: 4px; font-size: 11px; }
  #about .about-statement { font-size: clamp(20px, 3.5svh, 26px); line-height: 1.15; }
  #about .about-lede { margin-top: clamp(6px, 1.2svh, 12px); font-size: clamp(12.5px, 1.95svh, 15px); line-height: 1.5; }
  #about .chess-cta { margin-top: clamp(8px, 1.6svh, 14px); min-height: 40px; padding: 0 16px; font-size: 13px; }
}
@media (max-width: 860px) and (max-height: 600px) {
  #about .about-mosaic { height: 27svh; }
  #about .about-lede { font-size: 12px; line-height: 1.42; }
  #about .about-statement { font-size: 19px; }
  #about.screen { padding-top: 58px; padding-bottom: 12px; }
}

/* ---- Phone: portfolio fits one screen, everything scaled from the screen height ---- */
@media (max-width: 860px) {
  #portfolio.first-screen { min-height: 100svh; height: auto; display: flex; flex-direction: column; justify-content: center; padding: calc(58px + env(safe-area-inset-top)) 0 14px; }
  #portfolio .intro { margin-bottom: clamp(4px, 1svh, 8px); }
  #portfolio .intro-title { font-size: clamp(18px, 3.1svh, 24px); }
  #folio.section.tight { padding: 8px 0 0; }
  #portfolio .folio { padding: clamp(8px, 1.4svh, 12px) 12px clamp(8px, 1.4svh, 12px); }
  .folio > .live { position: absolute; top: clamp(8px, 1.4svh, 12px); left: 12px; margin: 0; padding: 3px 10px 3px 9px; gap: 7px; font-size: 12px; letter-spacing: .1em; }
  .folio > .live .live-dot { width: 9px; height: 9px; }
  .folio-hero { margin: clamp(14px, 3.4svh, 26px) 0 0; }
  .folio-value { font-size: clamp(30px, 5.8svh, 46px); }
  .folio-sub { margin-top: 2px; font-size: clamp(11px, 1.7svh, 13px); }
  .folio-body { margin-top: clamp(4px, 1svh, 8px); gap: clamp(6px, 1.2svh, 10px); }
  #portfolio .chart-wrap { height: clamp(64px, 12.5svh, 130px); min-height: 0; }
  #portfolio .chart-axis { margin-top: 3px; font-size: 9.5px; }
  #portfolio .hrow { grid-template-columns: 44px 1fr auto; gap: 8px; padding: 0 2px; height: clamp(20px, 3.5svh, 30px); min-height: 0; max-height: none; flex: none; align-items: center; }
  #portfolio .hrow.head { height: clamp(16px, 2.6svh, 22px); font-size: 9px; padding: 0 2px; }
  #portfolio .hrow .w, #portfolio .hrow .asset, #portfolio .hrow .ret { font-size: clamp(10.5px, 1.7svh, 13px); }
  #portfolio .hrow .asset { gap: 8px; }
  #portfolio .hrow .ico { width: clamp(15px, 2.6svh, 22px); height: clamp(15px, 2.6svh, 22px); font-size: 9px; }
  #portfolio .folio-links { padding-top: clamp(8px, 1.4svh, 12px); }
  #portfolio .folio-links .btn { min-height: 40px; padding: 0 16px; font-size: 13px; }
  #portfolio .menu-list a { padding: 11px 14px; }
}
@media (max-width: 860px) {
  #portfolio.first-screen { padding-top: calc(54px + env(safe-area-inset-top)); padding-bottom: 8px; }
  #portfolio .intro-title { font-size: clamp(17px, 2.9svh, 23px); }
  .folio-hero { margin-top: clamp(12px, 2.8svh, 24px); }
  .folio-value { font-size: clamp(26px, min(5.2svh, 9vw), 42px); }
  #portfolio .chart-wrap { height: clamp(54px, 10.5svh, 120px); }
  #portfolio .hrow { height: clamp(17px, 3.05svh, 29px); }
  #portfolio .hrow.head { height: clamp(14px, 2.3svh, 20px); }
  #portfolio .hrow .w, #portfolio .hrow .asset, #portfolio .hrow .ret { font-size: clamp(10px, 1.6svh, 13px); }
  #portfolio .hrow .ico { width: clamp(13px, 2.4svh, 21px); height: clamp(13px, 2.4svh, 21px); }
  #portfolio .folio-links .btn { min-height: 38px; }
  #portfolio .folio-links { padding-top: clamp(6px, 1.2svh, 12px); }
}
@media (max-width: 860px) {
  .folio > .live { font-size: 11px; padding: 2px 8px 2px 8px; gap: 6px; }
  .folio > .live .live-dot { width: 8px; height: 8px; }
  .folio-value { font-size: clamp(26px, min(5.2svh, 8vw), 42px); }
  #portfolio .main-col .chart-wrap { flex: none; }
}
/* phone: full-screen sections already pad for the nav, so jumping to them needs no extra offset; the card sections pad for it themselves */
@media (max-width: 860px) {
  html { scroll-padding-top: 0; }
  #engineering.section, #finance.section { padding-top: 84px; }
  .section-head, h2 { scroll-margin-top: 0; }
}

/* ---- Phone only: neon blue highlight around the Finance project cards ---- */
@media (max-width: 860px) {
  #finGrid .project {
    border-color: #2f9bff;
    box-shadow: 0 0 0 1px rgba(47, 155, 255, .55), 0 0 10px rgba(47, 155, 255, .55), 0 0 26px rgba(47, 155, 255, .28), inset 0 0 14px rgba(47, 155, 255, .12);
  }
  #finGrid .project::before { opacity: 1; background: linear-gradient(90deg, #2f9bff, #7cc4ff); height: 2px; }
  #finGrid .project h3 { text-shadow: 0 0 12px rgba(47, 155, 255, .35); }
  #finGrid .project .links a { color: #6cb8ff; }
  #finGrid .project .links a.dl { color: #4ade80; }
}
@media (max-width: 860px) and (prefers-reduced-motion: no-preference) {
  #finGrid .project { animation: neonPulse 3.6s ease-in-out infinite; }
  @keyframes neonPulse { 50% { box-shadow: 0 0 0 1px rgba(47, 155, 255, .7), 0 0 14px rgba(47, 155, 255, .75), 0 0 34px rgba(47, 155, 255, .38), inset 0 0 16px rgba(47, 155, 255, .16); } }
}

/* ---- Phone: taller portfolio chart (rows/spacing tightened slightly so it all still fits one screen) ---- */
@media (max-width: 860px) {
  #portfolio .chart-wrap { height: clamp(86px, 17.5svh, 190px); }
  #portfolio .hrow { height: clamp(16px, 2.8svh, 27px); }
  #portfolio .hrow.head { height: clamp(13px, 2.1svh, 19px); }
  #portfolio .hrow .w, #portfolio .hrow .asset, #portfolio .hrow .ret { font-size: clamp(9.5px, 1.5svh, 12.5px); }
  #portfolio .hrow .ico { width: clamp(12px, 2.2svh, 19px); height: clamp(12px, 2.2svh, 19px); }
  #portfolio .intro-title { font-size: clamp(16px, 2.7svh, 22px); }
  .folio-hero { margin-top: clamp(10px, 2.4svh, 22px); }
  .folio-value { font-size: clamp(24px, min(4.7svh, 8vw), 40px); }
  #portfolio .folio-links { padding-top: clamp(5px, 1svh, 10px); }
  #portfolio .folio-links .btn { min-height: 36px; }
}

/* ---- Phone: Bitcoin Inverse card shows its whole image, top aligned, so the title in the picture is readable ---- */
@media (max-width: 860px) {
  #finGrid .project[data-i="1"] .proj-img { aspect-ratio: 1200 / 694 !important; max-height: none; object-position: 50% 0; }
}

/* top-left brand mark: the same AD icon as the browser tab */
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; width: 38px; height: 38px; border-radius: 10px; }
@media (max-width: 860px) { .brand img { width: 36px; height: 36px; } }
