:root {
  --bg: #0b0d10;
  --bg-soft: #10141a;
  --panel: rgba(18, 23, 30, .82);
  --panel-strong: #151a22;
  --text: #eef2f6;
  --muted: #96a0ad;
  --line: rgba(255,255,255,.09);
  --accent: #69d49b;
  --accent-2: #7ab5ff;
  --danger: #ffb86b;
  --shadow: 0 30px 80px rgba(0,0,0,.34);
  --radius: 22px;
  --max: 1240px;
}

[data-theme="light"] {
  --bg: #f4f6f8;
  --bg-soft: #eef1f4;
  --panel: rgba(255,255,255,.84);
  --panel-strong: #ffffff;
  --text: #171b20;
  --muted: #606b77;
  --line: rgba(15,25,35,.11);
  --accent: #16794b;
  --accent-2: #246dcc;
  --shadow: 0 24px 60px rgba(30,45,60,.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 14% 6%, rgba(105,212,155,.10), transparent 30%),
    radial-gradient(circle at 89% 15%, rgba(122,181,255,.09), transparent 28%),
    linear-gradient(180deg, transparent 0 75%, rgba(105,212,155,.03));
}

.site-header {
  width: min(calc(100% - 40px), var(--max));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent); color: #09100c;
  font-weight: 900; font-size: 19px;
}
.brand-text em { color: var(--muted); font-style: normal; font-weight: 500; }
.header-nav { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 14px; }
.header-nav a:hover { color: var(--text); }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--text); background: transparent;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--panel); }

.hero {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  min-height: 600px;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 70px;
  align-items: center;
  padding: 74px 0 82px;
}
.eyebrow {
  margin: 0 0 17px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}
.hero h1 {
  margin: 0;
  font-size: clamp(44px, 5.3vw, 76px);
  line-height: 1.02;
  letter-spacing: -.052em;
  font-weight: 760;
}
.hero h1 span { color: var(--muted); font-weight: 600; }
.hero-lead { max-width: 730px; margin: 28px 0 0; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.button {
  min-height: 46px; padding: 0 18px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 700; border: 1px solid var(--line);
}
.button.primary { background: var(--accent); color: #08110c; border-color: transparent; }
.button.ghost { background: var(--panel); }
.button:hover { transform: translateY(-1px); }

.hero-panel { position: relative; }
.hero-panel::before {
  content: ""; position: absolute; inset: 8% -6% -9% 10%; z-index: -1;
  background: linear-gradient(135deg, rgba(105,212,155,.20), rgba(122,181,255,.10));
  filter: blur(60px); opacity: .8;
}
.hero-terminal {
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(8, 11, 15, .92);
  color: #dce5e0;
  border-radius: 20px;
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}
[data-theme="light"] .hero-terminal { background: #11161c; }
.terminal-bar { display: flex; gap: 7px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.terminal-bar span { width: 9px; height: 9px; border-radius: 50%; background: #59616a; }
.terminal-bar span:first-child { background: #ff756f; }
.terminal-bar span:nth-child(2) { background: #e9bd5a; }
.terminal-bar span:nth-child(3) { background: #69c978; }
.hero-terminal pre { margin: 0; padding: 26px; overflow: auto; font: 13.5px/1.78 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.hero-terminal .muted { color: #66717d; }
.hero-terminal .accent { color: #78dda5; }

.projects-section {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: 90px 0 40px;
  border-top: 1px solid var(--line);
}
.section-heading {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 500px);
  align-items: end;
  gap: 40px;
  margin-bottom: 34px;
}
.section-heading h2, .about-card h2 { margin: 0; font-size: clamp(32px, 4vw, 52px); line-height: 1.05; letter-spacing: -.04em; }
.section-heading > p { margin: 0; color: var(--muted); }
.filters { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 28px; }
.filter {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 8px 13px; cursor: pointer; font-size: 13px; font-weight: 700;
}
.filter span { opacity: .6; margin-left: 4px; }
.filter:hover, .filter.active { color: var(--text); background: var(--panel); }
.filter.active { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.project-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(255,255,255,.02);
  transition: transform .2s ease, border-color .2s ease, opacity .2s ease;
}
.project-card:hover { transform: translateY(-3px); border-color: rgba(105,212,155,.28); }
.project-card.hidden { display: none; }
.project-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 8.8;
  overflow: hidden;
  background: #0c1015;
  border-bottom: 1px solid var(--line);
}
.project-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.project-card:hover .project-media img { transform: scale(1.015); }
.media-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.24)); }
.generated { display: grid; place-items: center; }
.generated::before { content:""; position:absolute; inset:0; opacity:.65; background-size: 24px 24px; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); }
.generated.xmpp { background: radial-gradient(circle at 35% 30%, #174a60 0, #102533 38%, #0d131a 78%); }
.generated.barrymore { background: radial-gradient(circle at 72% 23%, #4f3546 0, #25202c 42%, #0e1117 78%); }
.generated-content { position:relative; z-index:1; text-align:center; display:grid; gap:5px; }
.generated-icon { width:56px; height:56px; margin:0 auto 7px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.18); border-radius:16px; color:#fff; font-size:24px; font-weight:800; background:rgba(255,255,255,.06); }
.generated-content strong { color:#fff; font-size:22px; letter-spacing:-.02em; }
.generated-content small { color:#9eabb7; font:12px ui-monospace, monospace; }
.project-body { padding: 23px 24px 22px; }
.project-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 11px; }
.project-type { color: var(--muted); text-transform: uppercase; letter-spacing: .09em; font-size: 10px; font-weight: 800; }
.status { white-space: nowrap; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .03em; border: 1px solid var(--line); }
.status.stable { color: var(--accent); background: rgba(105,212,155,.08); }
.status.active { color: var(--accent-2); background: rgba(122,181,255,.07); }
.status.research { color: var(--danger); background: rgba(255,184,107,.07); }
.project-card h3 { margin: 0 0 9px; font-size: 25px; line-height: 1.14; letter-spacing: -.035em; }
.project-card p { margin: 0; color: var(--muted); font-size: 14px; }
.tech { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 18px; }
.tech span { border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 3px 7px; font: 10.5px ui-monospace, SFMono-Regular, Menlo, monospace; }
.project-links { display: flex; gap: 18px; margin-top: 19px; padding-top: 16px; border-top: 1px solid var(--line); }
.project-links a { color: var(--text); font-size: 12px; font-weight: 750; }
.project-links a:hover { color: var(--accent); }

.about-section { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; padding: 100px 0 90px; }
.about-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 28px;
  padding: clamp(34px, 6vw, 72px);
  background: linear-gradient(135deg, rgba(105,212,155,.07), var(--panel) 42%, rgba(122,181,255,.06));
}
.about-card::after { content:""; position:absolute; width:360px; height:360px; border-radius:50%; right:-160px; bottom:-190px; border:1px solid var(--line); box-shadow: 0 0 0 50px rgba(255,255,255,.012), 0 0 0 100px rgba(255,255,255,.008); }
.about-card h2 { max-width: 800px; }
.about-card > p:not(.eyebrow) { max-width: 780px; color: var(--muted); font-size: 16px; }
.about-links { position:relative; z-index:1; display:flex; gap:22px; flex-wrap:wrap; margin-top:28px; }
.about-links a { font-size:13px; font-weight:750; border-bottom:1px solid var(--line); padding-bottom:3px; }
.about-links a:hover { border-color:var(--accent); color:var(--accent); }

footer {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto; padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 20px;
  color: var(--muted); font-size: 12px;
}

@media (max-width: 900px) {
  .header-nav a:nth-child(2) { display:none; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 45px; padding-top: 58px; }
  .hero-panel { max-width: 660px; }
  .section-heading { grid-template-columns: 1fr; align-items: start; }
  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .site-header, .hero, .projects-section, .about-section, footer { width: min(calc(100% - 24px), var(--max)); }
  .header-nav { gap: 12px; }
  .header-nav a { display:none; }
  .hero { padding: 48px 0 62px; }
  .hero h1 { font-size: clamp(39px, 12vw, 56px); }
  .hero-lead { font-size: 16px; }
  .hero-terminal { transform:none; }
  .hero-terminal pre { font-size: 11.5px; padding: 20px; }
  .projects-section { padding-top: 64px; }
  .project-body { padding: 20px; }
  .about-section { padding: 70px 0 60px; }
  footer { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
