/* ===== Tokens ===== */
:root {
  --bg: #f4f6f8;
  --bg-alt: #e9edf1;
  --surface: #ffffff;
  --ink: #1d2329;
  --ink-soft: #4a5560;
  --line: #cbd3db;
  --steel: #35566f;
  --accent: #f2b705;
  --accent-ink: #1d2329;
  --link: #24506f;
  --focus: #1b6bd1;

  --font-display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 6px;
  --container: 1080px;
  --header-h: 64px;
}

:root[data-theme="dark"] {
  --bg: #14181c;
  --bg-alt: #1b2127;
  --surface: #20272e;
  --ink: #eef1f4;
  --ink-soft: #aab4be;
  --line: #36404a;
  --steel: #8fb3cf;
  --link: #8fc0e6;
  --focus: #6aa8ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14181c;
    --bg-alt: #1b2127;
    --surface: #20272e;
    --ink: #eef1f4;
    --ink-soft: #aab4be;
    --line: #36404a;
    --steel: #8fb3cf;
    --link: #8fc0e6;
    --focus: #6aa8ff;
  }
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.muted { color: var(--ink-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; border-radius: var(--radius); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.site-nav ul { display: flex; gap: 1.6rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: .975rem; font-weight: 500; padding: .35rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: .4rem; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-alt); }
.nav-toggle { display: none; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: .8rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; font-size: 1rem; text-decoration: none; border: 2px solid transparent;
  transition: transform .15s ease, background-color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ffc61f; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* ===== Hero ===== */
.hero { padding: 4.5rem 0 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 280px; gap: 3rem; align-items: center; }
.hero-role { font-weight: 600; color: var(--steel); margin-bottom: .8rem; }
.hero h1 { font-size: clamp(3rem, 8vw, 5.5rem); font-weight: 800; font-stretch: 85%; letter-spacing: -0.03em; }
.hero-lead { font-size: 1.2rem; max-width: 36rem; margin: 1.2rem 0 1rem; color: var(--ink-soft); }
.hero-place { display: flex; align-items: center; gap: .4rem; color: var(--ink-soft); margin: 0; font-size: .975rem; }
.hero-photo {
  aspect-ratio: 4 / 5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; place-items: center; overflow: hidden; border-bottom: 6px solid var(--accent);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.monogram { font-family: var(--font-display); font-weight: 800; font-size: 5rem; color: var(--steel); font-stretch: 85%; }

/* Career scale (the one memorable element) */
.scale { margin: 4rem 0 0; padding-bottom: 1.2rem; }
.scale-marks { position: relative; height: 3.2rem; }
.mark { position: absolute; left: var(--p); bottom: 0; transform: translateX(-1px); padding-left: .55rem; border-left: 2px solid var(--accent); display: flex; flex-direction: column; line-height: 1.25; }
.mark b { font-family: var(--font-display); font-size: .95rem; }
.mark i { font-style: normal; font-size: .85rem; color: var(--ink-soft); }
.scale-ruler {
  height: 22px; border-top: 2px solid var(--ink);
  background:
    repeating-linear-gradient(to right, var(--ink) 0 1px, transparent 1px calc(100% / 90)) top / 100% 8px no-repeat,
    repeating-linear-gradient(to right, var(--ink) 0 2px, transparent 2px calc(100% / 9)) top / 100% 22px no-repeat;
}
.scale-years { display: grid; grid-template-columns: repeat(10, 1fr); font-size: .75rem; color: var(--ink-soft); margin-top: .1rem; }
.scale-years span:last-child { text-align: right; }

/* One orchestrated load moment: the ruler draws in */
@media (prefers-reduced-motion: no-preference) {
  .scale-ruler { clip-path: inset(0 100% 0 0); animation: draw 1.4s .2s cubic-bezier(.6, 0, .2, 1) forwards; }
  .mark { opacity: 0; animation: pop .4s ease forwards; }
  .mark:nth-child(1) { animation-delay: .5s; }
  .mark:nth-child(2) { animation-delay: .8s; }
  .mark:nth-child(3) { animation-delay: 1s; }
  .mark:nth-child(4) { animation-delay: 1.4s; }
  @keyframes draw { to { clip-path: inset(0 0 0 0); } }
  @keyframes pop { to { opacity: 1; } }
}

/* ===== Sections ===== */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-alt); }
.section h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 700; }
.split { display: grid; grid-template-columns: 240px 1fr; gap: 2rem 3rem; align-items: start; }
.split > h2 { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.prose { max-width: 40rem; }

/* Timeline */
.timeline { position: relative; border-left: 2px solid var(--line); margin-left: .4rem; }
.t-item { position: relative; padding: 0 0 2.6rem 2rem; }
.t-item:last-child { padding-bottom: 0; }
.t-item::before {
  content: ""; position: absolute; left: -9px; top: .35rem; width: 16px; height: 16px;
  background: var(--bg-alt); border: 3px solid var(--steel); border-radius: 50%;
}
.t-item:first-child::before { background: var(--accent); border-color: var(--ink); }
.t-date { font-size: .9rem; color: var(--ink-soft); margin-bottom: .2rem; font-weight: 500; }
.t-item h3 { font-size: 1.3rem; font-weight: 700; }
.t-org { font-weight: 600; color: var(--steel); margin: .15rem 0 .6rem; }
.t-item ul { list-style: disc; padding-left: 1.2rem; color: var(--ink-soft); }
.t-item li + li { margin-top: .25rem; }

/* Skills */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem 2.5rem; }
.skill-group h3 { font-size: 1.05rem; padding-bottom: .5rem; margin-bottom: .6rem; border-bottom: 2px solid var(--accent); display: inline-block; }
.skill-group li { padding: .3rem 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }

/* Project */
.project { margin-top: 2rem; display: grid; grid-template-columns: 1.6fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.project-main { padding: 2rem; }
.project-main h3 { font-size: 1.5rem; margin-bottom: .6rem; }
.project-role { color: var(--steel); font-weight: 600; }
.project-main h4 { font-size: 1rem; margin: 1.2rem 0 .5rem; }
.check-list li { position: relative; padding-left: 1.6rem; margin-bottom: .3rem; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .5em; width: 10px; height: 6px; border-left: 2px solid var(--steel); border-bottom: 2px solid var(--steel); transform: rotate(-45deg); }
.project-tech { margin: 1.2rem 0 1.4rem; color: var(--ink-soft); }
.project-results { background: var(--ink); color: var(--bg); padding: 2rem; display: flex; flex-direction: column; gap: 1.4rem; justify-content: center; }
:root[data-theme="dark"] .project-results { background: #0f1317; color: #eef1f4; }
.result-num { display: block; font-family: var(--font-display); font-weight: 800; font-size: 2.8rem; line-height: 1; color: var(--accent); }
.result-label { font-size: .95rem; opacity: .85; }
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.tag-list li { font-size: .82rem; padding: .2rem .6rem; border: 1px solid rgba(255,255,255,.35); border-radius: 99px; }

/* Education */
.edu-list li { padding: 0 0 1.6rem 1.2rem; border-left: 4px solid var(--accent); margin-bottom: 1.6rem; }
.edu-list li:last-child { margin-bottom: 0; padding-bottom: 0; }
.edu-list h3 { font-size: 1.25rem; }
.edu-list p { margin: .15rem 0 0; }

/* Contact */
.contact-lead { font-size: 1.2rem; max-width: 34rem; margin-bottom: 1.6rem; }
.contact-list li { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 1px solid var(--line); }
.contact-list span { color: var(--ink-soft); }
.contact-list a { font-weight: 500; word-break: break-word; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 1.6rem 0; font-size: .925rem; color: var(--ink-soft); }
.site-footer .container { display: flex; justify-content: space-between; gap: 1rem; }
.site-footer p { margin: 0; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split > h2 { position: static; }
  .project { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-grid; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--bg);
    border-bottom: 1px solid var(--line); display: none; padding: .5rem 1.25rem 1rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { display: block; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .hero { padding-top: 2.5rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-photo { max-width: 200px; aspect-ratio: 1; order: -1; }
  .monogram { font-size: 3.5rem; }
  .section { padding: 3.5rem 0; }
  .mark i { display: none; }
  .contact-list li { grid-template-columns: 1fr; gap: 0; }
}

/* ===== Additions ===== */
.hero-photo img { object-position: center 30%; }
.scale-caption { font-size: .85rem; color: var(--ink-soft); margin-top: .9rem; max-width: 46rem; }
.link-row { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-top: .5rem !important; font-weight: 500; }
.phones { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; }
.phones a { color: var(--link); }
.contact-list span:first-child { color: var(--ink-soft); }
