:root {
  --black: #08090d;
  --ink: #0e1117;
  --panel: #12161e;
  --platinum: #e6e9ef;
  --silver: #aab3c2;
  --steel: #6f7a8c;
  --ice: #9fb6d1;
  --line: rgba(200, 210, 225, 0.14);
  --line-strong: rgba(200, 210, 225, 0.35);
  --metal: linear-gradient(120deg, #8f99aa 0%, #f4f6fa 35%, #b5bfcd 55%, #ffffff 70%, #8f99aa 100%);
  --max: 1140px;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Montserrat', system-ui, sans-serif;
  --bright: #ffffff;
  --nav-bg: rgba(8, 9, 13, 0.82);
  --hover: rgba(255, 255, 255, 0.04);
  color-scheme: dark;
}

/* White theme: same names, inverted roles (--black = page, --platinum = text) */
:root[data-theme="light"] {
  --black: #f8f9fb;
  --ink: #eef1f5;
  --panel: #ffffff;
  --platinum: #14171d;
  --silver: #474f5e;
  --steel: #6b7383;
  --ice: #4f6d92;
  --line: rgba(20, 25, 35, 0.1);
  --line-strong: rgba(20, 25, 35, 0.28);
  --metal: linear-gradient(120deg, #1a1d24 0%, #5b6576 35%, #2a2f39 55%, #7d8797 70%, #1a1d24 100%);
  --bright: #000000;
  --nav-bg: rgba(248, 249, 251, 0.85);
  --hover: rgba(20, 25, 35, 0.04);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 300;
  background: var(--black);
  color: var(--platinum);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s, color .5s;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.1; }

a { color: inherit; }

::selection { background: var(--ice); color: var(--black); }

/* Metallic text */
h1 em, .section-title {
  background: var(--metal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px max(16px, calc((100% - var(--max)) / 2));
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-logo {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-decoration: none;
}
.nav-right { display: flex; align-items: center; gap: 36px; }
.nav nav { display: flex; gap: 32px; }
.nav nav a {
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--silver);
  transition: color .3s;
}
.nav nav a:hover { color: var(--bright); }

.lang-switch { display: flex; border: 1px solid var(--line-strong); }
.lang-switch button {
  border: 0;
  background: transparent;
  font: 500 0.68rem var(--sans);
  letter-spacing: 0.2em;
  color: var(--silver);
  padding: 6px 12px;
  cursor: pointer;
  transition: background .3s, color .3s;
}
.lang-switch button:hover { color: var(--bright); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--silver);
  cursor: pointer;
  transition: color .3s, border-color .3s;
}
.theme-toggle:hover { color: var(--bright); border-color: var(--platinum); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
.nav-controls { display: flex; align-items: center; gap: 10px; }
.lang-switch button[aria-pressed="true"] { background: var(--platinum); color: var(--black); }

/* HERO */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px 16px 56px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 72px;
  align-items: center;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -30% auto auto;
  width: 70%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(159, 182, 209, 0.16), transparent 65%);
  pointer-events: none;
  z-index: -1;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ice);
  margin-bottom: 28px;
}
.eyebrow::before { content: ""; width: 48px; height: 1px; background: var(--ice); }
h1 {
  font-size: clamp(3rem, 6.5vw, 5.4rem);
  font-weight: 300;
  letter-spacing: -0.01em;
  margin-bottom: 30px;
}
h1 em { font-style: italic; font-weight: 400; }
.lead { font-size: 1.02rem; color: var(--silver); max-width: 32em; margin-bottom: 44px; }

.hero-actions, .contact-links { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 16px 34px;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  transition: background .4s, color .4s, border-color .4s, box-shadow .4s;
}
.btn-primary { background: var(--metal); background-size: 200% 100%; color: var(--black); }
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 0 30px rgba(200, 215, 235, 0.25); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--platinum); }
.btn-ghost:hover { border-color: var(--platinum); background: var(--hover); }

/* Portrait in a double platinum frame */
.hero-photo {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 360px;
}
.hero-photo::before {
  content: "";
  position: absolute;
  inset: -16px;
  border: 1px solid var(--line-strong);
}
.hero-photo::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -22px;
  width: 12px; height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--black);
  border: 1px solid var(--silver);
}
.hero-photo img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.75) contrast(1.05);
}

/* WAVE */
.wave { max-width: var(--max); margin: 0 auto; padding: 24px 16px 0; }
.wave svg { width: 100%; height: 50px; display: block; }
.wave path { fill: none; stroke: var(--silver); stroke-width: 1; opacity: .4; }

/* SECTIONS */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 104px 16px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s ease, transform 1s ease;
}
.section.visible, .quote.visible { opacity: 1; transform: none; }

.section-title {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 300;
  margin-bottom: 52px;
  width: fit-content;
}

/* PROFILE */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 72px;
  align-items: start;
}
.about-text { font-size: 1.05rem; color: var(--silver); }
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.stats div {
  padding: 26px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stats dt {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 300;
  line-height: 1;
  margin-bottom: 10px;
  background: var(--metal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}
.stats dd {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--steel);
}

/* SERVICES */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  counter-reset: card;
}
.card {
  padding: 40px 28px;
  border-right: 1px solid var(--line);
  transition: background .5s;
}
.card:last-child { border-right: 0; }
.card::before {
  counter-increment: card;
  content: "0" counter(card);
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ice);
  margin-bottom: 26px;
}
.card:hover { background: linear-gradient(180deg, rgba(159, 182, 209, 0.08), transparent); }
.card h3 { font-size: 1.55rem; font-weight: 500; margin-bottom: 14px; }
.card p { color: var(--steel); font-size: 0.9rem; }

/* CV */
.cv {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 80px;
}
.timeline { list-style: none; border-left: 1px solid var(--line-strong); padding-left: 36px; }
.timeline li { position: relative; padding-bottom: 44px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -42px; top: 6px;
  width: 11px; height: 11px;
  transform: rotate(45deg);
  background: var(--black);
  border: 1px solid var(--silver);
}
.timeline li:first-child::before { background: var(--platinum); border-color: var(--platinum); box-shadow: 0 0 14px rgba(230, 233, 239, 0.5); }
.when {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ice);
}
.timeline h3 { font-size: 1.75rem; font-weight: 500; margin: 8px 0 4px; }
.where { color: var(--silver); font-size: 0.85rem; letter-spacing: 0.05em; margin-bottom: 12px; }
.timeline p:not(.where) { color: var(--steel); font-size: 0.92rem; }

.skill-group {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ice);
  margin: 36px 0 14px;
}
.section-title + .skill-group { margin-top: 0; }

.points { list-style: none; display: grid; gap: 6px; }
.points li {
  position: relative;
  padding-left: 20px;
  color: var(--steel);
  font-size: 0.9rem;
}
.points li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.72em;
  width: 8px; height: 1px;
  background: var(--silver);
}

.timeline.compact h3 { font-size: 1.4rem; }
.timeline.compact li { padding-bottom: 32px; }
.timeline.compact li:last-child { padding-bottom: 0; }
.timeline.compact + .section-title { margin-top: 72px; }

.facts { list-style: none; margin-bottom: 72px; }
.facts:last-child { margin-bottom: 0; }
.facts li {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.facts li:last-child { border-bottom: 1px solid var(--line); }
.facts strong { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; }
.facts span { color: var(--steel); font-size: 0.85rem; }
.facts.inline li { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 16px; }
.facts.inline span { font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ice); }

/* SKILLS */
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.skill-grid .skill-group { margin-top: 0; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 8px 14px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--silver);
  transition: border-color .3s, color .3s;
}
.tags li:hover { border-color: var(--platinum); color: var(--bright); }

/* CONTACT */
.contact { text-align: center; }
.contact .section-title { margin-left: auto; margin-right: auto; margin-bottom: 24px; }
.contact p { color: var(--silver); font-size: 1.02rem; margin-bottom: 44px; }
.contact-links { justify-content: center; }

/* FOOTER */
.footer {
  text-align: center;
  padding: 40px 16px;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--steel);
  border-top: 1px solid var(--line);
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .skill-grid { grid-template-columns: 1fr 1fr; }
  .card:nth-child(2) { border-right: 0; }
  .card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; gap: 64px; }
  .hero-photo { order: -1; max-width: 260px; }
  .about-grid, .cv, .skill-grid { grid-template-columns: 1fr; gap: 56px; }
  .section { padding: 72px 16px; }
}

@media (max-width: 560px) {
  .nav nav { display: none; }
  .nav-logo { letter-spacing: 0.2em; font-size: 1rem; }
}

@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  .card { border-right: 0; border-bottom: 1px solid var(--line); }
  .card:last-child { border-bottom: 0; }
  .btn { padding: 15px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .section, .quote { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 400px) {
  .nav-logo { font-size: 0.88rem; letter-spacing: 0.14em; }
}

/* Email button: keep the address readable and let it wrap on small screens */
.contact .btn-primary { text-transform: none; letter-spacing: 0.06em; font-size: 0.85rem; overflow-wrap: anywhere; }
