:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --text: #1f2a44;
  --muted: #5c6784;
  --accent: #2f4f8f;
  --bubble: #ff77d8;
  --bubble-dark: #bd2f90;
  --accent-soft: #e5ebfb;
  --border: #d8dfef;
  --border-strong: #c4d0ea;
  --header-bg: rgba(255, 255, 255, 0.92);
  --header-bg-solid: rgba(255, 255, 255, 0.98);
  --shadow-soft: 0 8px 18px rgba(44, 68, 123, 0.06);
  --shadow-hover: 0 14px 28px rgba(44, 68, 123, 0.12);
  --btn-shadow: 0 10px 20px rgba(35, 61, 113, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.theme-dark {
  --bg: #0e1322;
  --surface: #171d31;
  --text: #e8ecff;
  --muted: #acb5d7;
  --accent: #93a9ff;
  --accent-soft: #222b47;
  --border: #303b61;
  --border-strong: #4a5682;
  --header-bg: rgba(16, 22, 38, 0.84);
  --header-bg-solid: rgba(16, 22, 38, 0.98);
  --shadow-soft: 0 10px 24px rgba(2, 4, 12, 0.45);
  --shadow-hover: 0 14px 32px rgba(2, 4, 12, 0.62);
  --btn-shadow: 0 10px 20px rgba(5, 8, 19, 0.55);
}

body.intro-active {
  overflow: hidden;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: #0d111b;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.intro-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-name {
  margin: 0;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  font-family: "Baloo 2", "Fredoka", "Arial Rounded MT Bold", "Comic Sans MS", cursive;
  color: var(--bubble);
  letter-spacing: 0.02em;
  font-size: clamp(3rem, 13vw, 7.6rem);
  text-align: center;
  white-space: nowrap;
  z-index: 130;
  opacity: 1;
  font-weight: 800;
  -webkit-text-stroke: 1px #ffd8f1;
  text-shadow: 0 3px 0 #d94aac, 0 7px 0 var(--bubble-dark), 0 12px 0 #92266f,
    0 20px 34px rgba(0, 0, 0, 0.4);
  animation: none;
}

.intro-name.shrink-to-header {
  animation: shrinkToHeader 1.6s ease forwards;
}

.site-intro-complete .intro-name {
  display: none;
}

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

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}

.header:hover {
  box-shadow: 0 8px 24px rgba(39, 53, 91, 0.08);
}

.nav {
  min-height: 112px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "menu brand actions"
    "links links links";
  align-items: center;
  gap: 0.45rem 1rem;
}

.site-brand {
  font-family: "Baloo 2", "Fredoka", "Arial Rounded MT Bold", "Comic Sans MS", cursive;
  text-decoration: none;
  font-weight: 800;
  color: var(--bubble);
  font-size: clamp(1.4rem, 2.3vw, 1.95rem);
  letter-spacing: 0.01em;
  grid-area: brand;
  justify-self: center;
  text-align: center;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  text-shadow: 0 2px 0 #d94aac, 0 4px 0 var(--bubble-dark), 0 12px 20px rgba(0, 0, 0, 0.12);
}

.site-intro-complete .site-brand {
  opacity: 1;
  transform: translateY(0);
}

.menu-toggle {
  grid-area: menu;
  justify-self: start;
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.nav-links {
  grid-area: links;
  display: flex;
  justify-self: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  transition: color 0.25s ease, transform 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent);
  transform: translateY(-1px);
}

.top-actions {
  grid-area: actions;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.github-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.github-link:hover,
.github-link:focus-visible {
  color: var(--accent);
  border-color: var(--border);
  background: var(--surface);
  transform: translateY(-1px);
}

.hero {
  padding: 5rem 0 3.4rem;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

h1,
h2 {
  margin: 0 0 0.7rem;
  line-height: 1.15;
}

h1 {
  max-width: 20ch;
  font-size: clamp(2rem, 4.8vw, 3.2rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.hero-text,
.section p {
  color: var(--muted);
  max-width: 62ch;
}

.hero-actions {
  margin-top: 1.7rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.btn {
  text-decoration: none;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.72rem 1.25rem;
  border: 1px solid transparent;
  color: #ffffff;
  background: var(--accent);
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  background: #233d71;
  box-shadow: var(--btn-shadow);
}

.btn-secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.section {
  padding: 3rem 0;
  scroll-margin-top: 120px;
}

.section-tag {
  margin: 0 0 0.5rem;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.cards {
  margin-top: 1.2rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 1.1rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.card-meta {
  margin: 0;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 600;
}

.card h3 {
  margin: 0.45rem 0;
}

.card p {
  margin: 0;
}

.project-links {
  margin-top: 0.9rem;
  display: flex;
  gap: 1rem;
}

.project-links a,
.contact-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.22s ease;
}

.project-links a:hover,
.project-links a:focus-visible,
.contact-link:hover,
.contact-link:focus-visible {
  color: #1f3563;
}

.skills-list {
  margin: 1.1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  list-style: none;
  padding: 0;
}

.skills-list li {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.48rem 0.95rem;
  color: var(--text);
  background: var(--surface);
}

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

.gallery-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  transition: transform 0.4s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-note {
  margin-top: 0.8rem;
  font-size: 0.95rem;
}

.footer {
  margin-top: 2.4rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  padding: 1.15rem 0 1.5rem;
}

.footer-note {
  margin: 0.3rem 0 0;
  font-weight: 600;
}

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

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

@media (max-width: 820px) {
  .nav {
    min-height: 86px;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "menu brand actions";
    align-items: center;
  }

  .site-brand {
    font-size: 1.28rem;
  }

  .menu-toggle {
    display: inline-flex;
    justify-self: start;
  }

  .github-link {
    padding: 0.45rem;
  }

  .github-link span {
    display: none;
  }

  .theme-toggle {
    padding: 0.45rem;
  }

  .top-actions {
    justify-self: end;
  }

  .theme-label {
    display: none;
  }

  .nav-links {
    position: absolute;
    top: 86px;
    left: 0;
    right: 0;
    padding: 1rem 4%;
    background: var(--header-bg-solid);
    border-bottom: 1px solid var(--border);
    display: none;
    flex-direction: column;
    gap: 0.9rem;
  }

  .nav-links.open {
    display: flex;
  }
}

@keyframes shrinkToHeader {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0.35;
    transform: translate(-50%, -50%) translateY(-43vh) scale(0.23);
  }
}
