/* ============ Tokens ============ */
:root {
  --bg: #03030a;
  --bg-2: #070714;
  --card: rgba(255, 255, 255, .045);
  --card-b: rgba(255, 255, 255, .09);
  --text: #ecebf5;
  --muted: #a6a4c4;
  --violet: #8b5cff;
  --cyan: #4df3d0;
  --pink: #ff4fd8;
  --gold: #ffc861;
  --green: #4df3b0;
  --grad: linear-gradient(115deg, #ffc861 0%, #ff4fd8 34%, #8b5cff 68%, #4df3d0 100%);
  --grad-cool: linear-gradient(120deg, #c7a6ff 0%, #8b5cff 40%, #4df3d0 100%);
  --radius: 22px;
  --serif: "Instrument Serif", Georgia, serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(18px, 5vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 clamp(15px, 1.5vw, 17px)/1.65 var(--sans);
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.hidden { position: absolute; left: -9999px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mono { font-family: var(--mono); color: var(--cyan); }
.container { width: min(1160px, 100% - 2 * var(--pad)); margin-inline: auto; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--violet); color: #fff; }

/* ============ Background layers ============ */
.spotlight { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 255, .13), transparent 60%); }
.spotlight.on { opacity: 1; }
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 100; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: var(--grad); }

/* ============ Nav ============ */
.nav-wrap { position: fixed; inset: 0 0 auto 0; z-index: 90; padding: calc(12px + env(safe-area-inset-top)) var(--pad) 0; display: flex; justify-content: center; pointer-events: none; }
.nav { pointer-events: auto; width: min(960px, 100%); display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 20px;
  background: rgba(8, 8, 22, .65); border: 1px solid var(--card-b); border-radius: 999px; backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
.brand { font: 700 20px var(--sans); letter-spacing: -.5px; margin-right: auto; }
.brand span { color: var(--cyan); }
.nav-links { display: none; gap: 4px; }
.nav-links a { display: block; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 500; transition: .25s; }
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-cta-mobile { display: none; }
.burger { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .07); display: grid; place-content: center; gap: 6px; cursor: pointer; }
.burger span { display: block; width: 18px; height: 2px; background: #fff; transition: .3s; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
.nav-cta { display: none; }

@media (max-width: 859px) {
  .nav-cta { display: none !important; }
  .nav-links { position: fixed; inset: 0; z-index: -1; padding: calc(96px + env(safe-area-inset-top)) var(--pad) calc(32px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; justify-content: center; gap: 6px; background: rgba(3, 3, 10, .96); backdrop-filter: blur(24px);
    opacity: 0; visibility: hidden; transform: translateY(-12px); transition: .35s; }
  .nav-links.open { opacity: 1; visibility: visible; transform: none; }
  .nav-links a { font-size: 28px; font-family: var(--serif); padding: 14px 8px; min-height: 52px; color: #fff; background: none !important; }
  .nav-cta-mobile { display: block; margin-top: 18px; }
  .nav-cta-mobile a { background: var(--grad) !important; color: #03030a; text-align: center; border-radius: 16px; font-family: var(--sans); font-size: 17px; font-weight: 600; }
}
@media (min-width: 860px) {
  .burger { display: none; }
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
}

/* ============ Buttons / pills ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 26px; border-radius: 999px; font: 600 15px var(--sans); border: 1px solid transparent; cursor: pointer; transition: transform .25s, box-shadow .25s, background .25s; will-change: transform; }
.btn-sm { min-height: 40px; padding: 0 20px; font-size: 14px; }
.btn-primary { background: var(--grad); color: #03030a; box-shadow: 0 10px 40px -10px rgba(139, 92, 255, .7); }
.btn-primary:hover { box-shadow: 0 14px 50px -8px rgba(77, 243, 208, .6); }
.btn-ghost { background: rgba(255, 255, 255, .05); border-color: var(--card-b); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-block { width: 100%; min-height: 54px; font-size: 16px; }
.btn .arrow { transition: transform .25s; }
.btn:hover .arrow { transform: translateX(4px); }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border: 1px solid var(--card-b); background: var(--card); border-radius: 999px; font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: ping 2s infinite; display: inline-block; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

/* ============ Hero ============ */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(110px + env(safe-area-inset-top)) 0 56px; overflow: hidden; }
.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, #000 40%, transparent 100%); mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, #000 40%, transparent 100%); }
@media (max-width: 767px) { .hero-fx { opacity: .6; } }
.hero-inner { position: relative; z-index: 1; display: grid; gap: 22px; justify-items: start; }
.hero-title { font: 700 clamp(34px, 8.6vw, 84px)/1.04 var(--sans); letter-spacing: -.035em; text-wrap: balance; overflow-wrap: break-word; max-width: 100%; }
.hero-title em { font-size: 1.06em; letter-spacing: -.01em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font: 500 clamp(14px, 3.6vw, 20px) var(--mono); color: #cfd0e6; min-height: 1.6em; max-width: 100%; }
.caret { display: inline-block; width: 9px; height: 1.05em; background: var(--cyan); margin-left: 3px; vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-copy { max-width: 640px; color: var(--muted); font-size: clamp(15px, 2vw, 18px); }
.hero-copy b { color: #fff; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; margin-top: 18px; }
.stat { padding: 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--card-b); backdrop-filter: blur(8px); }
.stat b { display: block; font: 700 clamp(28px, 6vw, 42px)/1 var(--sans); letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.35; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, 1fr); max-width: 860px; } }

/* ============ Rings (percentages) ============ */
.ring { --size: 112px; position: relative; width: var(--size); aspect-ratio: 1; display: grid; place-items: center; flex: none; }
.ring.big { --size: clamp(150px, 22vw, 190px); }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.ring .t { stroke: rgba(255, 255, 255, .08); }
.ring .v { stroke: url(#ringGrad); stroke-dasharray: 326.7; stroke-dashoffset: 326.7; filter: drop-shadow(0 0 8px rgba(139, 92, 255, .55)); transition: stroke-dashoffset 1.8s cubic-bezier(.2, .7, .2, 1) .2s; }
.ring.go .v { stroke-dashoffset: calc(326.7 * (1 - var(--pct) / 100)); }
.ring b { position: relative; font: 700 calc(var(--size) * .26)/1 var(--sans); letter-spacing: -.03em; }
.impact { display: grid; gap: 16px; grid-template-columns: 1fr; }
.impact-card { padding: clamp(22px, 3vw, 32px); border-radius: var(--radius); background: var(--card); border: 1px solid var(--card-b); display: grid; justify-items: center; text-align: center; gap: 14px; }
.impact-card p { color: var(--muted); font-size: 14.5px; max-width: 34ch; }
@media (min-width: 860px) { .impact { grid-template-columns: repeat(3, 1fr); } }
.rings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 12px; justify-items: center; margin-bottom: 22px; padding: 26px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--card-b); }
.ring-item { display: grid; justify-items: center; gap: 10px; text-align: center; font-size: 13.5px; color: var(--muted); }
@media (min-width: 640px) { .rings { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .rings { grid-template-columns: repeat(6, 1fr); } }

/* ============ Marquee ============ */
.marquee { overflow: hidden; border-block: 1px solid var(--card-b); background: rgba(255, 255, 255, .02); padding: 16px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 38px; animation: scroll 38s linear infinite; }
.marquee-track span { font: 500 14px var(--mono); color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 38px; }
.marquee-track span::after { content: "◆"; color: var(--violet); font-size: 9px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ============ Sections ============ */
.section { padding: clamp(64px, 11vw, 120px) 0 0; }
.section-head { position: relative; margin-bottom: clamp(28px, 5vw, 48px); isolation: isolate; padding-block: 8px; }
.eyebrow { font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; }
.section h2 { font: 700 clamp(30px, 6.4vw, 56px)/1.08 var(--sans); letter-spacing: -.03em; text-wrap: balance; }
.section h2 em { color: #d9c8ff; }
h3 { font: 600 clamp(18px, 2.4vw, 22px)/1.3 var(--sans); letter-spacing: -.01em; }

/* Section-heading animation: floating orbs + circuit lines (CSS only, light on mobile) */
.fx-head::before, .fx-head::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.fx-head::before { width: clamp(120px, 28vw, 260px); aspect-ratio: 1; right: 4%; top: -40%; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(139, 92, 255, .55), rgba(77, 243, 208, .15) 55%, transparent 70%); filter: blur(22px); animation: orb 9s ease-in-out infinite alternate; }
.fx-head::after { inset: -10% 0 -10% 30%; opacity: .5;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='140' fill='none' stroke='%238b5cff' stroke-width='1.2'%3E%3Cpath d='M0 40h120l30 30h90l20-20h120l30 40h110' stroke-dasharray='6 10'/%3E%3Cpath d='M0 100h80l24-24h130l26 26h120l30-30h110' stroke='%234df3d0' stroke-dasharray='3 12'/%3E%3Ccircle cx='150' cy='70' r='4' fill='%234df3d0' stroke='none'/%3E%3Ccircle cx='260' cy='50' r='4' fill='%238b5cff' stroke='none'/%3E%3Ccircle cx='410' cy='90' r='4' fill='%23ff4fd8' stroke='none'/%3E%3C/svg%3E") right center / min(520px, 100%) auto no-repeat;
  animation: dash 6s linear infinite; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%); }
@keyframes orb { to { transform: translate3d(-16px, 14px, 0) scale(1.18); } }
@keyframes dash { to { background-position: calc(100% - 40px) center; } }

/* ============ Cards / bento ============ */
.card { position: relative; padding: clamp(20px, 3.4vw, 32px); border-radius: var(--radius); background: var(--card); border: 1px solid var(--card-b); backdrop-filter: blur(10px); transition: border-color .3s, background .3s; }
.card:hover { border-color: rgba(139, 92, 255, .45); }
.card-accent { background: linear-gradient(160deg, rgba(139, 92, 255, .22), rgba(77, 243, 208, .08)); }
.bento { display: grid; gap: 16px; grid-template-columns: 1fr; }
.card-lg { display: grid; gap: 22px; align-items: center; }
.card-lg h3 { margin-bottom: 12px; }
.card-lg p + p { margin-top: 12px; }
.card-lg p, .card p.muted { color: var(--muted); }
.about-copy { display: grid; gap: 14px; }
.about-copy p { margin: 0 !important; }
.about-copy b { color: #fff; font-weight: 600; }
.about-kicker { font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan) !important; }
.card-lg p.about-lead { color: #fff; font: 700 clamp(24px, 4.6vw, 40px)/1.12 var(--sans); letter-spacing: -.03em; text-wrap: balance; }
.about-lead em { font-size: 1.08em; color: #d9c8ff; letter-spacing: 0; }
.about-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.about-tags li { padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); border: 1px solid var(--card-b); background: rgba(255, 255, 255, .04); }
.about-tags li b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card-lg.card::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; padding: 1px;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, rgba(139, 92, 255, .9), rgba(77, 243, 208, .9), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 6s linear infinite; }
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --ang: 360deg; } }
.portrait { width: 100%; max-width: 240px; aspect-ratio: 1; object-fit: cover; border-radius: 20px; border: 1px solid var(--card-b); }
.card h3 { margin: 6px 0; }
@media (min-width: 768px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .card-lg { grid-column: 1 / -1; grid-template-columns: 240px 1fr; gap: 32px; }
}
@media (min-width: 1000px) {
  .bento { grid-template-columns: repeat(3, 1fr); }
  .card-lg { grid-column: 1 / -1; }
}

/* ============ Skills ============ */
.skills { display: grid; gap: 14px; grid-template-columns: 1fr; }
.skill-group { padding: 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--card-b); }
.skill-group h3 { font-size: 13px; font-family: var(--mono); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { --c: var(--violet); padding: 7px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 500; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 14%, transparent); transition: transform .2s, background .2s; }
.chip:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--c) 28%, transparent); }
.chip.lvl-5 { --c: #8b5cff; }
.chip.lvl-4 { --c: #4df3d0; }
.chip.lvl-3 { --c: #94a3b8; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13px; color: var(--muted); grid-column: 1 / -1; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: -10px; }
.legend i.lvl-5 { background: #8b5cff; } .legend i.lvl-4 { background: #4df3d0; } .legend i.lvl-3 { background: #94a3b8; }
@media (min-width: 768px) { .skills { grid-template-columns: repeat(2, 1fr); } }

/* ============ Timeline ============ */
.timeline { position: relative; margin-left: 10px; padding-left: clamp(22px, 4vw, 40px); border-left: 1px solid var(--card-b); display: grid; gap: 22px; }
.timeline > li { position: relative; padding: clamp(18px, 3vw, 26px); border-radius: var(--radius); background: var(--card); border: 1px solid var(--card-b); }
.timeline > li::before { content: ""; position: absolute; left: calc(-1 * clamp(22px, 4vw, 40px) - 6px); top: 30px; width: 11px; height: 11px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 5px rgba(77, 243, 208, .18), 0 0 20px var(--cyan); }
.timeline time { font: 500 12px var(--mono); color: var(--cyan); letter-spacing: .06em; text-transform: uppercase; }
.timeline h3 { margin: 6px 0 2px; }
.timeline ul { margin-top: 14px; display: grid; gap: 8px; }
.timeline ul li { padding-left: 18px; color: var(--muted); font-size: 14.5px; position: relative; }
.timeline ul li::before { content: "▹"; position: absolute; left: 0; top: 0; color: var(--violet); }

/* ============ Projects ============ */
.projects { display: grid; gap: 16px; grid-template-columns: 1fr; }
.project { display: flex; flex-direction: column; gap: 6px; padding: clamp(20px, 3vw, 28px); border-radius: var(--radius); background: var(--card); border: 1px solid var(--card-b); transition: border-color .3s; }
.project:hover { border-color: rgba(77, 243, 208, .5); }
.project-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tag { padding: 4px 11px; border-radius: 999px; font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; background: rgba(139, 92, 255, .2); color: #d9c8ff; }
.tag.ai { background: rgba(77, 243, 208, .16); color: #8ff7e6; }
.tag.ghost { background: transparent; border: 1px solid var(--card-b); color: var(--muted); }
.project-role { color: var(--cyan); font-size: 14px; font-weight: 500; }
.project ul { margin-top: 10px; display: grid; gap: 8px; color: var(--muted); font-size: 14.5px; }
.project li { padding-left: 18px; position: relative; }
.project li::before { content: "▹"; position: absolute; left: 0; color: var(--violet); }
.project li b { color: #fff; }
.stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 16px; }
.stack span { font: 500 11.5px var(--mono); padding: 3px 9px; border-radius: 6px; background: rgba(255, 255, 255, .06); color: #cfd0e6; }
@media (min-width: 768px) { .projects { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .projects { grid-template-columns: repeat(3, 1fr); } }

/* ============ Certs ============ */
.cert-filters { display: flex; gap: 8px; margin-bottom: 22px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cert-filters::-webkit-scrollbar { display: none; }
.filter { flex: none; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--card-b); background: var(--card); color: var(--muted); font: 500 14px var(--sans); cursor: pointer; transition: .25s; }
.filter:hover { color: #fff; }
.filter.active { background: var(--grad); color: #03030a; border-color: transparent; font-weight: 600; }
.certs { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 22px; }
.cert { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center; padding: 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--card-b); transition: transform .3s, border-color .3s, opacity .3s; }
.cert:hover { transform: translateY(-3px); border-color: rgba(139, 92, 255, .5); }
.cert.hide { display: none; }
.cert.retired { border-style: dashed; }
.cert.retired > * { opacity: .6; transition: opacity .3s; }
.cert.retired:hover > * { opacity: .9; }
.cert-icon { grid-row: 1 / 3; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font: 600 17px var(--mono); background: linear-gradient(135deg, rgba(139, 92, 255, .35), rgba(77, 243, 208, .2)); color: #fff; }
.cert b { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.cert small { color: var(--muted); font-size: 12.5px; }
.link { color: var(--cyan); border-bottom: 1px solid transparent; transition: .2s; }
.link:hover { border-color: var(--cyan); }
@media (min-width: 640px) { .certs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .certs { grid-template-columns: repeat(3, 1fr); } }

/* ============ Quotes ============ */
.quotes { display: grid; gap: 16px; grid-template-columns: 1fr; }
.quote { margin: 0; padding: clamp(20px, 3vw, 28px); border-radius: var(--radius); background: var(--card); border: 1px solid var(--card-b); display: flex; flex-direction: column; gap: 20px; }
.quote blockquote { margin: 0; font: italic 400 clamp(17px, 2.2vw, 20px)/1.55 var(--serif); color: #dcdbee; }
.quote blockquote::before { content: "“"; display: block; font: 700 54px/0.6 var(--serif); color: var(--violet); margin-bottom: 8px; }
.quote figcaption { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.quote img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 1px solid var(--card-b); }
.quote b { display: block; font-size: 15px; }
.quote span { font-size: 13px; color: var(--muted); }
@media (min-width: 900px) { .quotes { grid-template-columns: repeat(3, 1fr); } }

/* ============ Contact / form ============ */
.contact { display: grid; gap: 32px; padding: clamp(22px, 5vw, 48px); background: linear-gradient(160deg, rgba(139, 92, 255, .14), rgba(255, 255, 255, .03)); }
.contact h2 { margin-bottom: 14px; }
.contact-list { margin-top: 24px; display: grid; gap: 12px; }
.contact-list li { display: flex; align-items: center; gap: 12px; font-size: 15px; word-break: break-word; }
.contact-list span { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); font: 600 13px var(--mono); }
.contact-list a:hover { color: var(--cyan); }
.form { display: grid; gap: 16px; }
.row { display: grid; gap: 16px; grid-template-columns: 1fr; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend { font-size: 13px; font-weight: 500; color: #cfd0e6; padding: 0; margin-bottom: 8px; }
.field i { font-style: normal; color: var(--muted); }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; min-height: 50px; padding: 13px 16px; font: 400 16px var(--sans); color: var(--text); background: rgba(255, 255, 255, .05);
  border: 1px solid var(--card-b); border-radius: 14px; transition: border-color .2s, background .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%239a98ad' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
select option { background: #14141f; color: #fff; }
textarea { resize: vertical; min-height: 130px; }
input::placeholder, textarea::placeholder { color: #66647a; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); background: rgba(139, 92, 255, .08); box-shadow: 0 0 0 4px rgba(139, 92, 255, .2); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; border: 1px solid var(--card-b); background: rgba(255, 255, 255, .04); color: var(--muted); transition: .2s; }
.choice:hover span { color: #fff; border-color: rgba(139, 92, 255, .6); }
.choice input:checked + span { background: var(--grad); color: #03030a; border-color: transparent; font-weight: 600; }
.choice input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 3px; }
.form-status { min-height: 1.5em; font-size: 14px; text-align: center; }
.form-status.ok { color: var(--green); }
.form-status.err { color: #fb7185; }
.btn.loading { opacity: .7; pointer-events: none; }
@media (min-width: 640px) { .row { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .contact { grid-template-columns: .85fr 1.15fr; gap: 56px; } }

/* ============ Footer ============ */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; padding: 48px 0 calc(40px + env(safe-area-inset-bottom)); margin-top: clamp(56px, 9vw, 96px); border-top: 1px solid var(--card-b); font-size: 14px; color: var(--muted); }

/* ============ Reveal ============ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ============ Motion preferences ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
}
@media (hover: none) { .spotlight { display: none; } }

/* ============ Justified body copy ============ */
.hero-copy, .card-lg p:not(.about-lead):not(.about-kicker), .card p.muted, .about-copy p:not(.about-lead):not(.about-kicker),
.timeline ul li, .project ul li, .quote blockquote { text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto; }

/* ============ Mobile: keep stat / result tiles in a single row ============ */
@media (max-width: 639px) {
  .stats { grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
  .stat { padding: 12px 6px; border-radius: 14px; text-align: center; }
  .stat b { font-size: clamp(22px, 7vw, 30px); }
  .stat span { font-size: 10.5px; margin-top: 4px; overflow-wrap: anywhere; }

  .impact { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .impact-card { padding: 14px 6px; gap: 8px; border-radius: 16px; }
  .impact-card .ring.big { --size: clamp(68px, 21vw, 96px); }
  .impact-card h3 { font-size: 12px; line-height: 1.25; }
  .impact-card p { display: none; }

  .rings { grid-template-columns: repeat(3, 1fr); gap: 16px 6px; padding: 18px 8px; }
  .ring-item { font-size: 11.5px; gap: 6px; }
  .rings .ring { --size: clamp(64px, 19vw, 84px); }
}


/* ============ Section AI backgrounds (full-bleed, behind content) ============ */
.has-ai { position: relative; }
.has-ai > :not(.ai-bg) { position: relative; z-index: 1; }
.ai-bg { position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; margin-left: -50vw; z-index: 0; overflow: hidden; pointer-events: none; }
.ai-pane { position: absolute; width: min(400px, 44vw); height: 214px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(139, 92, 255, .22); background: rgba(4, 4, 12, .45); backdrop-filter: blur(2px);
  opacity: .4; transition: opacity .9s; overflow: hidden; box-shadow: 0 0 60px -20px rgba(139, 92, 255, .6); animation: aiFloat 11s ease-in-out infinite alternate; }
.ai-pane.off { opacity: 0; }
.ai-pane pre { margin: 0; font: 400 12px/1.7 var(--mono); color: #cfd0e6; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-pane .c { color: var(--cyan); } .ai-pane .v { color: #d9c8ff; } .ai-pane .g { color: var(--green); } .ai-pane .m { color: #6b6a85; } .ai-pane .y { color: #ffc861; }
.ai-pane .cur { display: inline-block; width: 7px; height: 1em; background: var(--cyan); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.ai-pane.p1 { top: 4%; left: 1.5%; } .ai-pane.p2 { top: 14%; right: 1.5%; animation-delay: -4s; } .ai-pane.p3 { top: 42%; left: 3%; animation-delay: -7s; } .ai-pane.p4 { top: 62%; right: 2.5%; animation-delay: -2s; } .ai-pane.p5 { top: 84%; left: 2%; animation-delay: -5s; }
@keyframes aiFloat { to { transform: translate3d(0, -14px, 0); } }
.ai-chip { position: absolute; font: 500 12px var(--mono); color: #a5b4fc; opacity: 0; white-space: nowrap; padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(139, 92, 255, .3); background: rgba(139, 92, 255, .08);
  transform: scale(var(--s, 1)); animation: aiRise var(--d, 18s) linear forwards; }
@keyframes aiRise { 8% { opacity: .45; } 85% { opacity: .35; } to { opacity: 0; transform: translate3d(var(--x, 0), -55vh, 0) scale(var(--s, 1)); } }
@media (max-width: 767px) {
  .ai-pane { width: 78vw; height: 170px; padding: 10px 12px; opacity: .3; }
  .ai-pane pre { font-size: 10.5px; line-height: 1.6; }
  .ai-pane:nth-child(odd) { left: -10%; right: auto; } .ai-pane:nth-child(even) { right: -10%; left: auto; } .ai-pane:nth-child(n+4) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ai-pane { animation: none; } }
/* ============ Number smash ============ */
html:not(.no-js) [data-count]:not(.smash) { opacity: 0; }
.smash { animation: smash .6s cubic-bezier(.2, .9, .25, 1.15) both; transform-origin: 0 60%; }
.ring b.smash { transform-origin: center; }
@keyframes smash {
  0% { transform: scale(3.4) rotate(-7deg); opacity: 0; filter: blur(12px); }
  50% { opacity: 1; filter: blur(0); transform: scale(.9) rotate(1.5deg); }
  70% { transform: scale(1.08) rotate(-.6deg); }
  100% { transform: none; opacity: 1; }
}
.thud { animation: thud .38s ease-out; }
@keyframes thud { 0% { translate: 0 0; } 25% { translate: 0 3px; } 55% { translate: 0 -1px; } 100% { translate: 0 0; } }
.shock { position: absolute; z-index: 5; width: var(--sz, 160px); aspect-ratio: 1; margin: calc(var(--sz, 160px) / -2) 0 0 calc(var(--sz, 160px) / -2); border-radius: 50%; border: 2px solid rgba(199, 166, 255, .9); box-shadow: 0 0 36px rgba(77, 243, 208, .55), inset 0 0 24px rgba(139, 92, 255, .4); pointer-events: none; animation: shock .7s ease-out forwards; }
@keyframes shock { from { transform: scale(.15); opacity: 1; } to { transform: scale(1); opacity: 0; } }
.spark { position: absolute; z-index: 5; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan), 0 0 18px var(--violet); pointer-events: none; animation: spark .75s cubic-bezier(.1, .7, .3, 1) forwards; }
.spark:nth-of-type(3n) { background: var(--violet); box-shadow: 0 0 10px var(--violet); }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* hero text block wrapper */
.hero-win { display: grid; gap: 22px; justify-items: start; }

/* =====================================================================
   THEME: macOS TERMINAL — every tile is its own dark Terminal window,
   with traffic lights, a title bar and flowing RGB text
   (activated by <html data-theme="terminal">, which is always set)
   ===================================================================== */
html[data-theme="terminal"] {
  --bg: #0a0a0c; --bg-2: #101013;
  --card: #1c1c1e; --card-b: rgba(255, 255, 255, .13);
  --text: #e5e5e7; --muted: #98989f;
  --violet: #bf5af2; --cyan: #64d2ff; --pink: #ff375f; --gold: #ffd60a; --green: #30d158;
  --rgb: linear-gradient(90deg, #ff453a, #ff9f0a, #ffd60a, #30d158, #64d2ff, #0a84ff, #bf5af2, #ff375f, #ff453a);
  --grad: var(--rgb);
  --btn-grad: linear-gradient(90deg, #ff453a, #ff9f0a, #30d158, #0a84ff, #bf5af2);
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "JetBrains Mono", monospace;
  --sans: var(--mono); --display: var(--mono); --serif: var(--mono);
  --bar: 28px;
  scrollbar-color: #48484a #0a0a0c;
}
html[data-theme="terminal"] body { font-size: clamp(13.5px, 1.3vw, 15px); line-height: 1.7; background: radial-gradient(90% 50% at 50% -10%, rgba(100, 110, 255, .09), transparent 65%), #0a0a0c; background-attachment: fixed; }
html[data-theme="terminal"] ::selection { background: #0a84ff; color: #fff; }
html[data-theme="terminal"] .fx-head::before, html[data-theme="terminal"] .fx-head::after { display: none; }
html[data-theme="terminal"] .hero-fx { filter: none; }

/* ---- the window: dark body + title bar + traffic lights + centred title ---- */
html[data-theme="terminal"] :is(.stat, .impact-card, .skill-group, .project, .timeline > li, .quote, .cert, .ring-item, .card, .contact) {
  position: relative; border: 1px solid rgba(255, 255, 255, .13); border-top: var(--bar) solid transparent; border-radius: 10px;
  background:
    radial-gradient(circle at 15px calc(var(--bar) / 2), #ff5f57 0 4.5px, transparent 5.2px),
    radial-gradient(circle at 31px calc(var(--bar) / 2), #febc2e 0 4.5px, transparent 5.2px),
    radial-gradient(circle at 47px calc(var(--bar) / 2), #28c840 0 4.5px, transparent 5.2px),
    linear-gradient(#3c3c3e, #2b2b2d) 0 0 / 100% var(--bar) no-repeat,
    rgba(24, 24, 26, .92);
  background-origin: border-box; background-clip: border-box;
  box-shadow: 0 24px 60px -26px rgba(0, 0, 0, .95), 0 0 0 1px rgba(0, 0, 0, .55);
}
html[data-theme="terminal"] :is(.stat, .impact-card, .skill-group, .project, .timeline > li, .quote, .cert, .ring-item, .card, .contact)::after {
  content: attr(data-title); position: absolute; top: calc(-1 * var(--bar)); left: 62px; right: 12px; height: var(--bar); line-height: var(--bar);
  text-align: left; font: 500 11px/var(--bar) var(--mono); color: #98989f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; letter-spacing: 0;
}
html[data-theme="terminal"] :is(.stat, .impact-card, .skill-group, .project, .timeline > li, .quote, .cert, .ring-item, .card, .contact):hover {
  border-color: rgba(255, 255, 255, .26); border-top-color: transparent; box-shadow: 0 30px 70px -26px rgba(0, 0, 0, 1), 0 0 0 1px rgba(0, 0, 0, .55), 0 0 40px -18px rgba(100, 160, 255, .55);
}
html[data-theme="terminal"] .card-accent { background-blend-mode: normal; }
html[data-theme="terminal"] .card-lg.card::after { animation: none; -webkit-mask: none; mask: none; padding: 0; background: none; }
html[data-theme="terminal"] .rings { background: none; border: 0; box-shadow: none; padding: 0; gap: 16px; }
html[data-theme="terminal"] .ring-item { padding: 18px 8px 14px; }
html[data-theme="terminal"] .timeline { border-left-color: rgba(255, 255, 255, .12); }
html[data-theme="terminal"] .timeline > li::before { top: 6px; background: #30d158; border-radius: 50%; box-shadow: 0 0 0 4px rgba(48, 209, 88, .16), 0 0 12px #30d158; }
html[data-theme="terminal"] .timeline > li::after { left: 62px; }

/* hero text block: the big window */
html[data-theme="terminal"] .hero-win { position: relative; width: 100%; padding: calc(34px + clamp(18px, 3vw, 32px)) clamp(18px, 3vw, 36px) clamp(18px, 3vw, 32px); border-radius: 12px; border: 1px solid rgba(255, 255, 255, .15);
  background: radial-gradient(circle at 18px 17px, #ff5f57 0 5.5px, transparent 6.2px), radial-gradient(circle at 38px 17px, #febc2e 0 5.5px, transparent 6.2px), radial-gradient(circle at 58px 17px, #28c840 0 5.5px, transparent 6.2px), linear-gradient(#404042, #2d2d2f) 0 0 / 100% 34px no-repeat, rgba(22, 22, 24, .78);
  box-shadow: 0 50px 110px -34px rgba(0, 0, 0, 1), 0 0 0 1px rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
html[data-theme="terminal"] .hero-win::before { content: "umar — -zsh — 100×30"; position: absolute; top: 0; left: 90px; right: 90px; height: 34px; text-align: center; font: 500 12px/34px var(--mono); color: #98989f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-theme="terminal"] .hero-title::before { content: "umar@portfolio ~ % whoami"; display: block; margin-bottom: 14px; font: 500 13px/1.4 var(--mono); letter-spacing: 0; color: #30d158; -webkit-text-fill-color: #30d158; }
html[data-theme="terminal"] .hero-title { font-size: clamp(26px, 4.6vw, 56px); line-height: 1.12; letter-spacing: -.045em; }
html[data-theme="terminal"] .section h2 { font-size: clamp(22px, 4vw, 40px); letter-spacing: -.04em; color: #f2f2f7; }
html[data-theme="terminal"] .section h2::before { content: "% "; color: #636366; }
html[data-theme="terminal"] .stats { margin-top: 22px; }

/* ---- flowing RGB text ---- */
@keyframes rgbflow { to { background-position: -300% 0; } }
html[data-theme="terminal"] :is(.grad, .hero-title em, .section h2 em, .eyebrow, .hero-sub #typed, .timeline time, .project-role, .brand span) {
  background: var(--rgb); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  animation: rgbflow 8s linear infinite; filter: none; text-shadow: none;
}
html[data-theme="terminal"] .section h2 em { animation-delay: -2s; } html[data-theme="terminal"] .eyebrow { animation-delay: -4s; } html[data-theme="terminal"] .timeline time { animation-delay: -1s; }
html[data-theme="terminal"] .eyebrow::before { content: "//"; color: #ff9f0a; -webkit-text-fill-color: #ff9f0a; margin-right: 10px; }
html[data-theme="terminal"] em { font-style: normal; }
html[data-theme="terminal"] :is(.stat b, .ring b) { background: var(--rgb); background-size: 500% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; filter: none; }
html[data-theme="terminal"] .stat:nth-child(1) b, html[data-theme="terminal"] .impact-card:nth-child(1) .ring b, html[data-theme="terminal"] .ring-item:nth-child(1) b { background-position: 4% 0; }
html[data-theme="terminal"] .stat:nth-child(2) b, html[data-theme="terminal"] .impact-card:nth-child(2) .ring b, html[data-theme="terminal"] .ring-item:nth-child(2) b { background-position: 24% 0; }
html[data-theme="terminal"] .stat:nth-child(3) b, html[data-theme="terminal"] .impact-card:nth-child(3) .ring b, html[data-theme="terminal"] .ring-item:nth-child(3) b { background-position: 44% 0; }
html[data-theme="terminal"] .stat:nth-child(4) b, html[data-theme="terminal"] .ring-item:nth-child(4) b { background-position: 64% 0; }
html[data-theme="terminal"] .ring-item:nth-child(5) b { background-position: 82% 0; } html[data-theme="terminal"] .ring-item:nth-child(6) b { background-position: 96% 0; }
html[data-theme="terminal"] .brand { letter-spacing: -.04em; }
html[data-theme="terminal"] .hero-sub .mono, html[data-theme="terminal"] .mono { color: #30d158; }
html[data-theme="terminal"] .caret { background: #e5e5e7; }
html[data-theme="terminal"] .hero-copy b { color: #fff; }
html[data-theme="terminal"] .about-lead em, html[data-theme="terminal"] .about-kicker { color: #64d2ff !important; }
html[data-theme="terminal"] #ringGrad stop:nth-child(1) { stop-color: #ff9f0a; }
html[data-theme="terminal"] #ringGrad stop:nth-child(2) { stop-color: #bf5af2; }
html[data-theme="terminal"] #ringGrad stop:nth-child(3) { stop-color: #0a84ff; }
html[data-theme="terminal"] .ring .v { filter: drop-shadow(0 0 6px rgba(120, 130, 255, .6)); }

/* tags, chips, bullets, icons */
html[data-theme="terminal"] .tag { background: rgba(100, 210, 255, .14); color: #64d2ff; border-radius: 4px; }
html[data-theme="terminal"] .tag.ai { background: rgba(191, 90, 242, .16); color: #bf5af2; }
html[data-theme="terminal"] .tag.ghost { background: transparent; color: var(--muted); }
html[data-theme="terminal"] .chip.lvl-5, html[data-theme="terminal"] .legend i.lvl-5 { --c: #30d158; }
html[data-theme="terminal"] .chip.lvl-4, html[data-theme="terminal"] .legend i.lvl-4 { --c: #64d2ff; }
html[data-theme="terminal"] .legend i.lvl-5 { background: #30d158; } html[data-theme="terminal"] .legend i.lvl-4 { background: #64d2ff; }
html[data-theme="terminal"] :is(.timeline ul li::before, .project li::before) { content: "›"; color: #30d158; }
html[data-theme="terminal"] .cert-icon { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); color: #64d2ff; }
html[data-theme="terminal"] :is(.chip, .about-tags li, .stack span, .pill, .filter, .choice span) { border-radius: 6px; }

/* nav, buttons, fields */
html[data-theme="terminal"] .nav { background: rgba(28, 28, 30, .86); border-color: rgba(255, 255, 255, .14); border-radius: 12px; box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .9); }
html[data-theme="terminal"] .nav-links a:hover, html[data-theme="terminal"] .nav-links a.active { color: #fff; background: rgba(255, 255, 255, .09); }
html[data-theme="terminal"] .btn-primary, html[data-theme="terminal"] .filter.active, html[data-theme="terminal"] .choice input:checked + span { background: var(--btn-grad); background-size: 200% 100%; color: #0a0a0c; font-weight: 700; box-shadow: 0 10px 30px -14px rgba(10, 132, 255, .8); transition: background-position .6s, transform .25s, box-shadow .25s; }
html[data-theme="terminal"] .btn-primary:hover { background-position: 100% 0; box-shadow: 0 12px 36px -12px rgba(191, 90, 242, .8); }
html[data-theme="terminal"] .nav-cta-mobile a { background: var(--btn-grad) !important; color: #0a0a0c; }
html[data-theme="terminal"] .btn-ghost { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .2); color: #e5e5e7; }
html[data-theme="terminal"] .btn-ghost:hover { background: rgba(255, 255, 255, .11); }
html[data-theme="terminal"] input[type="text"], html[data-theme="terminal"] input[type="email"], html[data-theme="terminal"] select, html[data-theme="terminal"] textarea { border-radius: 8px; border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05); }
html[data-theme="terminal"] input:focus, html[data-theme="terminal"] select:focus, html[data-theme="terminal"] textarea:focus { border-color: #0a84ff; background: rgba(10, 132, 255, .08); box-shadow: 0 0 0 3px rgba(10, 132, 255, .25); }
html[data-theme="terminal"] .progress { background: var(--rgb); background-size: 300% 100%; animation: rgbflow 6s linear infinite; }
html[data-theme="terminal"] .spotlight { background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(120, 140, 255, .07), transparent 62%); }
html[data-theme="terminal"] .marquee { border-color: rgba(255, 255, 255, .1); }
html[data-theme="terminal"] .marquee-track span::after { content: "●"; font-size: 8px; color: #30d158; text-shadow: none; }
html[data-theme="terminal"] .dot { background: #30d158; }
html[data-theme="terminal"] .section h2::before, html[data-theme="terminal"] .nav-links a::before { content: none; }
html[data-theme="terminal"] .section h2::before { content: "% "; font-size: .55em; vertical-align: .18em; color: #636366; -webkit-text-fill-color: #636366; }
@media (max-width: 859px) { html[data-theme="terminal"] .nav-links { background: rgba(10, 10, 12, .97); } html[data-theme="terminal"] .nav-links a { font-family: var(--mono); font-size: 22px; } }

/* AI windows: background Terminal sessions */
html[data-theme="terminal"] .ai-pane { border: 1px solid rgba(255, 255, 255, .12); border-top: 22px solid transparent; border-radius: 8px;
  background: radial-gradient(circle at 12px 11px, #ff5f57 0 3.6px, transparent 4.2px), radial-gradient(circle at 25px 11px, #febc2e 0 3.6px, transparent 4.2px), radial-gradient(circle at 38px 11px, #28c840 0 3.6px, transparent 4.2px), linear-gradient(#38383a, #2a2a2c) 0 0 / 100% 22px no-repeat, rgba(20, 20, 22, .8);
  background-origin: border-box; box-shadow: 0 20px 50px -28px rgba(0, 0, 0, .9); }
html[data-theme="terminal"] .ai-pane::after { content: attr(data-title); position: absolute; top: -22px; left: 50px; right: 50px; height: 22px; font: 500 10px/22px var(--mono); color: #8e8e93; text-align: center; white-space: nowrap; overflow: hidden; }
html[data-theme="terminal"] .ai-pane .c { color: #64d2ff; } html[data-theme="terminal"] .ai-pane .v { color: #bf5af2; }
html[data-theme="terminal"] .ai-pane .g { color: #30d158; } html[data-theme="terminal"] .ai-pane .m { color: #636366; }
html[data-theme="terminal"] .ai-pane .y { color: #ffd60a; } html[data-theme="terminal"] .ai-pane .cur { background: #e5e5e7; }
html[data-theme="terminal"] .ai-chip { color: #64d2ff; border-color: rgba(100, 210, 255, .3); background: rgba(100, 210, 255, .07); }
@media (prefers-reduced-motion: reduce) { html[data-theme="terminal"] :is(.grad, .hero-title em, .section h2 em, .eyebrow, .hero-sub #typed, .timeline time, .project-role, .brand span, .progress) { animation: none; } }

/* =====================================================================
   TERMINAL THEME — contact form typed like a shell session
   ===================================================================== */
html[data-theme="terminal"] .form { gap: 18px; font-family: var(--mono); }
html[data-theme="terminal"] .form::before { content: "Last login: just now on ttys001"; font: 400 12px/1.5 var(--mono); color: #636366; }
html[data-theme="terminal"] .row { gap: 18px 28px; }

/* every label becomes a prompt: "% your name ›" */
html[data-theme="terminal"] .field { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
html[data-theme="terminal"] fieldset.field, html[data-theme="terminal"] .field:has(textarea) { display: grid; gap: 8px; }
html[data-theme="terminal"] .field > span, html[data-theme="terminal"] .field legend { font: 500 13.5px/1.5 var(--mono); color: #30d158; margin: 0; padding: 0; text-transform: lowercase; white-space: nowrap; }
html[data-theme="terminal"] .field > span::before, html[data-theme="terminal"] .field legend::before { content: "% "; color: #636366; }
html[data-theme="terminal"] .field > span::after, html[data-theme="terminal"] .field legend::after { content: " ›"; color: #ffd60a; }
html[data-theme="terminal"] .field legend::after { content: " › (pick one)"; }
html[data-theme="terminal"] .field i { color: #636366; }

/* inputs: no boxes, just text on the prompt line with a block cursor */
html[data-theme="terminal"] .form :is(input[type="text"], input[type="email"], select, textarea) {
  flex: 1 1 80px; min-width: 0; min-height: 32px; padding: 3px 2px; border: 0; border-bottom: 1px dashed rgba(255, 255, 255, .16); border-radius: 0;
  background-color: transparent; box-shadow: none; font: 400 15px/1.5 var(--mono); color: #e5e5e7; caret-color: #30d158; caret-shape: block; -webkit-appearance: none; appearance: none;
}
html[data-theme="terminal"] .form :is(input[type="text"], input[type="email"], select, textarea)::placeholder { color: #5c5c61; font-style: normal; }
html[data-theme="terminal"] .form :is(input[type="text"], input[type="email"], select, textarea):focus { border-bottom: 1px solid #30d158; background-color: rgba(48, 209, 88, .06); box-shadow: none; outline: none; }
html[data-theme="terminal"] .form input:-webkit-autofill { -webkit-text-fill-color: #e5e5e7; box-shadow: 0 0 0 100px #1a1a1c inset; caret-color: #30d158; }
html[data-theme="terminal"] .form select { color: #ffd60a; cursor: pointer; padding-right: 26px; background-position: right 4px center; }
html[data-theme="terminal"] .form textarea { border: 0; border-left: 2px solid rgba(48, 209, 88, .45); padding: 6px 0 6px 12px; min-height: 120px; resize: vertical; background-image: none; }
html[data-theme="terminal"] .form textarea:focus { border-left-color: #30d158; }

/* the interest radios become a zsh-style menu:  ( ) option  /  (●) option */
html[data-theme="terminal"] .choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 2px 18px; }
html[data-theme="terminal"] .choice span { min-height: 34px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; font: 400 14px var(--mono); color: #98989f; transition: color .15s; }
html[data-theme="terminal"] .choice > span::before { content: "( ) "; white-space: pre; color: #636366; transition: color .15s; }
html[data-theme="terminal"] .choice:hover span { color: #e5e5e7; border: 0; }
html[data-theme="terminal"] .choice:hover > span::before { color: #30d158; }
html[data-theme="terminal"] .choice input:checked + span { background: none; box-shadow: none; color: #fff; font-weight: 600; }
html[data-theme="terminal"] .choice input:checked + span::before { content: "(●) "; color: #30d158; }
html[data-theme="terminal"] .choice input:focus-visible + span { outline: 1px dashed #30d158; outline-offset: 2px; }

/* submit = running a script, status = shell output */
html[data-theme="terminal"] .btn-block { justify-content: flex-start; padding: 0 20px; border-radius: 8px; font-family: var(--mono); letter-spacing: 0; text-transform: lowercase; }
html[data-theme="terminal"] .btn-block .label::before { content: "$ ./"; opacity: .7; }
html[data-theme="terminal"] .btn-block .arrow { margin-left: auto; }
html[data-theme="terminal"] .form-status { text-align: left; font: 400 13.5px/1.6 var(--mono); color: #98989f; }
html[data-theme="terminal"] .form-status:not(:empty)::before { content: "% "; color: #636366; }
html[data-theme="terminal"] .form-status.ok { color: #30d158; }
html[data-theme="terminal"] .form-status.ok::before { content: "✔ "; color: #30d158; }
html[data-theme="terminal"] .form-status.err { color: #ff453a; }
html[data-theme="terminal"] .form-status.err::before { content: "✖ "; color: #ff453a; }
@media (max-width: 639px) { html[data-theme="terminal"] .field > span::before, html[data-theme="terminal"] .field legend::before { content: "% "; } html[data-theme="terminal"] .field { flex-direction: column; align-items: stretch; } }

/* =====================================================================
   COMPACT FORM — smaller fields, tighter spacing (both themes)
   ===================================================================== */
.contact { gap: 24px; padding: clamp(18px, 3.4vw, 32px); }
.form { gap: 12px; }
.row { gap: 12px; }
.field > span, .field legend { margin-bottom: 2px; font-size: 12.5px; }
input[type="text"], input[type="email"], select, textarea { min-height: 42px; padding: 9px 14px; font-size: 15px; border-radius: 12px; }
textarea { min-height: 84px; }
.choices { gap: 6px; }
.choice span { min-height: 34px; padding: 0 13px; font-size: 13px; }
.btn-block { min-height: 44px; font-size: 14.5px; }
.form-status { min-height: 1.2em; font-size: 13px; }
.contact-list { margin-top: 16px; gap: 8px; }

/* terminal: even tighter, one-line prompts */
html[data-theme="terminal"] .form { gap: 8px; max-width: 520px; }
html[data-theme="terminal"] .form::before { font-size: 11px; }
html[data-theme="terminal"] .row { gap: 8px 22px; }
html[data-theme="terminal"] .field > span, html[data-theme="terminal"] .field legend { font-size: 12.5px; }
html[data-theme="terminal"] .form :is(input[type="text"], input[type="email"], select, textarea) { min-height: 26px; padding: 2px 2px; font-size: 13.5px; }
html[data-theme="terminal"] .form textarea { min-height: 64px; height: 64px; padding: 4px 0 4px 10px; }
html[data-theme="terminal"] .choices { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 14px; }
html[data-theme="terminal"] .choice span { min-height: 25px; font-size: 12.5px; }
html[data-theme="terminal"] .btn-block { min-height: 38px; font-size: 13.5px; }
html[data-theme="terminal"] .contact { padding-bottom: 18px; }
@media (min-width: 960px) { html[data-theme="terminal"] .contact { grid-template-columns: 1fr 1fr; gap: 28px; } }
html[data-theme="terminal"] .btn-block { width: auto; align-self: flex-start; padding: 0 22px; gap: 14px; }
html[data-theme="terminal"] .btn-block .arrow { margin-left: 0; }
html[data-theme="terminal"] .field > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
html[data-theme="terminal"] .field i { display: none; }
html[data-theme="terminal"] .form { max-width: 560px; }
html[data-theme="terminal"] .btn-block { justify-self: start; width: auto; }

/* second hero canvas: draws over the terminal window / hero text (never blocks clicks) */
.hero-fx-top { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
@media (max-width: 767px) { .hero-fx-top { opacity: .75; } }

/* readable body copy + quiet background AI windows */
html[data-theme="terminal"] :is(.hero-copy, .quote blockquote) { text-align: left; hyphens: manual; -webkit-hyphens: manual; }
html[data-theme="terminal"] .ai-pane { opacity: .26; }
@media (max-width: 767px) { html[data-theme="terminal"] .ai-pane { opacity: .18; } }

/* ---- typed reveal ---- */
.tt-r { opacity: 0; }
.tt-c { display: inline-block; width: .55em; height: 1.05em; margin-left: 1px; vertical-align: -.16em; background: #30d158; -webkit-text-fill-color: initial; animation: blink 1s steps(1) infinite; }

/* ---- brand: big outlined "uf." that fills with flowing colour, and goes weird on hover ----
   (the animation runs on the inner .bt so the hover target never moves out from under the pointer) */
.brand { display: inline-block; margin-right: auto; padding: 4px 14px 4px 6px; cursor: pointer; }
.brand .bt { position: relative; display: inline-block; font: 700 54px/1 var(--display); letter-spacing: -.07em; color: transparent; -webkit-text-stroke: 1.4px rgba(255, 255, 255, .55); user-select: none; transform-origin: 30% 70%; }
.brand .bt::before { content: attr(data-text); position: absolute; left: 0; top: 0; background: var(--rgb); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 0;
  clip-path: inset(100% 0 0 0); filter: drop-shadow(0 0 10px rgba(191, 90, 242, .6)); animation: brandFill 5.5s cubic-bezier(.55, 0, .25, 1) infinite, rgbflow 3s linear infinite; pointer-events: none; }
@keyframes brandFill { 0% { clip-path: inset(100% 0 0 0); } 35%, 68% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 100% 0); } }
.brand:hover .bt { animation: brandWobble .95s cubic-bezier(.3, 1.6, .5, 1) both; -webkit-text-stroke-color: rgba(255, 255, 255, .9); }
.brand:hover .bt::before { clip-path: inset(0 0 0 0); animation: rgbflow .55s linear infinite, brandGlitch .45s steps(2, end) infinite; filter: drop-shadow(3px 0 #ff453a) drop-shadow(-3px 0 #0a84ff) drop-shadow(0 0 14px rgba(255, 214, 10, .7)); }
@keyframes brandWobble {
  0% { transform: none; } 14% { transform: scale(1.4, .55) rotate(-7deg); } 30% { transform: scale(.7, 1.45) rotate(9deg) skewX(-16deg); }
  48% { transform: scale(1.25, .85) rotate(-4deg) skewX(12deg); } 70% { transform: rotateY(180deg) scale(1.1); } 100% { transform: rotateY(360deg) scale(1.1) rotate(-3deg); }
}
@keyframes brandGlitch { 0% { transform: translate(0, 0); } 25% { transform: translate(-3px, 2px) skewX(9deg); } 50% { transform: translate(3px, -2px); } 75% { transform: translate(-2px, -3px) skewX(-9deg); } 100% { transform: translate(0, 0); } }
@media (max-width: 859px) { .brand .bt { font-size: 40px; } }
@media (prefers-reduced-motion: reduce) { .brand .bt::before { clip-path: none; animation: none; } .brand:hover .bt, .brand:hover .bt::before { animation: none; } }

/* =====================================================================
   CLIENT-SAFE REFINEMENT — one green accent; rainbow only on the logo and name
   ===================================================================== */
/* accent text: solid green instead of flowing RGB */
html[data-theme="terminal"] :is(.hero-title em, .section h2 em, .eyebrow, .hero-sub #typed, .timeline time, .project-role) {
  background: none; -webkit-background-clip: border-box; background-clip: border-box; -webkit-text-fill-color: initial; color: #30d158; animation: none;
}
html[data-theme="terminal"] .eyebrow::before { color: #636366; -webkit-text-fill-color: #636366; }
html[data-theme="terminal"] .project-role, html[data-theme="terminal"] .timeline time { color: #8fe3a5; }
html[data-theme="terminal"] :is(.stat b, .ring b) { background: none; -webkit-text-fill-color: #e5e5e7; color: #e5e5e7; }
html[data-theme="terminal"] #ringGrad stop:nth-child(1) { stop-color: #64d2ff; }
html[data-theme="terminal"] #ringGrad stop:nth-child(2) { stop-color: #30d158; }
html[data-theme="terminal"] #ringGrad stop:nth-child(3) { stop-color: #30d158; }
html[data-theme="terminal"] .ring .v { filter: none; }

/* buttons and progress: solid green */
html[data-theme="terminal"] :is(.btn-primary, .filter.active, .choice input:checked + span) { background: #30d158; background-size: auto; color: #04140a; box-shadow: 0 8px 22px -12px rgba(48, 209, 88, .55); }
html[data-theme="terminal"] .btn-primary:hover { background: #46e06f; background-position: 0 0; box-shadow: 0 10px 26px -12px rgba(48, 209, 88, .7); }
html[data-theme="terminal"] .nav-cta-mobile a { background: #30d158 !important; }
html[data-theme="terminal"] .progress { background: #30d158; animation: none; }

/* network animation tinted to the single accent */
html[data-theme="terminal"] :is(.hero-fx, .hero-fx-top) { filter: grayscale(1) sepia(1) hue-rotate(78deg) saturate(2.2) brightness(1.1); }

/* figures just fade in (no slam, no thud) */
.smash { animation: numIn .5s ease both; transform-origin: 0 60%; }
@keyframes numIn { from { opacity: 0; } to { opacity: 1; } }
.thud { animation: none; }

/* logo: keeps its colour-fill; hover is a quick scramble + brighter glow (no flip or glitch) */
.brand:hover .bt { animation: none; transform: scale(1.04); transition: transform .2s; -webkit-text-stroke-color: rgba(255, 255, 255, .85); }
.brand:hover .bt::before { clip-path: inset(0 0 0 0); animation: rgbflow 1s linear infinite; filter: drop-shadow(0 0 12px rgba(191, 90, 242, .65)); }

/* typed-reveal helper spans must never pick up the styles of the elements they sit inside */
.tt, .tt-d, .tt-r { all: unset !important; }
.tt-r { opacity: 0 !important; }
/* contact copy: no mid-word hyphenation */
html[data-theme="terminal"] .contact p { hyphens: manual; -webkit-hyphens: manual; text-align: left; }

/* selected interest option = "(●) label" in the menu, never a filled block */
html[data-theme="terminal"] .choice input:checked + span { background: none; box-shadow: none; color: #fff; font-weight: 600; }

/* phones: fields stack as a column, so inputs must size to their content (not the row-layout flex-basis) */
@media (max-width: 639px) {
  html[data-theme="terminal"] .form :is(input[type="text"], input[type="email"], select, textarea) { flex: 0 0 auto; width: 100%; min-height: 34px; }
  html[data-theme="terminal"] .form textarea { height: 88px; }
  html[data-theme="terminal"] .choices { grid-template-columns: 1fr 1fr; gap: 2px 10px; }
  html[data-theme="terminal"] .choice span { min-height: 36px; display: inline-flex; align-items: center; }
}

/* =====================================================================
   JUSTIFIED BODY COPY — paragraphs, bullets and quotes across the whole site
   ===================================================================== */
html[data-theme="terminal"] body :is(p:not(.eyebrow):not(.pill):not(.hero-sub):not(.form-status):not(.about-kicker):not(.about-lead):not(.hidden):not(.hero-copy):not(.contact p), blockquote, .timeline ul li, .project ul li) {
  text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto;
}
/* wide blocks: justified, but whole words only (no hyphenation) */
html[data-theme="terminal"] body :is(.hero-copy, .contact p:not(.hidden)) { text-align: justify; text-justify: inter-word; hyphens: manual; -webkit-hyphens: manual; }
/* centred captions keep their last line centred */
html[data-theme="terminal"] body .impact-card p { text-align-last: center; }
