:root {
  --bg: #0c1110;
  --bg-elev: #141b19;
  --ink: #e7efe9;
  --muted: #8fa399;
  --line: rgba(231, 239, 233, 0.12);
  --accent: #3dba8c;
  --accent-dim: rgba(61, 186, 140, 0.18);
  --warn: #d4a35c;
  --max: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Syne", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-body: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100svh;
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #1a3a2e 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #1e2a38 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
}

/* Hero: brand first, one headline, one line, timeline starts */
.hero {
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -8%;
  top: 10%;
  width: min(42vw, 320px);
  height: min(42vw, 320px);
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-dim), transparent 70%);
  pointer-events: none;
  animation: drift 12s var(--ease) infinite alternate;
}

@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(-12px, 18px); }
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 1rem;
  opacity: 0;
  animation: rise 0.8s var(--ease) 0.05s forwards;
}

.brand span {
  color: var(--accent);
}

.tagline {
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: rise 0.8s var(--ease) 0.18s forwards;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0;
  animation: rise 0.8s var(--ease) 0.3s forwards;
}

.meta-row strong { color: var(--ink); font-weight: 500; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 2.5rem;
  padding: 2.5rem 0 4rem;
  align-items: start;
}

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .rail { order: -1; position: static !important; }
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  opacity: 0;
  animation: rise 0.8s var(--ease) 0.4s forwards;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.chip:hover,
.chip[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Timeline */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 1.25rem;
  border-left: 2px solid var(--line);
}

.entry {
  position: relative;
  padding: 0 0 2rem 1.25rem;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.7s var(--ease) forwards;
}

.entry::before {
  content: "";
  position: absolute;
  left: -1.4rem;
  top: 0.45rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.entry.is-hidden { display: none; }

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.85rem;
  margin-bottom: 0.45rem;
}

.entry-date {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.badge {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--warn);
}

.entry-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.entry-body {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 40rem;
}

.entry-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.pj-tag {
  font-size: 0.75rem;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  padding: 0;
  font: inherit;
  font-size: 0.75rem;
}

.pj-tag:hover { border-bottom-color: var(--accent); }

.empty {
  color: var(--muted);
  padding: 2rem 0;
  font-size: 0.95rem;
}

/* Project rail */
.rail {
  position: sticky;
  top: 1.5rem;
}

.rail h2 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  font-weight: 600;
}

.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.project-btn {
  width: 100%;
  text-align: left;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.project-btn:hover,
.project-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.project-btn .name {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.project-btn .blurb {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.project-btn .status {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  color: var(--accent);
}

.project-btn .status.archived { color: var(--muted); }

.foot {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

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

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .brand, .tagline, .meta-row, .filters, .entry {
    opacity: 1;
    transform: none;
  }
}
