/* =====================================================================
   Portfolio: "quantum lab" look.
   Ink on soft paper (light) / deep space (dark). Violet → cyan = AI glow.
   Everything is fluid: the layout widens with the browser up to 1680px,
   type scales with clamp(), grids add columns as room appears.
   ===================================================================== */
:root {
  --bg: #F7F6FB;
  --bg-2: #EFEDF7;
  --surface: #FFFFFF;
  --ink: #17142B;
  --ink-2: #5E5A78;
  --ink-3: #9A96B2;
  --line: #E3E0EE;
  --violet: #6D3BFF;
  --cyan: #00A8C8;
  --pink: #E0368F;
  --glow: rgba(109, 59, 255, .16);
  --grad: linear-gradient(100deg, var(--violet), var(--cyan));
  --solid: #17142B;
  --on-solid: #FFFFFF;
  --bar: rgba(247, 246, 251, .78);
  --shadow: 0 1px 2px rgba(23, 20, 43, .05), 0 18px 40px -22px rgba(23, 20, 43, .28);

  --display: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pad: clamp(18px, 4.5vw, 72px);
  --wrap: min(100% - 2 * var(--pad), 2000px);
  --gap: clamp(14px, 1.6vw, 28px);
  --r: clamp(18px, 1.6vw, 26px);
  color-scheme: light;
}
[data-mode="dark"] {
  --bg: #0B0A16;
  --bg-2: #12101F;
  --surface: #17152A;
  --ink: #F1EFFA;
  --ink-2: #B1ACCB;
  --ink-3: #726D8E;
  --line: #29263F;
  --violet: #9B7BFF;
  --cyan: #3FD6F0;
  --pink: #FF6CB4;
  --glow: rgba(155, 123, 255, .22);
  --solid: #F1EFFA;
  --on-solid: #0B0A16;
  --bar: rgba(11, 10, 22, .72);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 22px 50px -26px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; background: var(--bg); }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font: clamp(15.5px, .25vw + 14.6px, 18px)/1.6 var(--body);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body::before { /* faint dot grid behind everything */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--line) 1px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2.5px solid var(--violet); outline-offset: 3px; border-radius: 10px; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -.02em; line-height: 1.1; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.wrap { width: var(--wrap); margin-inline: auto; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.bar-row { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.mark { display: flex; align-items: center; gap: 10px; font: 700 1.05rem var(--display); white-space: nowrap; }
.mark span {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-size: .9rem; letter-spacing: .02em;
}
.links { display: flex; gap: 4px; margin-left: auto; }
.links a {
  padding: 8px 14px; border-radius: 99px; font-size: .92rem; font-weight: 600; color: var(--ink-2);
  transition: background .2s, color .2s;
}
.links a:hover { color: var(--ink); background: var(--bg-2); }
.links a.on { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.iconbtn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: transform .2s;
}
.iconbtn:hover { transform: rotate(-12deg); }

/* ---------- hero ---------- */
.hero { padding: clamp(36px, 7vw, 120px) 0 clamp(36px, 5vw, 80px); position: relative; overflow-x: clip; }
.hero::before { /* soft glow */
  content: ""; position: absolute; z-index: -1; inset: -10% -10% auto auto; width: 70vw; height: 70vw; max-width: 1100px; max-height: 1100px;
  background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 96px); align-items: center; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; border-radius: 99px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font-size: .85rem; font-weight: 600; color: var(--ink-2);
}
.kicker i { width: 9px; height: 9px; border-radius: 50%; background: #1DBF73; box-shadow: 0 0 0 4px color-mix(in srgb, #1DBF73 22%, transparent); }
.hero h1 { margin-top: clamp(16px, 2vw, 28px); font-size: clamp(2.3rem, 5.4vw, 6.2rem); font-weight: 800; line-height: 1; letter-spacing: -.035em; }
.aka { color: var(--ink-3); font-weight: 600; }
.headline { margin-top: clamp(14px, 1.6vw, 24px); font: 650 clamp(1.25rem, 2.1vw, 2.3rem)/1.2 var(--display); letter-spacing: -.02em; color: var(--ink-2); max-width: 26ch; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro { margin-top: clamp(14px, 1.6vw, 22px); color: var(--ink-2); max-width: 58ch; font-size: 1.06em; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(22px, 2.4vw, 36px); }
.btn {
  display: inline-flex; align-items: center; gap: 9px; min-height: 48px; padding: 0 20px; border-radius: 99px;
  font-weight: 650; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.btn.solid { background: var(--solid); color: var(--on-solid); box-shadow: none; }

.hero-photo { position: relative; justify-self: center; width: min(100%, 520px); aspect-ratio: 1; }
.hero-photo img {
  position: absolute; inset: 9%; width: 82%; height: 82%; object-fit: cover; border-radius: 50%;
  box-shadow: var(--shadow); border: 6px solid var(--surface);
}
.orbit { position: absolute; inset: 0; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--violet) 45%, transparent); animation: spin 40s linear infinite; }
.orbit::after { content: ""; position: absolute; top: 12%; left: 12%; width: 14px; height: 14px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 18px var(--violet); }
.o2 { inset: 4%; border-color: color-mix(in srgb, var(--cyan) 45%, transparent); animation-duration: 26s; animation-direction: reverse; }
.o2::after { top: auto; left: auto; bottom: 8%; right: 18%; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); width: 10px; height: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge {
  position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); white-space: nowrap;
  padding: 9px 16px; border-radius: 99px; font-size: .85rem; font-weight: 650;
  background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); margin-top: clamp(36px, 5vw, 80px); }
.fact { padding: clamp(16px, 1.6vw, 26px); border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.fact b { display: block; font: 800 clamp(1.6rem, 2.4vw, 2.6rem)/1 var(--display); letter-spacing: -.03em; }
.fact:nth-child(4n+1) b { color: var(--violet); }
.fact:nth-child(4n+2) b { color: var(--cyan); }
.fact:nth-child(4n+3) b { color: var(--pink); }
.fact span { display: block; margin-top: 8px; color: var(--ink-2); font-size: .92em; line-height: 1.45; }

/* ---------- sections ---------- */
.sec { padding: clamp(48px, 7vw, 130px) 0; }
.sec.tint { background: var(--bg-2); }
.sec-head { margin-bottom: clamp(22px, 3vw, 48px); }
.sec-num { font: 700 .85rem var(--display); color: var(--violet); letter-spacing: .1em; }
.sec-head h2 { margin-top: 6px; font-size: clamp(2rem, 4vw, 4.4rem); font-weight: 800; letter-spacing: -.035em; }
.sec-head p { margin-top: 10px; color: var(--ink-2); max-width: 60ch; }
.two { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 120px); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li { padding: 6px 13px; border-radius: 99px; font-size: .85rem; font-weight: 600; background: var(--bg-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- projects ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: var(--gap); }
.project { border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; display: flex; flex-direction: column; }
.project.featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.shot { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; background: var(--bg-2); overflow: hidden; }
.project.featured .shot { aspect-ratio: auto; min-height: 100%; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.shot:hover img { transform: scale(1.04); }
.peek {
  position: absolute; left: 16px; bottom: 16px; padding: 8px 14px; border-radius: 99px; font-size: .85rem; font-weight: 650;
  background: rgba(15, 12, 30, .72); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.project-body { padding: clamp(20px, 2.6vw, 48px); display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.project-body h3 { font-size: clamp(1.5rem, 2.4vw, 2.6rem); font-weight: 800; }
.project-body p { color: var(--ink-2); max-width: 60ch; }
.project-body .role { color: var(--violet); font-weight: 650; font-size: .92em; margin-top: -8px; }
.project-body .ticks { margin: 0; font-size: .95em; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.thumbs button { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); transition: transform .2s; }
.thumbs button:hover { transform: translateY(-3px); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.project.soon {
  padding: clamp(22px, 2.4vw, 40px); justify-content: center; gap: 10px; min-height: 220px;
  background: transparent; box-shadow: inset 0 0 0 2px var(--line); border: 0;
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--line) 45%, transparent) 14px 15px);
}
.project.soon h3 { font-size: 1.4rem; }
.project.soon p { color: var(--ink-2); }
.soon-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--grad); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .5; } }

/* ---------- experience + skills ---------- */
.job { padding: clamp(20px, 2.4vw, 40px); border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.job-top { display: flex; gap: 16px; align-items: center; }
.job-top h3 { font-size: clamp(1.2rem, 1.6vw, 1.7rem); }
.job-top .muted { font-size: .92em; margin-top: 4px; }
.logo-chip { width: 58px; height: 58px; flex: none; border-radius: 16px; display: grid; place-items: center; font: 800 1.05rem var(--display); color: #fff; background: #0F62FE; letter-spacing: .04em; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 28px; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 10px; border-radius: 3px; background: var(--grad); transform: rotate(45deg); }
.skills { display: grid; gap: var(--gap); }
.skill h4 { font-size: 1rem; margin-bottom: 10px; color: var(--ink); }

/* ---------- recommendations ---------- */
.recs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.rec { margin: 0; padding: clamp(20px, 2vw, 32px); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 22px; }
.rec blockquote { margin: 0; flex: 1; position: relative; padding-top: 34px; color: var(--ink-2); }
.rec blockquote::before { content: "“"; position: absolute; top: -18px; left: -4px; font: 800 4.5rem/1 var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rec figcaption { display: flex; align-items: center; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.rec figcaption > span:nth-child(2) { flex: 1; min-width: 0; }
.rec b { display: block; font-weight: 700; }
.rec small { display: block; color: var(--ink-3); font-size: .8rem; line-height: 1.35; }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 700 .9rem var(--display); color: #fff; background: var(--grad); }
.rec:nth-child(2) .avatar { background: linear-gradient(135deg, var(--pink), var(--violet)); }
.rec:nth-child(3) .avatar { background: linear-gradient(135deg, var(--cyan), #1DBF73); }
.rec:nth-child(4) .avatar { background: linear-gradient(135deg, #F5A524, var(--pink)); }
.rec figcaption a { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, color .2s; }
.rec figcaption a:hover { background: var(--solid); color: var(--on-solid); }

/* ---------- education ---------- */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.timeline li { position: relative; padding-top: 34px; }
.timeline li::before { content: ""; position: absolute; top: 9px; left: 0; right: calc(-1 * var(--gap)); height: 2px; background: var(--line); }
.timeline li:last-child::before { right: 0; }
.timeline li::after { content: ""; position: absolute; top: 2px; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 3px var(--ink-3); }
.timeline li.now::after { background: var(--violet); box-shadow: 0 0 0 6px var(--glow); }
.when { display: flex; align-items: center; gap: 10px; font: 700 .95rem var(--display); color: var(--ink-2); }
.when em { font-style: normal; font-size: .75rem; padding: 3px 9px; border-radius: 99px; background: var(--violet); color: #fff; }
.edu { margin-top: 12px; padding: clamp(18px, 2vw, 30px); border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); height: calc(100% - 36px); }
.edu h3 { font-size: clamp(1.15rem, 1.5vw, 1.5rem); }
.edu .muted { margin: 4px 0 12px; font-weight: 600; }
.edu p:last-child { color: var(--ink-2); font-size: .95em; }

/* ---------- contact ---------- */
.contact {
  position: relative; overflow: hidden; border-radius: calc(var(--r) * 1.4);
  padding: clamp(32px, 6vw, 110px); color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #2BC4E0 0%, transparent 45%), linear-gradient(120deg, #3B1FB8, #6D3BFF 55%, #A63BE0);
}
.contact h2 { font-size: clamp(2.2rem, 5.5vw, 6rem); font-weight: 800; letter-spacing: -.04em; max-width: 14ch; }
.contact > p { margin-top: 14px; opacity: .85; max-width: 50ch; font-size: 1.08em; }
.contact-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; margin-top: clamp(26px, 3.4vw, 56px); }
.contact-links a {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; min-width: 0;
  background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .2s, transform .2s;
}
.contact-links a:hover { background: rgba(255, 255, 255, .22); transform: translateY(-2px); }
.contact-links span { min-width: 0; overflow-wrap: anywhere; font-weight: 650; font-size: clamp(.9rem, 3.6vw, 1rem); }
.contact-links small { display: block; font-weight: 500; opacity: .75; font-size: .78rem; }
.foot { padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); color: var(--ink-3); font-size: .88rem; text-align: center; }

/* ---------- screenshot viewer ---------- */
dialog {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(8, 6, 18, .9); color: #fff; display: none; place-items: center;
}
dialog[open] { display: grid; }
dialog::backdrop { background: transparent; }
dialog img { max-width: min(92vw, 1600px); max-height: 82dvh; border-radius: 14px; object-fit: contain; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
dialog .iconbtn { position: absolute; background: rgba(255, 255, 255, .12); box-shadow: none; color: #fff; width: 48px; height: 48px; }
.v-close { top: calc(16px + env(safe-area-inset-top)); right: 16px; }
.v-prev { left: 16px; top: 50%; translate: 0 -50%; }
.v-next { right: 16px; top: 50%; translate: 0 -50%; }
.v-count { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; opacity: .7; font-size: .9rem; }

/* ---------- entrance animation ---------- */
.rise { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
.rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; transform: none; transition: none; }
  .orbit, .soon-dot { animation: none; }
}

/* ---------- big screens: a little more air ---------- */
@media (min-width: 1800px) {
  .contact h2 { max-width: 18ch; }
}

/* ---------- tablets ---------- */
@media (max-width: 1080px) {
  .two { grid-template-columns: 1fr; }
  .recs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project.featured { grid-template-columns: 1fr; }
  .project.featured .shot { aspect-ratio: 16 / 10; min-height: 0; }
}

/* ---------- phones ---------- */
@media (max-width: 860px) {
  .bar-row { flex-wrap: wrap; gap: 0 12px; }
  .mark { flex: 1; }
  .links {
    order: 3; width: 100%; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad) 10px; width: calc(100% + 2 * var(--pad));
    overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .links::-webkit-scrollbar { display: none; }
  .links a { flex: none; padding: 7px 13px; font-size: .88rem; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
  .links a.on { background: var(--solid); color: var(--on-solid); box-shadow: none; }
  html { scroll-padding-top: 116px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; width: min(72vw, 340px); }
  .cta .btn { flex: 1 1 auto; justify-content: center; }
  .timeline li::before { display: none; }
  .timeline { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .recs { grid-template-columns: 1fr; }
}
@media (max-width: 340px) {
  .facts { grid-template-columns: 1fr; }
}
.noscript { padding: 24px; }
