:root {
  --bg: #fdf6fa;
  --bg-soft: #f3f9fc;
  --card: #ffffff;
  --border: #e9dce4;
  --text: #4a3a44;
  --text-dim: #9b8b95;
  --pink: #f7c1cd;
  --pink-deep: #c14a75;
  --blue: #b3e6f7;
  --blue-deep: #0d7fa8;
  --white: #ffffff;
  --radius: 14px;
  --header-bg: rgba(253, 246, 250, 0.92);
}

:root[data-theme="dark"] {
  --bg: #1c1830;
  --bg-soft: #221c3b;
  --card: #2a2447;
  --border: #3d3560;
  --text: #f3eefb;
  --text-dim: #b6abce;
  --pink: #f5a9b8;
  --pink-deep: #f993a8;
  --blue: #5bcefa;
  --blue-deep: #7fdcfc;
  --white: #fdfcff;
  --header-bg: rgba(28, 24, 48, 0.92);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--blue-deep);
  text-decoration: none;
}

a:hover {
  color: var(--pink-deep);
}

header.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--blue), var(--pink));
  display: inline-block;
}

nav.main-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

nav.main-nav a {
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

nav.main-nav a:hover {
  background: var(--bg-soft);
  color: var(--text);
}

nav.main-nav a.active {
  background: linear-gradient(90deg, rgba(91, 206, 250, 0.25), rgba(245, 169, 184, 0.25));
  color: var(--text);
  border: 1px solid var(--border);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, transform 0.15s;
}

.theme-toggle:hover {
  border-color: var(--blue);
  transform: scale(1.05);
}

main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

footer.site-footer {
  text-align: center;
  padding: 24px;
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

h1 {
  font-size: 2.4rem;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.6rem;
  margin: 0 0 18px;
}

.tagline {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--blue-deep), var(--pink-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Hero / intro page */
.hero-grid {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap-reverse;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 420px;
}

.hero-photo {
  position: relative;
  width: 340px;
  height: 340px;
  flex: 0 0 340px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  border: 4px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.hero-photo-emoji {
  font-size: 72px;
}

.hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flag-bar {
  width: 100%;
  max-width: 360px;
  height: 10px;
  border-radius: 6px;
  margin: 18px 0 28px;
  background: linear-gradient(180deg,
      var(--blue) 0% 20%,
      var(--pink) 20% 40%,
      var(--white) 40% 60%,
      var(--pink) 60% 80%,
      var(--blue) 80% 100%);
  box-shadow: 0 2px 10px rgba(91, 206, 250, 0.25);
}

.age-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 20px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 4px 18px rgba(238, 135, 160, 0.1);
}

.age-card h3 {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.age-units {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.age-unit {
  min-width: 90px;
}

.age-unit .num {
  font-size: 2.1rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--blue-deep), var(--pink-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.age-unit .label {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.tag-break {
  flex-basis: 100%;
  height: 0;
}

.tag {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Grids / cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(58, 44, 53, 0.04);
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
  box-shadow: 0 8px 22px rgba(91, 206, 250, 0.18);
}

.projects-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
}

.page-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, transform 0.15s;
}

.page-arrow:hover:not(:disabled) {
  border-color: var(--blue);
  transform: scale(1.05);
}

.page-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.page-indicator {
  font-size: 0.9rem;
  color: var(--text);
  min-width: 48px;
  text-align: center;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-dim);
}

/* Skills page */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(5, 140px);
  justify-content: center;
  gap: 16px;
}

@media (max-width: 700px) {
  .skill-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }

  .contact-box {
    padding: 32px 20px;
  }

  .contact-box .email-link {
    font-size: 0.92rem;
    padding: 12px 18px;
  }
}

.skill-tile {
  width: 140px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(58, 44, 53, 0.04);
}

/* Interests page: two big tiles dividing the row, still centered */
#interests-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

#interests-grid .skill-tile {
  width: auto;
  flex: 1 1 280px;
  max-width: 460px;
  padding: 40px 24px;
}

#interests-grid .skill-icon-fallback {
  width: auto;
  height: auto;
  font-size: 48px;
}

.interest-thumb {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
  margin-right: 6px;
  vertical-align: middle;
}

.skill-tile:hover,
.skill-tile:focus-visible {
  transform: translateY(-3px);
  border-color: var(--pink);
  box-shadow: 0 8px 22px rgba(245, 169, 184, 0.22);
}

.skill-tile img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.skill-tile .skill-icon-fallback {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.skill-tile span {
  font-weight: 600;
  font-size: 0.9rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 44, 53, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 16px 40px rgba(58, 44, 53, 0.2);
  position: relative;
}

.modal-box img {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
}

.modal-box .skill-icon-fallback {
  font-size: 2.4rem;
  margin-bottom: 16px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-dim);
}

.modal-box #interests-modal-body {
  text-align: left;
}

.modal-box #interests-modal-body h3 {
  text-align: center;
}

.modal-box #interests-modal-body h4 {
  margin: 18px 0 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.interest-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.interest-list li {
  margin-bottom: 6px;
}

.interest-item {
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 6px 0;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}

.interest-item::before {
  content: "▸";
  color: var(--pink-deep);
  font-size: 0.75rem;
}

.interest-item:hover {
  color: var(--pink-deep);
}

.interest-note {
  margin: 0 0 8px 18px;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.modal-close:hover {
  color: var(--pink-deep);
}

/* Projects page */
.project-card .repo-meta {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.project-card a.repo-link {
  display: inline-block;
  margin-top: 14px;
  font-weight: 600;
}

.state-msg {
  color: var(--text-dim);
  padding: 30px 0;
}

.section-block {
  margin-bottom: 48px;
}

.section-block h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Creative page */
.creative-card {
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  display: block;
  width: 100%;
}

.modal-box-wide {
  max-width: 640px;
}

.modal-box-wide #creative-modal-body {
  text-align: left;
}

.modal-box-wide #creative-modal-body h3 {
  text-align: center;
}

.modal-box-wide #creative-modal-body h4 {
  margin: 18px 0 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 16px;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Contact */
.contact-main {
  display: flex;
  justify-content: center;
  padding-top: 24px;
}

.contact-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 28px rgba(58, 44, 53, 0.08);
  overflow: hidden;
  position: relative;
}

.contact-flag-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--blue), var(--pink), var(--white), var(--pink), var(--blue));
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 32px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--blue), var(--pink));
}

.contact-tagline {
  margin-bottom: 8px;
}

.contact-box .email-link {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  max-width: 100%;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(91, 206, 250, 0.2), rgba(245, 169, 184, 0.2));
  border: 1px solid var(--border);
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.contact-box .email-link:hover {
  transform: translateY(-2px);
  border-color: var(--pink);
  box-shadow: 0 8px 22px rgba(245, 169, 184, 0.22);
  color: var(--text);
}

.icon-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 22px;
}

.icon-row a {
  color: var(--text-dim);
  font-weight: 600;
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 999px;
  transition: transform 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.icon-row a:hover {
  color: var(--text);
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(91, 206, 250, 0.18);
}

/* Gallery */
.gallery-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(58, 44, 53, 0.04);
}

.gallery-tile:hover,
.gallery-tile:focus-visible {
  transform: translateY(-3px);
  border-color: var(--pink);
  box-shadow: 0 8px 22px rgba(245, 169, 184, 0.22);
}

.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#gallery-modal .modal-box {
  max-width: 640px;
}

#gallery-modal-body img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.gallery-nav:hover {
  border-color: var(--pink);
  box-shadow: 0 8px 22px rgba(245, 169, 184, 0.22);
  transform: translateY(-50%) scale(1.05);
}

.gallery-nav-prev {
  left: 8px;
}

.gallery-nav-next {
  right: 8px;
}

.gallery-thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 16px;
  padding-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.gallery-thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: none;
  opacity: 0.6;
  transition: opacity 0.15s, border-color 0.15s;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb:hover {
  opacity: 0.9;
}

.gallery-thumb.active {
  opacity: 1;
  border-color: var(--pink);
}

@media (max-width: 700px) {
  .gallery-nav {
    width: 34px;
    height: 34px;
    font-size: 1.3rem;
  }
}