:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem; --space-24: 6rem;
  --radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.75rem;
  --radius-xl: 1rem; --radius-full: 9999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --content-default: 960px;
  --color-bg: #080807;
  --color-surface: #0f0f0e;
  --color-border: #1f1f1d;
  --color-text: #e6e4e0;
  --color-text-muted: #7a7874;
  --color-text-faint: #3a3a38;
  --shadow-md: 0 4px 20px oklch(0 0 0 / 0.5);
  --shadow-lg: 0 12px 40px oklch(0 0 0 / 0.6);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
ul[role="list"] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.15; }
p, li { text-wrap: pretty; max-width: 72ch; }
::selection { background: oklch(from var(--color-text) l c h / 0.15); color: var(--color-text); }
:focus-visible { outline: 2px solid var(--color-text); outline-offset: 3px; border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

button { cursor: pointer; background: none; border: none; }
a, button { transition: color var(--transition), background var(--transition), border-color var(--transition), opacity var(--transition); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.container { max-width: var(--content-default); margin-inline: auto; padding-inline: var(--space-6); }

nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: var(--space-4) var(--space-6);
  display: flex; align-items: center; justify-content: space-between;
  background: oklch(from var(--color-bg) l c h / 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.05);
}

.nav-logo { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--color-text); }
.nav-logo img { height: 32px; width: auto; transition: opacity var(--transition); }
.nav-logo:hover img { opacity: 0.75; }
.nav-logo-name { font-family: var(--font-display); font-size: var(--text-lg); font-style: italic; letter-spacing: -0.01em; }

.nav-links { display: flex; align-items: center; gap: var(--space-5); }
.nav-links a { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--color-text-muted); font-size: var(--text-sm); }
.nav-links a:hover { color: var(--color-text); }
.nav-links a i { width: 14px; height: 14px; flex-shrink: 0; }

@keyframes fade-up {
  from { opacity: 0; clip-path: inset(24px 0 0 0); }
  to   { opacity: 1; clip-path: inset(0 0 0 0); }
}

.hero {
  padding-top: calc(var(--space-24) + 64px);
  padding-bottom: var(--space-24);
  min-height: 100dvh;
  display: flex; align-items: center;
  position: relative; overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 10% 60%, oklch(0.35 0.03 250 / 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 85% 20%, oklch(0.3 0.02 200 / 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero-eyebrow {
  font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--color-text-faint); margin-bottom: var(--space-5);
  opacity: 0;
  animation: fade-up 0.7s var(--ease-out) 0.1s both;
}

.hero-title {
  font-family: var(--font-display); font-size: var(--text-3xl);
  font-style: italic; line-height: 1.05; letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
  opacity: 0;
  animation: fade-up 0.8s var(--ease-out) 0.22s both;
}

.hero-sub {
  font-size: var(--text-base); color: var(--color-text-muted);
  max-width: 46ch; line-height: 1.7; margin-bottom: var(--space-8);
  opacity: 0;
  animation: fade-up 0.8s var(--ease-out) 0.35s both;
}

.hero-cta {
  display: inline-flex; align-items: center; gap: var(--space-2);
  text-decoration: none; font-size: var(--text-sm); color: var(--color-text);
  border: 1px solid oklch(from var(--color-text) l c h / 0.22);
  padding: 0.75rem 1.5rem; border-radius: var(--radius-full);
  opacity: 0;
  animation: fade-up 0.8s var(--ease-out) 0.45s both;
  transition: border-color var(--transition), background var(--transition), transform 220ms var(--ease-out);
}

.hero-cta:hover {
  border-color: oklch(from var(--color-text) l c h / 0.5);
  background: oklch(from var(--color-text) l c h / 0.05);
  transform: translateY(-1px);
}

.hero-cta:active { transform: translateY(0); }
.hero-cta:hover .arrow { transform: translateX(4px); }
.arrow { transition: transform var(--transition); }
.hero-cta i { width: 15px; height: 15px; flex-shrink: 0; }

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--color-border) 20%, var(--color-border) 80%, transparent 100%);
  border: none;
}

.section { padding-block: clamp(var(--space-16), 8vw, var(--space-24)); }

.section-label {
  font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--color-text-faint); margin-bottom: var(--space-8);
  display: flex; align-items: center; gap: var(--space-3);
}

.section-label::before {
  content: '';
  display: block; width: 20px; height: 1px;
  background: var(--color-text-faint); flex-shrink: 0;
}

.section-title {
  font-family: var(--font-display); font-size: var(--text-xl);
  font-style: italic; line-height: 1.1; letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}

.section-body { color: var(--color-text-muted); max-width: 50ch; line-height: 1.65; }

.projects-grid {
  margin-top: var(--space-12);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--space-4);
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl); padding: var(--space-8);
  display: flex; flex-direction: column; gap: var(--space-3);
  transition: border-color var(--transition), box-shadow var(--transition), transform 220ms var(--ease-out);
}

.project-card:hover {
  border-color: oklch(from var(--color-text) l c h / 0.2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.project-card:active { transform: translateY(0); }
.project-card-tag { font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-faint); }
.project-card-title { font-family: var(--font-display); font-size: var(--text-lg); font-style: italic; line-height: 1.2; }
.project-card-desc { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; flex: 1; }
.project-card-link { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); color: var(--color-text-muted); text-decoration: none; margin-top: var(--space-2); }
.project-card-link:hover { color: var(--color-text); }
.project-card-link i { width: 12px; height: 12px; }
.status-dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--color-text-faint); display: inline-block; margin-right: var(--space-1); flex-shrink: 0; }
.status-dot.live { background: #6daa45; box-shadow: 0 0 6px oklch(0.6 0.15 145 / 0.5); }

.empty-state {
  grid-column: 1 / -1;
  padding: var(--space-16) var(--space-8);
  background: var(--color-surface);
  border: 1px dashed oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-xl);
  display: flex; flex-direction: column; gap: var(--space-3);
}

.empty-state-icon { color: var(--color-text-faint); margin-bottom: var(--space-2); }
.empty-state-icon i { width: 32px; height: 32px; stroke-width: 1.25; }
.empty-state h3 { font-family: var(--font-display); font-style: italic; font-size: var(--text-lg); }
.empty-state p { font-size: var(--text-sm); color: var(--color-text-faint); }

.contact-row { margin-top: var(--space-10); }
.contact-link { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; font-size: var(--text-sm); color: var(--color-text-muted); border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.12); padding-bottom: 2px; }
.contact-link:hover { color: var(--color-text); border-color: oklch(from var(--color-text) l c h / 0.4); }
.contact-link i { width: 14px; height: 14px; flex-shrink: 0; }

footer {
  padding: var(--space-8) var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-4);
}

.footer-left { display: flex; align-items: center; gap: var(--space-3); }
.footer-logo img { height: 20px; width: auto; opacity: 0.4; transition: opacity var(--transition); }
.footer-logo:hover img { opacity: 0.7; }
.footer-copy { font-size: var(--text-xs); color: var(--color-text-faint); }

.fade-in { opacity: 1; }

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: scroll-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 70%;
  }
}

@keyframes scroll-fade { to { opacity: 1; } }

@media (max-width: 600px) {
  nav { padding: var(--space-3) var(--space-4); }
  .nav-logo-name { display: none; }
  .nav-links { gap: var(--space-3); }
  .hero { padding-top: calc(var(--space-16) + 64px); min-height: auto; padding-bottom: var(--space-16); }
  footer { flex-direction: column; align-items: flex-start; }
}