:root {
  --c-900: #06141B;
  --c-800: #11212D;
  --c-700: #253745;
  --c-600: #4A5C6A;
  --c-300: #9BA8AB;
  --c-100: #CCD0CF;
  --radius: 14px;
  --maxw: 980px;

  /* Dark theme (default) */
  --bg: radial-gradient(ellipse at top left, var(--c-700) 0%, var(--c-800) 35%, var(--c-900) 100%);
  --text: var(--c-100);
  --text-strong: #fff;
  --muted: var(--c-300);
  --subtle: var(--c-600);
  --border: var(--c-700);
  --border-strong: var(--c-600);
  --surface: var(--c-800);
  --surface-hover: var(--c-700);
  --nav-bg: rgba(6, 20, 27, 0.85);
  --card-bg: linear-gradient(160deg, rgba(37, 55, 69, 0.55), rgba(17, 33, 45, 0.75));
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --row-hover: rgba(74, 92, 106, 0.18);
  --btn-bg: var(--c-100);
  --btn-text: var(--c-900);
  --btn-hover: #fff;
  --chip-bg: var(--c-300);
  --chip-text: var(--c-900);
  --dialog-bg: linear-gradient(160deg, var(--c-700), var(--c-800) 40%, var(--c-900));
  --dialog-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  --backdrop: rgba(6, 20, 27, 0.7);
  color-scheme: dark;
}

[data-theme="light"] {
  /* Light tints of the palette's blue hue (from --c-700) */
  --tint-50: #EEF4F8;
  --tint-100: #D8E4EE;
  --tint-200: #BACEDE;
  --bg: radial-gradient(ellipse at top left, #ffffff 0%, var(--tint-50) 40%, var(--tint-100) 100%);
  --text: var(--c-800);
  --text-strong: var(--c-900);
  --muted: var(--c-600);
  --subtle: #5d7384;
  --border: var(--tint-200);
  --border-strong: var(--c-300);
  --surface: #ffffff;
  --surface-hover: var(--tint-100);
  --nav-bg: rgba(238, 244, 248, 0.85);
  --card-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(216, 228, 238, 0.8));
  --card-shadow: 0 10px 30px rgba(17, 33, 45, 0.08);
  --row-hover: rgba(155, 168, 171, 0.18);
  --btn-bg: var(--c-800);
  --btn-text: var(--c-100);
  --btn-hover: var(--c-900);
  --chip-bg: var(--c-700);
  --chip-text: var(--c-100);
  --dialog-bg: linear-gradient(160deg, #ffffff, var(--tint-50) 60%, var(--tint-100));
  --dialog-shadow: 0 25px 60px rgba(17, 33, 45, 0.25);
  --backdrop: rgba(17, 33, 45, 0.45);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg) fixed;
  transition: color 0.25s;
  min-height: 100vh;
}

a { color: var(--text); text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { color: var(--text-strong); text-decoration-color: var(--muted); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0.75rem 1.25rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.nav__brand {
  font-weight: 700; letter-spacing: 0.08em; text-decoration: none;
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 0.15rem 0.6rem;
}
.nav__links { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; flex: 1; }
.nav__links a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.nav__links a:hover { color: var(--text); }

.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  background: var(--btn-bg); color: var(--btn-text);
  border-radius: 999px; padding: 0.6rem 1.2rem;
  transition: background 0.2s;
}
.btn:hover { background: var(--btn-hover); color: var(--btn-text); }
.btn--small { padding: 0.35rem 0.9rem; font-size: 0.85rem; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; border-radius: 50%; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  transition: background 0.2s, transform 0.3s;
}
.theme-toggle:hover { background: var(--surface-hover); transform: rotate(20deg); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.nav__actions { display: flex; align-items: center; gap: 0.6rem; }

/* Mobile menu (hamburger), shown under 760px next to the SG link */
.nav__toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 2.1rem; height: 2.1rem; padding: 0 0.55rem; border-radius: 50%; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
}
.nav__toggle span { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.25s, opacity 0.2s; }
.nav--open .nav__toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav--open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav--open .nav__toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Hero */
.hero { padding: 5rem 0 3rem; }
.hero__eyebrow { text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted); font-size: 0.85rem; margin: 0 0 0.9rem; }
.social { display: flex; gap: 0.6rem; margin: 0 0 1.25rem; }
.social__link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; border-radius: 10px;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.social__link:hover { background: #0A66C2; border-color: #0A66C2; color: #fff; transform: translateY(-2px); }
.social__link svg { width: 1.2rem; height: 1.2rem; }
.hero__name { font-size: clamp(2.5rem, 7vw, 4.25rem); line-height: 1.05; margin: 0 0 0.6rem; font-weight: 700; color: var(--text-strong); }
.hero__tagline { max-width: 40rem; color: var(--muted); font-size: 1.15rem; margin: 0 0 2rem; }

.contact { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.contact li {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.6rem 1rem; font-size: 0.95rem;
}
.contact__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--subtle); }

/* Sections */
.section { padding: 2.5rem 0; }
.section__title {
  font-size: 1.6rem; margin: 0 0 1.5rem; color: var(--text-strong);
  display: flex; align-items: center; gap: 0.75rem;
}
.section__title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--card-shadow);
}
.card + .card { margin-top: 1rem; }
.card h3 { margin: 0 0 0.75rem; color: var(--text-strong); font-size: 1.1rem; }
.card h4 { margin: 1rem 0 0.4rem; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; }
.card p { margin: 0.4rem 0; }
.card ul { margin: 0.25rem 0; padding-left: 1.2rem; }
.card li { margin: 0.3rem 0; }
.card li::marker { color: var(--subtle); }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; }
tbody tr:last-child td { border-bottom: none; }
td:first-child { color: var(--text-strong); font-weight: 600; }
td:last-child { color: var(--muted); white-space: nowrap; }

/* Clickable companies + role dialog */
.hint { color: var(--muted); font-size: 0.85rem; margin: -0.4rem 0 0.6rem !important; }
.company {
  font: inherit; font-weight: 600; color: var(--text-strong); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 0.2rem 0.75rem; transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.company::after { content: ' +'; color: var(--muted); }
.company:hover, .company:focus-visible { background: var(--surface-hover); border-color: var(--muted); transform: translateY(-1px); outline: none; }
tbody tr { transition: background 0.2s; }
tbody tr:hover { background: var(--row-hover); }

.job-dialog {
  width: min(680px, calc(100% - 2rem)); max-height: min(80vh, 760px);
  padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--dialog-bg);
  color: var(--text); box-shadow: var(--dialog-shadow);
  overflow: hidden;
}
.job-dialog[open] { display: flex; flex-direction: column; animation: pop 0.22s ease-out; }
.job-dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.job-dialog__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: 1.25rem 1.5rem 0.75rem; border-bottom: 1px solid var(--border);
}
.job-dialog__head h3 { margin: 0; color: var(--text-strong); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.job-dialog__dates { margin: 0 0 0.2rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); }
.job-dialog__close {
  background: none; border: 1px solid var(--border-strong); color: var(--text); border-radius: 50%;
  width: 2rem; height: 2rem; font-size: 1.25rem; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.job-dialog__close:hover { background: var(--surface-hover); }
.job-dialog__body { padding: 1rem 1.5rem 1.5rem; overflow-y: auto; }
.job-dialog__body h4 { margin: 1rem 0 0.4rem; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; }
.job-dialog__body p { margin: 0.4rem 0; }
.job-dialog__body ul { margin: 0.25rem 0; padding-left: 1.2rem; }
.job-dialog__body li { margin: 0.35rem 0; }
.job-dialog__body li::marker { color: var(--muted); }
.job__duration { color: var(--muted); font-size: 0.8rem; }
.job__company {
  font-size: 0.8rem; font-weight: 500; color: var(--chip-text); background: var(--chip-bg);
  border-radius: 999px; padding: 0.05rem 0.6rem;
}

/* Education */
.edu { list-style: none; padding: 0.5rem 1.5rem; margin: 0; }
.edu li { display: flex; gap: 1.25rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); margin: 0; }
.edu li:last-child { border-bottom: none; }
.edu__year { font-weight: 700; color: var(--muted); min-width: 3rem; }
.edu em { color: var(--muted); font-style: normal; }

/* Skills */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-2 .card + .card { margin-top: 0; }
.skills { margin: 0; }
.skills dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--subtle); margin-top: 0.75rem; }
.skills dt:first-child { margin-top: 0; }
.skills dd { margin: 0.35rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  font-size: 0.82rem; padding: 0.2rem 0.65rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
}

.footer { border-top: 1px solid var(--border); padding: 2rem 0; margin-top: 2rem; color: var(--subtle); font-size: 0.9rem; text-align: center; }
.footer a { color: var(--muted); }

/* Logos & illustrations */
.logo {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; object-fit: contain;
  background: #fff; padding: 2px; box-shadow: 0 0 0 1px rgba(17, 33, 45, 0.12);
  vertical-align: middle;
}
.logo--mono {
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  background: linear-gradient(135deg, var(--c-600), var(--c-800)); color: #fff;
  font-size: 0.5rem; font-weight: 700; letter-spacing: 0.02em;
}
.company { display: inline-flex; align-items: center; gap: 0.5rem; padding-left: 0.3rem; }
.company .logo { transition: transform 0.25s; }
.company:hover .logo { transform: scale(1.12) rotate(-4deg); }
.job-dialog__head h3 .logo { width: 28px; height: 28px; align-self: center; }
.edu li { align-items: center; }
.edu .logo { width: 28px; height: 28px; transition: transform 0.25s; }
.edu li:hover .logo { transform: scale(1.1); }

.section__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.2rem; height: 2.2rem; border-radius: 10px; flex-shrink: 0;
  background: var(--glass-sheen), var(--glass-bg); border: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge); color: var(--muted);
}
.section__icon svg, .card__art svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.card { position: relative; transition: transform 0.25s, box-shadow 0.25s; }
.grid-2 .card:hover { transform: translateY(-3px); }
.card__art {
  float: right; margin: -0.2rem -0.4rem 0.5rem 0.75rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: 12px;
  background: linear-gradient(135deg, var(--c-600), var(--c-800)); color: var(--c-100);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 16px rgba(6, 20, 27, 0.25);
  transition: transform 0.3s;
}
.card:hover .card__art { transform: rotate(-6deg) scale(1.06); }
.card__art svg { width: 1.4rem; height: 1.4rem; }

.hero .container { position: relative; }
.hero__art {
  position: absolute; right: 1.25rem; top: -1rem; width: 300px; padding: 0.75rem;
  border-radius: 20px; color: var(--muted);
  background: var(--glass-sheen), var(--glass-bg); border: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge), var(--card-shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  animation: float 6s ease-in-out infinite;
}
.hero__art svg { display: block; width: 100%; height: auto; }
.ha-grid path { stroke: var(--border); stroke-width: 1; fill: none; stroke-dasharray: 3 5; }
.ha-bars rect { fill: currentColor; opacity: 0.18; transform-origin: bottom; transform-box: fill-box; animation: grow 1s ease-out both; }
.ha-bars rect:nth-child(2) { animation-delay: .08s } .ha-bars rect:nth-child(3) { animation-delay: .16s }
.ha-bars rect:nth-child(4) { animation-delay: .24s } .ha-bars rect:nth-child(5) { animation-delay: .32s } .ha-bars rect:nth-child(6) { animation-delay: .4s }
.ha-line { fill: none; stroke: var(--text-strong); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.6s 0.4s ease-out forwards; }
.ha-dots circle { fill: var(--text-strong); stroke: var(--c-100); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pulse 2.4s 2s ease-in-out infinite; }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 50% { transform: scale(1.35); } }
@keyframes float { 50% { transform: translateY(-8px); } }
@media (max-width: 960px) { .hero__art { display: none; } }
@media (prefers-reduced-motion: reduce) { .hero__art, .ha-bars rect, .ha-dots circle { animation: none; } .ha-line { animation: none; stroke-dashoffset: 0; } }

/* Contact page */
.contact-page__intro { color: var(--muted); font-size: 1.05rem; margin: -0.5rem 0 1.5rem; max-width: 40rem; }
.contact-form { display: grid; gap: 1rem; padding: 1.5rem; }
.contact-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); }
.field input, .field textarea {
  font: inherit; color: var(--text); width: 100%;
  padding: 0.7rem 0.9rem; border-radius: 12px; border: 1px solid var(--glass-border);
  background: var(--glass-bg); box-shadow: var(--glass-edge);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--c-600); box-shadow: var(--glass-edge), 0 0 0 3px rgba(74, 92, 106, 0.3); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-form__actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.contact-form .btn { border: none; cursor: pointer; font: inherit; font-weight: 600; }
.contact-form .btn:disabled { opacity: 0.6; cursor: progress; }
.contact-form__status { margin: 0; font-size: 0.92rem; color: var(--muted); }
.contact-form__status[data-type="ok"] { color: #2f8f5b; }
.contact-form__status[data-type="error"] { color: #c0392b; }
.contact-form__note { margin: 0; font-size: 0.82rem; color: var(--subtle); }
.nav__links a[aria-current="page"] { color: var(--text-strong); font-weight: 600; }
@media (max-width: 760px) { .contact-form__row { grid-template-columns: 1fr; } }

/* Liquid glass */
.contact:target li { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--c-600); transform: translateY(-2px); } }
:root {
  --glass-bg: rgba(37, 55, 69, 0.32);
  --glass-bg-strong: rgba(17, 33, 45, 0.72);
  --glass-border: rgba(204, 208, 207, 0.16);
  --glass-sheen: linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.02) 38%, rgba(255, 255, 255, 0) 60%);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  --glass-blur: blur(18px) saturate(160%);
  --blob-a: rgba(74, 92, 106, 0.55);
  --blob-b: rgba(155, 168, 171, 0.22);
  --blob-c: rgba(37, 55, 69, 0.7);
}
[data-theme="light"] {
  --glass-bg: rgba(255, 255, 255, 0.42);
  --glass-bg-strong: rgba(238, 244, 248, 0.85);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-sheen: linear-gradient(135deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.15) 40%, rgba(255, 255, 255, 0) 65%);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(17, 33, 45, 0.06);
  --blob-a: rgba(186, 206, 222, 0.75);
  --blob-b: rgba(37, 55, 69, 0.3);
  --blob-c: rgba(216, 228, 238, 0.9);
  --bg: radial-gradient(ellipse at top left, #ffffff 0%, #e3edf4 40%, var(--tint-200) 100%);
  --btn-bg: var(--c-700);
  --btn-hover: var(--c-800);
  --chip-bg: var(--c-700);
  --text-strong: var(--c-700);
  --subtle: var(--c-600);
  --border: rgba(37, 55, 69, 0.18);
  --row-hover: rgba(37, 55, 69, 0.06);
  --glass-bg: rgba(238, 244, 248, 0.55);
}
[data-theme="light"] .section__title::after { background: linear-gradient(90deg, var(--c-700), rgba(37, 55, 69, 0)); }
[data-theme="light"] .nav__brand { background: var(--c-700); color: #fff; border-color: var(--c-700); }
[data-theme="light"] .tag,
[data-theme="light"] .company {
  background: var(--glass-sheen), rgba(186, 206, 222, 0.45);
  border-color: rgba(37, 55, 69, 0.25);
  color: var(--c-700);
}
[data-theme="light"] .company:hover,
[data-theme="light"] .company:focus-visible { background: var(--glass-sheen), rgba(186, 206, 222, 0.8); }
[data-theme="light"] .social__link,
[data-theme="light"] .theme-toggle,
[data-theme="light"] .nav__toggle { color: var(--c-700); border-color: rgba(37, 55, 69, 0.3); }
[data-theme="light"] th { color: var(--c-600); }
[data-theme="light"] .edu__year { color: var(--c-600); }
[data-theme="light"] .hero__eyebrow,
[data-theme="light"] .contact__label { color: var(--c-600); }
[data-theme="light"] .card h3 { color: var(--c-700); }

body::before {
  content: ''; position: fixed; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 12% 18%, var(--blob-a), transparent 70%),
    radial-gradient(32vmax 32vmax at 88% 30%, var(--blob-b), transparent 70%),
    radial-gradient(42vmax 42vmax at 60% 95%, var(--blob-c), transparent 70%);
  animation: drift 28s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) rotate(4deg) scale(1.05); } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }

.nav,
.card,
.contact li,
.theme-toggle,
.nav__toggle,
.social__link,
.company,
.tag,
.job-dialog__close {
  background: var(--glass-sheen), var(--glass-bg);
  border-color: var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.card, .contact li { box-shadow: var(--glass-edge), var(--card-shadow); }
.theme-toggle, .nav__toggle, .social__link, .company, .tag, .job-dialog__close { box-shadow: var(--glass-edge); }
.nav { border-bottom-color: var(--glass-border); box-shadow: var(--glass-edge); }
.theme-toggle:hover, .company:hover, .company:focus-visible, .job-dialog__close:hover {
  background: var(--glass-sheen), var(--surface-hover);
}
.btn { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 14px rgba(0, 0, 0, 0.15); }
.job-dialog {
  background: var(--glass-sheen), var(--glass-bg-strong);
  border-color: var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow: var(--glass-edge), var(--dialog-shadow);
}
.job-dialog::backdrop { backdrop-filter: blur(6px); }

/* Chat assistant */
.chat-fab {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.1rem; border-radius: 999px; border: 1px solid var(--glass-border);
  background: var(--btn-bg); color: var(--btn-text); font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 28px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background 0.2s ease;
}
.chat-fab:hover { transform: translateY(-2px); background: var(--btn-hover); }
.chat-fab svg { width: 20px; height: 20px; }
.chat-fab[aria-expanded="true"] .chat-fab__label { display: none; }
.chat-panel {
  position: fixed; right: 1.25rem; bottom: 5.25rem; z-index: 60;
  width: min(380px, calc(100vw - 2rem)); height: min(540px, calc(100vh - 7.5rem));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px; border: 1px solid var(--glass-border); color: var(--text);
  background: var(--glass-sheen), var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: var(--glass-edge), var(--dialog-shadow);
  transform-origin: bottom right; animation: chat-in 0.22s ease-out;
}
.chat-panel[hidden] { display: none; }
@keyframes chat-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.chat-panel__head { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--glass-border); }
.chat-panel__avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--chip-bg); color: var(--chip-text); font-weight: 700; font-size: 0.85rem; }
.chat-panel__title { margin: 0; font-size: 0.98rem; color: var(--text-strong); }
.chat-panel__sub { margin: 0; font-size: 0.78rem; color: var(--muted); }
.chat-panel__close { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.chat-panel__close:hover { background: var(--surface-hover); }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.chat-msg { max-width: 85%; padding: 0.6rem 0.85rem; border-radius: 16px; font-size: 0.92rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg--bot { align-self: flex-start; background: var(--glass-bg); border: 1px solid var(--glass-border); border-bottom-left-radius: 4px; }
.chat-msg--user { align-self: flex-end; background: var(--btn-bg); color: var(--btn-text); border-bottom-right-radius: 4px; }
.chat-msg--error { border-color: rgba(220, 120, 110, 0.6); }
.chat-msg--typing span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: chat-dot 1s infinite ease-in-out; }
.chat-msg--typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-msg--typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 1rem 0.6rem; }
.chat-suggestions[hidden] { display: none; }
.chat-suggestions button { padding: 0.35rem 0.7rem; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text); font: inherit; font-size: 0.8rem; cursor: pointer; }
.chat-suggestions button:hover { background: var(--surface-hover); }
.chat-form { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--glass-border); }
.chat-form input { flex: 1; min-width: 0; padding: 0.6rem 0.8rem; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text); font: inherit; font-size: 0.92rem; }
.chat-form input:focus { outline: 2px solid var(--c-300); outline-offset: 1px; }
.chat-form button { padding: 0 0.9rem; border-radius: 12px; border: none; background: var(--btn-bg); color: var(--btn-text); font: inherit; font-weight: 600; cursor: pointer; }
.chat-form button:disabled { opacity: 0.5; cursor: default; }
.chat-panel__note { margin: 0; padding: 0 1rem 0.7rem; font-size: 0.7rem; color: var(--muted); }
.chat-panel__note a { color: inherit; }
[data-theme="light"] .chat-panel__avatar { background: var(--c-700); color: #fff; }
@media (prefers-reduced-motion: reduce) { .chat-panel, .chat-msg--typing span { animation: none; } }
@media (max-width: 760px) { .chat-fab__label { display: none; } .chat-fab { padding: 0.8rem; } }

/* Responsive */
@media (max-width: 760px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 0.25rem 1.25rem 0.75rem;
    background: var(--dialog-bg); border-bottom: 1px solid var(--glass-border); box-shadow: var(--card-shadow);
  }
  .nav--open .nav__links { display: flex; }
  .nav__links li + li { border-top: 1px solid var(--border); }
  .nav__links a { display: block; padding: 0.75rem 0; font-size: 1rem; }
  .nav__inner { gap: 0.75rem; }
  .nav__actions { margin-left: auto; }
  .hero { padding: 3rem 0 2rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .summary-table { overflow-x: auto; }
}

/* Print */
@media print {
  body { background: #fff; color: #111; font-size: 10.5pt; }
  body::before { display: none; }
  .card, .contact li, .tag, .company { backdrop-filter: none; box-shadow: none; }
  .nav, .footer, script { display: none; }
  a { color: #111; text-decoration: none; }
  .hero { padding: 0 0 1rem; }
  .hero__name, .section__title, .card h3 { color: #000; }
  .hero__tagline, .contact__label, td:last-child, th, .edu__year, .edu em, .skills dt, .card h4 { color: #444; }
  .contact li, .card { background: none; border: 1px solid #ccc; box-shadow: none; }
  .tag, [data-theme] .tag { background: none; border-color: #999; color: #111; }
  .section { padding: 1rem 0; break-inside: auto; }
  .company, [data-theme] .company { background: none; border: none; padding: 0; color: #111; }
  .company::after, .hint, .job-dialog, .hero__art, .section__icon, .card__art, .logo, .chat-fab, .chat-panel { display: none; }
}
