:root {
  --bg: #fbf9f4;
  --bg-deep: #f3eee3;
  --surface: #ffffff;
  --text: #0b0b1a;
  --muted: #5b5b6e;
  --accent: #6d28d9;
  --accent-2: #ec4899;
  --accent-3: #f59e0b;
  --accent-soft: rgba(109, 40, 217, 0.10);
  --border: #e7e2d3;
  --chip-bg: rgba(16, 185, 129, 0.12);
  --chip-text: #047857;
  --chip-dot: #10b981;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 16px 32px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 28px rgba(109, 40, 217, 0.18), 0 24px 60px rgba(236, 72, 153, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07071a;
    --bg-deep: #0d0c24;
    --surface: #15142e;
    --text: #f6f5fb;
    --muted: #a4a3bb;
    --accent: #c084fc;
    --accent-2: #f472b6;
    --accent-3: #fbbf24;
    --accent-soft: rgba(192, 132, 252, 0.14);
    --border: #2a2849;
    --chip-bg: rgba(16, 185, 129, 0.16);
    --chip-text: #34d399;
    --chip-dot: #34d399;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 16px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 28px rgba(192, 132, 252, 0.22), 0 24px 60px rgba(244, 114, 182, 0.18);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(236, 72, 153, 0.22), transparent 60%),
    radial-gradient(800px 480px at -10% 15%, rgba(109, 40, 217, 0.22), transparent 60%),
    radial-gradient(700px 420px at 50% 110%, rgba(245, 158, 11, 0.16), transparent 60%),
    var(--bg);
  animation: drift 24s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-2%, 1%, 0) scale(1.05); }
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 84px 24px 96px;
  position: relative;
}

/* Status chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem 0.35rem 0.7rem;
  background: var(--chip-bg);
  color: var(--chip-text);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  border: 1px solid color-mix(in srgb, var(--chip-text) 25%, transparent);
}
.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chip-dot);
  box-shadow: 0 0 0 0 var(--chip-dot);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--chip-dot) 70%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Typography */
.greet {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
  font-weight: 500;
}

h1 {
  font-size: clamp(3rem, 9vw, 5.5rem);
  margin: 0 0 1rem;
  font-weight: 800;
  line-height: 1.08;
  padding-bottom: 0.08em;
  letter-spacing: -0.045em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}

h2 {
  font-size: 0.85rem;
  margin: 3.5rem 0 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
h2::before, h2::after {
  content: "";
  flex: 0 0 1.5rem;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
}
h2::after { flex: 1; }

h3 {
  font-size: 1.05rem;
  margin: 2rem 0 0.4rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.lead {
  font-size: 1.25rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  max-width: 38ch;
}

p { margin: 0.7rem 0; }
.meta { color: var(--muted); font-size: 0.9rem; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s ease;
}
a:hover { text-decoration: underline; }

.back {
  font-size: 0.875rem;
  margin: 0 0 2.5rem;
}
.back a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(8px);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.back a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
  transform: translateX(-2px);
}

ul {
  padding-left: 1.1rem;
  margin: 0.5rem 0;
}
ul li {
  margin-bottom: 0.4rem;
  padding-left: 0.25rem;
}
ul li::marker { color: var(--muted); }

/* Project cards */
.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}
.cards > li {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}
.cards > li::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 0;
  border-radius: inherit;
  padding: 1px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.cards > li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.cards > li:hover::before { opacity: 1; }

.cards > li a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.cards > li a::after {
  content: "→";
  display: inline-block;
  color: var(--accent);
  transition: transform 0.2s ease;
}
.cards > li:hover a { text-decoration: none; }
.cards > li:hover a::after { transform: translateX(4px); }
.cards > li .meta {
  position: relative;
  z-index: 1;
  margin: 0.35rem 0 0;
}

footer {
  margin-top: 5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

time { font-variant-numeric: tabular-nums; }

pre, code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
code {
  font-size: 0.92em;
  background: var(--accent-soft);
  color: var(--text);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}
pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 0.9rem 0;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  font-size: 0.92rem;
  line-height: 1.5;
}
pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem;
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
th, td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
tbody tr:last-child td { border-bottom: none; }
thead th {
  background: var(--bg-deep);
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.78rem;
}

::selection {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 520px) {
  main { padding: 56px 20px 72px; }
  body { font-size: 16px; }
  h2::before { flex: 0 0 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  body::before, .chip::before { animation: none; }
  * { transition: none !important; }
}
