/* Light/Dark mode toggle */
body,
.site-header,
.card,
.skill-card,
.project-card,
.nav-links,
.skill-bubble,
.education-duration,
.contact-chip,
.contact-list li,
.photo-missing,
.btn-ghost {
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

#theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 100;
}

/* Dark mode: override CSS variables so every var(--x) element switches automatically */
html.dark-mode {
  --bg: #181a1b;
  --paper: #23272a;
  --ink: #e0e0e0;
  --muted: #9aa5a0;
  --accent: #f08050;
  --accent-dark: #f4a070;
  --line: #3a4045;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

html.dark-mode body {
  background: radial-gradient(circle at 15% 10%, #1e2122 0%, #181a1b 45%, #131516 100%);
  color: var(--ink);
}

html.dark-mode .site-header {
  background: rgba(24, 26, 27, 0.85);
  border-bottom-color: rgba(58, 64, 69, 0.6);
}

html.dark-mode .skill-bubble,
html.dark-mode .education-duration,
html.dark-mode .contact-chip {
  background: #2a3035;
  border-color: var(--line);
  color: var(--ink);
}

html.dark-mode .btn-ghost {
  background: rgba(35, 39, 42, 0.85);
  border-color: var(--line);
  color: var(--ink);
}

html.dark-mode .contact-list li {
  background: rgba(35, 39, 42, 0.7);
}

html.dark-mode .photo-missing {
  background: #23272a;
}

html.dark-mode .bg-shape-1 {
  background: #7a3a1a;
}

html.dark-mode .bg-shape-2 {
  background: #1e3a2a;
}

html.dark-mode .nav-links {
  background: var(--paper);
}
:root {
  --bg: #f4efe5;
  --paper: #fffaf2;
  --ink: #1f2a24;
  --muted: #4f5b53;
  --accent: #da5a2a;
  --accent-dark: #a53f1a;
  --line: #dacdb8;
  --shadow: 0 12px 30px rgba(31, 42, 36, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 10%, #fdf5e8 0%, #f4efe5 45%, #ebe4d6 100%);
  line-height: 1.6;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.38;
}

.bg-shape-1 {
  width: 260px;
  height: 260px;
  background: #ffbf86;
  top: -90px;
  right: -70px;
}

.bg-shape-2 {
  width: 300px;
  height: 300px;
  background: #8db7a0;
  bottom: -120px;
  left: -90px;
}

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(6px);
  background: rgba(244, 239, 229, 0.75);
  border-bottom: 1px solid rgba(218, 205, 184, 0.5);
  z-index: 20;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 16px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
}

.hero {
  padding: 90px 0 60px;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
}

.hero-text {
  order: 2;
  justify-self: start;
  max-width: 62ch;
}

.hero-photo-wrap {
  order: 1;
  display: flex;
  justify-content: center;
  justify-self: start;
  width: clamp(220px, 30vw, 320px);
  aspect-ratio: 1 / 1;
  margin-inline: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--line);
  box-shadow: 0 14px 34px rgba(31, 42, 36, 0.2);
  background: #eee8dc;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  transform: scale(1.1);
  transform-origin: center top;
}

.photo-missing {
  width: 100%;
  height: 100%;
  display: none;
  place-items: center;
  text-align: center;
  padding: 18px;
  border-radius: inherit;
  border: 0;
  background: #f3ead9;
  color: var(--muted);
  font-weight: 600;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
  line-height: 1.1;
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(2rem, 6vw, 4.5rem);
  max-width: 13ch;
}

h1 span {
  color: var(--accent-dark);
}

.hero-copy {
  color: var(--muted);
  max-width: 62ch;
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.hero-cta {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 11px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(130deg, #e06d3d, #c74b20);
  box-shadow: 0 6px 14px rgba(199, 75, 32, 0.25);
}

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.75);
}

.section {
  padding: 40px 0;
}

.page-main {
  padding-top: 20px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.page-links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.page-link-card {
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.page-link-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.page-link-card p {
  margin: 0;
  color: var(--muted);
}

.card,
.skill-card,
.project-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.card {
  padding: 24px;
}

.skills-grid,
.projects-grid {
  display: grid;
  gap: 16px;
}

.skills-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.skill-card {
  padding: 18px;
}

.skill-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-bubble {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff7ea;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.stack-label {
  margin: 10px 0 6px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.projects-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-card .tag {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--accent-dark);
  font-weight: 700;
}

.project-card p {
  color: var(--muted);
  margin: 0;
}

.project-meta-title {
  color: var(--ink);
  font-weight: 700;
  margin-top: 2px;
}

.project-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.project-card a {
  margin-top: auto;
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.education-card {
  display: grid;
  gap: 8px;
}

.education-label {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-dark);
  font-weight: 700;
}

.education-degree {
  margin: 0;
  font-size: clamp(1.1rem, 2.3vw, 1.4rem);
  line-height: 1.25;
}

.education-school {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

.education-year {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.education-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.education-duration {
  width: fit-content;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff7ea;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.contact-card ul {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}

.contact-card {
  display: grid;
  gap: 14px;
}

.contact-lead {
  margin: 0;
  color: var(--muted);
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 250, 242, 0.6);
}

.contact-label {
  font-weight: 700;
  color: var(--ink);
  min-width: 78px;
}

.contact-value {
  color: var(--accent-dark);
  text-decoration: none;
  word-break: break-word;
}

.contact-value:hover {
  text-decoration: underline;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 700;
  color: var(--ink);
  background: #fff7ea;
}

.contact-chip:hover {
  border-color: var(--accent-dark);
}

.site-footer {
  padding: 18px 0 28px;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.65s ease forwards;
}

.reveal:nth-of-type(2) {
  animation-delay: 0.08s;
}

.reveal:nth-of-type(3) {
  animation-delay: 0.16s;
}

.reveal:nth-of-type(4) {
  animation-delay: 0.24s;
}

.reveal:nth-of-type(5) {
  animation-delay: 0.32s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .page-links-grid {
    grid-template-columns: 1fr;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-text {
    order: 1;
  }

  .hero-photo-wrap {
    order: 2;
    width: min(70vw, 300px);
    margin-inline: auto;
  }

  .hero-photo {
    object-position: center 15%;
    transform: scale(1.1);
    transform-origin: center top;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    right: 4%;
    width: min(250px, 92vw);
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 12px;
    padding: 10px 14px;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .hero {
    padding-top: 70px;
  }

  .hero-photo-wrap {
    width: min(82vw, 280px);
  }

  .hero-photo {
    object-position: center 15%;
    transform: scale(1.1);
    transform-origin: center top;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }
}
