:root {
  --tyrian-purple: hsla(323, 73%, 22%, 1);
  --carmine: hsla(349, 96%, 31%, 1);
  --ut-orange: hsla(29, 96%, 56%, 1);
  --spanish-orange: hsla(23, 84%, 48%, 1);
  --midnight-green: hsla(192, 72%, 21%, 1);
  --color-bg: hsl(198, 17%, 88%);
  --color-surface: hsl(198, 17%, 88%);
  --color-text: var(--midnight-green);
  --color-text-soft: hsla(196, 24%, 30%, 0.9);
  --color-muted: hsla(196, 20%, 38%, 1);
  --color-accent: var(--carmine);
  --color-accent-strong: var(--tyrian-purple);
  --color-accent-soft-bg: hsla(29, 96%, 56%, 0.12);
  --color-accent-border: hsla(29, 96%, 45%, 0.35);
  --color-divider: hsla(29, 96%, 45%, 0.25);
  --color-border: hsla(196, 32%, 70%, 0.65);
  --color-text-on-accent: hsla(0, 0%, 100%, 1);
  --shadow-dark: hsla(0, 0%, 48%, 0.30);
  --shadow-dark-heavy: hsla(0, 0%, 48%, 0.05);
  --shadow-light: hsla(0, 0%, 100%, 0.70);
  --shadow-light-heavy: hsla(0, 0%, 100%, 0.95);
  --shadow-inset: rgba(0, 0, 0, 0.08);
  --icon-color: var(--color-accent-strong);
  --radius: 22px;
  --corder-shape: squircle
  color: var(--color-text);
  background: var(--color-bg);
}

body[data-theme="dark"] {
  --color-bg: var(--midnight-green);
  --color-surface: --midnight-green;
  --color-text: hsla(29, 73%, 94%, 1);
  --color-text-soft: hsla(29, 73%, 94%, 0.88);
  --color-muted: hsla(192, 28%, 72%, 1);
  --color-accent: var(--carmine);
  --color-accent-strong: var(--ut-orange);
  --color-accent-soft-bg: hsla(349, 96%, 31%, 0.25);
  --color-accent-border: var(--carmine);
  --color-divider: var(--carmine);
  --color-border: hsla(192, 36%, 28%, 0.7);
  --icon-color: var(--carmine);
  --shadow-dark: rgba(0, 0, 0, 0.65);
  --shadow-dark-heavy: rgba(0, 0, 0.80);
  --shadow-light: rgba(255, 255, 255, 0.10);
  --shadow-light-heavy: rgba(255, 255, 255, 0.05);
  --shadow-inset: rgba(0, 0, 0, 0.22);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  transition: background 0.4s ease, color 0.4s ease;
  font-family: "Noto Sans", sans-serif;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.hero {
  padding-top: 4rem;
  padding-bottom: 3rem;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-top .eyebrow {
  margin-bottom: 0;
}

.hero-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.content {
  width: min(1100px, 100%);
  margin: 0 auto;
  background: var(--color-surface);
  border-radius: calc(var(--radius) + 6px);
  corner-shape: var(--corder-shape);
  padding: 2.5rem;
  box-shadow: 4px 4px 20px var(--shadow-dark), 4px 4px 4px var(--shadow-dark-heavy), -4px -4px 20px var(--shadow-light), -4px -4px 4px var(--shadow-light-heavy);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--color-muted);
}

h1 {
  font-size: clamp(2.6rem, 3.8vw, 4rem);
  margin: 0.8rem 0 0.65rem;
}

h2 {
  font-size: clamp(1.8rem, 2.1vw, 2.4rem);
  margin: 0.25rem 0 0.6rem;
}

h3 {
  margin: 0;
  font-size: 1.25rem;
}

h4 {
  margin: 0;
  font-size: 1.05rem;
}

p {
  color: var(--color-text-soft);
  line-height: 1.65;
}

.lede {
  font-size: 1.14rem;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 1.6rem 0 1.1rem;
  align-items: center;
}

.hero-actions > * {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.9rem;
  border-radius: 1.2rem;
  corner-shape: var(--corder-shape);
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
  background: var(--color-surface);
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.btn.primary {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
}

.btn.ghost {
  color: var(--color-text);
  background: var(--color-bg);
}

.btn.icon-btn {
  padding-inline: 1.4rem;
  justify-content: flex-start;
}

.btn-icon {
  display: inline-flex;
  width: 1.3rem;
  height: 1.3rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.btn:hover {
  box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}

.meta {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.meta span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  text-transform: uppercase;
}

.theme-toggle {
  width: 78px;
  height: 40px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: var(--color-surface);
  box-shadow: 4px 4px 20px var(--shadow-dark), 4px 4px 4px var(--shadow-dark-heavy), -4px -4px 20px var(--shadow-light), -4px -4px 4px var(--shadow-light-heavy);
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.35s ease;
}

body[data-theme="dark"] .theme-toggle {
  box-shadow: inset 1px 1px 3px var(--shadow-inset),
    5px 5px 12px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 6px;
}

.toggle-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  corner-shape: var(--corder-shape);
  background: var(--color-bg);
  box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
  transform: translateX(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.35s ease,
  box-shadow 0.35s ease;
}

body[data-theme="dark"] .toggle-thumb {
  transform: translateX(38px);
}

.toggle-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
}

.toggle-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: 0.65;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

body[data-theme="dark"] .toggle-icon.sun svg,
body[data-theme="light"] .toggle-icon.moon svg {
  opacity: 0.4;
  transform: scale(0.9);
}

.nav-panel {
  padding: 0.5rem 5vw 0;
  margin-top: -0.5rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 0.75rem 1.5rem;
  margin: 0;
  text-transform: uppercase;
  font-size: 0.86rem;
  font-weight: bolder;
  padding: 1rem 0;
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--color-text);
  opacity: 0.78;
  letter-spacing: 0.02em;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
  transition: color 0.16s ease, border 0.16s ease, opacity 0.16s ease;
}

.site-nav a:hover {
  color: var(--color-accent-strong);
  border-bottom-color: var(--color-accent-border);
  opacity: 1;
}

main {
  padding-bottom: 4rem;
}

section {
  margin: 3rem auto;
  padding: 2.3rem;
  border-radius: var(--radius);
  corner-shape: var(--corder-shape);
  background: var(--color-surface);
  max-width: 1100px;
  box-shadow: 4px 4px 20px var(--shadow-dark), 4px 4px 4px var(--shadow-dark-heavy), -4px -4px 20px var(--shadow-light), -4px -4px 4px var(--shadow-light-heavy);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

body[data-theme="dark"] .content,
body[data-theme="dark"] section,
body[data-theme="dark"] #skills .skill-grid div {
  box-shadow: 10px 10px 24px var(--shadow-dark), -8px -8px 18px var(--shadow-light);
}

body[data-theme="dark"] section,
body[data-theme="dark"] .content,
body[data-theme="dark"] #skills .skill-grid div {
  border-color: transparent;
}

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

article {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
}

article:first-of-type {
  border-top: 0;
  padding-top: 0.5rem;
}

article header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.88rem;
  font-weight: bolder;
  margin-left: 1.5em;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--color-accent-soft-bg);
  color: var(--color-accent-strong);
  border: 1px solid var(--color-accent-border);
  box-shadow: inset 1px 1px 2px var(--shadow-light);
}

article ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: var(--color-text-soft);
}

article ul li {
  margin-bottom: 0.5rem;
}

.nested {
  border-top: none;
}

#skills .skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
}

#skills .skill-grid div {
  background: var(--color-surface);
  border-radius: var(--radius);
  corner-shape: var(--corder-shape);
  padding: 1.2rem;
  min-height: 130px;
  box-shadow: 4px 4px 20px var(--shadow-dark), 4px 4px 4px var(--shadow-dark-heavy), -4px -4px 20px var(--shadow-light), -4px -4px 4px var(--shadow-light-heavy);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

footer {
  padding: 2.5rem 5vw 4rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.92rem;
  transition: color 0.35s ease;
}

@media (max-width: 900px) {
  .content {
    padding: 2rem;
  }

  section {
    padding: 2rem;
  }
}

@media (max-width: 640px) {
  header,
  main,
  footer {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .content {
    padding: 1.6rem;
  }

  .hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-top-actions {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .nav-panel .site-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav {
    flex-direction: column;
  }

  article header {
    flex-direction: column;
    align-items: flex-start;
  }
}
