:root {
  --bg: #faf9f6;
  --bg-soft: #f3f1ec;
  --text: #1a1a1a;
  --text-soft: #2e2e2e;
  --text-muted: #757067;
  --accent: #1e3a5f;
  --accent-soft: #2c4f7c;
  --border: #e8e4dc;
  --tag-bg: #ffffff;
  --header-bg: rgba(250, 249, 246, 0.82);
  --max-width: 1040px;
  --header-height: 64px;
  --easing: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #14181f;
  --bg-soft: #1c2029;
  --text: #f0ece4;
  --text-soft: #d4d0c8;
  --text-muted: #8a8378;
  --accent: #8aaed6;
  --accent-soft: #a6c0db;
  --border: #2a2e38;
  --tag-bg: #1c2029;
  --header-bg: rgba(20, 24, 31, 0.85);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-weight: 400;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.35s ease, color 0.35s ease;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

h1, h2, h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 2.5rem;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 400;
}

.nav a:hover {
  color: var(--accent);
}

/* ---------- Toggles (lang + theme) ---------- */

.lang-toggle,
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.35s ease;
}

.lang-toggle:hover,
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.lang-toggle {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.theme-icon {
  position: absolute;
  transition: opacity 0.35s var(--easing), transform 0.45s var(--easing);
}

.theme-icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.theme-icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* ---------- Layout ---------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem 0 4rem;
  position: relative;
  animation: fadeUp 0.9s var(--easing) both;
}

.hero-content {
  max-width: 720px;
}

.overline {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-weight: 500;
}

.hero-name {
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin-bottom: 1.75rem;
  color: var(--text);
}

.hero-role {
  font-size: 1.075rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 2.5rem;
}

.hero-tagline {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--text-muted);
  max-width: 32em;
  font-weight: 400;
  line-height: 1.4;
}

.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}

.scroll-cue:hover {
  color: var(--accent);
}

.scroll-cue-line {
  width: 1px;
  height: 36px;
  background: currentColor;
  animation: scrollLine 1.8s ease-in-out infinite;
  transform-origin: top;
}

@keyframes scrollLine {
  0%, 100% { transform: scaleY(0.35); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ---------- Sections ---------- */

.section {
  padding: 5rem 0;
}

.section-header {
  margin-bottom: 2.25rem;
}

.section-number {
  display: inline-block;
  font-family: "Fraunces", Georgia, serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 0.85rem;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

.section h2 {
  font-size: clamp(1.85rem, 3.5vw, 2.4rem);
  color: var(--text);
}

.section-body p {
  font-size: 1.05rem;
  color: var(--text-soft);
  max-width: 60ch;
  margin-bottom: 1.1rem;
}

.section-body p:last-of-type {
  margin-bottom: 0;
}

/* ---------- Skills ---------- */

.skill-group + .skill-group {
  margin-top: 2.5rem;
}

.subhead {
  font-family: "Inter", sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1.1rem;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tags li {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.875rem;
  background: var(--tag-bg);
  color: var(--text);
  font-weight: 500;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    background-color 0.35s ease;
}

.tags li:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.tags--muted li {
  background: transparent;
  color: var(--text-muted);
  border-style: dashed;
}

/* ---------- Contact ---------- */

.contact-links {
  list-style: none;
  margin-top: 2rem;
}

.contact-links li:first-child a {
  border-top: 1px solid var(--border);
}

.contact-links a {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  transition:
    padding 0.25s var(--easing),
    border-color 0.35s ease;
}

.contact-links a:hover {
  padding-left: 0.5rem;
}

.contact-links a:hover .contact-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

.contact-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  font-weight: 500;
}

.contact-value {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 500;
}

.contact-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: transform 0.25s var(--easing), color 0.2s ease;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 3rem 2.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  transition: border-color 0.35s ease;
}

/* ---------- Animations ---------- */

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

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--easing), transform 0.9s var(--easing);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-in {
    opacity: 1;
    transform: none;
  }
  .scroll-cue-line {
    animation: none;
  }
}

/* ---------- Desktop: two-column sections ---------- */

@media (min-width: 820px) {
  .section {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 4rem;
    padding: 6rem 0;
  }
  .section-header {
    margin-bottom: 0;
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    align-self: start;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  .site-header {
    padding: 0 1.25rem;
  }
  .nav {
    gap: 0.9rem;
  }
  .nav a {
    font-size: 0.82rem;
  }
  main {
    padding: 0 1.5rem;
  }
  .section {
    padding: 4rem 0;
  }
  .hero {
    padding: 5.5rem 0 4rem;
  }
  .contact-links a {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 1.1rem 0;
  }
  .contact-label {
    grid-column: 1 / -1;
    margin-bottom: 0.15rem;
  }
}

@media (max-width: 380px) {
  .nav {
    gap: 0.65rem;
  }
  .nav a {
    font-size: 0.75rem;
  }
}
