:root {
  color-scheme: light;
  --bg: #f7f3ee;
  --bg-alt: #f1ece6;
  --surface: #ffffff;
  --surface-alt: #f6f1ea;
  --text: #1c1b20;
  --muted: #5a5663;
  --border: rgba(20, 20, 20, 0.12);
  --accent: #ff6b35;
  --accent-2: #1b7f79;
  --accent-3: #f5b841;
  --shadow: 0 28px 60px rgba(15, 15, 20, 0.12);
  --shadow-strong: 0 32px 80px rgba(15, 15, 20, 0.18);
  --radius: 24px;
  --radius-lg: 34px;
}

body[data-theme="ocean"] {
  --bg: #f1f6f9;
  --bg-alt: #e7eff3;
  --surface: #ffffff;
  --surface-alt: #eef5f7;
  --text: #10212b;
  --muted: #4b5c66;
  --accent: #2f8f9d;
  --accent-2: #0f3d3e;
  --accent-3: #3fc1c9;
}

body[data-theme="terra"] {
  --bg: #fbf4ea;
  --bg-alt: #f4e8da;
  --surface: #ffffff;
  --surface-alt: #f9efe3;
  --text: #2a1c16;
  --muted: #6a4d45;
  --accent: #d1495b;
  --accent-2: #00798c;
  --accent-3: #edae49;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(255, 107, 53, 0.14), transparent 40%),
    radial-gradient(circle at 80% 5%, rgba(27, 127, 121, 0.12), transparent 45%),
    radial-gradient(circle at 20% 90%, rgba(245, 184, 65, 0.12), transparent 45%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.55));
  pointer-events: none;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Ccircle cx='2' cy='2' r='2' fill='%23d8d0c7' fill-opacity='0.35'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

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

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

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(247, 243, 238, 0.86);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.logo {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.nav-link {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: var(--surface-alt);
}

.nav-link[aria-current="page"],
.nav-link.active {
  background: var(--accent);
  color: #ffffff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ghost-button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.menu-toggle {
  display: none;
}

.hero {
  padding: 4.5rem 0 3rem;
  position: relative;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-2);
}

.hero h1 {
  font-size: clamp(2.4rem, 3vw + 1.8rem, 4rem);
  margin: 0.6rem 0 0.5rem;
  letter-spacing: -0.03em;
}

.tagline {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(1.1rem, 1vw + 1rem, 1.6rem);
  margin: 0 0 1.8rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-3));
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(255, 107, 53, 0.3);
}

.button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(255, 107, 53, 0.35);
}

.button.ghost {
  border-color: var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.6);
}

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

.hero-stats {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
}

.stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.card:hover::after {
  opacity: 1;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card-contrast {
  background: linear-gradient(140deg, rgba(255, 107, 53, 0.12), rgba(245, 184, 65, 0.12));
}

.section {
  padding: 3.5rem 0;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: clamp(1.8rem, 2vw + 1rem, 2.8rem);
  margin: 0;
}

.section-header p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.35rem 0.8rem;
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.chip.is-active,
.chip[aria-pressed="true"] {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.list-check {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.list-check li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
}

.list-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
}

.timeline {
  position: relative;
  padding-left: 1.5rem;
  display: grid;
  gap: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--accent), transparent);
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 1.4rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(255, 107, 53, 0.15);
}

.timeline-meta {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.project-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  font-weight: 600;
}

.accordion {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem 1.4rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.accordion + .accordion {
  margin-top: 1rem;
}

.accordion summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 600;
  font-size: 1.05rem;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent);
}

.accordion[open] summary::after {
  content: "–";
}

.accordion-body {
  margin-top: 0.9rem;
  color: var(--muted);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.skill-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.3rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
}

.skill-card .chip {
  cursor: default;
}

.contact-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.contact-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.footer-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-weight: 600;
}

.toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  background: var(--text);
  color: #ffffff;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s ease;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

  .menu-toggle {
    display: inline-flex;
  }

  .nav-links {
    width: 100%;
    order: 3;
    flex-direction: column;
    align-items: flex-start;
    background: var(--surface);
    border-radius: 18px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }

  body.nav-open .nav-links {
    max-height: 400px;
    padding: 0.8rem;
  }

  .hero {
    padding-top: 3rem;
  }
}

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