/* global design system: flat background, strong text, one ice-blue accent.
   light theme swaps the same tokens; nothing below names a raw color twice */
:root {
  color-scheme: dark;
  --bg: #000000;
  --text-strong: #ffffff;
  --name: #ffffff;
  --line: rgba(255, 255, 255, 0.12);
  --surface-hover: rgba(255, 255, 255, 0.04);
  --band: rgba(255, 255, 255, 0.03);
  --skel: rgba(255, 255, 255, 0.06);
  --muted-60: rgba(255, 255, 255, 0.6);
  --faint-35: rgba(255, 255, 255, 0.35);
  --sheen: rgba(255, 255, 255, 0.12);
  --accent: #9eddf7;
  --accent-line: rgba(158, 221, 247, 0.5);
  --accent-faint: rgba(158, 221, 247, 0.4);
  --accent-contrast: #000000;
  --burst: 158, 221, 247;
  --sel-bg: #e5e5e5;
  --sel-fg: #000000;
  --navbg: rgba(0, 0, 0, 0.55);
  --panelbg: rgba(0, 0, 0, 0.82);
  --font-display: "Geist", system-ui, sans-serif;
  --font-ui: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa;
  --text-strong: #101010;
  --name: #101010;
  --line: rgba(0, 0, 0, 0.14);
  --surface-hover: rgba(0, 0, 0, 0.05);
  --band: rgba(0, 0, 0, 0.03);
  --skel: rgba(0, 0, 0, 0.07);
  --muted-60: rgba(0, 0, 0, 0.6);
  --faint-35: rgba(0, 0, 0, 0.35);
  --sheen: rgba(3, 105, 161, 0.12);
  --accent: #0369a1;
  --accent-line: rgba(3, 105, 161, 0.45);
  --accent-faint: rgba(3, 105, 161, 0.35);
  --accent-contrast: #ffffff;
  --burst: 3, 105, 161;
  --sel-bg: #101010;
  --sel-fg: #ffffff;
  --navbg: rgba(250, 250, 250, 0.6);
  --panelbg: rgba(250, 250, 250, 0.85);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scrollbar-width: none; overflow-x: hidden; overflow-x: clip; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

body {
  background: var(--bg);
  color: var(--text-strong);
  font-family: var(--font-ui);
  line-height: 1.4;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: 64px;
  cursor: url("cursors/cursor-sm.png") 4 1, url("cursors/arrow-32.cur"), auto;
}
main { flex: 1 0 auto; }

/* interactive elements get the larger arrow. no hand cursor anywhere.
   bibata modern ice assets, see cursors/LICENSE-bibata.txt */
a, button, .project-cell, .contact-btn {
  cursor: url("cursors/cursor-md.png") 5 1, url("cursors/arrow-32.cur"), auto;
}

/* click-burst overlay: fixed, transparent to input, holds burst lines only */
.burst-canvas {
  position: fixed; inset: 0; z-index: 90;
  pointer-events: none;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

::selection { background: var(--sel-bg); color: var(--sel-fg); }
::-moz-selection { background: var(--sel-bg); color: var(--sel-fg); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 16px; top: -48px;
  background: #fff; color: #000; padding: 8px 16px;
  font-family: var(--font-mono); font-size: 0.85rem;
  text-transform: lowercase; z-index: 110;
}
.skip:focus { top: 8px; }

.container {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
  box-sizing: border-box;
}

/* layout-only: sections are full-width wrappers with zero inline
   spacing of their own; the single inner .container owns the edges */
.hero, .section {
  padding-inline: 0;
  margin-inline: 0;
}

/* nav */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--navbg);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid transparent;
  will-change: transform;
  transition: border-color 200ms ease-out;
}
.site-nav[data-scrolled="true"] { border-bottom-color: var(--line); }
.nav-inner {
  display: flex; align-items: center; gap: 24px;
  height: 64px;
}
.nav-brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-right: auto; }
.nav-avatar {
  display: block; width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden;
  border: 1px solid var(--accent);
  padding: 2px; background: var(--bg);
}
.nav-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover; object-position: center 20%;
}
.logo-btn {
  background: none; border: 0;
  font-family: var(--font-ui); font-weight: 500; font-size: 1.1rem;
  line-height: 1.4; white-space: nowrap;
  color: var(--text-strong); opacity: 1;
  min-width: 120px; text-align: left;
  padding: 4px 0;
}
.logo-btn span {
  display: inline-block;
  transition: opacity 100ms ease-out;
}
.logo-btn span.is-fading { opacity: 0; }
.site-nav nav { display: flex; align-items: center; gap: 24px; flex-shrink: 0; }
.site-nav nav a {
  font-family: var(--font-ui); font-weight: 500; font-size: 0.9rem;
  line-height: 1.2; color: var(--text-strong); opacity: 0.6;
  text-decoration: none; white-space: nowrap;
  transition: opacity 200ms ease-out;
}
.site-nav nav a:hover { opacity: 1; }
.site-nav nav a.is-active {
  opacity: 1; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 6px;
}
.site-nav nav a:last-child { color: var(--accent); }

/* theme toggle: sun/moon button living in the header */
.theme-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-strong);
  border: 0;
  padding: 0;
  margin-right: -12px;
  opacity: 0.7; transition: opacity 150ms ease-out;
}
.theme-btn:hover { opacity: 1; }
.theme-btn svg { width: 16px; height: 16px; display: block; }
.theme-btn .icon-moon { display: none; }
[data-theme="light"] .theme-btn .icon-sun { display: none; }
[data-theme="light"] .theme-btn .icon-moon { display: block; }

/* burger button: mobile only, hidden on desktop.
   sits above the open panel so the X stays tappable */
.menu-btn {
  display: none;
  position: relative; z-index: 56;
  background: none; border: 0;
  color: var(--text-strong);
  padding: 8px; margin-right: -8px;
  opacity: 0.7; transition: opacity 150ms ease-out;
}
.menu-btn:hover { opacity: 1; }
.menu-btn .burger-lines { display: block; position: relative; width: 15px; height: 12px; }
.menu-btn .burger-lines i {
  position: absolute; left: 0; width: 100%; height: 1.5px;
  background: currentColor; border-radius: 2px;
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease-out;
}
.menu-btn .burger-lines i:nth-child(1) { top: 0; }
.menu-btn .burger-lines i:nth-child(2) { top: 5px; }
.menu-btn .burger-lines i:nth-child(3) { top: 10px; }
.menu-btn.is-open .burger-lines i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-btn.is-open .burger-lines i:nth-child(2) { opacity: 0; }
.menu-btn.is-open .burger-lines i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* sections: hairline is an in-flow block inside the inner container,
   so it spans exactly the content width, edge to edge with the text.
   sections linked from the nav land fully below it via scroll-margin. */
section[id] { scroll-margin-top: 80px; }
.section { padding: 0 0 80px; }
.section > .container::before {
  content: "";
  display: block;
  height: 1px; background: var(--line);
  margin-bottom: 80px;
}
.section-heading {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.75rem, 3.5vw, 2.25rem); line-height: 0.95;
  color: var(--text-strong); opacity: 1;
  margin-bottom: 40px;
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 40px;
}
.section-head .section-heading { margin-bottom: 0; }
.all-link {
  flex-shrink: 0;
  font-family: var(--font-mono); font-weight: 500; font-size: 1rem;
  color: var(--text-strong); opacity: 0.6; white-space: nowrap;
}
.all-link:hover { opacity: 1; }
.all-link .all-arrow { display: inline-block; transition: transform 200ms ease-out; }
.all-link:hover .all-arrow { transform: rotate(20deg); }

/* hero */
.hero { padding-top: 120px; padding-bottom: 80px; text-align: left; }
.hero-eyebrow {
  font-family: var(--font-display); font-weight: 800; font-size: 1.5rem;
  color: var(--text-strong); opacity: 0.6; line-height: 1.2;
  margin-bottom: 4px;
}
.hero-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(3rem, 13vw, 7rem);
  line-height: 0.95; letter-spacing: -0.02em;
  color: var(--name); opacity: 1;
  max-width: 100%;
  margin-left: -0.04em; /* optical only: offset glyph left side bearing */
}
.hero-sub {
  font-family: var(--font-ui); font-weight: 700; font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  letter-spacing: 0.01em; opacity: 0.6;
  margin-top: 4px; line-height: 1.2;
}
.hero-line {
  display: flex; align-items: baseline; justify-content: flex-start; gap: 0.35em; flex-wrap: wrap;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.4; text-align: left;
}
.hero-line-one { margin-top: 40px; }
.hero-break { display: none; }
@media (max-width: 640px) {
  .hero-break { display: block; width: 100%; height: 0; }
}
.hero-line .lead {
  font-family: var(--font-ui); font-weight: 500;
  font-size: 1em; line-height: inherit; opacity: 0.6;
}
.hero-line .tail { font-weight: 500; opacity: 0.6; }
.hero-line > *, .roller-stack { min-width: 0; }
.roller-stack {
  display: grid;
  max-width: 100%;
  overflow: hidden;
  font-weight: 500; opacity: 1;
  transition: width 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.roller-stack .roller-phrase {
  grid-area: 1 / 1;
  justify-self: start;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(0.5em);
  transition: opacity 500ms cubic-bezier(0.16, 1, 0.3, 1), transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.roller-stack .roller-phrase.is-active {
  opacity: 1; transform: translateY(0);
  pointer-events: auto;
}
.roller-stack .roller-phrase.is-exiting {
  opacity: 0; transform: translateY(-0.5em);
}
.reach-line {
  margin-top: 8px;
  font-family: var(--font-ui); font-weight: 500; font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--muted-60); line-height: 1.4;
  text-align: left;
}
.reach-line .keyword, .hero-line .keyword { font-weight: 500; opacity: 1; color: var(--text-strong); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--faint-35); text-underline-offset: 4px; }
.reach-line .keyword:hover, .hero-line .keyword:hover { opacity: 0.6; text-decoration-color: var(--faint-35); }
.mail-mark { opacity: 0.6; }

/* activity heatmap: github contribution grid in site type */
.activity-scroll { overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.activity-scroll::-webkit-scrollbar { display: none; }
.activity-total {
  flex-shrink: 0;
  font-family: var(--font-mono); font-weight: 500; font-size: 0.85rem;
  color: var(--text-strong); opacity: 0.6; white-space: nowrap;
}
.activity-months {
  display: grid; gap: 3px;
  margin-bottom: 8px;
  font-weight: 600; font-size: 0.8rem; opacity: 0.4; line-height: 1.2;
}
.activity-months span { overflow: visible; white-space: nowrap; }
.activity-grid {
  display: grid; grid-template-rows: repeat(7, 14px); grid-auto-flow: column; gap: 3px;
  width: max-content;
}
.activity-grid .act-cell { width: 14px; height: 14px; border-radius: 3px; }
.activity-legend {
  display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  margin-top: 12px;
  font-family: var(--font-mono); font-weight: 500; font-size: 0.72rem;
  color: var(--text-strong); opacity: 0.6;
}
.activity-legend .sw { width: 14px; height: 14px; border-radius: 3px; }
.lv0 { background: rgba(255, 255, 255, 0.07); }
.lv1 { background: #0e4429; }
.lv2 { background: #006d32; }
.lv3 { background: #26a641; }
.lv4 { background: #39d353; }
[data-theme="light"] .lv0 { background: #ebedf0; }
[data-theme="light"] .lv1 { background: #9be9a8; }
[data-theme="light"] .lv2 { background: #40c463; }
[data-theme="light"] .lv3 { background: #30a14e; }
[data-theme="light"] .lv4 { background: #216e39; }

/* skills */
.skill-rows { display: flex; flex-direction: column; }
.skill-row {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.skill-row > * { min-width: 0; }
.skill-rows .skill-row:last-child { border-bottom: 1px solid var(--line); }
.skill-label { font-weight: 500; font-size: 0.9rem; opacity: 0.4; line-height: 1.2; padding-top: 8px; }
.skill-pills { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px 0; min-width: 0; }
.skill-pills span {
  font-weight: 500; font-size: 0.9rem; opacity: 1;
  line-height: 1.2; white-space: nowrap;
}
.skill-pills span:not(:last-child)::after { content: ",\00a0"; }

/* projects */
.project-box {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.project-cell {
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
  padding: 24px; min-height: 150px;
  border: 1px solid var(--line); border-radius: 14px;
  color: var(--text-strong); text-align: left;
  transition: background 150ms ease-out;
}
.project-cell:hover { background: var(--surface-hover); }
/* glass corner: soft light pools in the top-right corner on hover.
   transition lives on the hover rule only: smooth fade-in, instant cut on leave */
.project-cell::after {
  content: ""; position: absolute; top: 0; right: 0;
  width: 140px; height: 140px; pointer-events: none;
  background: radial-gradient(circle at top right, var(--sheen), transparent 70%);
  opacity: 0;
}
.project-cell:hover::after {
  opacity: 1;
  transition: opacity 250ms ease-out;
}
.cell-title { font-weight: 500; font-size: 1rem; opacity: 1; line-height: 1.2; overflow-wrap: anywhere; }
.cell-badge-row { display: block; min-height: 44px; margin-top: 8px; }
.cell-badge {
  display: inline-block;
  font-family: var(--font-mono); font-weight: 500; font-size: 0.65rem;
  text-transform: uppercase; letter-spacing: 0.02em; opacity: 1;
  color: var(--accent);
  border: 1px solid var(--accent-line); border-radius: 999px;
  padding: 4px 8px; line-height: 1.2; white-space: normal;
}
.cell-badge.is-gold { color: #e8b84d; border-color: rgba(232, 184, 77, 0.5); }
.cell-badge.is-bronze { color: #c98f5f; border-color: rgba(201, 143, 95, 0.5); }
.cell-desc {
  font-weight: 500; font-size: 0.9rem; opacity: 0.6; line-height: 1.4;
  margin-top: 8px; min-height: 4.2em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cell-cat {
  margin-top: auto; padding-top: 16px;
  font-family: var(--font-mono); font-weight: 500; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.4; line-height: 1.2;
}
.skeleton-cell {
  min-height: 150px; padding: 24px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--skel);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.06; } 50% { opacity: 0.12; } }

/* volunteering */
.vol-row {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px;
  padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.vol-row + .vol-row { border-top: 0; }
#education .vol-row { padding: 16px 0; }
.edu-at { font-weight: 500; opacity: 0.45; }
.edu-row { grid-template-columns: 180px minmax(0, 1fr) auto; }
.vol-loc {
  font-weight: 500; font-size: clamp(1rem, 2vw, 1.25rem); opacity: 0.4; line-height: 1.1;
  text-align: right; white-space: nowrap;
}
.vol-row > * { min-width: 0; }
.vol-dates { font-weight: 600; font-size: 0.9rem; opacity: 0.4; line-height: 1.2; }
.vol-head { display: flex; align-items: center; gap: 16px; min-width: 0; }
.vol-logo {
  width: 44px; height: 44px; flex-shrink: 0;
  object-fit: cover; border-radius: 10px; border: 0;
}
.vol-org { font-weight: 500; font-size: 1.1rem; opacity: 1; line-height: 1.2; }
.vol-role, .vol-desc { font-weight: 500; font-size: 0.9rem; opacity: 0.6; line-height: 1.4; }
.vol-role { margin-top: 8px; }
.vol-desc { margin-top: 4px; }

/* gallery page */
.gallery-grid { display: block; columns: 3; column-gap: 16px; }
.g-item {
  margin: 0 0 16px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  break-inside: avoid;
}
.g-item img {
  width: 100%; height: auto;
  filter: grayscale(1); opacity: 0.8;
  transition: filter 150ms ease-out, opacity 150ms ease-out;
}
.g-item:hover img { filter: grayscale(0); opacity: 1; }

/* contact + footer */
.contact-band {
  background: var(--band);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 96px 0;
}
.contact-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
}
.contact-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem); line-height: 1.1;
  opacity: 1; max-width: 16ch;
}
.contact-btn {
  flex-shrink: 0;
  font-family: var(--font-mono); font-weight: 500; font-size: 0.9rem;
  color: var(--accent); background: transparent;
  border: 1px solid var(--accent-faint); border-radius: 999px;
  padding: 12px 22px; white-space: nowrap;
  transition: border-color 150ms ease-out, background 150ms ease-out;
}
.contact-btn:hover { border-color: var(--accent); background: var(--accent); color: var(--accent-contrast); }
.contact-btn .contact-arrow { display: inline-block; transition: transform 200ms ease-out; }
.contact-btn:hover .contact-arrow { transform: rotate(20deg); }

.site-footer { padding: 24px 0 40px; }
.footer-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center;
  font-family: var(--font-mono); font-weight: 500; font-size: 0.85rem; opacity: 0.6;
}
.footer-inner p:first-child { text-align: left; }
.footer-inner p:last-child { text-align: right; }
.footer-inner a { opacity: 0.6; }
.footer-inner a:hover { opacity: 1; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: currentColor; }

/* responsive */
@media (max-width: 1100px) {
  .project-box { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .project-box { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { columns: 2; }
}
@media (max-width: 768px) {
  .section { padding-bottom: 48px; }
  .section > .container::before { margin-bottom: 48px; }
  .hero { padding-top: 96px; padding-bottom: 48px; }
  .vol-row { grid-template-columns: 1fr; gap: 16px; }
  .vol-loc { text-align: left; }
  .skill-label { padding-top: 0; }
  .contact-inner { flex-direction: column; align-items: flex-start; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .footer-inner p:first-child { text-align: center; }
  .footer-inner p:last-child { text-align: center; }
  .menu-btn { display: block; }
  .site-nav nav {
    position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh;
    width: min(300px, 78vw);
    flex-direction: column; align-items: flex-end; justify-content: flex-start;
    gap: 28px; padding: 96px 32px 32px; overflow-y: auto;
    text-align: right;
    background: var(--panelbg);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border-left: 1px solid var(--line);
    transform: translateX(103%);
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 55;
  }
  .site-nav nav.is-open { transform: none; }
  .site-nav nav.is-open a { font-size: 1.25rem; }
}
@media (max-width: 640px) {
  .nav-inner { height: 56px; }
  body { padding-top: 56px; }
  section[id] { scroll-margin-top: 72px; }
  .skill-row { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 560px) {
  .project-box { grid-template-columns: 1fr; }
  .gallery-grid { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .roller-stack .roller-phrase { position: static; opacity: 0; transform: none; }
  .roller-stack .roller-phrase.is-active { opacity: 1; }
  .skeleton-cell { opacity: 0.06; }
}

/* one body size for the whole page: the hero-line standard.
   display type (name, bio, headings, contact title) is untouched */
.hero-line, .reach-line, .skill-label, .skill-pills span,
.cell-title,
.vol-dates, .vol-org, .vol-role,
.site-nav nav a, .logo-btn {
  font-size: clamp(1rem, 2vw, 1.25rem);
}
