:root {
  --bg: #1a1a1a;
  --bg-soft: #222526;
  --panel: #222526;
  --panel-alt: #353a3e;
  --surface: #2b2f32;
  --text: #e0e0e0;
  --text-soft: #bfbfbf;
  --border: #353a3e;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  --nav-bg: rgba(26, 26, 26, 0.9);
  --button-text: #1a1a1a;
  --dark-button-bg: #1a1a1a;
  --dark-button-text: #e0e0e0;
  --star-color: rgba(255, 255, 255, 0.95);
  --star-glow: rgba(255, 255, 255, 0.5);
  --star-low-opacity: 0.45;
  --star-high-opacity: 1;
  --star-twinkle-duration: 0.7s;
  --reveal-duration: 560ms;
  --hover-duration: 160ms;
  --transition: 180ms ease;
  --focus: #e0e0e0;
}

:root[data-theme="light"] {
  --bg: #e0e0e0;
  --bg-soft: #f5f5f5;
  --panel: #ffffff;
  --panel-alt: #bfbfbf;
  --surface: #d9d9d9;
  --text: #1a1a1a;
  --text-soft: #353a3e;
  --border: #bfbfbf;
  --shadow: 0 14px 32px rgba(26, 26, 26, 0.08);
  --nav-bg: rgba(224, 224, 224, 0.9);
  --button-text: #1a1a1a;
  --dark-button-bg: #1a1a1a;
  --dark-button-text: #e0e0e0;
  --star-color: rgba(8, 8, 8, 0.98);
  --star-glow: rgba(8, 8, 8, 0.4);
  --star-low-opacity: 0.5;
  --star-high-opacity: 1;
  --star-twinkle-duration: 0.7s;
  --reveal-duration: 560ms;
  --hover-duration: 160ms;
  --focus: #1a1a1a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  position: relative;
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

::selection {
  background: var(--panel-alt);
  color: var(--text);
}

::-moz-selection {
  background: var(--panel-alt);
  color: var(--text);
}

section[id] {
  scroll-margin-top: 90px;
}

.star-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: var(--star-color);
  box-shadow: 0 0 8px var(--star-glow);
  animation: twinkle var(--star-twinkle-duration) ease-in-out infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: var(--star-low-opacity);
  }
  50% {
    opacity: var(--star-high-opacity);
  }
}

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

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

button {
  font: inherit;
}

ul {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 90px 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.8rem;
  color: var(--text-soft);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.section-heading {
  margin-bottom: 2rem;
}

.section-heading h2 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
  max-width: 620px;
}

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--text);
  z-index: 120;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition),
    box-shadow var(--transition);
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header.scrolled {
  background: var(--nav-bg);
  border-color: var(--border);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.navbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: relative;
}

.brand {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  order: 3;
}

.nav-panel {
  display: flex;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  order: 2;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 22px;
  white-space: nowrap;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 600;
  transition: color var(--transition), transform var(--hover-duration) ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  transform: translateY(-1px);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle,
.resume-link,
.button,
.mini-link,
.copy-email,
.filter-btn,
.modal-close,
.back-to-top {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  transition: transform var(--transition), border-color var(--transition),
    background var(--transition), box-shadow var(--transition);
}

.theme-toggle,
.modal-close,
.back-to-top {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.back-to-top {
  width: 38px;
  height: 38px;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
}

.theme-toggle i {
  position: absolute;
  transition: opacity var(--transition), transform var(--transition);
}

.theme-toggle {
  position: relative;
}

.theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.8);
}
.theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

:root[data-theme="light"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}
:root[data-theme="light"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.8);
}

.resume-link,
.button,
.mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.35rem;
  font-weight: 600;
  cursor: pointer;
}

.resume-link,
.button.primary,
.filter-btn.active {
  background: var(--dark-button-bg);
  color: var(--dark-button-text);
  border-color: transparent;
}

.button.secondary,
.copy-email {
  background: var(--panel);
  color: var(--text);
}

.resume-link:hover,
.button:hover,
.mini-link:hover,
.copy-email:hover,
.filter-btn:hover,
.theme-toggle:hover,
.modal-close:hover,
.back-to-top:hover {
  transform: translateY(-1px);
  border-color: var(--text-soft);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  padding-top: 120px;
  padding-bottom: 80px;
}

.hero-layout {
  display: block;
}

.hero-copy {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  animation: heroIntro 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-copy > * {
  opacity: 0;
  animation: fadeUp 720ms ease forwards;
}

.hero-copy .eyebrow {
  animation-delay: 90ms;
}

.hero-copy h1 {
  animation-delay: 150ms;
}

.hero-copy .lead,
.hero-copy .hero-text,
.hero-copy .hero-text.secondary,
.hero-copy .intro-statement {
  animation-delay: 210ms;
}

.hero-copy .hero-actions {
  animation-delay: 300ms;
}

.hero-copy .status-badge,
.hero-copy .social-row {
  animation-delay: 360ms;
}

.hero-copy h1 {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3em;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
  margin-bottom: 1.35rem;
  white-space: nowrap;
}

.hero-copy > .eyebrow {
  margin-bottom: 1rem;
  font-size: clamp(1.6rem, 3.2vw, 3.2rem);
  letter-spacing: -0.04em;
  line-height: 1;
  text-transform: none;
}

.hero-copy h1 span {
  display: inline;
  color: var(--text-soft);
}

.hero-copy h1 .hero-greeting {
  color: var(--text);
}

.hero-copy h1 .hero-name {
  color: var(--text-soft);
}

.build-line {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  min-height: 5.4rem;
  margin: 0 auto 1.35rem;
  color: var(--text);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 700;
}

.build-label {
  color: var(--text-soft);
  font-size: 0.78em;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.build-phrase-shell {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: min(20ch, 100%);
  min-height: 1.7em;
  color: var(--text);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.2;
}

.build-phrase {
  display: inline-block;
  border-right: 2px solid var(--text);
  padding-right: 0.2rem;
  white-space: nowrap;
  animation: caretBlink 760ms step-end infinite;
}

@keyframes caretBlink {
  0%,
  45% {
    border-color: var(--text);
  }
  46%,
  100% {
    border-color: transparent;
  }
}

.lead {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--text-soft);
  margin-bottom: 1rem;
}

.hero-text {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-soft);
  font-size: 1.02rem;
}

.hero-text.secondary {
  margin-top: 0.8rem;
}

.intro-statement {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.7vw, 1.12rem);
  line-height: 1.5;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.8rem auto 0;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-soft);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a8d5a2;
  box-shadow: 0 0 0 6px rgba(168, 213, 162, 0.12);
}

.social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.social-row a {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  transition: transform var(--hover-duration) ease,
    border-color var(--hover-duration) ease,
    background var(--hover-duration) ease, box-shadow var(--hover-duration) ease;
}

.social-row a:hover {
  transform: translateY(-2px);
  border-color: var(--text-soft);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2.5rem;
  color: var(--text-soft);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.scroll-indicator i {
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroIntro {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.skill-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.3rem;
}

.skill-group {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: transform var(--hover-duration) ease,
    border-color var(--hover-duration) ease,
    box-shadow var(--hover-duration) ease;
}

.skill-group:hover {
  transform: translateY(-3px);
  border-color: var(--text-soft);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.08);
}

.skill-group h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.skill-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.8rem;
}

.filter-btn {
  padding: 0.7rem 1.05rem;
  background: var(--panel);
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 600;
}

.filter-btn.active {
  background: var(--dark-button-bg);
  color: var(--dark-button-text);
  border-color: transparent;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  align-items: stretch;
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--hover-duration) ease,
    border-color var(--hover-duration) ease,
    box-shadow var(--hover-duration) ease;
}

.project-card.hidden {
  display: none;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--text-soft);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.08);
}

.project-visual {
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.project-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
  display: block;
  transition: transform var(--hover-duration) ease;
}

.project-card:hover .project-visual img {
  transform: scale(1.02);
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.4rem;
}

.project-meta {
  margin-bottom: 0.8rem;
}

.meta-tag {
  display: inline-flex;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-body h3 {
  margin-bottom: 0.7rem;
  font-size: 1.2rem;
}

.project-body p {
  color: var(--text-soft);
  margin-bottom: 1rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  margin-bottom: 1rem;
}

.tech-stack span {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 0.72rem;
}

.project-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.mini-link {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  font-size: 0.82rem;
}

.detail-trigger {
  background: var(--bg-soft);
  color: var(--text);
}

.about-layout {
  display: grid;
  gap: 2rem;
}

.about-content {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.about-image-wrap {
  width: 160px;
  height: 160px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
}

.about-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-copy {
  color: var(--text-soft);
  font-size: 1.04rem;
}

.about-copy p + p {
  margin-top: 0.9rem;
}

.interest-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.interest-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
  transition: transform var(--hover-duration) ease,
    border-color var(--hover-duration) ease,
    box-shadow var(--hover-duration) ease;
}

.interest-card:hover {
  transform: translateY(-3px);
  border-color: var(--text-soft);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.08);
}

.interest-card i {
  display: inline-block;
  margin-bottom: 0.7rem;
  font-size: 1.15rem;
  color: var(--text);
}

.interest-card h3 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

.interest-card p {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.contact-panel {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  box-shadow: var(--shadow);
}

.contact-copy h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
  max-width: 540px;
  margin-bottom: 0.9rem;
}

.contact-copy p {
  color: var(--text-soft);
}

.contact-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-soft);
}

.contact-list i {
  width: 18px;
  color: var(--text);
}

.contact-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
}

.site-footer {
  padding: 14px 0 18px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.04);
}

.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding-right: 3.5rem;
  color: var(--text-soft);
  text-align: center;
}

.bottom-bar span {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .site-footer {
    padding: 12px 0 18px;
  }

  .bottom-bar {
    margin-top: 0;
    padding-right: 0;
    padding-left: 0;
    padding-bottom: 2.75rem;
  }

  .back-to-top {
    right: 12px;
    bottom: 12px;
  }
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
}

.modal-panel {
  position: relative;
  width: min(720px, calc(100% - 24px));
  max-height: 85vh;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 4.25rem 1.5rem 1.5rem;
  z-index: 1;
  animation: modalIn 200ms ease;
}

#modal-content {
  max-height: calc(85vh - 5.75rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-alt) transparent;
}

#modal-content::-webkit-scrollbar {
  width: 6px;
}

#modal-content::-webkit-scrollbar-track {
  background: transparent;
}

#modal-content::-webkit-scrollbar-thumb {
  background: var(--panel-alt);
  border-radius: 999px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 2;
}

.modal-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.modal-hero > div {
  min-width: 0;
}

.modal-hero h3 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.modal-body {
  display: grid;
  gap: 1rem;
}

.modal-section {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.modal-section h4 {
  margin-bottom: 0.6rem;
  font-size: 0.96rem;
}

.modal-section p,
.modal-section li {
  color: var(--text-soft);
}

.modal-section ul {
  list-style: disc;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1),
    transform var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

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

.section-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

@media (max-width: 900px) {
  .hero-layout,
  .contact-panel,
  .skill-groups,
  .interest-grid {
    grid-template-columns: 1fr;
  }

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

  .hero-layout {
    display: block;
  }

  .skill-groups {
    gap: 1rem;
  }

  .contact-actions {
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .about-image-wrap {
    width: 138px;
    height: 138px;
  }
}

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

  .nav-toggle {
    display: block;
  }

  .nav-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    transform: none;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-soft);
    box-shadow: var(--shadow);
  }

  .nav-panel.is-open {
    display: flex;
  }

  .nav-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    width: 100%;
    white-space: normal;
  }

  .resume-link {
    flex: 1;
  }

  .project-links,
  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .project-links .mini-link,
  .contact-actions .button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .section {
    padding: 80px 0;
  }

  .hero {
    padding-top: 90px;
  }

  .modal-panel {
    width: min(100% - 16px, 720px);
    padding: 4rem 1rem 1rem;
    border-radius: 18px;
  }

  .modal-hero {
    flex-direction: column;
    gap: 0.75rem;
  }

  .status-badge {
    width: 100%;
    justify-content: center;
  }

  .social-row {
    justify-content: center;
  }

  .about-image-wrap {
    width: 120px;
    height: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .star {
    animation-duration: var(--star-twinkle-duration) !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition-duration: var(--reveal-duration) !important;
  }
}
