/* Portfolio styles — clean & modern. Colors are tokens on :root; edit them here. */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: #e8efff;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 6%);
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120;
    --bg-alt: #0f172a;
    --surface: #131c31;
    --text: #e6ebf5;
    --muted: #a3b0c7;
    --border: #243049;
    --accent: #7aa2ff;
    --accent-ink: #0b1120;
    --accent-soft: #1a2a4d;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --surface: #131c31;
  --text: #e6ebf5;
  --muted: #a3b0c7;
  --border: #243049;
  --accent: #7aa2ff;
  --accent-ink: #0b1120;
  --accent-soft: #1a2a4d;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; display: block; }

.wrap { width: min(1080px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2rem); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.icon { width: 1.15em; height: 1.15em; flex: none; }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.bar { display: flex; align-items: center; gap: 1.25rem; min-height: 3.5rem; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; margin-right: auto; white-space: nowrap; }
.bar nav ul { display: flex; gap: 1.1rem; }
.bar nav a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; }
.bar nav a:hover { color: var(--text); }
.theme {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); cursor: pointer;
}
.theme .to-light { display: none; }
:root[data-theme="dark"] .theme .to-dark { display: none; }
:root[data-theme="dark"] .theme .to-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .to-dark { display: none; }
  :root:not([data-theme="light"]) .theme .to-light { display: inline; }
}

/* Hero */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 2.5rem; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .95rem; margin-bottom: .75rem; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); font-weight: 800; }
.headline { font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: var(--accent); font-weight: 600; margin: .6rem 0 1rem; }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 36rem; }
.portrait {
  width: clamp(200px, 28vw, 340px); height: auto; aspect-ratio: 1; object-fit: cover;
  border-radius: 28px; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem; border-radius: 10px; font-weight: 600; font-size: .98rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.highlights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 3rem; }
.highlights li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .15rem;
}
.highlights strong { font-size: 1.55rem; letter-spacing: -0.02em; color: var(--accent); }
.highlights span { color: var(--muted); font-size: .92rem; line-height: 1.4; }

/* Sections */
section { padding: clamp(2.75rem, 6vw, 4.5rem) 0; }
section.alt { background: var(--bg-alt); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 750; margin-bottom: 1.5rem; }
h2::after { content: ""; display: block; width: 2.5rem; height: 4px; border-radius: 4px; background: var(--accent); margin-top: .6rem; }
.center h2::after { margin-inline: auto; }
#about p { color: var(--muted); font-size: 1.1rem; }

/* Experience timeline */
.timeline { display: grid; gap: 2rem; border-left: 2px solid var(--border); padding-left: 1.5rem; margin-left: .35rem; }
.job { position: relative; }
.job::before {
  content: ""; position: absolute; left: calc(-1.5rem - 7px); top: .5rem;
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg-alt);
}
.job-head { display: flex; flex-direction: column; gap: .15rem; }
.job h3 { font-size: 1.15rem; }
.period { color: var(--muted); font-size: .92rem; margin: 0; white-space: nowrap; }
.company { color: var(--muted); margin: .15rem 0 .6rem; font-weight: 500; }
.sep { opacity: .5; }
.job ul { display: grid; gap: .45rem; }
.job li { position: relative; padding-left: 1.1rem; }
.job li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .7; }

/* Cards & grids */
.grid { display: grid; gap: 1.1rem; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.two { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 2.5rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.3rem; box-shadow: var(--shadow);
}
.project { display: flex; flex-direction: column; gap: .75rem; }
.project h3 { font-size: 1.1rem; }
.project p { color: var(--muted); font-size: .98rem; margin: 0; flex: 1; }
.project { position: relative; transition: transform .15s ease, border-color .15s ease; }
.project h3 a { color: var(--text); text-decoration: none; }
.project .stretched::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.project:hover { border-color: var(--accent); transform: translateY(-2px); }
.project:hover h3 a { color: var(--accent); }
.project:has(.stretched:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.project .stretched:focus-visible { outline: none; }
.more { font-weight: 600; font-size: .95rem; color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.tags li {
  background: var(--accent-soft); color: var(--accent); border-radius: 999px;
  padding: .2rem .7rem; font-size: .85rem; font-weight: 600;
}
.skill-group h3 { font-size: 1rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .7rem; }

.certs { list-style: none; padding: 0; }
.cert h3 { font-size: 1rem; line-height: 1.35; }
.cert p { margin: .3rem 0 0; color: var(--muted); font-size: .92rem; }
.cert a { display: block; color: inherit; text-decoration: none; }
.cert .verify { display: inline-flex; align-items: center; gap: .3rem; margin-top: .6rem; color: var(--accent); font-weight: 600; font-size: .9rem; }
.cert:has(a):hover { border-color: var(--accent); }

/* Experience logos */
.job-top { display: flex; gap: .9rem; align-items: flex-start; }
.job-top .job-head { flex: 1; }
.logos { display: flex; gap: .4rem; flex: none; }
.logos img { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--border); background: #fff; object-fit: cover; }

/* Project covers */
.project { padding: 0; overflow: hidden; }
.project > :not(.cover) { margin-inline: 1.3rem; }
.project > :last-child { margin-bottom: 1.25rem; }
.project .cover { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--border); margin-bottom: .25rem; }

/* Certification badges */
.cert a, .cert .cert-body { display: flex; gap: 1rem; align-items: center; }
.cert .badge { width: 72px; height: 72px; flex: none; object-fit: contain; }
.cert .badge.placeholder { display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.cert .badge.placeholder .icon { width: 30px; height: 30px; }
.edu em { font-style: normal; color: var(--muted); }

.cert .badge.tile { border-radius: 14px; border: 1px solid var(--border); background: #fff; object-fit: cover; }
.edu li { display: flex; gap: .9rem; align-items: center; }
.edu-logo { width: 48px; height: 48px; flex: none; border-radius: 10px; border: 1px solid var(--border); background: #fff; object-fit: cover; }
.grid.two.projects { gap: 1.25rem; }

/* Education */
.edu { display: grid; gap: 1.1rem; }
.edu h3 { font-size: 1.05rem; }
.edu p { margin: .1rem 0 0; color: var(--muted); }
.sub { font-size: 1.05rem; margin: 2rem 0 .6rem; }
.langs { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; color: var(--muted); }
.langs strong { color: var(--text); }

/* Contact */
.contact { display: grid; gap: .7rem; justify-content: center; margin-top: 1.5rem; }
.contact li { display: flex; align-items: center; justify-content: center; gap: .6rem; font-size: 1.05rem; }

footer { border-top: 1px solid var(--border); padding: 1.5rem 0; color: var(--muted); font-size: .9rem; text-align: center; }
footer p { margin: 0; }

/* Language switch */
.lang {
  display: inline-flex; align-items: center; gap: .3rem; height: 2.4rem; padding: 0 .75rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem;
}
.lang:hover { border-color: var(--accent); }

/* Recommendations */
.recs { align-items: stretch; }
.rec { margin: 0; display: flex; flex-direction: column; gap: 1.1rem; position: relative; }
.rec::before {
  content: "\201C"; display: block; height: 1.9rem; margin-bottom: -1.1rem; font-size: 3.6rem; line-height: 1;
  color: var(--accent); opacity: .35; font-family: Georgia, serif;
}
.rec blockquote { margin: 0; flex: 1; }
.rec blockquote p { margin: 0; color: var(--text); font-size: 1rem; line-height: 1.65; }
.rec figcaption { display: flex; gap: .75rem; align-items: center; border-top: 1px solid var(--border); padding-top: .9rem; }
.rec figcaption strong { display: block; font-size: .98rem; }
.rec-meta { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.avatar {
  width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .95rem;
}
.recs-more { margin: 1.5rem 0 0; color: var(--muted); font-size: .95rem; }
.recs-more a { font-weight: 600; }

/* Responsive */
@media (max-width: 1040px) {
  .bar nav { display: none; }
}
@media (max-width: 860px) {
  .grid.three { grid-template-columns: repeat(2, 1fr); }
  .recs.grid.three { grid-template-columns: 1fr; }
  .highlights { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hero-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .portrait { order: -1; width: 160px; border-radius: 22px; }
  .grid.three, .grid.two { grid-template-columns: 1fr; }
  .period { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .project { transition: none; }
}

/* Print: a clean one-column resume-style page */
@media print {
  :root { --bg: #fff; --bg-alt: #fff; --surface: #fff; --text: #000; --muted: #333; --border: #ccc; --accent: #000; --accent-soft: #eee; --shadow: none; }
  .topbar, .skip, .actions, .theme, .lang, .more, .verify, .recs-more, #projects .tags { display: none; }
  section { padding: 1rem 0; break-inside: avoid-page; }
  .portrait { width: 110px; box-shadow: none; }
  .grid.three, .grid.two { grid-template-columns: repeat(2, 1fr); }
  a { color: inherit; text-decoration: none; }
}
