:root[data-theme="dark"] {
  --bg: #070707;
  --fg: #e8e6df;
  --dim: #6b6962;
  --rule: rgba(232, 230, 223, 0.12);
  --term-border: rgba(255, 255, 255, 0.10);
  --canvas-ink: 255, 90, 90;
  --gh-bg: #f4f1ea; --gh-fg: #8a8880;
  --gh0: #dcd8cf; --gh1: #9be9a8; --gh2: #40c463; --gh3: #30a14e; --gh4: #216e39;
}
:root[data-theme="light"] {
  --bg: #f4f1ea;
  --fg: #1a1a1a;
  --dim: #8a8880;
  --rule: rgba(0, 0, 0, 0.14);
  --term-border: rgba(0, 0, 0, 0.10);
  --canvas-ink: 15, 90, 35;
  --gh-bg: #0d0d0d; --gh-fg: #8a8880;
  --gh0: #1f2226; --gh1: #0e4429; --gh2: #006d32; --gh3: #26a641; --gh4: #39d353;
}

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

:root {
  --display: 'Sempione Modern', 'Sempione Modern Medium', 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Gravitica Mono Icon Medium', 'Gravitica Mono Medium', 'Gravitica Mono', 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s ease, color 0.4s ease;
}

body {
  min-height: 100vh;
  padding: 40px 32px 64px 56px;
  position: relative;
  overflow-x: hidden;
  background: transparent;
}

#fabric {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page { position: relative; z-index: 1; }

/* ===== GitHub contributions panel ===== */
.gh {
  max-width: 720px;
  margin: 4px 0 24px;
  padding: 14px 16px 12px;
  background: var(--gh-bg);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--gh-fg);
  transition: background 0.4s ease;
}
.gh-grid {
  display: grid;
  gap: 3px;
  align-items: center;
}
.gh-month {
  grid-row: 1;
  width: 0;
  white-space: nowrap;
  overflow: visible;
  padding-bottom: 6px;
}
.gh-day { grid-column: 1; padding-right: 8px; }
.gh-c {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--gh0);
}
.gh-legend i {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--gh0);
}
[data-l="1"] { background: var(--gh1) !important; }
[data-l="2"] { background: var(--gh2) !important; }
[data-l="3"] { background: var(--gh3) !important; }
[data-l="4"] { background: var(--gh4) !important; }
.gh-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.gh-legend { display: inline-flex; align-items: center; gap: 3px; }
.gh-legend span { margin: 0 3px; }

.column { max-width: 560px; }

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity 0.18s ease;
}
a:hover { opacity: 0.7; }

/* ===== Theme toggle ===== */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 10;
  background: none;
  border: none;
  padding: 6px 8px;
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.theme-toggle:hover { color: var(--fg); }

/* ===== Live time + place ===== */
.place {
  position: fixed;
  bottom: 26px;
  right: 28px;
  z-index: 10;
  display: flex;
  gap: 22px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--dim);
}
.place-time {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* ===== Header: name + nav ===== */
.top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin-bottom: 36px;
}
.name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 29px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
  text-decoration: none;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  line-height: 1;
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
}
.nav a {
  color: var(--fg);
  text-decoration: none;
}
.nav a:hover, .nav a[aria-current] {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nav .dot { color: var(--dim); user-select: none; }

p { margin-bottom: 18px; }
.age { font-variant-numeric: tabular-nums; }

/* ===== Sections ===== */
section { margin-top: 40px; }
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
}
.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 10px 0 18px;
}

/* ===== Currently ===== */
.current .role-link {
  font-family: var(--display);
  font-weight: 700;
  font-size: 23px;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.015em;
}
.current .role-link:hover { opacity: 0.7; }
.current .role-link .arrow {
  margin-left: 6px;
  color: var(--dim);
  font-size: 15px;
}
.current .meta {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.current .work { margin: 10px 0 0; }

/* ===== Projects ===== */
.project {
  margin-bottom: 18px;
}
.project .title { font-weight: 700; }
.project .title .arrow {
  color: var(--dim);
  margin-left: 4px;
}
.project .desc { margin-top: 2px; }
.project .lang {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

@media (max-width: 600px) {
  body { padding: 36px 22px 56px; }
  .name { font-size: 23px; }
  .top { gap: 10px 20px; margin-bottom: 28px; }
  .current .role-link { font-size: 19px; }
  .theme-toggle { top: 18px; right: 18px; }
  .place { bottom: 16px; right: 18px; gap: 14px; font-size: 12px; }
}

/* ===== Email popup ===== */
.email-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}
.email-modal.is-open {
  display: flex;
}
.email-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: emailFade 180ms ease-out;
}
.email-modal__card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--term-border);
  border-radius: 12px;
  padding: 22px 26px 20px;
  min-width: 280px;
  max-width: 92vw;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: emailRise 200ms cubic-bezier(.2, .8, .25, 1);
}
.email-modal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 22px;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.email-modal__close:hover { color: var(--fg); }
.email-modal__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}
.email-modal__email {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  user-select: all;
  -webkit-user-select: all;
  margin-bottom: 14px;
  word-break: break-all;
}
.email-modal__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--term-border);
  border-radius: 8px;
  color: var(--fg);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.email-modal__copy:hover {
  border-color: var(--fg);
}
.email-modal__copy.is-copied {
  border-color: var(--fg);
  color: var(--bg);
  background: var(--fg);
}
@keyframes emailFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes emailRise {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
