:root {
  color-scheme: light;
  --bg: #f8f7f2;
  --text: #171717;
  --muted: #62615d;
  --line: rgba(23, 23, 23, 0.12);
  --panel: rgba(255, 255, 255, 0.72);
  --accent: #0f766e;
  --accent-dark: #134e4a;
  --warm: #d97706;
  --shadow: 0 24px 80px rgba(23, 23, 23, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101312;
  --text: #f4f1e8;
  --muted: #aaa79e;
  --line: rgba(244, 241, 232, 0.14);
  --panel: rgba(24, 29, 27, 0.78);
  --accent: #5eead4;
  --accent-dark: #99f6e4;
  --warm: #fbbf24;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 32%),
    linear-gradient(315deg, rgba(217, 119, 6, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

.spotlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--x, 50%) var(--y, 20%),
    rgba(15, 118, 110, 0.16),
    transparent 22rem
  );
  mix-blend-mode: multiply;
  opacity: 0.8;
}

:root[data-theme="dark"] .spotlight {
  mix-blend-mode: screen;
  opacity: 0.42;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand,
nav,
.site-footer div {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  font-weight: 700;
}

.brand-mark {
  width: 13px;
  height: 13px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 8px 0 0 var(--warm);
}

nav a,
.site-footer a {
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 180ms ease;
}

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

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theme-icon {
  width: 16px;
  height: 16px;
  border: 2px solid var(--text);
  border-radius: 50%;
  box-shadow: inset -5px -3px 0 var(--panel);
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  min-height: calc(100vh - 96px);
  padding: 48px 0 80px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.93;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.intro {
  max-width: 600px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.button.ghost:hover {
  border-color: var(--accent);
  background: var(--panel);
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}

#signalCanvas {
  width: 100%;
  height: 100%;
  min-height: 420px;
}

.visual-label {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.visual-label strong {
  color: var(--text);
}

.section {
  padding: 96px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.project-art {
  display: block;
  height: 210px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.project-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transform: scale(1.01);
  transition: transform 320ms ease, filter 320ms ease;
}

.project-card:hover .project-art img {
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.06);
}

.project-body {
  padding: 24px;
}

.project-type {
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.project-body p:not(.project-type) {
  color: var(--muted);
  line-height: 1.6;
}

.project-body a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--text);
  font-weight: 700;
}

.project-body a::after {
  content: "";
  width: 18px;
  height: 1px;
  margin: 11px 0 0 9px;
  background: currentColor;
  transition: width 180ms ease;
}

.project-body a:hover::after {
  width: 30px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 7vw, 6rem);
}

.about-copy p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.skill-list span {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: 92px 0;
  border-top: 1px solid var(--line);
}

.contact h2 {
  max-width: 900px;
  margin-bottom: 30px;
}

.contact-link {
  display: inline-flex;
  border-bottom: 2px solid var(--accent);
  color: var(--accent-dark);
  font-size: clamp(1.4rem, 4vw, 3rem);
  font-weight: 700;
}

.contact-photo {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.contact-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 58% center;
  transition: transform 420ms ease, filter 420ms ease;
}

.contact:hover .contact-photo img {
  filter: saturate(1.06) contrast(1.04);
  transform: scale(1.035);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.reveal {
  transform: translateY(18px);
  opacity: 0;
  transition: transform 600ms ease, opacity 600ms ease;
}

.reveal.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 860px) {
  .site-header {
    flex-wrap: wrap;
  }

  nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    padding-top: 8px;
  }

  .hero,
  .split,
  .contact {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual,
  #signalCanvas {
    min-height: 360px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .contact-photo {
    max-width: 520px;
  }

  .section-heading {
    display: block;
  }
}

@media (max-width: 520px) {
  main,
  .site-header,
  .site-footer {
    width: min(100% - 24px, 1120px);
  }

  h1 {
    font-size: 3.1rem;
  }

  .hero {
    padding-top: 24px;
  }

  .button {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
  }
}

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