:root {
  --bg: #f1e8d7;
  --bg-hero-brown: #e9dcc7;
  --bg-hero-shadow: #dbc8ac;
  --bg-content-green: #efe6d2;
  --bg-elev: #f7f0e2;
  --surface: #f4ebda;
  --text: #2f2418;
  --text-muted: #4e4135;
  --accent: #86b895;
  --accent-strong: #5f976f;
  --accent-gold: #c8a040;
  --accent-gold-light: #f5d87a;
  --border: rgba(74, 58, 40, 0.28);
  --shadow: 0 12px 28px rgba(64, 44, 24, 0.14);
  --paper: #e7d8b6;
  --ink: #2b1b10;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #eadfcf 0%, #e8d9c1 26%, var(--bg-content-green) 58%, #f2e9d8 100%);
  color: var(--text);
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
}

#loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, #f3e7d2 0%, #dfccb0 68%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 60;
  transition: opacity 0.55s ease;
}

#loader.fade {
  opacity: 0;
  pointer-events: none;
}

#loader-stamp {
  width: 80px;
  height: 80px;
  border: 3px solid var(--accent-gold);
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  margin-bottom: 16px;
  animation: loader-pulse 1.2s ease-in-out infinite;
}

#loader p {
  color: #6a5948;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

@keyframes loader-pulse {
  0%, 100% { transform: scale(1); opacity: 0.65; }
  50% { transform: scale(1.08); opacity: 1; }
}

#cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(61, 45, 30, 0.7);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 120ms ease, border-color 160ms ease;
  z-index: 45;
  mix-blend-mode: normal;
}

#cursor.hovering {
  transform: translate(-50%, -50%) scale(1.7);
}

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

.container {
  width: min(1080px, 92vw);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(245, 235, 220, 0.92), rgba(238, 227, 208, 0.85));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 76px;
  gap: 20px;
}

.brand {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

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

.nav-links a {
  color: var(--text-muted);
  transition: color 160ms ease;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.hero {
  position: relative;
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(122, 74, 30, 0.22) 0%, rgba(122, 74, 30, 0.08) 28%, rgba(15, 12, 6, 0) 60%),
    linear-gradient(180deg, rgba(235, 222, 202, 0.96), rgba(228, 213, 191, 0.74) 60%, rgba(239, 230, 210, 0.8) 100%);
}

#canvas-wrapper {
  position: absolute;
  inset: 0;
}

#scene-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(42px, 9vw, 88px) 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 20px;
}

.hero-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  max-width: 23ch;
  opacity: 0.94;
}

.eyebrow {
  color: var(--accent-gold-light);
  font-size: 0.86rem;
  margin: 0 0 10px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 4rem);
  line-height: 1.14;
  max-width: 18ch;
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  letter-spacing: -0.02em;
}

.accent {
  color: var(--accent);
}

.hero-sub {
  margin: 14px 0 24px;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  max-width: 58ch;
}

.intro {
  padding-top: 28px;
}

.intro-title {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  max-width: 22ch;
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 19px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent-strong);
  color: #f6fbf8;
  font-weight: 500;
  transition: transform 130ms ease, background-color 130ms ease, box-shadow 130ms ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  background: #6aa67c;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.button.ghost {
  background: transparent;
  border-color: rgba(74, 58, 40, 0.42);
  color: var(--text);
  box-shadow: none;
}

.button.ghost:hover,
.button.ghost:focus-visible {
  background: rgba(95, 81, 67, 0.08);
}

.section {
  padding: 48px 0 20px;
  position: relative;
}

.content-card {
  margin-top: 18px;
  padding: clamp(22px, 3vw, 34px);
  border-radius: 22px;
  border: 1px solid rgba(109, 84, 49, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.94), rgba(245, 236, 222, 0.94)),
    radial-gradient(circle at 100% 0%, rgba(134, 184, 149, 0.15) 0%, rgba(134, 184, 149, 0) 42%);
  box-shadow:
    0 10px 22px rgba(64, 44, 24, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.content-card::after {
  content: none;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  letter-spacing: -0.01em;
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  font-weight: 700;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--accent-gold-light);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.section-lead {
  margin: 0 0 20px;
  max-width: 72ch;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-card {
  position: relative;
  border: 1px solid rgba(109, 84, 49, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.95), rgba(244, 233, 216, 0.96)),
    radial-gradient(circle at 0% 0%, rgba(95, 151, 111, 0.13), rgba(95, 151, 111, 0));
  color: var(--text);
  border-radius: 14px;
  padding: 16px 16px 18px;
  box-shadow: 0 8px 18px rgba(64, 44, 24, 0.1);
  transform: none;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.project-card::before {
  content: none;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(109, 84, 49, 0.32);
  box-shadow: 0 12px 24px rgba(64, 44, 24, 0.14);
}

.project-card h3 {
  margin: 0;
  font-size: 1.02rem;
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.project-meta {
  margin-top: 4px;
  color: #6d542f;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.project-desc {
  margin: 10px 0 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.project-link {
  font-weight: 700;
  color: #2e2418;
  letter-spacing: 0.03em;
  font-size: 0.8rem;
}

.project-link:hover,
.project-link:focus-visible {
  text-decoration: underline;
}

.about-copy p {
  margin: 0 0 10px;
  color: var(--text-muted);
  max-width: 72ch;
}

.about-copy .italic {
  font-style: italic;
  color: var(--text);
}

.about-copy ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.about-copy li {
  margin-bottom: 6px;
}

.connect-copy {
  margin: 0 0 16px;
  color: var(--text-muted);
  max-width: 62ch;
}

.connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  background: rgba(236, 225, 206, 0.8);
}

.footer-wrap {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

#panel {
  position: absolute;
  top: 50%;
  right: clamp(10px, 3vw, 34px);
  transform: translateY(-50%) translateX(20px);
  width: clamp(270px, 30vw, 420px);
  background: linear-gradient(180deg, rgba(250, 244, 233, 0.96), rgba(241, 230, 211, 0.96));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.24s ease, opacity 0.24s ease;
  z-index: 6;
}

#panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

#panel-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #4f4030;
  font-size: 1.3rem;
  cursor: pointer;
}

#panel-emoji {
  display: block;
  font-size: 1.9rem;
  margin-bottom: 8px;
}

#panel-title {
  font-size: 1.2rem;
  font-weight: 700;
}

#panel-tag {
  display: inline-block;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  color: #624a24;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#panel-desc {
  margin-top: 10px;
  color: var(--text-muted);
}

#panel-link {
  display: inline-block;
  margin-top: 12px;
  font-weight: 500;
}

#panel-link:hover,
#panel-link:focus-visible {
  text-decoration: underline;
}

@media (max-width: 820px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    transform: none;
  }

  .nav-wrap,
  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 12px 0;
  }

  #cursor {
    display: none;
  }

  .hero-overlay {
    justify-content: flex-start;
    align-items: flex-end;
  }

  #panel {
    left: 50%;
    right: auto;
    width: min(92vw, 420px);
    transform: translate(-50%, 26px);
    top: auto;
    bottom: 20px;
  }

  #panel.visible {
    transform: translate(-50%, 0);
  }
}
