:root {
  --bg: #0a0a0b;
  --surface: #141417;
  --surface-elevated: #1b1b20;
  --border: #26262b;
  --border-strong: #303036;
  --text: #f4f4f5;
  --text-secondary: #c7c7ce;
  --text-muted: #9a9aa2;
  --accent: #8b5cf6;
  --accent-hover: #a47cf8;
  --accent-soft: rgba(139, 92, 246, 0.12);
  --font-display: "Anton", system-ui, sans-serif;
  --font-sans: "Archivo", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

a { color: inherit; text-underline-offset: 4px; text-decoration-color: var(--border-strong); }
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }

.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 12px;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Hero */
.hero {
  padding-bottom: 72px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(60% 80% at 0% 60%, var(--accent-soft), transparent 70%);
}
.hero .eyebrow { margin-top: 96px; }
h1 {
  margin: 0 0 20px;
  font: 400 clamp(2.75rem, 9vw, 4.5rem)/0.95 var(--font-display);
  letter-spacing: 0.01em;
  text-transform: lowercase;
}
h1 em { font-style: normal; color: var(--accent); }
.lead { margin: 0; max-width: 32em; color: var(--text-secondary); }

section { padding-top: 72px; }
h2 {
  margin: 0 0 24px;
  font-size: clamp(1.75rem, 5vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Contact */
.email {
  display: inline-block;
  font-size: clamp(1.25rem, 4.5vw, 1.6rem);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 4px;
  overflow-wrap: anywhere;
}
.email span { color: var(--accent); transition: margin .2s var(--ease-out); }
.email:hover { border-color: var(--accent); }
.email:hover span { margin-left: 6px; }

/* Portfolio */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.project-open {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 12px 12px 18px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color .2s var(--ease-out), transform .2s var(--ease-out);
}
.project-open:hover { border-color: var(--accent); transform: translateY(-3px); }
.project-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.project-open > :not(.thumb) { margin-left: 6px; margin-right: 6px; }

.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  background:
    radial-gradient(80% 90% at 100% 100%, rgba(139, 92, 246, 0.45), transparent 70%),
    var(--surface-elevated);
  position: relative;
}
.thumb span {
  position: absolute;
  left: 14px;
  bottom: 8px;
  font: 400 3rem/1 var(--font-display);
  color: rgba(244, 244, 245, 0.18);
}

.tag {
  margin: 16px 0 4px;
  font: 12px/1 var(--font-mono);
  color: var(--accent);
}
h3 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.meta { margin: 2px 0 0; font: 13px/1.5 var(--font-mono); color: var(--text-muted); }

/* Modal */
dialog {
  width: min(640px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 28px rgba(139, 92, 246, 0.2);
}
.modal-inner { padding: 16px 16px 24px; }
dialog::backdrop { background: rgba(5, 5, 6, 0.75); backdrop-filter: blur(4px); }
dialog[open] { animation: pop .25s var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.modal-close {
  position: absolute;
  z-index: 1;
  top: 28px;
  right: 28px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { border-color: var(--accent); color: var(--accent-hover); }
.modal-close:not(:focus-visible) { outline: none; }
.modal-inner > :not(.modal-media):not(.modal-close) { margin-left: 8px; margin-right: 8px; }
dialog h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
.modal-meta { margin-bottom: 12px; }
.modal-body { color: var(--text-secondary); }

footer {
  margin-top: 96px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font: 12px/1 var(--font-mono);
  color: var(--text-muted);
}
