/* ---------- Tokens ---------- */
:root {
  --bg: #07090f;
  --bg-2: #0d1220;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --fg: #eef1f7;
  --muted: #9aa4b8;
  --accent: #6ea8ff;
  --accent-2: #b78bff;
  --accent-3: #4de0c4;
  --glow: rgba(110, 168, 255, 0.18);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 22px;
  --pad: clamp(16px, 5vw, 56px);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #e9edf6;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --border: rgba(20, 30, 60, 0.12);
  --fg: #101523;
  --muted: #566078;
  --accent: #2557d6;
  --accent-2: #7a3fe0;
  --accent-3: #0a9b84;
  --glow: rgba(37, 87, 214, 0.14);
  --shadow: 0 24px 50px -24px rgba(30, 50, 100, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: var(--pad); }

/* ---------- Background effects ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: radial-gradient(1200px 700px at 80% -10%, var(--bg-2), transparent), var(--bg); }
/* Soft blobs drawn as radial gradients, not blurred circles: a 90px blur on
   three drifting half-screen layers had Safari redrawing the blur every
   frame, starving everything else (animations stalled on iPhone). The box is
   grown by the old blur radius on each side so the fade reaches as far. */
.aurora span { background: radial-gradient(closest-side, var(--c), color-mix(in srgb, var(--c) 82%, transparent) 25%, color-mix(in srgb, var(--c) 50%, transparent) 50%, color-mix(in srgb, var(--c) 20%, transparent) 72%, color-mix(in srgb, var(--c) 5%, transparent) 88%, transparent); position: absolute; width: calc(46vw + 180px); height: calc(46vw + 180px); min-width: 500px; min-height: 500px; margin: -90px; border-radius: 50%; opacity: 0.5; animation: drift 24s ease-in-out infinite alternate; will-change: transform; }
.aurora span:nth-child(1) { --c: var(--accent); top: -12%; left: -8%; opacity: 0.32; }
.aurora span:nth-child(2) { --c: var(--accent-2); top: 30%; right: -14%; animation-duration: 30s; animation-delay: -8s; opacity: 0.28; }
.aurora span:nth-child(3) { --c: var(--accent-3); bottom: -20%; left: 22%; animation-duration: 36s; animation-delay: -14s; opacity: 0.2; }
:root[data-theme="light"] .aurora span { opacity: 0.22; }
@keyframes drift { to { transform: translate3d(8vw, 6vh, 0) scale(1.15); } }

.grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.06; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

.cursor-glow { position: fixed; top: 0; left: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; pointer-events: none; z-index: -1; background: radial-gradient(circle, var(--glow), transparent 65%); transform: translate3d(-999px, -999px, 0); transition: opacity 0.3s; }
@media (hover: none) { .cursor-glow { display: none; } }

.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 100; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)); }

/* ---------- Nav ---------- */
.nav { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 28px; padding: 10px 14px 10px 22px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); max-width: calc(100% - 32px); transition: box-shadow 0.3s, background 0.3s; }
.nav.scrolled { box-shadow: var(--shadow); background: var(--surface-strong); }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.logo .logo-text { color: var(--fg); }
.nav nav { display: flex; gap: 6px; }
.nav nav a { text-decoration: none; font-size: 0.9rem; color: var(--muted); padding: 6px 12px; border-radius: 999px; transition: color 0.2s, background 0.2s; }
.nav nav a:hover, .nav nav a.active { color: var(--fg); background: var(--surface-strong); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--fg); cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.menu-toggle span { display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.25s, opacity 0.2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.theme-toggle { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--fg); cursor: pointer; display: grid; place-items: center; transition: transform 0.4s, background 0.2s; }
.theme-toggle:hover { background: var(--surface-strong); transform: rotate(40deg); }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; align-items: center; position: relative; padding-block: 120px 80px; }
.hero-inner { display: flex; flex-direction: column; gap: 28px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 0 0 var(--accent-3); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: clamp(2.6rem, 8vw, 5.6rem); font-weight: 700; display: flex; flex-direction: column; gap: 4px; }
.grad { background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--accent-3)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }
.typed { background: linear-gradient(100deg, var(--accent), var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.caret { display: inline-block; width: 0.08em; height: 0.9em; margin-left: 6px; vertical-align: -0.08em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lede { max-width: 60ch; font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 500; font-size: 0.95rem; text-decoration: none; cursor: pointer; border: 1px solid var(--border); font-family: inherit; color: var(--fg); background: transparent; transition: transform 0.25s, background 0.25s, box-shadow 0.25s, border-color 0.25s; will-change: transform; }
.btn.primary { background: linear-gradient(100deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 10px 30px -10px var(--accent); }
.btn.primary:hover { box-shadow: 0 14px 40px -8px var(--accent); }
.btn.ghost { background: var(--surface); backdrop-filter: blur(8px); }
.btn.ghost:hover { background: var(--surface-strong); border-color: var(--accent); }
.stats { display: flex; flex-wrap: wrap; gap: 14px 44px; padding-top: 12px; }
.stats li { display: flex; flex-direction: column; }
.stats strong { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.stats span { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.scroll-hint { position: absolute; bottom: 26px; left: 50%; width: 24px; height: 38px; margin-left: -12px; border: 2px solid var(--border); border-radius: 14px; }
.scroll-hint span { position: absolute; left: 50%; top: 7px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--fg); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); filter: blur(6px); transition: opacity 0.8s cubic-bezier(.2,.7,.2,1), transform 0.8s cubic-bezier(.2,.7,.2,1), filter 0.8s; transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; filter: none; }
.no-js .reveal { opacity: 1; transform: none; filter: none; }

/* ---------- Shared section ---------- */
section { position: relative; }
.kicker { font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 14px; }
h2 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; }
.sub { color: var(--muted); max-width: 56ch; margin-top: 14px; }

/* ---------- Work: horizontal rail ---------- */
.work { padding-block: 100px 70px; }
.work-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.controls { display: flex; align-items: center; gap: 10px; }
.counter { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); margin-right: 8px; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--fg); font-size: 1.2rem; cursor: pointer; backdrop-filter: blur(8px); transition: transform 0.25s, background 0.25s, border-color 0.25s, opacity 0.25s; }
.round:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: transparent; transform: scale(1.08); }
.round:disabled { opacity: 0.35; cursor: default; }

.rail { display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; padding-block: 24px 36px; scrollbar-width: none; cursor: grab; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.rail::-webkit-scrollbar { display: none; }
.rail.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.rail.dragging * { user-select: none; pointer-events: none; }
.rail-pad { flex: 0 0 max(var(--pad), calc((100vw - 1180px) / 2 + var(--pad))); }

.card { flex: 0 0 min(440px, 86vw); scroll-snap-align: center; display: flex; flex-direction: column; gap: 18px; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%); position: relative; overflow: hidden; transform-style: preserve-3d; transition: transform 0.25s ease-out, border-color 0.3s, box-shadow 0.3s, opacity 0.4s; box-shadow: var(--shadow); opacity: 0.55; }
.card.active { opacity: 1; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--glow), transparent 60%); opacity: 0; transition: opacity 0.3s; }
.card:hover::before { opacity: 1; }
.card.featured { flex-basis: min(560px, 90vw); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.num { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: transparent; -webkit-text-stroke: 1px var(--border); line-height: 1; }
.card h3 { font-size: 1.7rem; }
.blurb { color: var(--muted); }
.points { display: flex; flex-direction: column; gap: 10px; font-size: 0.93rem; }
.points li { position: relative; padding-left: 20px; }
.points li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-3)); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.chips span { font-family: var(--font-mono); font-size: 0.74rem; padding: 4px 10px; border-radius: 8px; background: var(--surface-strong); border: 1px solid var(--border); color: var(--muted); }
.card-link { display: inline-flex; width: fit-content; gap: 6px; font-weight: 500; text-decoration: none; color: var(--accent); border-bottom: 1px solid transparent; transition: border-color 0.2s, gap 0.2s; }
.card-link:hover { border-color: var(--accent); gap: 10px; }

.shot { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-2); }
.shot img { width: 100%; height: auto; transition: transform 0.6s; }
.card:hover .shot img { transform: scale(1.03); }

.flow { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--font-mono); font-size: 0.72rem; }
.flow li { padding: 5px 10px; border-radius: 8px; border: 1px dashed var(--border); color: var(--muted); }
.flow li:not(:last-child)::after { content: "→"; margin-left: 10px; color: var(--accent); }

.diagram { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px; border-radius: 14px; border: 1px dashed var(--border); background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.node { padding: 8px 16px; border-radius: 10px; font-family: var(--font-mono); font-size: 0.8rem; background: var(--surface-strong); border: 1px solid var(--border); }
.node.sm { padding: 8px 14px; }
.trio { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.arrow { color: var(--accent); }
.note { font-size: 0.75rem; color: var(--muted); font-family: var(--font-mono); text-align: center; }

.pipeline { display: flex; align-items: center; gap: 6px; padding: 14px; border-radius: 14px; border: 1px dashed var(--border); font-family: var(--font-mono); font-size: 0.74rem; overflow: hidden; }
.pipeline span { padding: 6px 10px; border-radius: 8px; background: var(--surface-strong); border: 1px solid var(--border); white-space: nowrap; }
.pipeline i { flex: 1 1 10px; min-width: 10px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 200% 100%; animation: flowline 1.6s linear infinite; }
@keyframes flowline { to { background-position: -200% 0; } }

.code { margin: 0; padding: 16px 18px; border-radius: 14px; background: #0b0f1a; border: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.7; overflow-x: auto; color: #d6deeb; }
.code .k { color: #82aaff; } .code .n { color: #f78c6c; } .code .c { color: #637777; }
.code-cap { font-size: 0.75rem; color: var(--muted); margin-top: -8px; }

.steps { display: flex; flex-direction: column; gap: 8px; }
.steps div { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface-strong); border: 1px solid var(--border); font-size: 0.9rem; }
.steps b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.78rem; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.grid-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.grid-tags span { font-size: 0.82rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-strong); transition: transform 0.2s, border-color 0.2s; }
.grid-tags span:hover { transform: translateY(-3px); border-color: var(--accent); }

.rail-bar { height: 3px; border-radius: 3px; background: var(--border); overflow: hidden; }
.rail-bar span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0.1); background: linear-gradient(90deg, var(--accent), var(--accent-3)); transition: transform 0.15s linear; }

/* ---------- Timeline ---------- */
.experience { padding-block: 90px; }
.timeline { position: relative; margin-top: 48px; display: flex; flex-direction: column; gap: 28px; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), var(--accent-2), transparent); }
.timeline li { position: relative; padding: 24px 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(14px); transition: transform 0.3s, border-color 0.3s; max-width: 860px; }
.timeline li:hover { transform: translateX(6px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.timeline li::before { content: ""; position: absolute; left: -34px; top: 32px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); box-shadow: 0 0 0 6px var(--glow); }
.timeline time { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); }
.timeline h3 { font-size: 1.3rem; margin: 6px 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.timeline h3 span { font-family: var(--font-body); font-size: 0.9rem; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.timeline p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Skills ---------- */
.skills { padding-block: 70px; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 40px; }
.skill { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(14px); transition: transform 0.3s, border-color 0.3s; }
.skill:hover { transform: translateY(-6px); border-color: var(--accent); }
.skill h3 { font-size: 1.15rem; margin-bottom: 10px; background: linear-gradient(100deg, var(--accent), var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
.skill p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Contact ---------- */
.contact { padding-block: 110px 120px; text-align: center; }
.contact-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.contact h2 { font-size: clamp(2.6rem, 8vw, 5.6rem); background: linear-gradient(100deg, var(--accent), var(--accent-2), var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.email { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; }
#email-text { font-family: var(--font-mono); font-size: clamp(0.9rem, 3.4vw, 1.1rem); overflow-wrap: anywhere; }
.contact .cta { justify-content: center; margin-top: 8px; }

.footer { border-top: 1px solid var(--border); padding-block: 26px; font-size: 0.85rem; color: var(--muted); }
.footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--fg); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav { left: 12px; right: 12px; transform: none; max-width: none; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; top: 10px; }
  .menu-toggle { display: flex; }
  .nav nav { display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; flex-direction: column; gap: 2px; padding: 8px; border-radius: 22px; background: var(--bg); border: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav.open nav { display: flex; }
  .nav nav a { padding: 12px 14px; font-size: 1rem; border-radius: 14px; }
  .footer .container { justify-content: space-between; }
  .dnc { flex: 0 0 100%; text-align: center; order: 3; }
  .hero { padding-top: 110px; }
  .card { padding: 20px; }
  .card h3 { font-size: 1.45rem; }
  .timeline { padding-left: 26px; }
  .timeline li::before { left: -26px; }
  .timeline li { padding: 20px; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
}

/* ---------- Added: live badge, card links ---------- */
.badge.live { color: var(--accent-3); background: color-mix(in srgb, var(--accent-3) 12%, transparent); border-color: color-mix(in srgb, var(--accent-3) 35%, transparent); }
.card-links { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.card-link.strong { padding: 8px 16px; border-radius: 999px; color: #fff; background: linear-gradient(100deg, var(--accent), var(--accent-2)); border: 0; }
.card-link.strong:hover { gap: 10px; filter: brightness(1.1); }
.note-sm { font-size: 0.78rem; color: var(--muted); margin-top: -6px; }

/* ---------- Added: "Do not click" ---------- */
.footer .container { align-items: center; }
.dnc { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; position: relative; transition: color 0.2s; }
.dnc:hover { color: var(--fg); }
@media (min-width: 721px) { .footer .dnc { text-align: right; } }
.dnc.dodging { transition: transform 0.25s cubic-bezier(.3,1.6,.5,1); }

.term-wrap { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(4px); animation: fadein 0.25s; }
@keyframes fadein { from { opacity: 0; } }
.term { transform-origin: 0% 100%; width: min(640px, 100%); border-radius: 12px; overflow: hidden; background: #0b0f14; border: 1px solid #263040; box-shadow: 0 30px 80px rgba(0,0,0,.6); font-family: var(--font-mono); font-size: 0.84rem; color: #cfe3d4; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: #151c26; color: #7b8aa0; font-size: 0.75rem; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 8px; }
.term-body { padding: 16px; min-height: 260px; max-height: 60vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.term-body .cmd { color: #8be9fd; } .term-body .err { color: #ff6b81; } .term-body .ok { color: #50fa7b; } .term-body .dim { color: #6b7a90; }
.term-caret { display: inline-block; width: 8px; height: 1em; vertical-align: -2px; background: #cfe3d4; animation: blink 1s steps(1) infinite; }
.term-hint { padding: 10px 16px 14px; font-size: 0.72rem; color: #6b7a90; }

.bug { position: fixed; z-index: 150; left: 0; top: 0; font-size: 2rem; cursor: crosshair; user-select: none; line-height: 1; will-change: transform; }
.bug.dead { animation: splat 0.5s forwards; pointer-events: none; }
@keyframes splat { 30% { transform: scale(1.8) rotate(20deg); } to { opacity: 0; transform: scale(0.2) rotate(120deg); } }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 210; transform: translateX(-50%) translateY(20px); opacity: 0; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 0.9rem; text-align: center; transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%); }
/* Disco recolours the page sections but not the falling emoji or the toast
   (they're <body> children too). Not on <body> itself: a filter there pins
   position:fixed children to the page instead of the screen. */
html.disco body > :where(:not(.rain):not(.toast)) { animation: disco 0.9s linear infinite; }
html.disco.shake main, html.disco.shake footer { animation: disco 0.9s linear infinite, shake 0.5s; }
@keyframes disco { to { filter: hue-rotate(360deg); } }
.rain { position: fixed; top: -2rem; z-index: 190; font-size: 1.6rem; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
/* Shake the page content only: a transform on <html> or <body> would knock
   the fixed layers (emoji, toast, nav) off the screen for a moment. */
.shake main, .shake footer { animation: shake 0.5s; }
@keyframes shake { 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }

/* ---------- Added: System32 prank ---------- */
.blackout { position: fixed; inset: 0; z-index: 400; background: #000; display: grid; place-items: center; cursor: none; }
.blackout.out { animation: blackout-fade 0.6s forwards; }
@keyframes blackin { from { opacity: 0; } to { opacity: 1; } }
@keyframes blackout-fade { to { opacity: 0; } }
.blackout-text { font-family: var(--font-display); font-size: clamp(2.6rem, 11vw, 7rem); font-weight: 700; color: #fff; text-align: center; opacity: 0; transform: scale(0.9); letter-spacing: -0.03em; padding: 16px; }
.blackout-text.show { opacity: 1; transform: none; transition: opacity 0.5s, transform 0.5s cubic-bezier(.2,1.4,.4,1); }
.blackout-sub { display: block; margin-top: 14px; font-family: var(--font-mono); font-size: clamp(0.8rem, 2.4vw, 1rem); font-weight: 400; letter-spacing: 0; color: #8a94a6; }

/* Terminal waits 1.5s after the click, then slides up from the bottom-left (no flicker) */
.term-wrap.pending { opacity: 0; pointer-events: none; animation: none; }
.term-wrap:not(.pending) .term { animation: term-open 0.7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes term-open {
  0%   { transform: translate(-42vw, 46vh) scale(0.12); opacity: 0; }
  35%  { opacity: 1; }
  100% { transform: none; opacity: 1; }
}

/* ---------- macOS Terminal look ---------- */
.term-wrap { background: rgba(0, 0, 0, 0.28); backdrop-filter: none; -webkit-backdrop-filter: none; }
.term.mac { width: min(660px, 100%); border-radius: 10px; background: #1e1e1e; border: 1px solid #3d3d3f; box-shadow: 0 0 0 0.5px rgba(0,0,0,.6), 0 28px 70px rgba(0,0,0,.55); font-family: "SF Mono", Menlo, Monaco, "JetBrains Mono", ui-monospace, monospace; font-size: 0.8rem; color: #e6e6e6; transform-origin: 50% 50%; }
.term.mac .term-bar { position: relative; justify-content: flex-start; gap: 8px; padding: 0 13px; height: 28px; background: linear-gradient(#3b3b3d, #2f2f31); border-bottom: 1px solid #1a1a1a; }
.term.mac .term-bar i { width: 12px; height: 12px; }
.term.mac .term-bar span { position: absolute; left: 0; right: 0; margin: 0; text-align: center; color: #b5b5b8; font-family: -apple-system, "Inter", system-ui, sans-serif; font-size: 0.78rem; pointer-events: none; }
.term.mac .term-body { height: 330px; min-height: 0; max-height: 60vh; padding: 10px 12px; line-height: 1.45; color: #e6e6e6; white-space: pre-wrap; }
.term.mac .dim { color: #9a9a9e; }
.mac-caret { display: inline-block; width: 0.6em; height: 1.15em; vertical-align: -0.2em; background: #c7c7c7; animation: blink 1.1s steps(1) infinite; }
/* macOS opens windows with a quick scale-up and fade, no slide */
.term-wrap:not(.pending) .term.mac { animation: mac-open 0.28s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes mac-open { from { transform: scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- OS variants ---------- */
.mac-caret { background: currentColor; opacity: 0.8; }
.term.windows .dim, .term.linux .dim { white-space: pre-wrap; }

/* Windows Command Prompt */
.term.windows { width: min(700px, 100%); border-radius: 8px; background: #0c0c0c; border: 1px solid #3a3a3a; box-shadow: 0 28px 70px rgba(0,0,0,.55); font-family: Consolas, "Cascadia Mono", "JetBrains Mono", monospace; font-size: 0.82rem; color: #cccccc; transform-origin: 50% 50%; }
.term.windows .term-bar { position: relative; padding: 0 0 0 10px; height: 32px; background: #202020; border-bottom: 1px solid #2c2c2c; justify-content: flex-start; gap: 10px; }
.term.windows .term-bar i { display: none; }
.term.windows .win-icon { font: 600 0.68rem Consolas, monospace; color: #0c0c0c; background: #d4d4d4; padding: 1px 4px; border-radius: 2px; }
.term.windows .term-bar span { margin: 0; color: #e6e6e6; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 0.78rem; }
.win-ctl { margin-left: auto; display: flex; height: 100%; text-decoration: none; }
.win-ctl em { font-style: normal; width: 46px; display: grid; place-items: center; color: #d4d4d4; font-size: 0.8rem; }
.win-ctl em:last-child:hover { background: #c42b1c; }
.term.windows .term-body { height: 330px; min-height: 0; max-height: 60vh; padding: 8px 10px; line-height: 1.35; color: #cccccc; white-space: pre-wrap; }
.term.windows .dim { color: #999; }
.term-wrap:not(.pending) .term.windows, .term-wrap:not(.pending) .term.linux { animation: mac-open 0.22s cubic-bezier(.2,.9,.3,1.1) both; }

/* Ubuntu-style terminal */
.term.linux { width: min(680px, 100%); border-radius: 10px 10px 6px 6px; background: #300a24; border: 1px solid #1d0516; box-shadow: 0 28px 70px rgba(0,0,0,.55); font-family: "Ubuntu Mono", "DejaVu Sans Mono", Menlo, "JetBrains Mono", monospace; font-size: 0.84rem; color: #f2f2f2; transform-origin: 50% 50%; }
.term.linux .term-bar { position: relative; height: 34px; padding: 0 12px; background: #3d3d3d; border-bottom: 1px solid #222; justify-content: center; }
.term.linux .term-bar i { display: none; }
.term.linux .term-bar span { margin: 0; color: #e6e6e6; font-family: "Ubuntu", "Inter", system-ui, sans-serif; font-size: 0.8rem; }
.term.linux .term-body { height: 330px; min-height: 0; max-height: 60vh; padding: 8px 10px; line-height: 1.4; color: #f2f2f2; white-space: pre-wrap; }
.term.linux .dim { color: #c9a3b8; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; line-height: 1; }
.logo img { width: 38px; height: 38px; display: block; object-fit: contain; transition: transform 0.3s; }
.logo:hover img { transform: scale(1.12); }
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.logo-text span { color: var(--accent); }
.blackout-text { position: relative; }
.blackout-sub { max-width: 34ch; margin-inline: auto; line-height: 1.5; }

/* ---------- Browser mock (AAK Decor) ---------- */
.browser { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-strong); }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.browser-bar span { margin-left: 10px; flex: 1; text-align: center; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 2px 10px; }
.browser-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.b-hero { padding: 22px 16px; border-radius: 8px; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--accent-2) 25%, transparent)); font-family: var(--font-display); font-size: 1.05rem; line-height: 1.25; }
.b-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.b-tags span { font-size: 0.78rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }

/* ---------- LeetCode ---------- */
.leetcode { padding-block: 70px; }
.lc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-top: 36px; }
.lc-tile { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(14px); transition: transform 0.3s, border-color 0.3s; display: flex; flex-direction: column; gap: 6px; }
.lc-tile:hover { transform: translateY(-6px); border-color: var(--accent); }
.lc-tile strong { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1; background: linear-gradient(100deg, var(--accent), var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
.lc-tile span { color: var(--muted); font-size: 0.9rem; }
.lc-tile small { color: var(--muted); font-size: 0.75rem; opacity: 0.85; margin-top: -2px; }
.lc-tile small[hidden] { display: none; }
@media (min-width: 900px) {
  .lc-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; }
  .lc-tile { padding: 22px; }
  .lc-tile strong { font-size: clamp(1.7rem, 2.5vw, 2.5rem); white-space: nowrap; }
}
.lc-best { margin-top: 22px; color: var(--muted); }
.lc-best b { color: var(--fg); }
.leetcode .card-link.strong { margin-top: 18px; }
.lc-updated { margin-top: 10px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.lc-updated::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-3); }
.lc-tile[hidden] { display: none; }
.lc-updated[hidden] { display: none; }

/* ---------- "Do not click": phone and tablet erase screens ---------- */
.mob-wrap { position: fixed; inset: 0; z-index: 200; overflow: hidden; }
.mob-wrap.pending { opacity: 0; pointer-events: none; }
.mob, .mob-dim, .mob-erase { position: absolute; inset: 0; }
.mob-dim { background: rgba(0, 0, 0, 0.55); animation: fadein 0.3s both; }
.mob-erase { background: #000; display: grid; place-content: center; justify-items: center; gap: 22px; opacity: 0; pointer-events: none; transition: opacity 0.35s; }
.mob-wrap.erasing .mob-erase { opacity: 1; }
.mob .tap { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(255,255,255,0.35); transform: scale(0); opacity: 0; pointer-events: none; }
.mob .pressed .tap { animation: tap 0.45s ease-out forwards; }
@keyframes tap { 0% { transform: scale(0.2); opacity: 0.9; } 100% { transform: scale(1.4); opacity: 0; } }

/* iOS and iPadOS: action sheet, then a black screen with a progress bar */
.mob.ios { font-family: -apple-system, "SF Pro Text", "Helvetica Neue", "Inter", system-ui, sans-serif; }
.ios-sheet { position: absolute; left: 0; right: 0; bottom: 0; width: min(430px, 100%); margin-inline: auto; padding: 0 8px max(10px, env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.mob-wrap:not(.pending) .ios-sheet { animation: sheet-up 0.45s cubic-bezier(.2,.9,.25,1) both; }
@keyframes sheet-up { from { transform: translateY(110%); } to { transform: none; } }
.ios-group, .ios-cancel { background: rgba(44, 44, 46, 0.97); border-radius: 14px; color: #fff; text-align: center; }
.ios-group p { margin: 0; padding: 14px 16px; font-size: 0.8rem; line-height: 1.35; color: #98989f; border-bottom: 1px solid rgba(255,255,255,0.12); }
.ios-erase { position: relative; overflow: hidden; width: 100%; padding: 17px 16px; border: 0; background: transparent; color: #ff453a; font: 400 1.2rem/1 inherit; font-family: inherit; transition: background 0.15s; }
.ios-erase.pressed { background: rgba(255,255,255,0.14); }
.ios-cancel { padding: 17px 16px; font-size: 1.2rem; font-weight: 600; color: #0a84ff; }
.ios-bar { width: min(200px, 56vw); height: 4px; border-radius: 4px; background: rgba(255,255,255,0.22); overflow: hidden; }
.ios-bar b { display: block; width: 0; height: 100%; background: #fff; border-radius: 4px; }
.mob-wrap.erasing .ios-bar b { width: 100%; transition: width 4.2s cubic-bezier(.35,.1,.4,1); }

/* Android: Material dialog, then a spinner */
.mob.android { font-family: Roboto, "Google Sans", "Inter", system-ui, sans-serif; }
.and-dialog { position: absolute; left: 50%; top: 50%; width: min(312px, calc(100% - 48px)); padding: 24px 24px 18px; border-radius: 28px; background: #2b2930; color: #e6e0e9; transform: translate(-50%, -50%); }
.mob-wrap:not(.pending) .and-dialog { animation: and-in 0.28s cubic-bezier(.2,.9,.3,1) both; }
@keyframes and-in { from { opacity: 0; transform: translate(-50%, -46%) scale(0.92); } to { opacity: 1; transform: translate(-50%, -50%); } }
.and-dialog h4 { margin: 0 0 14px; font-size: 1.5rem; font-weight: 400; line-height: 1.25; }
.and-dialog p { margin: 0 0 22px; font-size: 0.9rem; line-height: 1.45; color: #cac4d0; }
.and-btns { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 500; color: #d0bcff; }
.and-btns span { padding: 10px 12px; }
.and-erase { position: relative; overflow: hidden; padding: 10px 12px; border: 0; border-radius: 20px; background: transparent; color: inherit; font: inherit; transition: background 0.15s; }
.and-erase.pressed { background: rgba(208, 188, 255, 0.2); }
.and-spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.18); border-top-color: #fff; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mob.android .mob-erase p { margin: 0; color: #cac4d0; font-size: 1rem; }
@media (prefers-reduced-motion: reduce) { .and-spin { animation: none; } .mob-wrap.erasing .ios-bar b { transition: none; } }

/* ---------- Organisation logos (transparent, no tile) ---------- */
.org-logo { display: grid; place-items: center; flex: none; }
.org-logo img { display: block; height: 52px; width: auto; max-width: 150px; object-fit: contain; }
.org-logo.tall img { height: 82px; }
.org-logo.wide img { height: auto; width: 150px; max-width: none; }
.org-logo.portrait img { height: 108px; }
/* light and dark artwork: dark theme is the default, light theme sets data-theme="light" */
.ol-d { display: block; }
.ol-l { display: none !important; }
:root[data-theme="light"] .ol-l { display: block !important; }
:root[data-theme="light"] .ol-d { display: none !important; }
.timeline li { display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 30px; align-items: start; }
.timeline li > :not(.org-logo) { grid-column: 2; }
.timeline .org-logo { grid-column: 1; grid-row: 1 / span 3; align-self: center; justify-self: center; }
.title-row { display: flex; align-items: center; gap: 14px; }
.title-row .org-logo.sm img { height: 46px; max-width: 70px; }
@media (max-width: 720px) {
  .timeline li { display: block; }
  .timeline .org-logo { justify-self: start; place-items: start; margin-bottom: 12px; }
  .timeline .org-logo img { height: 40px; max-width: 120px; }
  .timeline .org-logo.tall img { height: 60px; }
  .timeline .org-logo.wide img { width: 118px; height: auto; }
  .timeline .org-logo.portrait img { height: 76px; }
}

.footer .dnc:disabled, .footer .dnc:disabled:hover, .footer .dnc:disabled:focus-visible { color: inherit; cursor: default; opacity: 0.55; pointer-events: none; transition: none; outline: none; }

/* ---------- Native text sizes for the fake terminals and warnings ----------
   Terminals use each system's default terminal font size; the iOS sheet follows the user's Dynamic Type setting
   (Safari on iPhone and iPad); the Android dialog uses Material sizes in rem, which follow the browser/system font scale. */
.term.mac { width: min(560px, 100%); font-size: 11px; }
.term.mac .term-body { height: 354px; line-height: 14px; max-height: 70vh; }
.term.windows { width: min(980px, 100%); font-size: 16px; }
.term.windows .term-body { height: 560px; line-height: 18px; max-height: 70vh; }
.term.linux { width: min(800px, 100%); font-size: 16px; }
.term.linux .term-body { height: 500px; line-height: 1.3; max-height: 70vh; }
.ios-group p { font-size: 13px; }
.ios-erase, .ios-cancel { font-size: 20px; }
.and-dialog h4 { font-size: 1.5rem; }
.and-dialog p, .and-btns { font-size: 0.875rem; }
@supports (font: -apple-system-body) {
  .ios-group p { font: -apple-system-footnote; }
  .ios-erase { font: -apple-system-title3; font-weight: 400; }
  .ios-cancel { font: -apple-system-title3; font-weight: 600; }
}

/* ---------- Cursor ---------- */
/* Arrow over ordinary text; the text cursor only where text is meant to be
   selected or typed. Links and buttons keep their pointer. */
html { cursor: default; }
input, textarea, [contenteditable="true"], #email-text { cursor: text; }
/* A card that isn't centred: click to bring it into view. */
.rail .card:not(.active) { cursor: pointer; }
.rail.dragging .card { cursor: grabbing; }
