
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #eef4fb;
  --ink: #142033;
  --muted: #5a687a;
  --muted-2: #738092;
  --line: #dce5ef;
  --brand: #0b2447;
  --brand-2: #155e75;
  --accent: #0f766e;
  --accent-soft: #def7f4;
  --shadow: 0 24px 60px rgba(20, 32, 51, 0.10);
  --shadow-soft: 0 12px 30px rgba(20, 32, 51, 0.08);
  --radius-lg: 28px;
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1160px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --bg: #08111f;
  --surface: #0f172a;
  --surface-soft: #152238;
  --ink: #eef5ff;
  --muted: #b7c4d6;
  --muted-2: #91a1b6;
  --line: rgba(172, 193, 216, 0.22);
  --brand: #7dd3fc;
  --brand-2: #5eead4;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.12), transparent 32rem),
    linear-gradient(180deg, #08111f 0%, #0b1220 22rem);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 32rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 22rem);
  line-height: 1.65;
}
body.modal-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 9999; padding: .75rem 1rem; background: var(--brand); color: #fff; }
.skip-link:focus { left: 1rem; top: 1rem; }
.container { width: min(100% - 2rem, var(--container)); margin: 0 auto; }
.narrow { max-width: 860px; }
.section-pad { padding: 5.5rem 0; }
.surface-section { background: color-mix(in srgb, var(--surface-soft) 72%, transparent); border-block: 1px solid var(--line); }
.site-header { position: sticky; top: 0; z-index: 1000; background: color-mix(in srgb, var(--surface) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.nav-shell { width: min(100% - 2rem, var(--container)); margin: 0 auto; min-height: 76px; display: flex; align-items: center; justify-content: flex-start; gap: .75rem; }
.brand { order: 1; }
.site-nav { order: 2; margin-left: auto; }
.theme-toggle { order: 3; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 40px; padding: .55rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 800; font-size: .88rem; cursor: pointer; box-shadow: var(--shadow-soft); transition: transform 160ms ease, background 160ms ease, border-color 160ms ease; }
.theme-toggle:hover, .theme-toggle:focus-visible { transform: translateY(-1px); background: var(--surface-soft); outline: none; }
.nav-toggle { order: 4; }
.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-weight: 800; letter-spacing: -.04em; box-shadow: var(--shadow-soft); }
.brand strong { display: block; line-height: 1.1; }
.brand small { display: block; color: var(--muted); line-height: 1.2; margin-top: .12rem; }
.site-nav { display: flex; align-items: center; gap: .15rem; }
.nav-link { text-decoration: none; color: var(--muted); font-weight: 650; font-size: .93rem; padding: .65rem .72rem; border-radius: 999px; transition: color 160ms ease, background 160ms ease; }
.nav-link:hover, .nav-link:focus-visible { color: var(--brand); background: var(--surface-soft); outline: none; }
.nav-link.active { color: var(--brand); background: var(--accent-soft); }
.nav-toggle { display: none; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--brand); margin: 5px auto; border-radius: 99px; }
.hero-section { padding-top: 4.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 2.4rem; align-items: center; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 800; margin: 0 0 .8rem; }
h1, h2, h3 { line-height: 1.12; margin-top: 0; color: var(--ink); }
h1 { font-size: clamp(2.55rem, 5.8vw, 5.2rem); letter-spacing: -.07em; margin-bottom: .85rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); letter-spacing: -.04em; }
h3 { font-size: 1.12rem; letter-spacing: -.02em; }
.hero-title { font-weight: 750; color: var(--brand-2); font-size: clamp(1.15rem, 2vw, 1.45rem); margin: 0 0 1rem; }
.hero-lead, .page-hero p, .section-intro { font-size: 1.08rem; color: var(--muted); max-width: 72ch; }
.hero-actions, .panel-actions, .contact-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.7rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 999px; padding: .72rem 1.05rem; border: 1px solid transparent; text-decoration: none; font-weight: 750; cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease; }
.btn:hover, .btn:focus-visible { transform: translateY(-2px); outline: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-soft); }
.btn-primary:hover, .btn-primary:focus-visible { background: #11325d; }
.btn-secondary { background: var(--surface); color: var(--brand); border-color: var(--line); box-shadow: var(--shadow-soft); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn-small { min-height: 38px; padding: .55rem .85rem; font-size: .9rem; }
.text-link { color: var(--brand-2); font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.strength-strip, .tag-list, .course-list, .skills-highlight-list { display: flex; flex-wrap: wrap; gap: .55rem; }
.strength-strip { margin-top: 2rem; }
.strength-strip span, .tag-list span, .course-list span, .skills-highlight-list span { display: inline-flex; align-items: center; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 78%, transparent); color: var(--brand); font-weight: 700; font-size: .88rem; padding: .42rem .68rem; border-radius: 999px; }
.hero-card, .profile-panel, .education-card, .contact-card, .diagram-card, .info-card, .metric-card, .project-card, .skill-group, .skill-feature, .experience-card { background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow-soft); border-radius: var(--radius-lg); }
.hero-card { padding: 1rem; }
.quick-card { padding: 1.35rem; }
.quick-card h2 { font-size: 1.35rem; margin-bottom: 1.15rem; }
.profile-photo { width: 100%; border-radius: 22px; background: var(--surface-soft); border: 1px solid var(--line); object-fit: cover; }
.profile-photo.large { border-radius: 50%; width: 190px; height: 190px; margin: 0 auto 1rem; }
.quick-facts, .detail-list { display: grid; gap: .75rem; margin: 0; }
.quick-facts div, .detail-list div { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); }
dt { color: var(--muted); font-weight: 700; }
dd { margin: 0; font-weight: 700; color: var(--ink); }
.section-heading { text-align: center; max-width: 780px; margin: 0 auto 2rem; }
.section-heading.left { text-align: left; margin-left: 0; }
.section-heading p { color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.metric-card { padding: 1.35rem; }
.metric-card strong { display: block; font-size: 2rem; color: var(--brand); line-height: 1; }
.metric-card span { color: var(--muted); font-weight: 700; }
.split-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 2rem; align-items: start; }
.featured-list { display: grid; gap: .85rem; }
.featured-list a { display: grid; gap: .25rem; padding: 1.15rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow-soft); transition: transform 160ms ease, border-color 160ms ease; }
.featured-list a:hover { transform: translateY(-2px); border-color: rgba(15,118,110,.35); }
.featured-list span { font-weight: 800; color: var(--brand); }
.featured-list small { color: var(--muted); font-weight: 650; }
.cta-section { padding-top: 0; }
.cta-card { background: linear-gradient(135deg, var(--brand), #123c69); color: #fff; border-radius: var(--radius-lg); padding: 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; box-shadow: var(--shadow); }
.cta-card h2, .cta-card .eyebrow { color: #fff; }
.cta-card p { color: rgba(255,255,255,.78); margin-bottom: 0; }
.cta-card .btn-primary { background: var(--surface); color: var(--brand); }
.page-hero { padding-bottom: 3rem; }
.page-hero h1 { font-size: clamp(2.25rem, 4vw, 4rem); max-width: 980px; }
.content-grid { display: grid; grid-template-columns: 330px 1fr; gap: 2rem; align-items: start; }
.profile-panel { padding: 1.35rem; text-align: center; position: sticky; top: 96px; }
.profile-panel p { color: var(--muted); }
.prose { max-width: 76ch; }
.prose h2 { font-size: 1.65rem; margin-top: 2rem; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--muted); }
.academic-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 1.2rem; align-items: start; }
.education-card { padding: 1.5rem; }
.note, .form-note { color: var(--muted-2); font-size: .95rem; }
.experience-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.experience-card { padding: 1.25rem; display: grid; grid-template-columns: 72px 1fr; gap: 1rem; align-items: start; }
.experience-card.feature:first-child { grid-column: 1 / -1; }
.experience-card ul { margin-bottom: 0; color: var(--muted); padding-left: 1.25rem; }
.experience-card p { color: var(--muted); }
.experience-logo { width: 72px; height: 72px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; padding: .65rem; }
.experience-logo.small { width: 58px; height: 58px; border-radius: 16px; }
.experience-logo img { max-height: 100%; object-fit: contain; }
.experience-card.compact { grid-template-columns: 58px 1fr; padding: 1rem; border-radius: var(--radius); }
.experience-card.compact h2 { font-size: 1.12rem; }

.experience-timeline { position: relative; max-width: 980px; }
.experience-timeline::before { content: ""; position: absolute; left: 35px; top: .7rem; bottom: .7rem; width: 2px; border-radius: 999px; background: linear-gradient(180deg, rgba(11,36,71,.18), rgba(15,118,110,.55), rgba(11,36,71,.18)); }
.timeline-item { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 1rem; margin-bottom: 1.05rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot { position: relative; z-index: 1; align-self: start; justify-self: center; margin-top: 1.95rem; width: 18px; height: 18px; border-radius: 999px; background: var(--accent); border: 4px solid #fff; box-shadow: 0 0 0 1px rgba(15,118,110,.22), var(--shadow-soft); }
.timeline-dot.small-dot { width: 14px; height: 14px; margin-top: 1.75rem; background: var(--brand-2); }
.timeline-card { width: 100%; }
.experience-timeline .experience-card { grid-template-columns: 72px 1fr; }
.experience-timeline .experience-card.compact { grid-template-columns: 58px 1fr; max-width: 900px; padding: .95rem 1rem; }
.experience-timeline .experience-card.compact p { margin-bottom: 0; }

.card-grid { display: grid; gap: 1rem; }
.two-col { grid-template-columns: repeat(2, 1fr); }
.three-col { grid-template-columns: repeat(3, 1fr); }
.info-card { padding: 1.4rem; }
.info-card p { color: var(--muted); margin-bottom: 0; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.6rem; }
.filter-button { border: 1px solid var(--line); background: var(--surface); color: var(--brand); padding: .62rem .9rem; border-radius: 999px; font-weight: 800; cursor: pointer; transition: 150ms ease; }
.filter-button:hover, .filter-button:focus-visible { transform: translateY(-1px); outline: none; border-color: rgba(15,118,110,.4); }
.filter-button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.project-card { overflow: hidden; display: flex; flex-direction: column; min-height: 100%; transition: transform 160ms ease, border-color 160ms ease; }
.project-card:hover { transform: translateY(-4px); border-color: rgba(15,118,110,.35); }
.project-media {
  height: 220px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1rem;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center !important;
}
.project-body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.project-body p { color: var(--muted); }
.project-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 .9rem; }
.project-meta span { background: var(--surface-soft); color: var(--brand); border-radius: 999px; padding: .25rem .5rem; font-size: .78rem; font-weight: 800; }
.project-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: auto; }
.secondary-projects { margin-top: 4rem; }
.compact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; }
.compact-project { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.compact-project h3 { font-size: 1rem; margin-bottom: .45rem; }
.compact-project p { color: var(--muted); font-size: .92rem; margin-bottom: .9rem; }
.modal { position: fixed; inset: 0; z-index: 2000; display: none; }
.modal.active { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(11,36,71,.72); backdrop-filter: blur(10px); }
.modal-panel { position: relative; width: min(920px, calc(100% - 2rem)); max-height: min(86vh, 900px); overflow: auto; margin: 7vh auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1.5rem; }
.modal-close { position: sticky; top: 0; margin-left: auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--brand); font-size: 1.8rem; z-index: 2; }
.modal-hero { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.25rem; align-items: center; margin-top: -1rem; }
.modal-hero img { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-soft); width: 100%; height: 360px; object-fit: contain !important; object-position: center; padding: 1rem; }
.modal-section-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.2rem; }
.modal-section { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--surface-soft); }
.modal-section h3 { color: var(--brand); }
.modal-section p, .modal-section li { color: var(--muted); }
.modal-wide { margin-top: 1rem; }
.skills-layout { display: grid; grid-template-columns: .78fr 1.22fr; gap: 1.2rem; align-items: start; }
.skill-feature { padding: 1.6rem; position: sticky; top: 96px; }
.skill-feature p { color: var(--muted); }
.skills-catalogue { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.compact-skills { grid-template-columns: 1fr; }
.skill-group { padding: 1.25rem; border-radius: var(--radius); }
.skill-group h2 { font-size: 1.18rem; margin-bottom: .8rem; }
.thesis-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: start; }
.diagram-card { padding: 1rem; position: sticky; top: 96px; }
.diagram-card img { border-radius: var(--radius); background: var(--surface-soft); border: 1px solid var(--line); margin-bottom: 1rem; }
.contact-showcase { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.2rem; align-items: stretch; }
.main-contact-card, .contact-side-card { padding: 1.7rem; }
.contact-email { font-size: 1.1rem; font-weight: 750; color: var(--brand-2); }
.contact-actions.horizontal { flex-direction: row; align-items: center; }
.site-footer { background: var(--brand); color: #fff; padding: 2.6rem 0 1.4rem; margin-top: 3rem; }
.footer-inner { width: min(100% - 2rem, var(--container)); margin: 0 auto; display: flex; justify-content: space-between; gap: 2rem; align-items: start; }
.footer-inner p, .copyright { color: rgba(255,255,255,.74); max-width: 66ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: .8rem; }
.footer-links a { color: #fff; text-decoration: none; font-weight: 750; }
.footer-links a:hover { text-decoration: underline; }
.copyright { width: min(100% - 2rem, var(--container)); margin: 1.5rem auto 0; font-size: .92rem; }
/* Dark mode component overrides */
html[data-theme="dark"] .brand-mark,
html[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #0f766e, #164e63);
  color: #ffffff;
}
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .site-footer {
  background: #050b14;
}
html[data-theme="dark"] .cta-card {
  background: linear-gradient(135deg, #06101e, #0f2b3c);
  border: 1px solid var(--line);
}
html[data-theme="dark"] .cta-card .btn-primary {
  background: #ffffff;
  color: #0b2447;
}
html[data-theme="dark"] .modal-backdrop {
  background: rgba(2, 6, 12, .78);
}
html[data-theme="dark"] .project-meta span,
html[data-theme="dark"] .strength-strip span,
html[data-theme="dark"] .tag-list span,
html[data-theme="dark"] .course-list span,
html[data-theme="dark"] .skills-highlight-list span {
  color: var(--ink);
  background: var(--surface-soft);
}

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 500ms ease, transform 500ms ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } .reveal { opacity: 1; transform: none; } }
@media (max-width: 1040px) {
  .nav-toggle { display: block; margin-left: 0; }
  .theme-toggle { order: 3; }
  .nav-toggle { order: 4; }
  .site-nav { order: 5; margin-left: 0; position: fixed; left: 1rem; right: 1rem; top: 84px; display: none; flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .nav-link { padding: .85rem 1rem; }
  .hero-grid, .content-grid, .split-layout, .thesis-grid, .academic-grid, .contact-showcase, .skills-layout { grid-template-columns: 1fr; }
  .profile-panel, .diagram-card, .skill-feature { position: static; }
  .metric-grid, .compact-grid { grid-template-columns: repeat(2, 1fr); }
  .three-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .section-pad { padding: 3.5rem 0; }
  .project-media { height: 185px; padding: .75rem; }
  .modal-hero img { height: 260px; }
  .hero-section { padding-top: 3rem; }
  h1 { font-size: clamp(2.3rem, 14vw, 3.45rem); }
  .hero-actions .btn, .panel-actions .btn { width: 100%; }
  .metric-grid, .project-grid, .skills-catalogue, .two-col, .compact-grid, .modal-section-grid, .modal-hero, .experience-cards { grid-template-columns: 1fr; }
  .quick-facts div, .detail-list div { grid-template-columns: 1fr; gap: .2rem; }
  .cta-card, .footer-inner { flex-direction: column; }
  .modal-panel { margin: 4vh auto; max-height: 92vh; padding: 1rem; }
  .experience-card.feature:first-child { grid-column: auto; }
  .experience-card, .experience-card.compact { grid-template-columns: 1fr; }
  .experience-timeline::before { left: 13px; }
  .timeline-item { grid-template-columns: 28px minmax(0, 1fr); gap: .75rem; }
  .timeline-dot, .timeline-dot.small-dot { justify-self: start; margin-left: 6px; }
  .experience-timeline .experience-card, .experience-timeline .experience-card.compact { grid-template-columns: 1fr; }
}
