@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

/* ─────────────────────────────────────────────
   Reset
───────────────────────────────────────────── */

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

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: clip;
}

/* ─────────────────────────────────────────────
   Design Tokens
───────────────────────────────────────────── */

:root {
  /* Typography */
  --font-sans:
    "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

  --font-feature-settings: "cv02", "cv03", "cv04", "cv11";

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.18s var(--ease-out);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --enter-duration: 0.55s;
  --enter-ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --content-width: 640px;
  --page-padding: clamp(24px, 8vw, 140px);

  /* Profile picture */
  --pfp-size: 90px;
  --pfp-border-width: 3px;
  --pfp-radius: 50%;

  /* Theme toggle */
  --toggle-size: 40px;
  --toggle-radius: 50%;
}

/* ─────────────────────────────────────────────
   Dark Theme
───────────────────────────────────────────── */

html[data-theme="dark"] {
  --bg: #05070a;
  --surface: #0b1017;
  --surface-hover: #101722;

  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light-muted: #b1b9c2;
  --text-faint: #526174;

  --accent: #c7ebff;
  --accent-soft: rgba(199, 235, 255, 0.1);
  --accent-foreground: #071018;

  --border: rgba(148, 163, 184, 0.14);

  --shadow-color: rgba(0, 0, 0, 0.18);
  --shadow-color-hover: rgba(0, 0, 0, 0.22);
}

/* ─────────────────────────────────────────────
   Light Theme
───────────────────────────────────────────── */

html[data-theme="light"] {
  --bg: #fdf7fb;
  --surface: #ffffff;
  --surface-hover: #fff8fb;

  --text: #1a0f23;
  --text-muted: #6b5b85;
  --text-light-muted: #9e8fb3;
  --text-faint: #b9a8cf;

  --accent: #ce4180;
  --accent-soft: rgba(219, 39, 119, 0.08);
  --accent-foreground: #ffffff;

  --border: rgba(26, 15, 35, 0.1);

  --shadow-color: rgba(26, 15, 35, 0.12);
  --shadow-color-hover: rgba(26, 15, 35, 0.16);
}

/* ─────────────────────────────────────────────
   Base
───────────────────────────────────────────── */

body {
  position: relative;
  z-index: 0;

  font-family: var(--font-sans);
  font-feature-settings: var(--font-feature-settings);

  background: var(--bg);
  color: var(--text);

  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;

  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}

/* Ambient bloom effect on the right side */
body::after {
  content: "";
  position: fixed;
  top: -10vh;
  right: -10vw;
  width: 80vmin;
  height: 80vmin;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 60%);
  opacity: 0.15;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

/* ─────────────────────────────────────────────
   Theme Toggle
───────────────────────────────────────────── */

.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10;

  width: var(--toggle-size);
  height: var(--toggle-size);

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--border);
  border-radius: var(--toggle-radius);

  background: var(--surface);
  color: var(--text-muted);

  cursor: pointer;

  box-shadow: 0 4px 16px var(--shadow-color);

  transition:
    color var(--transition),
    border-color var(--transition),
    background-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);

  transform: translateY(-1px);

  box-shadow: 0 6px 20px var(--shadow-color-hover);
}

.theme-toggle:active {
  transform: translateY(0) scale(0.96);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
  grid-area: 1 / 1;
  transition:
    opacity 0.2s cubic-bezier(0.2, 0, 0, 1),
    transform 0.2s cubic-bezier(0.2, 0, 0, 1),
    filter 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.theme-toggle {
  display: grid;
  place-items: center;
}

html[data-theme="light"] .moon-icon,
html[data-theme="dark"] .sun-icon {
  opacity: 0;
  transform: scale(0.25);
  filter: blur(4px);
}

/* ─────────────────────────────────────────────
   Hero
───────────────────────────────────────────── */

.hero {
  min-height: 100vh;

  display: flex;
  align-items: center;

  padding: 96px var(--page-padding);
}

.hero-content {
  width: 100%;
  max-width: var(--content-width);
}
/* ─────────────────────────────────────────────
   Profile Picture
───────────────────────────────────────────── */

.pfp {
  display: block;

  width: var(--pfp-size);
  height: var(--pfp-size);

  margin-bottom: 24px;

  border: var(--pfp-border-width) solid var(--bg);
  border-radius: var(--pfp-radius);

  object-fit: cover;

  box-shadow:
    0 0 0 1px var(--accent),
    0 8px 24px var(--shadow-color),
    0 0 32px var(--accent-soft);

  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-spring);
}

.pfp:hover {
  transform: translateY(-2px);

  box-shadow:
    0 0 0 1px var(--accent),
    0 10px 28px var(--shadow-color-hover),
    0 0 42px var(--accent-soft);
}

/* ─────────────────────────────────────────────
   Hero Typography
───────────────────────────────────────────── */

.hero-name {
  margin-bottom: 4px;
  text-wrap: balance;

  color: var(--text);

  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.hero-role {
  margin-bottom: 32px;

  color: var(--text-light-muted);

  font-size: 16px;
  line-height: 1.5;
}

.hero-bio {
  color: var(--text-muted);
  text-wrap: pretty;

  font-size: 15px;
  line-height: 1.75;
}

.hero-bio p {
  margin-bottom: 18px;
}

.hero-bio p:last-child {
  margin-bottom: 28px;
}

.links {
  display: inline-block;

  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;

  transition:
    color var(--transition),
    transform var(--transition);
}

.links:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-links {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
}

.hero-links a {
  color: var(--text-muted);

  font-size: 14px;
  font-weight: 500;

  text-decoration: none;

  /* 44px touch hit area without changing visuals */
  padding: 12px 6px;
  margin: -12px -6px;

  transition:
    color var(--transition),
    transform var(--transition);
}

.hero-links a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.pfp {
  animation: fade-in-up var(--enter-duration) var(--enter-ease) 0s both;
}

.hero-name {
  animation: fade-in-up var(--enter-duration) var(--enter-ease) 0.1s both;
}

.hero-role {
  animation: fade-in-up var(--enter-duration) var(--enter-ease) 0.2s both;
}

.hero-bio {
  animation: fade-in-up var(--enter-duration) var(--enter-ease) 0.3s both;
}

.hero-links {
  animation: fade-in-up var(--enter-duration) var(--enter-ease) 0.4s both;
}

.theme-toggle {
  animation: fade-in 0.4s var(--ease-out) 0.2s both;
}

.work-nav {
  animation: fade-in-up var(--enter-duration) var(--enter-ease) 0s both;
}

.work-header {
  animation: fade-in-up var(--enter-duration) var(--enter-ease) 0.1s both;
}

.work-section {
  animation: fade-in-up var(--enter-duration) var(--enter-ease) 0.2s both;
}

.work-footer {
  animation: fade-in-up var(--enter-duration) var(--enter-ease) 0.3s both;
}

/* ─────────────────────────────────────────────
   Work Page Layout & Elements
───────────────────────────────────────────── */

.work-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 80px var(--page-padding) 100px;
}

.work-nav {
  margin-bottom: 36px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;

  /* 44px touch hit area without changing visuals */
  padding: 12px 8px 12px 0;
  margin: -12px -8px -12px 0;

  transition:
    color var(--transition),
    transform var(--transition);
}

.back-link:hover {
  color: var(--accent);
  transform: translateX(-3px);
}

.back-link svg {
  transition: transform var(--transition);
}

.back-link:hover svg {
  transform: translateX(-2px);
}

.work-header {
  margin-bottom: 48px;
}

.work-title {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.04em;
  text-wrap: balance;
  color: var(--text);
  margin-bottom: 12px;
}

.work-subtitle {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-muted);
}

.work-subtitle a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity var(--transition);
}

.work-subtitle a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.work-section {
  margin-bottom: 56px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--text);
}

.section-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
}

.section-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.work-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.work-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;

  text-decoration: none;
  color: inherit;

  box-shadow: 0 2px 8px var(--shadow-color);

  transition:
    border-color var(--transition),
    transform var(--transition),
    background-color var(--transition),
    box-shadow var(--transition);
}

.work-item:hover {
  border-color: var(--accent);
  background-color: var(--surface-hover);
  box-shadow: 0 8px 24px var(--shadow-color-hover);
}

@media (hover: hover) and (pointer: fine) {
  .work-item:hover {
    transform: translateY(-2px);
  }
}

.work-item:active {
  transform: translateY(0) scale(0.96);
}

.work-item:focus-visible,
.back-link:focus-visible,
.hero-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.item-id {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-muted);
}

.item-title {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  transition: color var(--transition);
}

.work-item:hover .item-title {
  color: var(--accent);
}

.external-icon {
  color: var(--text-faint);
  flex-shrink: 0;
  transition:
    color var(--transition),
    transform var(--transition);
}

.work-item:hover .external-icon {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 9999px;
  line-height: 1.4;
}

.badge-critical {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-high {
  background: rgba(249, 115, 22, 0.12);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.badge-moderate {
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.25);
}

.badge-pr {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}

/* PR Status Tags */
.item-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 9999px;
  line-height: 1.4;
}

.tag-merged {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.tag-open {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.tag-closed {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

html[data-theme="light"] .badge-critical {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}

html[data-theme="light"] .badge-high {
  background: rgba(234, 88, 12, 0.08);
  color: #ea580c;
  border-color: rgba(234, 88, 12, 0.25);
}

html[data-theme="light"] .badge-moderate {
  background: rgba(202, 138, 4, 0.08);
  color: #b45309;
  border-color: rgba(202, 138, 4, 0.25);
}

html[data-theme="light"] .tag-merged {
  background: rgba(126, 34, 206, 0.08);
  color: #7e22ce;
  border-color: rgba(126, 34, 206, 0.25);
}

html[data-theme="light"] .tag-open {
  background: rgba(21, 128, 61, 0.08);
  color: #15803d;
  border-color: rgba(21, 128, 61, 0.25);
}

html[data-theme="light"] .tag-closed {
  background: rgba(100, 116, 139, 0.08);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.25);
}

.work-footer {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

@media (max-width: 640px) {
  .hero {
    padding: 72px 20px 56px;
  }

  .work-container {
    padding: 64px 20px 72px;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-name,
  .work-title {
    font-size: 28px;
  }

  .hero-role {
    margin-bottom: 28px;
  }

  .hero-bio,
  .work-subtitle {
    font-size: 14.5px;
  }

  .hero-links {
    gap: 22px;
  }

  .work-item {
    padding: 14px 15px;
  }

  .theme-toggle {
    top: 16px;
    right: 16px;

    width: 38px;
    height: 38px;
  }

  .webring {
    display: none;
  }
}

/* ─────────────────────────────────────────────
   Touch devices: color feedback yes, hover lifts no
───────────────────────────────────────────── */

@media (hover: none) {
  .theme-toggle:hover,
  .pfp:hover,
  .links:hover,
  .hero-links a:hover,
  .back-link:hover,
  .webring-controls > a:hover {
    transform: none;
  }
}

/* ─────────────────────────────────────────────
   Reduced Motion
───────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
} /* ─────────────────────────────────────────────
   Webring
───────────────────────────────────────────── */

.webring {
  margin-top: 28px;

  display: flex;
  flex-direction: column;
  align-items: flex-start;

  gap: 8px;
}

.webring-title {
  color: var(--text-faint);
  animation: fade-in-up var(--enter-duration) var(--enter-ease) 0.5s both;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.webring-title a {
  color: var(--text-muted);

  text-decoration: none;

  transition: color var(--transition);
}

.webring-title a:hover {
  color: var(--accent);
}

.webring-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  animation: fade-in-up var(--enter-duration) var(--enter-ease) 0.6s both;
}

.webring-controls > a {
  color: var(--text-faint);

  font-size: 12px;
  font-weight: 500;

  text-decoration: none;

  transition:
    color var(--transition),
    transform var(--transition);
}

.webring-controls > a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.webring-logo {
  width: 100px;
  height: 35px;

  display: block;
  object-fit: contain;

  outline: 1px solid oklch(1 0 0 / 0.1);
  outline-offset: -1px;
}

html[data-theme="light"] .webring-logo {
  outline-color: oklch(0 0 0 / 0.1);
}

html[data-theme="dark"] .webring-logo {
  content: url("/assets/dark-webring.png");
}

html[data-theme="light"] .webring-logo {
  content: url("/assets/light-webring.png");
}

/* Theme View Transition */

html[data-theme-transition="active"]::view-transition-old(root),
html[data-theme-transition="active"]::view-transition-new(root) {
  animation: none;
}

html[data-theme-transition="active"]::view-transition-new(root) {
  clip-path: circle(0% at var(--theme-x) var(--theme-y));
}
