:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #fbfbfc;
  --surface-strong: #f3f3f5;
  --text: #111114;
  --muted: #66666f;
  --line: #e4e4e8;
  --line-strong: #d3d3d8;
  --accent: #0b0a1c;
  --accent-text: #ffffff;
  --success: #38c867;
  --shadow: 0 22px 70px rgba(20, 20, 32, 0.12);
  --max: 1120px;
  --radius: 16px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0d;
  --surface: #111114;
  --surface-strong: #1a1a1f;
  --text: #f6f6f8;
  --muted: #a4a4ad;
  --line: #29292f;
  --line-strong: #393940;
  --accent: #f7f7fa;
  --accent-text: #111114;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; min-width: 320px; overflow-x: hidden; color: var(--text); background: var(--bg); font-family: "Inter", sans-serif; font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; transition: color .25s ease, background .25s ease; }
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { color: var(--accent-text); background: var(--accent); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 1rem; left: 1rem; z-index: 999; padding: .7rem 1rem; color: var(--accent-text); background: var(--accent); border-radius: 10px; transform: translateY(-180%); }
.skip-link:focus { transform: none; }

.site-header { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.nav-shell { display: flex; width: min(calc(100% - 2rem), var(--max)); min-height: 74px; align-items: center; justify-content: space-between; margin: 0 auto; }
.brand { font-size: .98rem; font-weight: 600; letter-spacing: -.02em; }
.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav > a { position: relative; color: var(--muted); font-size: .84rem; transition: color .2s ease; }
.site-nav > a::after { position: absolute; right: 0; bottom: -.55rem; left: 0; height: 1px; content: ""; background: var(--text); transform: scaleX(0); transition: transform .2s ease; }
.site-nav > a:hover, .site-nav > a:focus-visible, .site-nav > a.is-active { color: var(--text); }
.site-nav > a.is-active::after { transform: scaleX(1); }
.theme-toggle, .menu-toggle { display: grid; place-items: center; background: transparent; border: 0; cursor: pointer; }
.theme-toggle { width: 2rem; height: 2rem; border-radius: 50%; }
.theme-toggle:hover { background: var(--surface-strong); }
.theme-toggle svg { width: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-toggle { display: none; }

.section { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; }
.hero { position: relative; display: grid; min-height: calc(100svh - 74px); grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: clamp(3rem, 8vw, 7rem); align-items: center; padding: 5rem 0 7rem; }
.availability { display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 1.5rem; padding: .48rem .76rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: .76rem; font-weight: 500; }
.availability span, .portrait-status span { width: .55rem; height: .55rem; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 15%, transparent); }
.hero h1 { margin: 0; font-size: clamp(3.5rem, 6.2vw, 5.75rem); font-weight: 500; line-height: .98; letter-spacing: -.075em; }
.hero h1 strong { font-weight: 650; }
.hero-lead { max-width: 660px; margin: 1.8rem 0 0; color: var(--muted); font-size: clamp(1.25rem, 2vw, 1.62rem); line-height: 1.45; letter-spacing: -.025em; }
.hero-lead b { color: var(--text); font-weight: 600; }
.hero-note { max-width: 600px; margin: 1rem 0 0; color: var(--muted); font-size: .98rem; }
.hero-actions, .contact-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: .74rem 1.35rem; border: 1px solid var(--line-strong); border-radius: 8px; font-size: .84rem; font-weight: 600; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,20,30,.1); }
.button-primary { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.button-secondary { background: var(--bg); }
.social-links { display: flex; gap: .7rem; margin-top: 1.6rem; }
.social-links a { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; transition: transform .2s ease, background .2s ease; }
.social-links a:hover { background: var(--surface-strong); transform: translateY(-2px); }
.social-links svg { width: 1.1rem; fill: currentColor; }
.hero-stats { display: grid; max-width: 560px; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 3.2rem 0 0; }
.hero-stats div { min-width: 0; }
.hero-stats dt { font-size: clamp(1.75rem, 3vw, 2.45rem); font-weight: 500; line-height: 1; letter-spacing: -.045em; }
.hero-stats dd { margin: .55rem 0 0; color: var(--muted); font-size: .74rem; }
.portrait-wrap { position: relative; justify-self: center; }
.portrait-halo { position: absolute; inset: -7%; background: radial-gradient(circle, color-mix(in srgb, var(--text) 8%, transparent), transparent 68%); filter: blur(18px); }
.portrait-frame { position: relative; width: min(38vw, 390px); overflow: hidden; aspect-ratio: 1; background: #e9e9ec; border: 5px solid var(--bg); border-radius: 50%; box-shadow: var(--shadow); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait-status { position: absolute; right: -1.4rem; bottom: 1.9rem; display: flex; align-items: center; gap: .75rem; padding: 1rem 1.15rem; background: var(--bg); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); font-size: .78rem; font-weight: 500; }
.scroll-cue { position: absolute; bottom: 1.5rem; left: 50%; display: flex; flex-direction: column; align-items: center; gap: .2rem; color: var(--muted); font-size: .72rem; transform: translateX(-50%); }
.scroll-cue span { color: var(--text); font-size: 1.2rem; animation: bob 1.8s ease-in-out infinite; }

.section-block { padding: 7rem 0; border-top: 1px solid var(--line); }
.section-heading { max-width: 700px; margin: 0 auto 3.5rem; text-align: center; }
.section-heading h2 { margin: 0; font-size: clamp(2.1rem, 4vw, 3.2rem); font-weight: 650; line-height: 1.08; letter-spacing: -.055em; }
.section-heading p { margin: 1rem auto 0; color: var(--muted); font-size: .98rem; }
.section-heading .section-kicker { margin: 0 0 .65rem; color: var(--accent); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; }

.skill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.skill-card { min-height: 150px; padding: 1.4rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.skill-card:hover { border-color: var(--line-strong); box-shadow: 0 14px 38px rgba(20,20,30,.07); transform: translateY(-3px); }
.skill-card h3 { display: flex; align-items: center; gap: .75rem; margin: 0; font-size: .92rem; font-weight: 550; }
.skill-card h3 span { display: grid; width: 1.5rem; place-content: center; font-size: 1rem; }
.skill-card ul, .tag-list { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.skill-card li, .tag-list li { padding: .25rem .5rem; color: var(--text); background: var(--surface-strong); border-radius: 6px; font-size: .7rem; line-height: 1.2; }

.journey-section { display: grid; gap: 0; }
.journey-group { scroll-margin-top: 96px; }
.journey-group + .journey-group { padding-top: 5rem; border-top: 1px solid var(--line); }
.journey-list { display: grid; max-width: 900px; gap: 1rem; margin: 0 auto; }
.journey-card { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 2rem; padding: 1.65rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.journey-label { margin: 0 0 .35rem; color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.journey-card h3 { margin: 0; font-size: 1.04rem; font-weight: 600; }
.journey-card strong { display: block; margin-top: .15rem; font-size: .82rem; font-weight: 500; }
.journey-meta { display: flex; flex-direction: column; gap: .3rem; align-items: flex-end; color: var(--muted); font-size: .78rem; }
.journey-copy { grid-column: 1 / -1; margin: .25rem 0 -1rem; color: var(--muted); font-size: .9rem; }
.journey-card .tag-list { grid-column: 1 / -1; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.project-card { display: flex; min-width: 0; overflow: hidden; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.project-card:hover { border-color: var(--line-strong); box-shadow: 0 18px 44px rgba(20,20,30,.09); transform: translateY(-5px); }
.project-image { display: block; overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-strong); border-bottom: 1px solid var(--line); }
.project-image img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s ease; }
.project-card:hover .project-image img { transform: scale(1.035); }
.project-content { display: flex; flex: 1; flex-direction: column; padding: 1.35rem; }
.project-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .68rem; }
.project-content h3 { margin: .75rem 0 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -.02em; }
.project-content > p { margin: 1rem 0 0; color: var(--muted); font-size: .86rem; line-height: 1.58; }
.project-content .tag-list { margin-top: 1.1rem; }
.project-links { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: auto; padding-top: 1.35rem; }
.project-links a { padding: .48rem .78rem; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; font-size: .72rem; font-weight: 600; }
.project-links a:last-child:not(:first-child) { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.center-link { display: flex; justify-content: center; margin-top: 2rem; }
.content-notice { grid-column: 1 / -1; padding: 2rem; color: var(--muted); text-align: center; border: 1px solid var(--line); border-radius: var(--radius); }

.credential-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.credential-card { display: flex; min-height: 220px; flex-direction: column; padding: 1.5rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.credential-card:first-child { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.credential-number { color: var(--muted); font-size: .7rem; }
.credential-card:first-child .credential-number, .credential-card:first-child .credential-meta { color: color-mix(in srgb, var(--accent-text) 70%, transparent); }
.credential-issuer { margin: auto 0 .55rem; color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.credential-card:first-child .credential-issuer { color: color-mix(in srgb, var(--accent-text) 72%, transparent); }
.credential-card h3 { margin: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.3; }
.credential-meta { display: flex; justify-content: space-between; gap: .8rem; margin-top: 1.2rem; padding-top: 1rem; color: var(--muted); border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent); font-size: .67rem; }

.contact-grid { display: grid; max-width: 900px; grid-template-columns: .9fr 1.1fr; gap: 2rem; margin: 0 auto; }
.contact-list { display: grid; gap: 1rem; }
.contact-card { display: flex; min-height: 92px; align-items: center; gap: 1rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); }
a.contact-card:hover { border-color: var(--line-strong); background: var(--surface); }
.contact-icon { display: grid; width: 2.2rem; height: 2.2rem; flex: 0 0 auto; place-items: center; background: var(--surface-strong); border-radius: 50%; font-size: .72rem; font-weight: 700; }
.contact-card b, .contact-card small { display: block; }
.contact-card b { font-size: .85rem; }
.contact-card small { margin-top: .2rem; color: var(--muted); font-size: .76rem; }
.contact-cta { display: flex; min-height: 308px; flex-direction: column; justify-content: center; padding: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.eyebrow { margin: 0; color: var(--muted); font-size: .7rem; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; }
.contact-cta h3 { margin: .65rem 0 0; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.08; letter-spacing: -.045em; }
.contact-cta > p:not(.eyebrow) { margin: 1rem 0 0; color: var(--muted); font-size: .9rem; }

.site-footer { display: flex; width: min(calc(100% - 2rem), var(--max)); align-items: center; justify-content: space-between; gap: 1rem; margin: 0 auto; padding: 2.5rem 0; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; color: var(--muted); font-size: .72rem; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .65s ease, transform .65s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

@media (max-width: 980px) {
  .site-nav { gap: 1.25rem; }
  .hero { grid-template-columns: 1fr .8fr; gap: 2.5rem; }
  .hero h1 { font-size: clamp(3.2rem, 8vw, 4.8rem); }
  .portrait-frame { width: min(39vw, 350px); }
  .skill-grid, .project-grid, .credential-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 70px; }
  .nav-shell { min-height: 66px; }
  .menu-toggle { display: grid; width: 2.5rem; height: 2.5rem; align-content: center; gap: .28rem; }
  .menu-toggle > span:not(.sr-only) { display: block; width: 1.05rem; height: 1px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
  .menu-toggle[aria-expanded="true"] > span:first-child { transform: translateY(.29rem) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] > span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] > span:nth-child(3) { transform: translateY(-.29rem) rotate(-45deg); }
  .site-nav { position: fixed; inset: 66px 0 auto; display: grid; gap: 0; padding: 1rem; background: var(--bg); border-bottom: 1px solid var(--line); visibility: hidden; opacity: 0; transform: translateY(-10px); transition: opacity .2s ease, transform .2s ease, visibility .2s; }
  .site-nav.is-open { visibility: visible; opacity: 1; transform: none; }
  .site-nav > a { padding: .8rem; font-size: 1rem; }
  .site-nav > a::after { display: none; }
  .theme-toggle { margin: .5rem 0 .5rem .55rem; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 4rem 0 7rem; text-align: center; }
  .hero-copy { display: flex; align-items: center; flex-direction: column; }
  .hero-note { max-width: 560px; }
  .portrait-wrap { grid-row: 1; }
  .portrait-frame { width: min(72vw, 330px); }
  .portrait-status { right: -1rem; }
  .hero-stats { width: 100%; }
  .scroll-cue { bottom: 1rem; }
  .section-block { padding: 5.5rem 0; }
  .journey-card { grid-template-columns: 1fr; gap: .8rem; }
  .journey-meta { align-items: flex-start; }
  .journey-copy, .journey-card .tag-list { grid-column: auto; }
  .journey-copy { margin: .25rem 0 -1rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; text-align: center; }
}

@media (max-width: 560px) {
  .section, .nav-shell, .site-footer { width: min(calc(100% - 1.5rem), var(--max)); }
  .hero h1 { font-size: clamp(3rem, 15vw, 4.4rem); }
  .hero-lead { font-size: 1.15rem; }
  .hero-actions, .contact-actions { width: 100%; }
  .hero-actions .button, .contact-actions .button { width: 100%; }
  .hero-stats { gap: .5rem; }
  .hero-stats dt { font-size: 1.8rem; }
  .hero-stats dd { font-size: .62rem; }
  .skill-grid, .project-grid, .credential-grid { grid-template-columns: 1fr; }
  .credential-card { min-height: 200px; }
  .contact-card small { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
