:root {
  --bg: #0b0b0d;
  --bg-soft: #121216;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f5f2eb;
  --muted: #aca69b;
  --line: rgba(255, 255, 255, 0.06);
  --accent: #d6c3a1;
  --accent-strong: #f1dfbe;
  --button-primary-bg: #f5f2eb;
  --button-primary-text: #0a0a0c;
  --button-secondary-bg: rgba(255, 255, 255, 0.045);
  --button-secondary-border: rgba(255, 255, 255, 0.2);
  --toggle-bg: rgba(255, 255, 255, 0.045);
  --toggle-border: rgba(255, 255, 255, 0.22);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --container: 1120px;
}

body[data-theme="light"] {
  --bg: #f4efe6;
  --bg-soft: #ece6db;
  --panel: rgba(255, 255, 255, 0.68);
  --panel-strong: rgba(255, 255, 255, 0.82);
  --border: rgba(17, 17, 20, 0.08);
  --text: #101014;
  --muted: #615b52;
  --line: rgba(17, 17, 20, 0.08);
  --accent: #7e6847;
  --accent-strong: #9c8157;
  --button-primary-bg: #101014;
  --button-primary-text: #f4efe6;
  --button-secondary-bg: rgba(16, 16, 20, 0.04);
  --button-secondary-border: rgba(16, 16, 20, 0.16);
  --toggle-bg: rgba(16, 16, 20, 0.045);
  --toggle-border: rgba(16, 16, 20, 0.18);
  --shadow: 0 8px 24px rgba(49, 40, 30, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(214, 195, 161, 0.1), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 50%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04), transparent 16%),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.04), transparent 22%);
  opacity: 0.7;
}

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

.page-shell {
  position: relative;
  width: min(calc(100% - 40px), var(--container));
  margin: 0 auto;
}

.noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.018;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.6) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.6) 1px, transparent 1px);
  background-size: 6px 6px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  font-size: 0.9rem;
  letter-spacing: 0.28em;
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 24px;
  color: var(--muted);
}

.site-nav a {
  transition: color 180ms ease;
}

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--toggle-border);
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero {
  position: relative;
  min-height: calc(100vh - 92px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 0 80px;
  border-top: 1px solid var(--line);
}

.scroll-cue {
  position: absolute;
  right: 96px;
  top: 49%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  transform: translateY(-50%);
  opacity: 0.96;
  transition: transform 220ms ease, opacity 220ms ease;
  will-change: transform, opacity;
}

.scroll-cue span {
  width: 60px;
  height: 60px;
  border-right: 4px solid var(--accent-strong);
  border-bottom: 4px solid var(--accent-strong);
  transform: rotate(45deg);
  opacity: 0.4;
  animation: scroll-cue-fade 2.2s ease-in-out infinite;
  transition:
    opacity 220ms ease,
    border-color 220ms ease,
    transform 220ms ease;
  will-change: transform, opacity;
}

.scroll-cue span:nth-child(2) {
  animation-delay: 0.2s;
}

.scroll-cue span:nth-child(3) {
  animation-delay: 0.4s;
}

.scroll-cue:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.03);
}

.scroll-cue:hover span {
  opacity: 0.82;
  border-color: var(--text);
}

.hero-kicker,
.section-label,
.project-type,
.meta-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-kicker {
  margin-top: 20px;
}

.hero h1,
.intro-copy h2,
.section-heading h2,
.contact-panel h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.hero h1 {
  margin-top: 18px;
  font-size: clamp(3.8rem, 10vw, 8rem);
  white-space: nowrap;
}

.hero-actions {
  margin-top: 34px;
  width: min(100%, 680px);
}

.hero-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 18px;
  width: min(100%, 680px);
}

.type-line {
  display: inline-block;
  min-height: 1em;
}

.type-line::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 0.88em;
  margin-left: 0.08em;
  vertical-align: -0.08em;
  background: var(--accent-strong);
  animation: caret-blink 1s steps(1) infinite;
}

.type-line.is-complete::after {
  animation-duration: 1.4s;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
  will-change: transform;
}

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

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

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

.hero-actions .button-primary {
  width: 100%;
  min-width: 0;
  padding: 0 34px;
}

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

.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.button-icon svg {
  width: 100%;
  height: 100%;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  transition: color 180ms ease, transform 180ms ease;
}

.hero-link:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.hero-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--button-secondary-border);
  background: var(--button-secondary-bg);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.hero-link-icon svg {
  width: 15px;
  height: 15px;
}

.intro-panel,
.portfolio-preview,
.contact-panel {
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow: var(--shadow);
}

#about,
#contact {
  scroll-margin-top: 72px;
}

#portfolio {
  scroll-margin-top: 120px;
}

#portfolio-grid {
  scroll-margin-top: 190px;
}

.intro-panel,
.contact-panel {
  display: grid;
  gap: 24px;
}

.intro-panel {
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
}

.intro-copy {
  display: grid;
  gap: 14px;
  align-content: start;
}

.intro-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.section-heading {
  display: grid;
  gap: 14px;
}

.intro-copy h2,
.section-heading h2,
.contact-panel h2 {
  margin-top: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.section-copy,
.contact-copy {
  margin: 0;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.75;
}

.intro-copy p:last-child,
.project-card p {
  color: var(--muted);
  line-height: 1.8;
}

.intro-meta {
  display: grid;
  gap: 16px;
  align-content: start;
}

.meta-card,
.project-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--panel-strong);
}

.meta-card strong,
.project-card h3 {
  display: block;
  margin-top: 10px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.intro-meta .meta-card strong {
  font-size: 1.08rem;
  line-height: 1.35;
}

.portfolio-preview {
  margin-top: 28px;
}

.project-marquee-stack {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.project-marquee {
  position: relative;
}

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

.project-card {
  width: 100%;
  background: var(--panel);
  box-shadow: none;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease;
}

.project-card h3 {
  margin-bottom: 8px;
}

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

.project-stack {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}

.project-links {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.project-links a,
.project-link-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--button-secondary-border);
  background: var(--button-secondary-bg);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.link-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  font-size: 0.8rem;
  line-height: 1;
}

.project-links a:hover {
  transform: translateY(-2px);
}

.project-link-disabled {
  cursor: default;
  opacity: 0.8;
}

.contact-panel {
  margin: 28px 0 40px;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  transition: color 180ms ease, transform 180ms ease;
}

.contact-link:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 850ms ease,
    transform 850ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

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

@keyframes caret-blink {
  0%,
  45% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@keyframes scroll-cue-fade {
  0%,
  100% {
    opacity: 0.26;
    transform: rotate(45deg) translate(0, 0);
  }

  50% {
    opacity: 1;
    transform: rotate(45deg) translate(10px, 10px);
  }
}

@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;
  }

  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  .scroll-cue span {
    animation: none;
    opacity: 0.7;
  }
}

@media (max-width: 920px) {
  .intro-panel,
  .project-track {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 28px), var(--container));
  }

  .site-header {
    gap: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .site-nav {
    gap: 16px;
    flex-wrap: wrap;
  }

  .hero {
    min-height: auto;
    padding: 48px 0 64px;
  }

  .scroll-cue {
    right: 18px;
    top: auto;
    bottom: 18px;
    transform: none;
  }

  .hero h1 {
    white-space: normal;
    line-height: 1;
  }

  .intro-panel,
  .portfolio-preview,
  .contact-panel {
    padding: 24px;
    border-radius: 24px;
  }

  .button {
    width: 100%;
  }

  .hero-links {
    gap: 14px;
  }
}
