:root {
  --bg: #0A0A0B; --panel: #121214; --panel-2: #17171A; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --ink: #F4F4F2; --muted: #A5A5A0; --dim: #6E6E6A; --accent: #C8F169;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 28px; }
.brand { font-weight: 600; font-size: 15px; text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--dim); font-weight: 400; }
.top nav { display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.top nav a { text-decoration: none; transition: color .2s; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }

/* Type */
.eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 16px; }
h1 { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: clamp(44px, 7vw, 88px); line-height: .98; letter-spacing: -.01em; margin: 0 0 22px; max-width: 920px; }
h1 em { color: var(--accent); }
h2 { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: clamp(48px, 6.4vw, 80px); line-height: 1.02; margin: 0; }
h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.lede { color: var(--muted); font-size: 18px; max-width: 640px; margin: 0; }
.hero { padding: 72px 0 80px; }
.crumbs { font-size: 13px; color: var(--dim); margin: 0 0 18px; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

/* Category blocks */
.cat { border-top: 1px solid var(--line); padding: 56px 0 72px; }
.cat-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.cat-head .num { display: block; color: var(--dim); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.cat-head p { color: var(--muted); margin: 10px 0 0; max-width: 560px; font-size: 15px; }
.more { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.more:hover { text-decoration: underline; }

/* Project card with a live preview */
.project { display: grid; grid-template-columns: 1.55fr 1fr; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); }
.project > * { min-width: 0; }
.project + .project { margin-top: 28px; }
.project .info { padding: 32px 30px; display: flex; flex-direction: column; gap: 16px; }
.project .info p { margin: 0; color: var(--muted); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12px; padding: 4px 10px; border-radius: 30px; border: 1px solid var(--line); color: var(--muted); }
.actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 8px; font-weight: 600; font-size: 14px; text-decoration: none; transition: background-color .2s, transform .2s, border-color .2s; }
.btn-accent { background: var(--accent); color: #0A0A0B; }
.btn-accent:hover { background: #D8F98C; transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: rgba(255,255,255,.06); }

/* Live preview: the real page rendered at desktop width, scaled to fit */
.preview { position: relative; display: block; background: #000; border-right: 1px solid var(--line); }
.preview .chrome { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.preview .chrome i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.14); }
.preview .chrome .url { margin-left: 8px; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview .chrome .live-dot { margin-left: auto; font-size: 11px; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.preview .chrome .live-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(200,241,105,.2); }
.screen { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #070806 center / cover no-repeat; }
.screen iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; opacity: 0; transition: opacity .6s; }
.screen iframe.ready { opacity: 1; }
.preview .open { position: absolute; inset: 0; z-index: 2; }
.preview .open span { position: absolute; right: 14px; bottom: 14px; font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 30px; background: rgba(10,10,11,.78); border: 1px solid var(--line-2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s; }
.preview:hover .open span, .preview .open:focus-visible span { opacity: 1; transform: none; }

/* Design switcher under a preview */
.switch { display: flex; gap: 4px; padding: 10px 12px; background: var(--panel-2); border-top: 1px solid var(--line); position: relative; z-index: 3; }
.switch button { font: 500 12px/1 'Inter', system-ui, sans-serif; color: var(--muted); background: none; border: 1px solid transparent; border-radius: 6px; padding: 7px 10px; cursor: pointer; }
.switch button:hover { color: var(--ink); }
.switch button[aria-selected="true"] { color: var(--ink); background: rgba(255,255,255,.06); border-color: var(--line); }

/* Big stacked layout on the category page */
.project.big { grid-template-columns: 1fr; }
.project.big .preview { border-right: 0; border-bottom: 1px solid var(--line); }
.project.big .info { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px 40px; align-items: start; }
.project.big .info .actions { grid-column: 1 / -1; margin-top: 0; }

/* Repo cards (skills category) */
.repos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.repo { display: flex; flex-direction: column; gap: 12px; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); text-decoration: none; transition: border-color .2s, transform .2s; }
.repo:hover { border-color: var(--line-2); transform: translateY(-2px); }
.repo p { margin: 0; color: var(--muted); font-size: 14px; }
.repo .go { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--accent); }
.repo .kind { font-size: 12px; color: var(--dim); display: inline-flex; gap: 8px; align-items: center; }
.repo .kind svg { width: 14px; height: 14px; fill: currentColor; }

footer { border-top: 1px solid var(--line); padding-top: 28px; padding-bottom: 40px; color: var(--dim); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .project, .project.big .info { grid-template-columns: 1fr; }
  .preview { border-right: 0; border-bottom: 1px solid var(--line); }
  .repos { grid-template-columns: 1fr; }
  .top nav { gap: 16px; }
  .top nav .hide-sm { display: none; }
  .hero { padding: 48px 0 56px; }
  .project .info { padding: 24px 20px; }
  .preview .open span { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .screen iframe { transition: none; } }

/* Static visual in place of a live preview */
.visual { display: flex; align-items: center; background: #FBF8F2; border-right: 1px solid var(--line); overflow: hidden; }
.visual img { display: block; width: 100%; height: auto; transition: transform .5s ease; }
.visual:hover img { transform: scale(1.015); }
.repos:has(> .repo:only-child) { grid-template-columns: 1fr; }
@media (max-width: 900px) { .visual { border-right: 0; border-bottom: 1px solid var(--line); } }
.subhead { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.05; letter-spacing: -.01em; color: var(--ink); margin: 0 0 22px; display: flex; align-items: center; gap: 18px; }
.subhead::before { content: ""; flex: 0 0 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(200,241,105,.16); }
.subhead::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.project + .subhead { margin-top: 64px; }
