:root {
  --bg: #07111f;
  --bg-elevated: #0b1728;
  --bg-soft: #0d1c30;
  --surface: rgba(17, 32, 51, 0.78);
  --surface-solid: #112033;
  --text: #f4f7fb;
  --text-muted: #a9b6c7;
  --heading: #ffffff;
  --border: rgba(158, 177, 199, 0.18);
  --accent: #65e6c4;
  --accent-strong: #25cda1;
  --accent-blue: #77a8ff;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  --header-bg: rgba(7, 17, 31, 0.82);
  --max-width: 1180px;
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --bg-soft: #eaf0f7;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --text: #213047;
  --text-muted: #5e6c7d;
  --heading: #07111f;
  --border: rgba(20, 45, 75, 0.13);
  --accent: #087d68;
  --accent-strong: #006b57;
  --accent-blue: #316dd9;
  --shadow: 0 24px 60px rgba(32, 54, 80, 0.14);
  --header-bg: rgba(244, 247, 251, 0.86);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .24;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 65%);
  z-index: -1;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 9999;
  padding: 10px 14px;
  background: var(--accent);
  color: #07111f;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
}
.skip-link:focus { top: 16px; }

.container { width: min(calc(100% - 40px), var(--max-width)); margin-inline: auto; }
.section { position: relative; padding: 112px 0; overflow: clip; }
.section-muted { background: var(--bg-elevated); border-block: 1px solid var(--border); }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: #07111f; background: linear-gradient(135deg, var(--accent), #92ddff); font-size: .84rem; box-shadow: 0 10px 30px rgba(75, 220, 187, .2); }
.brand-name { color: var(--heading); }
.nav-links { display: flex; align-items: center; gap: 25px; }
.nav-links > a { position: relative; color: var(--text-muted); font-size: .92rem; font-weight: 650; text-decoration: none; }
.nav-links > a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -8px; height: 2px; background: var(--accent); transition: right .2s ease; }
.nav-links > a:hover, .nav-links > a:focus-visible { color: var(--heading); }
.nav-links > a:hover::after, .nav-links > a:focus-visible::after { right: 0; }

.theme-toggle, .nav-toggle { border: 0; cursor: pointer; color: var(--text); background: transparent; }
.theme-toggle { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 12px; }
.theme-toggle:hover { background: var(--bg-soft); }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .sun-icon { display: block; }
html[data-theme="dark"] .moon-icon { display: none; }
html[data-theme="light"] .sun-icon { display: none; }
html[data-theme="light"] .moon-icon { display: block; }
.nav-toggle { display: none; width: 42px; height: 42px; padding: 9px; }
.nav-toggle span { display: block; height: 2px; margin: 5px 0; background: currentColor; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }

.hero { min-height: 100vh; padding-top: 166px; display: block; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(360px, .86fr); align-items: center; gap: 80px; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 15%, transparent); }
.hero h1 { max-width: 770px; margin: 0; color: var(--heading); font-size: clamp(3.25rem, 6.2vw, 6.4rem); line-height: .99; letter-spacing: -.066em; }
.hero h1 span { color: transparent; background: linear-gradient(100deg, var(--accent), #8cb6ff 68%, var(--accent-blue)); background-clip: text; -webkit-background-clip: text; }
.hero-lead { max-width: 700px; margin: 28px 0 0; color: var(--text-muted); font-size: clamp(1.05rem, 1.7vw, 1.23rem); }
.hero-actions, .contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 20px; border: 1px solid transparent; border-radius: 13px; font-size: .92rem; font-weight: 800; text-decoration: none; transition: transform .18s ease, background-color .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--accent); color: #07111f; box-shadow: 0 14px 36px color-mix(in srgb, var(--accent) 22%, transparent); }
.button-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.button-secondary { color: var(--heading); border-color: var(--border); background: var(--surface); }
.button-secondary:hover { border-color: color-mix(in srgb, var(--accent) 58%, var(--border)); }
.hero-links { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 31px; }
.hero-links a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-weight: 700; font-size: .9rem; text-decoration: none; }
.hero-links a:hover { color: var(--heading); }
.hero-links svg { width: 18px; height: 18px; fill: currentColor; }

.hero-visual { position: relative; min-height: 520px; display: grid; place-items: center; }
.orbit-card { position: relative; width: min(440px, 100%); aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: radial-gradient(circle at center, color-mix(in srgb, var(--accent) 9%, transparent), transparent 62%); }
.orbit-card::before, .orbit-card::after { content: ""; position: absolute; inset: 12%; border: 1px dashed color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 50%; animation: spin 30s linear infinite; }
.orbit-card::after { inset: 26%; animation-direction: reverse; animation-duration: 22s; }
.profile-portrait { position: relative; z-index: 2; width: 172px; height: 172px; padding: 5px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 54%, var(--border)); border-radius: 42px; background: linear-gradient(145deg, var(--accent), #8aafff); box-shadow: 0 28px 70px color-mix(in srgb, var(--accent) 22%, transparent); transform: rotate(-4deg); }
.profile-portrait img { display: block; width: 100%; height: 100%; border-radius: 37px; object-fit: cover; object-position: center; }
.orbit { position: absolute; z-index: 3; display: grid; place-items: center; width: 60px; height: 60px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface-solid); box-shadow: var(--shadow); color: var(--heading); font-size: .78rem; font-weight: 900; letter-spacing: .08em; }
.orbit-one { top: 4%; right: 17%; transform: rotate(5deg); }
.orbit-two { bottom: 12%; left: 2%; transform: rotate(-8deg); }
.orbit-three { bottom: 7%; right: 9%; transform: rotate(7deg); }
.terminal-card { position: absolute; left: -4%; top: 12%; z-index: 4; width: 250px; padding: 13px 16px 18px; border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--bg-elevated) 88%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(16px); transform: rotate(-4deg); }
.terminal-top { display: flex; gap: 5px; margin-bottom: 12px; }
.terminal-top i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.terminal-card code { color: var(--text-muted); font-family: "SFMono-Regular", Consolas, monospace; font-size: .74rem; line-height: 1.8; }
.terminal-card code span { color: var(--accent); }
.hero-glow { position: absolute; border-radius: 50%; filter: blur(4px); pointer-events: none; }
.hero-glow-one { width: 420px; height: 420px; left: -180px; top: 20%; background: radial-gradient(circle, color-mix(in srgb, var(--accent-blue) 15%, transparent), transparent 70%); }
.hero-glow-two { width: 520px; height: 520px; right: -220px; top: 3%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); }
.hero-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 82px; border-block: 1px solid var(--border); }
.hero-metrics div { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 15px; min-height: 100px; padding: 22px 28px; border-right: 1px solid var(--border); }
.hero-metrics div:last-child { border-right: 0; }
.hero-metrics strong { color: var(--heading); font-size: 1.72rem; letter-spacing: -.04em; white-space: nowrap; }
.hero-metrics span { color: var(--text-muted); font-size: .86rem; line-height: 1.4; }

.section-heading { margin-bottom: 48px; }
.section-heading h2 { max-width: 720px; margin: 0; color: var(--heading); font-size: clamp(2.25rem, 4.5vw, 4.4rem); line-height: 1.05; letter-spacing: -.055em; }
.two-column { display: grid; grid-template-columns: .8fr 1.2fr; gap: 80px; align-items: start; }
.about-copy { max-width: 720px; }
.about-copy p { margin: 0 0 22px; color: var(--text-muted); font-size: 1.08rem; }
.focus-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.focus-list span, .tags span { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--surface-solid) 70%, transparent); color: var(--text-muted); font-size: .76rem; font-weight: 750; }
.focus-list span { color: var(--heading); min-height: 36px; padding-inline: 14px; }

.project-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; }
.text-link { flex: none; color: var(--accent); font-weight: 800; text-decoration: none; }
.text-link:hover span { display: inline-block; transform: translate(2px, -2px); }
.project { border: 1px solid var(--border); border-radius: 26px; background: var(--surface); box-shadow: 0 16px 60px rgba(0,0,0,.08); overflow: hidden; }
.project-featured { display: grid; grid-template-columns: 1.12fr .88fr; margin-bottom: 28px; }
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.project-card { display: flex; flex-direction: column; }
.project-media { position: relative; overflow: hidden; min-height: 300px; background: #0b1220; }
.project-featured .project-media { min-height: 100%; }
.project-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(7,17,31,.28), transparent 45%); pointer-events: none; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.project-card .project-media img { aspect-ratio: 16/10; }
.project:hover .project-media img { transform: scale(1.025); }
.project-content { position: relative; padding: 38px; }
.project-card .project-content { display: flex; flex-direction: column; flex: 1; }
.project-number { position: absolute; right: 30px; top: 25px; color: color-mix(in srgb, var(--accent) 58%, transparent); font-size: 3.6rem; font-weight: 900; line-height: 1; letter-spacing: -.08em; opacity: .45; }
.project-type { margin: 0 0 10px; color: var(--accent); font-size: .74rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.project h3 { max-width: 82%; margin: 0; color: var(--heading); font-size: clamp(1.55rem, 2.6vw, 2.45rem); line-height: 1.1; letter-spacing: -.04em; }
.project-content > p:not(.project-type) { margin: 20px 0 0; color: var(--text-muted); }
.project-points { margin: 22px 0 0; padding: 0; list-style: none; color: var(--text-muted); }
.project-points li { position: relative; margin: 10px 0; padding-left: 20px; }
.project-points li::before { content: ""; position: absolute; left: 0; top: .68em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.button-project { align-self: flex-start; margin-top: 28px; border-color: var(--border); color: var(--heading); background: transparent; }
.button-project:hover { border-color: var(--accent); color: var(--accent); }
.project-card .button-project { margin-top: auto; padding-top: 0; }
.mini-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 22px; }
.mini-metrics div { padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--surface-solid) 64%, transparent); }
.mini-metrics strong { display: block; color: var(--heading); font-size: 1.1rem; }
.mini-metrics span { display: block; margin-top: 2px; color: var(--text-muted); font-size: .73rem; }

.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.skill-card { padding: 32px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); }
.skill-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, var(--surface-solid)); color: var(--accent); font-size: .8rem; font-weight: 900; }
.skill-card h3 { margin: 22px 0 10px; color: var(--heading); font-size: 1.25rem; }
.skill-card p { margin: 0; color: var(--text-muted); }

.experience-layout { display: grid; grid-template-columns: 1.05fr .95fr; gap: 88px; }
.timeline { position: relative; margin-left: 7px; padding-left: 31px; border-left: 1px solid var(--border); }
.timeline-item { position: relative; padding: 0 0 48px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker { position: absolute; left: -39px; top: 5px; width: 15px; height: 15px; border: 3px solid var(--bg); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.timeline-time { color: var(--accent); font-size: .75rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.timeline-item h3 { margin: 8px 0 2px; color: var(--heading); font-size: 1.26rem; }
.timeline-place { margin: 0 0 11px !important; color: var(--accent-blue) !important; font-weight: 750; }
.timeline-item p { margin: 0; color: var(--text-muted); }
.education-cards { display: grid; gap: 14px; }
.education-card, .award-card { padding: 27px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.education-card span { color: var(--accent); font-size: .75rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.education-card h3, .award-card h3 { margin: 9px 0 5px; color: var(--heading); font-size: 1.19rem; }
.education-card p, .award-card p { margin: 0; color: var(--text-muted); }
.education-card strong { display: inline-block; margin-top: 13px; color: var(--heading); font-size: .88rem; }
.award-card { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 10%, var(--surface-solid)), var(--surface)); }
.award-card .eyebrow { margin-bottom: 8px; }

.contact-section { padding-top: 48px; }
.contact-card { display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 55px; padding: 55px; border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border)); border-radius: 28px; background: radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--accent-blue) 12%, transparent), transparent 38%), linear-gradient(145deg, color-mix(in srgb, var(--accent) 8%, var(--surface-solid)), var(--surface)); box-shadow: var(--shadow); }
.contact-card h2 { margin: 0; color: var(--heading); font-size: clamp(2.3rem, 4.5vw, 4.3rem); line-height: 1; letter-spacing: -.055em; }
.contact-card p:not(.eyebrow) { max-width: 670px; margin: 20px 0 0; color: var(--text-muted); }
.contact-actions { justify-content: flex-end; margin: 0; }

.site-footer { border-top: 1px solid var(--border); }
.footer-inner { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--text-muted); font-size: .85rem; }
.footer-inner a { color: var(--heading); text-decoration: none; font-weight: 750; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .65s ease, transform .65s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .section { padding: 88px 0; }
  .hero { padding-top: 132px; }
  .hero-grid { grid-template-columns: 1fr; gap: 52px; }
  .hero-copy { max-width: 850px; }
  .hero-visual { min-height: 450px; }
  .project-featured, .experience-layout, .contact-card { grid-template-columns: 1fr; }
  .project-featured .project-media { min-height: 390px; }
  .contact-actions { justify-content: flex-start; }
  .two-column { gap: 50px; }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 28px), var(--max-width)); }
  .section { padding: 74px 0; }
  .brand-name { display: none; }
  .nav-toggle { display: block; }
  .nav-links { position: absolute; left: 14px; right: 14px; top: calc(100% + 8px); display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 12px; border: 1px solid var(--border); border-radius: 18px; background: var(--bg-elevated); box-shadow: var(--shadow); }
  .nav-links.is-open { display: flex; }
  .nav-links > a { padding: 12px 11px; border-radius: 10px; }
  .nav-links > a:hover { background: var(--bg-soft); }
  .nav-links > a::after { display: none; }
  .theme-toggle { margin: 8px 10px 4px; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hero { min-height: auto; padding-top: 124px; }
  .hero h1 { font-size: clamp(3rem, 15vw, 4.7rem); }
  .hero-visual { min-height: 390px; }
  .orbit-card { width: min(350px, 94vw); }
  .profile-portrait { width: 136px; height: 136px; border-radius: 34px; }
  .profile-portrait img { border-radius: 29px; }
  .terminal-card { left: 0; top: 6%; width: 215px; }
  .orbit { width: 52px; height: 52px; }
  .hero-metrics { grid-template-columns: 1fr; margin-top: 54px; }
  .hero-metrics div { border-right: 0; border-bottom: 1px solid var(--border); }
  .hero-metrics div:last-child { border-bottom: 0; }
  .two-column, .project-grid, .skills-grid { grid-template-columns: 1fr; }
  .project-heading { align-items: start; flex-direction: column; }
  .project-featured .project-media { min-height: 270px; }
  .project-content { padding: 29px 24px; }
  .project-number { right: 22px; top: 22px; font-size: 3rem; }
  .contact-card { padding: 34px 25px; }
  .footer-inner { padding: 24px 0; align-items: flex-start; flex-direction: column; }
}

@media (max-width: 460px) {
  .hero-actions .button, .contact-actions .button { width: 100%; }
  .hero-links { gap: 14px 20px; }
  .hero-visual { min-height: 345px; }
  .terminal-card { transform: rotate(-2deg) scale(.88); transform-origin: left top; }
  .orbit-two { bottom: 5%; }
  .mini-metrics { grid-template-columns: 1fr; }
}

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

/* User-supplied wind turbine diagram: preserve the full square illustration. */
.project-card:last-child .project-media { background: #ffffff; }
.project-card:last-child .project-media img { object-fit: contain; padding: 14px; background: #ffffff; }
