/* ── Design tokens ───────────────────────────────────────────── */
:root {
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --bg-card: #111111;
  --text: #ffffff;
  --text-muted: #a3a3a3;
  --text-subtle: #737373;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);
  --gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  --gradient-soft: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 720px;
  --header-height: 72px;
}

/* ── Reset & base ────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

/* ── Utilities ───────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 1rem;
}

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo-link {
  display: inline-flex;
  opacity: 1;
  transition: opacity var(--transition);
}

.logo-link:hover {
  opacity: 0.85;
}

.logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

/* ── Main layout ─────────────────────────────────────────────── */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  padding: clamp(4rem, 12vw, 7rem) 0 clamp(3rem, 8vw, 5rem);
  animation: fadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.hero__title {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1.25rem;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero__title {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  font-weight: 300;
  color: var(--text-muted);
  max-width: 36ch;
  line-height: 1.7;
}

/* ── Works grid ────────────────────────────────────────────────── */
.works {
  padding-bottom: clamp(4rem, 10vw, 6rem);
}

.works__fallback {
  font-size: 0.9375rem;
  color: var(--text-muted);
  padding: 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.works__fallback code {
  font-size: 0.875em;
  color: var(--text);
}

.works__grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition:
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
  animation: fadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.work-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.08);
}

.work-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.work-card__title {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}

.work-card__description {
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--text-subtle);
  line-height: 1.6;
}

.work-card__link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding: 0.5rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--gradient-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  transition:
    color var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.work-card__link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

.work-card__link span,
.work-card__link svg {
  position: relative;
  z-index: 1;
}

.work-card__link:hover {
  border-color: rgba(236, 72, 153, 0.4);
  transform: translateX(2px);
}

.work-card__link:hover::before {
  opacity: 1;
}

.work-card__link:hover span,
.work-card__link:hover svg {
  color: var(--text);
}

.work-card__link svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition);
}

.work-card__link:hover svg {
  transform: translate(2px, -2px);
}

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
  padding: 2.5rem clamp(1.5rem, 5vw, 3rem);
  border-top: 1px solid var(--border);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.site-footer__copy,
.site-footer__credit {
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--text-subtle);
}

.site-footer__credit {
  color: var(--text-muted);
}

/* ── Animations ────────────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger cards via inline animation-delay set in JS */

/* ── Responsive ────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .work-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }

  .work-card__header {
    flex: 1;
  }

  .work-card__link {
    flex-shrink: 0;
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
