:root {
  --bg: #edf1f7;
  --bg-soft: #ffffff;
  --ink: #14243a;
  --ink-soft: #4f6078;
  --line: #c3cfdf;
  --brand: #2c4d7d;
  --brand-strong: #223e67;

  --about-band: linear-gradient(130deg, #e7edf7 0%, #dde6f3 100%);
  --skills-band: linear-gradient(132deg, #e1eaf4 0%, #d7e2ef 100%);
  --projects-band: linear-gradient(130deg, #e5ece6 0%, #dbe5de 100%);
  --contact-band: linear-gradient(135deg, #efe7db 0%, #e7ddcd 100%);

  --r-lg: 24px;
  --r-xl: 34px;
  --r-pill: 999px;

  --s1: 8px;
  --s2: 12px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s6: 48px;
  --s7: 72px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 8% -10%, rgba(44, 77, 125, 0.14), transparent 32%),
    radial-gradient(circle at 92% -10%, rgba(34, 62, 103, 0.11), transparent 34%),
    linear-gradient(180deg, #edf1f7 0%, #e5ebf3 100%);
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 0 var(--s3);
  border-bottom: 1px solid #2e3d56;
  background: rgba(13, 18, 28, 0.92);
  backdrop-filter: blur(10px);
}

.brand {
  color: #edf3ff;
  text-decoration: none;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle,
.nav-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid #364967;
  border-radius: 999px;
  background: #182233;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.theme-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #ecf2ff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-dark {
  display: none;
}

body.theme-dark .theme-icon-light {
  display: none;
}

body.theme-dark .theme-icon-dark {
  display: block;
}

.nav-toggle {
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: #ecf2ff;
}

.main-nav {
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  padding: var(--s4);
  background: rgba(10, 14, 22, 0.98);
  border-bottom: 1px solid #2e3d56;
}

.main-nav.open {
  display: flex;
}

.main-nav a {
  text-decoration: none;
  color: #c8d4e8;
  padding: 10px 0;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 14px;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: #ffffff;
}

.nav-theme-toggle {
  margin-top: 8px;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: var(--s7) 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  position: relative;
  z-index: 0;
}

.section::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
}

.section::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  background:
    radial-gradient(circle at 16% 22%, rgba(255, 255, 255, 0.3), transparent 38%),
    radial-gradient(circle at 84% 78%, rgba(255, 255, 255, 0.22), transparent 42%);
  pointer-events: none;
}

#hero.section::before {
  background: linear-gradient(140deg, #e8eef8 0%, #dfe8f5 52%, #d7e3f2 100%);
}

#about.section::before {
  background: var(--about-band);
}

#skills.section::before {
  background: var(--skills-band);
}

#projects.section::before {
  background: var(--projects-band);
}

#contact.section::before {
  background: var(--contact-band);
}

.kicker {
  margin: 0 0 var(--s2) 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: #3e4f68;
  font-family: "Space Grotesk", Arial, sans-serif;
}

#about.section .kicker,
#skills.section .kicker,
#projects.section .kicker,
#contact.section .kicker {
  color: #2e3e56;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: clamp(2.3rem, 7.5vw, 5.2rem);
  line-height: 0.97;
  letter-spacing: -0.04em;
  color: #14243a;
}

.lead {
  margin-top: var(--s4);
  font-size: clamp(1.05rem, 2.1vw, 1.28rem);
  line-height: 1.58;
  color: var(--ink-soft);
  max-width: 62ch;
}

.hero {
  display: grid;
  gap: var(--s5);
  align-items: center;
}

.hero-actions {
  margin-top: var(--s4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.btn {
  min-height: 44px;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.btn-primary {
  background: linear-gradient(180deg, #2d4f84 0%, #233f6b 100%);
  color: #f4f7ff;
  border: 1px solid #36598f;
}

.btn-secondary {
  background: #dfe6f1;
  color: #1a3155;
  border: 1px solid #aebdd2;
}

#hero .btn-primary:hover,
#hero .btn-primary:focus-visible {
  background: linear-gradient(180deg, #284775 0%, #1f385d 100%);
  border-color: #3d639d;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 18px rgba(31, 56, 93, 0.35);
}

#hero .btn-secondary:hover,
#hero .btn-secondary:focus-visible {
  background: #d3deed;
  border-color: #8fa5c1;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 18px rgba(26, 49, 85, 0.2);
}

.hero-visual {
  margin: 0;
  border: 1px solid #8ea2bf;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(40, 56, 84, 0.18);
  position: relative;
  isolation: isolate;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 62%;
  background: radial-gradient(circle at 30% 40%, rgba(54, 90, 146, 0.24), transparent 55%);
  z-index: 1;
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, rgba(24, 43, 70, 0.16), transparent 45%);
  z-index: 1;
  pointer-events: none;
  opacity: 0.38;
  transition: opacity 260ms ease;
}

.hero-visual img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 46%;
  transition: transform 320ms ease, filter 320ms ease;
  transform-origin: center;
}

.hero-visual:hover img,
.hero-visual:focus-within img {
  transform: scale(1.04);
  filter: contrast(1.04) saturate(1.04);
}

.hero-visual:hover::before,
.hero-visual:focus-within::before {
  opacity: 1;
  transform: translateY(6px) scale(1.03);
}

.hero-visual:hover::after,
.hero-visual:focus-within::after {
  opacity: 0.5;
}

.section-header {
  margin-bottom: var(--s5);
}

h2 {
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: clamp(1.7rem, 4.8vw, 3.1rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
  max-width: 25ch;
  color: #14243a;
}

.about-layout,
.skills-grid,
.project-list,
.contact-panel {
  display: grid;
  gap: var(--s3);
}

.panel,
.tile,
.project-item,
.contact-panel a {
  background: #f2f6fb;
  border: 1px solid #c3cfdf;
  border-radius: var(--r-lg);
  transition: background-color 220ms ease, border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.panel,
.tile,
.project-item {
  border-radius: 28px;
}

.skills-grid .tile:nth-child(odd) {
  border-top-left-radius: 36px;
  border-bottom-right-radius: 36px;
}

.skills-grid .tile:nth-child(even) {
  border-top-right-radius: 36px;
  border-bottom-left-radius: 36px;
}

.project-list .project-item:nth-child(1) {
  border-top-left-radius: 40px;
}

.project-list .project-item:nth-child(2) {
  border-top-right-radius: 40px;
}

.project-list .project-item:nth-child(3) {
  border-bottom-right-radius: 40px;
}

.panel {
  padding: var(--s4);
}

.panel p,
.stats ul,
.tile p,
.project-item p {
  color: #485b77;
  line-height: 1.64;
}

.panel p + p {
  margin-top: var(--s3);
}

.stats h3,
.tile h3,
.project-item h3 {
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: #16273f;
}

.skills-grid {
  grid-template-columns: 1fr;
}

.tile,
.project-item {
  padding: 22px;
}

.about-layout .panel:nth-child(1) {
  background: linear-gradient(150deg, #f3f6fb 0%, #ebf0f8 100%);
}

.about-layout .panel:nth-child(2) {
  background: linear-gradient(150deg, #eef3fa 0%, #e6edf7 100%);
}

.skills-grid .tile:nth-child(1) {
  background: linear-gradient(145deg, #e9eef7 0%, #dde6f3 100%);
}

.skills-grid .tile:nth-child(2) {
  background: linear-gradient(145deg, #e6edf6 0%, #dce8f3 100%);
}

.skills-grid .tile:nth-child(3) {
  background: linear-gradient(145deg, #e8edf7 0%, #dfe7f3 100%);
}

.skills-grid .tile:nth-child(4) {
  background: linear-gradient(145deg, #e4ecf3 0%, #d8e3ee 100%);
}

.skills-grid .tile:nth-child(5) {
  background: linear-gradient(145deg, #e9edf6 0%, #dfe5f1 100%);
}

.skills-grid .tile:nth-child(6) {
  background: linear-gradient(145deg, #e6ebf2 0%, #dbe2eb 100%);
}

.project-list .project-item:nth-child(1) {
  background: linear-gradient(145deg, #e3eaf2 0%, #d7e2ec 100%);
}

.project-list .project-item:nth-child(2) {
  background: linear-gradient(145deg, #e0e9e4 0%, #d3e1da 100%);
}

.project-list .project-item:nth-child(3) {
  background: linear-gradient(145deg, #e5e8ef 0%, #d9dee8 100%);
}

.panel:hover,
.panel:focus-within,
.tile:hover,
.tile:focus-within,
.project-item:hover,
.project-item:focus-within {
  border-color: #7f96ba;
  background: #ffffff;
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(30, 47, 77, 0.16);
}

.contact-panel {
  grid-template-columns: 1fr;
}

.contact-panel a {
  min-height: 48px;
  text-decoration: none;
  color: #16253a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #b8c5d9;
}

.contact-panel a:nth-child(1) {
  background: #e8edf6;
}

.contact-panel a:nth-child(2) {
  background: #e6ecf5;
}

.contact-panel a:nth-child(3) {
  background: #e4ece7;
}

.contact-panel a:nth-child(4) {
  background: #ece5da;
}

.contact-panel a:hover,
.contact-panel a:focus-visible {
  border-color: #7a93ba;
  box-shadow: 0 0 0 2px rgba(122, 147, 186, 0.2), 0 10px 20px rgba(33, 50, 80, 0.18);
  transform: translateY(-3px);
}

.footer {
  border-top: 1px solid #c8d2e8;
  padding: var(--s4);
  text-align: center;
  color: #55647e;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 13px;
  background: rgba(245, 247, 253, 0.9);
}

body.theme-dark {
  --bg: #0d1422;
  --bg-soft: #141e30;
  --ink: #ecf2fb;
  --ink-soft: #b0bfd5;
  --line: #2a3850;
  --about-band: linear-gradient(130deg, #182336 0%, #1d2c44 100%);
  --skills-band: linear-gradient(132deg, #172a3c 0%, #1a3347 100%);
  --projects-band: linear-gradient(130deg, #182d2a 0%, #1d3a36 100%);
  --contact-band: linear-gradient(135deg, #2b241d 0%, #372c22 100%);
}

body.theme-dark {
  background-image:
    radial-gradient(circle at 8% -10%, rgba(84, 112, 153, 0.22), transparent 34%),
    radial-gradient(circle at 92% -10%, rgba(67, 88, 122, 0.2), transparent 36%),
    linear-gradient(180deg, #0c1320 0%, #0a101a 100%);
}

body.theme-dark h1,
body.theme-dark h2,
body.theme-dark .tile h3,
body.theme-dark .project-item h3,
body.theme-dark .stats h3,
body.theme-dark .panel p,
body.theme-dark .tile p,
body.theme-dark .project-item p,
body.theme-dark .stats ul,
body.theme-dark .kicker {
  color: #e8effa;
}

body.theme-dark #about.section .kicker,
body.theme-dark #skills.section .kicker,
body.theme-dark #projects.section .kicker,
body.theme-dark #contact.section .kicker {
  color: #c2d0e6;
}

body.theme-dark .panel,
body.theme-dark .tile,
body.theme-dark .project-item,
body.theme-dark .contact-panel a {
  background: linear-gradient(160deg, rgba(20, 29, 44, 0.96), rgba(14, 22, 35, 0.96));
  border-color: #304158;
}

body.theme-dark .panel:hover,
body.theme-dark .tile:hover,
body.theme-dark .project-item:hover,
body.theme-dark .panel:focus-within,
body.theme-dark .tile:focus-within,
body.theme-dark .project-item:focus-within {
  background: linear-gradient(160deg, rgba(24, 35, 52, 0.98), rgba(18, 28, 43, 0.98));
  border-color: #4c6385;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
}

body.theme-dark .hero-visual {
  background: #131d2e;
  border-color: #4a5e7d;
}

body.theme-dark .hero-visual::before {
  background: radial-gradient(circle at 30% 40%, rgba(108, 140, 188, 0.26), transparent 55%);
}

body.theme-dark .hero-visual::after {
  background: linear-gradient(to top right, rgba(16, 29, 47, 0.44), transparent 48%);
}

body.theme-dark .btn-primary {
  background: linear-gradient(180deg, #3d5d93 0%, #2e486f 100%);
  color: #eef4ff;
  border-color: #5473a4;
}

body.theme-dark .btn-secondary {
  background: #2f3d54;
  color: #e9f0fb;
  border-color: #597099;
}

body.theme-dark #hero .btn-primary:hover,
body.theme-dark #hero .btn-primary:focus-visible {
  background: linear-gradient(180deg, #365382 0%, #283d5f 100%);
  border-color: #5d7cae;
  box-shadow: 0 10px 18px rgba(24, 37, 58, 0.4);
}

body.theme-dark #hero .btn-secondary:hover,
body.theme-dark #hero .btn-secondary:focus-visible {
  background: #384a66;
  border-color: #6d86b0;
  box-shadow: 0 10px 18px rgba(21, 34, 55, 0.35);
}

body.theme-dark .contact-panel a:hover,
body.theme-dark .contact-panel a:focus-visible {
  border-color: #6f88b1;
  box-shadow: 0 0 0 2px rgba(111, 136, 177, 0.24), 0 10px 20px rgba(8, 13, 21, 0.45);
}

body.theme-dark .contact-panel a {
  color: #edf3ff;
}

body.theme-dark .footer {
  border-top-color: #2c3b53;
  color: #9db0ce;
  background: rgba(11, 17, 28, 0.95);
}

@media (min-width: 820px) {
  .top-nav {
    padding: 0 var(--s5);
  }

  .nav-toggle {
    display: none;
  }

  .main-nav {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--s4);
    border: 0;
    padding: 0;
    background: transparent;
  }

  .nav-theme-toggle {
    margin-top: 0;
    margin-left: 6px;
  }

  .hero {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .about-layout {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contact-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  .skills-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
:root {
  --bg: #edf1f6;
  --ink: #18263b;
  --ink-soft: #4d5d74;
  --line: #c7d1df;

  --about-band: linear-gradient(130deg, #e3eaf4 0%, #d8e2f0 100%);
  --skills-band: linear-gradient(132deg, #dfe9f3 0%, #d3dfed 100%);
  --projects-band: linear-gradient(130deg, #e1e8e3 0%, #d4dfd8 100%);
  --contact-band: linear-gradient(135deg, #ece4d9 0%, #e3d9cc 100%);

  --card-a: linear-gradient(150deg, #f5f8fc 0%, #edf2f8 100%);
  --card-b: linear-gradient(150deg, #edf3fa 0%, #e5edf7 100%);
  --card-c: linear-gradient(150deg, #eaf1f8 0%, #e2ebf5 100%);

  --hero-primary: linear-gradient(180deg, #284a78 0%, #203d64 100%);
  --hero-secondary: #dce5f2;
  --hero-secondary-hover: #cedaec;
  --hero-accent: #8ea5c6;

  --r-lg: 24px;
  --r-xl: 34px;
  --r-pill: 999px;

  --s2: 12px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s7: 72px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 8% -10%, rgba(42, 72, 120, 0.1), transparent 32%),
    radial-gradient(circle at 92% -10%, rgba(39, 63, 101, 0.08), transparent 34%),
    linear-gradient(180deg, #edf1f6 0%, #e5ebf3 100%);
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 0 var(--s3);
  border-bottom: 1px solid #2b3951;
  background: rgba(12, 17, 26, 0.93);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #eef4ff;
  text-decoration: none;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #506585;
  box-shadow: 0 0 0 2px rgba(16, 24, 36, 0.35);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle,
.nav-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid #334564;
  border-radius: 999px;
  background: #182132;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.nav-toggle {
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: #ecf2ff;
}

.theme-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #ecf2ff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-dark {
  display: none;
}

body.theme-dark .theme-icon-light {
  display: none;
}

body.theme-dark .theme-icon-dark {
  display: block;
}

.main-nav {
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  padding: var(--s4);
  background: rgba(10, 14, 22, 0.98);
  border-bottom: 1px solid #2d3a54;
}

.main-nav.open {
  display: flex;
}

.main-nav a {
  text-decoration: none;
  color: #c7d2e7;
  padding: 10px 0;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 14px;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: #ffffff;
}

.nav-theme-toggle {
  margin-top: 8px;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: var(--s7) 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  position: relative;
  z-index: 0;
}

.section::before,
.section::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
}

.section::after {
  background:
    radial-gradient(circle at 16% 22%, rgba(255, 255, 255, 0.26), transparent 36%),
    radial-gradient(circle at 84% 78%, rgba(255, 255, 255, 0.2), transparent 40%);
  pointer-events: none;
}

#hero.section::before {
  background: linear-gradient(140deg, #e7edf7 0%, #dde7f4 52%, #d5e1f0 100%);
}

#about.section::before {
  background: var(--about-band);
}

#skills.section::before {
  background: var(--skills-band);
}

#projects.section::before {
  background: var(--projects-band);
}

#contact.section::before {
  background: var(--contact-band);
}

.hero {
  display: grid;
  gap: var(--s5);
  align-items: center;
}

.kicker {
  margin: 0 0 var(--s2) 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: #3f4f68;
  font-family: "Space Grotesk", Arial, sans-serif;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: clamp(2.3rem, 7.5vw, 5.2rem);
  line-height: 0.97;
  letter-spacing: -0.04em;
  color: #13223a;
}

.lead {
  margin-top: var(--s4);
  font-size: clamp(1.05rem, 2.1vw, 1.28rem);
  line-height: 1.58;
  color: var(--ink-soft);
  max-width: 62ch;
}

.hero-actions {
  margin-top: var(--s4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.btn {
  min-height: 44px;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.btn-primary {
  background: var(--hero-primary);
  color: #f4f8ff;
  border: 1px solid #3d5f90;
}

.btn-secondary {
  background: var(--hero-secondary);
  color: #1b3156;
  border: 1px solid var(--hero-accent);
}

#hero .btn-primary:hover,
#hero .btn-primary:focus-visible {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 18px rgba(33, 58, 95, 0.3);
}

#hero .btn-secondary:hover,
#hero .btn-secondary:focus-visible {
  background: var(--hero-secondary-hover);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 18px rgba(33, 58, 95, 0.2);
}

.hero-visual {
  margin: 0;
  border: 1px solid #8ea2bf;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(40, 56, 84, 0.16);
  position: relative;
  isolation: isolate;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 62%;
  background: radial-gradient(circle at 30% 40%, rgba(54, 90, 146, 0.22), transparent 55%);
  z-index: 1;
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, rgba(24, 43, 70, 0.16), transparent 45%);
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
  transition: opacity 260ms ease;
}

.hero-visual img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 46%;
  transition: transform 320ms ease, filter 320ms ease;
  transform-origin: center;
}

.hero-visual:hover img,
.hero-visual:focus-within img {
  transform: scale(1.04);
  filter: contrast(1.04) saturate(1.05);
}

.hero-visual:hover::before,
.hero-visual:focus-within::before {
  transform: translateY(4px) scale(1.02);
}

.section-header {
  margin-bottom: var(--s5);
}

h2 {
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: clamp(1.7rem, 4.8vw, 3.1rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
  max-width: 25ch;
  color: #13223a;
}

.about-layout,
.skills-grid,
.project-list,
.contact-panel {
  display: grid;
  gap: var(--s3);
}

.panel,
.tile,
.project-item,
.contact-panel a {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: background-color 220ms ease, border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.panel,
.tile,
.project-item {
  border-radius: 28px;
}

.about-layout .panel:nth-child(1) {
  background: var(--card-a);
}

.about-layout .panel:nth-child(2) {
  background: var(--card-b);
}

.skills-grid .tile:nth-child(odd) {
  border-top-left-radius: 36px;
  border-bottom-right-radius: 36px;
}

.skills-grid .tile:nth-child(even) {
  border-top-right-radius: 36px;
  border-bottom-left-radius: 36px;
}

.project-list .project-item:nth-child(1) {
  border-top-left-radius: 40px;
}

.project-list .project-item:nth-child(2) {
  border-top-right-radius: 40px;
}

.project-list .project-item:nth-child(3) {
  border-bottom-right-radius: 40px;
}

.panel {
  padding: var(--s4);
}

.panel p {
  color: #31465f;
  line-height: 1.68;
}

.panel p + p {
  margin-top: var(--s3);
}

.stats h3 {
  margin-bottom: 10px;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 1.1rem;
  color: #16273f;
}

.stats ul {
  margin: 0;
  padding-left: 18px;
  color: #31465f;
  line-height: 1.7;
}

.skills-grid {
  grid-template-columns: 1fr;
}

.tile,
.project-item {
  padding: 22px;
}

.tile h3,
.project-item h3 {
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: #16273f;
}

.tile p,
.project-item p {
  color: #465975;
  line-height: 1.58;
}

.skills-grid .tile:nth-child(1) {
  background: var(--card-a);
}

.skills-grid .tile:nth-child(2) {
  background: var(--card-b);
}

.skills-grid .tile:nth-child(3) {
  background: var(--card-c);
}

.skills-grid .tile:nth-child(4) {
  background: var(--card-a);
}

.skills-grid .tile:nth-child(5) {
  background: var(--card-b);
}

.skills-grid .tile:nth-child(6) {
  background: var(--card-c);
}

.project-list .project-item:nth-child(1) {
  background: var(--card-a);
}

.project-list .project-item:nth-child(2) {
  background: var(--card-b);
}

.project-list .project-item:nth-child(3) {
  background: var(--card-c);
}

.panel:hover,
.panel:focus-within,
.tile:hover,
.tile:focus-within,
.project-item:hover,
.project-item:focus-within {
  border-color: #879cbc;
  background: #ffffff;
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(30, 47, 77, 0.16);
}

.contact-panel {
  grid-template-columns: 1fr;
}

.contact-panel a {
  min-height: 48px;
  text-decoration: none;
  color: #1b2e4b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-color: #b8c5d9;
}

.contact-panel a:nth-child(1) {
  background: #e6edf7;
}

.contact-panel a:nth-child(2) {
  background: #e2eaf6;
}

.contact-panel a:nth-child(3) {
  background: #e2ebe5;
}

.contact-panel a:nth-child(4) {
  background: #ebe4d9;
}

.contact-panel a:hover,
.contact-panel a:focus-visible {
  border-color: #7a93ba;
  box-shadow: 0 0 0 2px rgba(122, 147, 186, 0.2), 0 10px 20px rgba(33, 50, 80, 0.18);
  transform: translateY(-3px);
}

.footer {
  border-top: 1px solid #c8d2e8;
  padding: var(--s4);
  text-align: center;
  color: #55647e;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 13px;
  background: rgba(240, 244, 250, 0.92);
}

body.theme-dark {
  --bg: #0d1422;
  --ink: #ecf2fb;
  --ink-soft: #b0bfd5;
  --line: #2a3850;
  --about-band: linear-gradient(130deg, #182336 0%, #1d2c44 100%);
  --skills-band: linear-gradient(132deg, #172a3c 0%, #1a3347 100%);
  --projects-band: linear-gradient(130deg, #182d2a 0%, #1d3a36 100%);
  --contact-band: linear-gradient(135deg, #2b241d 0%, #372c22 100%);
  --card-a: linear-gradient(160deg, rgba(20, 29, 44, 0.96), rgba(14, 22, 35, 0.96));
  --card-b: linear-gradient(160deg, rgba(21, 33, 49, 0.96), rgba(15, 24, 38, 0.96));
  --card-c: linear-gradient(160deg, rgba(19, 31, 46, 0.96), rgba(14, 23, 36, 0.96));
  --hero-primary: linear-gradient(180deg, #3d5d93 0%, #2e486f 100%);
  --hero-secondary: #2f3d54;
  --hero-secondary-hover: #384a66;
  --hero-accent: #5e769f;
}

body.theme-dark {
  background-image:
    radial-gradient(circle at 8% -10%, rgba(84, 112, 153, 0.22), transparent 34%),
    radial-gradient(circle at 92% -10%, rgba(67, 88, 122, 0.2), transparent 36%),
    linear-gradient(180deg, #0c1320 0%, #0a101a 100%);
}

body.theme-dark #hero.section::before {
  background: linear-gradient(140deg, #131d31 0%, #17263f 52%, #1d2d49 100%);
}

body.theme-dark h1,
body.theme-dark h2,
body.theme-dark .tile h3,
body.theme-dark .project-item h3,
body.theme-dark .stats h3,
body.theme-dark .panel p,
body.theme-dark .tile p,
body.theme-dark .project-item p,
body.theme-dark .stats ul,
body.theme-dark .kicker,
body.theme-dark .lead {
  color: #e8effa;
}

body.theme-dark #about.section .kicker,
body.theme-dark #skills.section .kicker,
body.theme-dark #projects.section .kicker,
body.theme-dark #contact.section .kicker {
  color: #c2d0e6;
}

body.theme-dark .panel,
body.theme-dark .tile,
body.theme-dark .project-item,
body.theme-dark .contact-panel a {
  border-color: #304158;
}

body.theme-dark .panel:hover,
body.theme-dark .tile:hover,
body.theme-dark .project-item:hover,
body.theme-dark .panel:focus-within,
body.theme-dark .tile:focus-within,
body.theme-dark .project-item:focus-within {
  border-color: #4c6385;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
}

body.theme-dark .hero-visual {
  background: #131d2e;
  border-color: #4a5e7d;
}

body.theme-dark .hero-visual::before {
  background: radial-gradient(circle at 30% 40%, rgba(108, 140, 188, 0.26), transparent 55%);
}

body.theme-dark .hero-visual::after {
  background: linear-gradient(to top right, rgba(16, 29, 47, 0.44), transparent 48%);
}

body.theme-dark .btn-primary {
  color: #eef4ff;
  border-color: #5473a4;
}

body.theme-dark .btn-secondary {
  color: #e9f0fb;
  border-color: #5f789f;
}

body.theme-dark #hero .btn-primary:hover,
body.theme-dark #hero .btn-primary:focus-visible {
  background: linear-gradient(180deg, #365382 0%, #283d5f 100%);
  border-color: #5d7cae;
  box-shadow: 0 10px 18px rgba(24, 37, 58, 0.4);
}

body.theme-dark #hero .btn-secondary:hover,
body.theme-dark #hero .btn-secondary:focus-visible {
  border-color: #6d86b0;
  box-shadow: 0 10px 18px rgba(21, 34, 55, 0.35);
}

body.theme-dark .contact-panel a:hover,
body.theme-dark .contact-panel a:focus-visible {
  border-color: #6f88b1;
  box-shadow: 0 0 0 2px rgba(111, 136, 177, 0.24), 0 10px 20px rgba(8, 13, 21, 0.45);
}

body.theme-dark .footer {
  border-top-color: #2c3b53;
  color: #9db0ce;
  background: rgba(11, 17, 28, 0.95);
}

@media (min-width: 820px) {
  .top-nav {
    padding: 0 var(--s5);
  }

  .nav-toggle {
    display: none;
  }

  .main-nav {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--s4);
    border: 0;
    padding: 0;
    background: transparent;
  }

  .nav-theme-toggle {
    margin-top: 0;
    margin-left: 6px;
  }

  .hero {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .about-layout {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contact-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  .skills-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
