/* Portfolio chrome — minimal, Figma-inspired spacing; no third-party CSS */
:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --surface: #141416;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --accent: #dd0000;
  --border: #27272a;
  --focus-ring: #f4f4f5;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 0.75rem;
  z-index: 300;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--focus-ring);
  border-radius: 6px;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.75rem;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.anchor-nav-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

main {
  padding-top: 4.5rem;
}

.anchor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem var(--container-padding);
  justify-content: center;
  max-width: var(--container-max-width);
  margin-inline: auto;
}

.anchor-nav__link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.anchor-nav__link:hover {
  color: var(--text);
  border-color: #52525b;
}

.anchor-nav__link.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.anchor-nav__link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.section {
  padding-block: 8rem;
}

/* Fixed anchor nav: align hash scroll so the spy "line" lands in the target block */
#hero.section,
#works.section,
#ai-workflow.section,
#about.section,
#contact {
  scroll-margin-top: 4.75rem;
}

.section--tight {
  padding-block: 3rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 42rem;
  margin: 0 0 2rem;
}

.hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  line-height: 1.1;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 36rem;
  margin: 0 0 1.5rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-cta--center {
  justify-content: center;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  border-color: #52525b;
  background: #1c1c1f;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  filter: brightness(1.08);
}

.btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.work-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  width: 100%;
  color: inherit;
  font: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.work-card:hover {
  transform: translateY(-2px);
  border-color: #3f3f46;
}

.work-card:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.work-card__media {
  aspect-ratio: 4 / 3;
  background: #09090b;
  overflow: hidden;
}

.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-card__body {
  padding: 1rem 1.1rem 1.15rem;
}

.work-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.work-card__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.work-card__date {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
}

.ai-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.35rem;
  height: 100%;
}

.ai-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--text);
}

.ai-card p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.ai-card a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.ai-card a:hover {
  text-decoration: underline;
}

.embed-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  aspect-ratio: 16 / 9;
  max-width: 100%;
}

.embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.site-footer {
  padding: 2.5rem var(--container-padding);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer a {
  color: var(--text-muted);
  margin: 0 0.5rem;
}

.site-footer a:hover {
  color: var(--text);
}

/* Modal */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 768px) {
  .project-modal {
    align-items: center;
    padding: 2rem;
  }
}

.project-modal[hidden] {
  display: none !important;
}

.project-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  border: 0;
  cursor: pointer;
}

.project-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  max-height: min(92vh, 900px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
}

@media (min-width: 768px) {
  .project-modal__dialog {
    border-radius: 16px;
  }
}

.project-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.project-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.project-modal__published {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.project-modal__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.project-modal__close:hover {
  background: #27272a;
}

.project-modal__close:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.project-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.project-modal__body {
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
  flex: 1;
}

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

.project-modal__gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #09090b;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
