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

:root {
  --lavender: #e6e6fa;
  --lilac: #c8a2c8;
  --periwinkle: #ccccff;
  --light-purple: #dab1da;

  --bg: #fbfaff;
  --fg: #1a1530;
  --muted: #6b6388;
  --accent: #7c3aed;
  --accent-2: #a78bfa;
  --accent-fg: #ffffff;
  --border: rgba(124, 58, 237, 0.14);
  --card: rgba(255, 255, 255, 0.65);
  --glass: rgba(255, 255, 255, 0.55);
  --max-width: 880px;
  --radius: 16px;
  --shadow: 0 10px 30px -12px rgba(76, 29, 149, 0.25);
  --shadow-lg: 0 24px 60px -20px rgba(76, 29, 149, 0.35);

  --bg-gradient:
    radial-gradient(1200px 600px at 10% -10%, var(--periwinkle), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, var(--lilac), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, var(--lavender), transparent 60%),
    linear-gradient(180deg, #fbfaff, #f4f1ff);

  --grad-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --grad-text: linear-gradient(135deg, #5b21b6 0%, #7c3aed 45%, #a78bfa 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0b1e;
    --fg: #ece9ff;
    --muted: #a39cc4;
    --accent: #a78bfa;
    --accent-2: #c4b5fd;
    --accent-fg: #0f0b1e;
    --border: rgba(167, 139, 250, 0.18);
    --card: rgba(255, 255, 255, 0.05);
    --glass: rgba(20, 14, 40, 0.55);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);

    --bg-gradient:
      radial-gradient(1200px 600px at 10% -10%, rgba(124, 58, 237, 0.35), transparent 60%),
      radial-gradient(900px 500px at 100% 0%, rgba(200, 162, 200, 0.22), transparent 55%),
      radial-gradient(700px 500px at 50% 110%, rgba(204, 204, 255, 0.18), transparent 60%),
      linear-gradient(180deg, #0f0b1e, #14102a);

    --grad-text: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 50%, #e9d5ff 100%);
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg-gradient) var(--bg) fixed;
  color: var(--fg);
  font: 16px/1.65 "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, opacity 160ms ease;
}
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
  position: relative;
}

/* Header — frosted glass pill */
.site-header {
  position: sticky;
  top: 1rem;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: var(--max-width);
  margin: 1rem auto 0;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }
.brand img {
  border-radius: 8px;
  box-shadow: 0 4px 14px -4px rgba(124, 58, 237, 0.55);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.site-nav a {
  position: relative;
  color: var(--muted);
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}
.site-nav a:hover {
  text-decoration: none;
  background: rgba(124, 58, 237, 0.08);
  color: var(--fg);
}
.site-nav a[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
  background: rgba(124, 58, 237, 0.12);
}
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.2rem;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-accent);
}

/* Hero */
.hero {
  position: relative;
  padding: 2rem 0 1rem;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
}
.hero::before {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--periwinkle), transparent 65%);
  top: -60px;
  left: -80px;
}
.hero::after {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--light-purple), transparent 65%);
  top: -20px;
  right: -60px;
}

.hero h1 {
  font-size: clamp(2.2rem, 4.5vw + 1rem, 3.6rem);
  margin: 0 0 0.75rem;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.lede {
  font-size: 1.18rem;
  color: var(--muted);
  max-width: 56ch;
  margin-top: 0;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  background: var(--grad-accent);
  color: var(--accent-fg);
  border: 1px solid transparent;
  margin-right: 0.5rem;
  font-weight: 600;
  font-size: 0.97rem;
  box-shadow: 0 8px 20px -8px rgba(124, 58, 237, 0.6);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}
.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -10px rgba(124, 58, 237, 0.7);
}
.button:active { transform: translateY(0); }
.button-ghost {
  background: var(--glass);
  color: var(--accent);
  border-color: var(--border);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.button-ghost:hover { background: rgba(124, 58, 237, 0.08); }

/* Prose */
.prose h1 {
  margin-top: 0;
  font-size: clamp(2rem, 3vw + 1rem, 2.75rem);
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.prose h2 {
  margin-top: 2.25rem;
  font-size: 1.45rem;
  color: var(--fg);
}
.prose p { color: var(--fg); }
.prose ul {
  padding-left: 1.25rem;
  list-style: none;
}
.prose ul li {
  position: relative;
  padding-left: 1.1rem;
  margin: 0.35rem 0;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad-accent);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}

/* Cat gallery */
.cat-frame {
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.cat-image {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 220ms ease, box-shadow 220ms ease, filter 180ms ease;
  user-select: none;
  -webkit-user-drag: none;
}
.cat-image:hover {
  transform: translateY(-2px) rotate(-0.4deg);
  box-shadow: var(--shadow-lg);
  filter: saturate(1.05);
}
.cat-image:active { transform: translateY(0) scale(0.99); }
.cat-image:not([src]),
.cat-image[src=""] {
  background:
    repeating-linear-gradient(45deg, rgba(124,58,237,0.06) 0 10px, transparent 10px 20px),
    var(--card);
}
.cat-caption {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  max-width: 60ch;
}

/* Project cards */
.project-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}
.project-list > li {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.project-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--grad-accent);
  opacity: 0.85;
}
.project-list > li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(124, 58, 237, 0.3);
}
.project-list h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  color: var(--fg);
}
.project-list p { color: var(--muted); margin: 0.25rem 0; }
.project-list p a { font-weight: 600; }

/* Footer */
.site-footer {
  position: relative;
  max-width: var(--max-width);
  margin: 2rem auto 0;
  padding: 1.75rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.25rem;
  right: 1.25rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  opacity: 0.5;
}

/* Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 560px) {
  .site-header {
    border-radius: 22px;
    padding: 0.75rem 1rem;
  }
  .site-nav { gap: 0.1rem; }
  .site-nav a { padding: 0.35rem 0.6rem; font-size: 0.95rem; }
}
