/* Shared responsive layer: mobile menu, consent banner, small-screen fixes. Loaded after each site's own CSS. */
img, svg, video { max-width: 100%; height: auto; }
.btn.sm { padding: 10px 18px; font-size: 14px; }
body { overflow-x: hidden; }
.menu { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 0; margin-right: -8px; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.menu span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
header.nav.open .menu span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
header.nav.open .menu span:nth-child(2) { opacity: 0; }
header.nav.open .menu span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 1180px) {
  :root header.nav .wrap { position: relative; }
  :root header.nav.has-menu .menu, header.nav .menu { display: flex; }
  :root header.nav.has-menu nav { display: none; position: absolute; left: 0; right: 0; top: 72px; background: var(--ivory); border-bottom: 1px solid var(--line); box-shadow: 0 14px 24px rgba(32,33,36,.08); padding: 8px 20px 20px; flex-direction: column; gap: 0; }
  :root header.nav.has-menu.open nav { display: flex; }
  :root header.nav.has-menu nav a { font-size: 18px; padding: 14px 4px; border-bottom: 1px solid var(--line); width: 100%; }
  :root header.nav.has-menu nav a.btn { margin-top: 16px; text-align: center; border-bottom: 0; width: 100%; }
  /* without JS the nav simply wraps */
  :root header.nav:not(.has-menu) .wrap { flex-wrap: wrap; height: auto; min-height: 72px; padding-top: 10px; padding-bottom: 10px; }
  :root .btn, :root .tab, :root .chip { min-height: 44px; }
  :root .hero .wrap { padding-top: 40px; padding-bottom: 48px; }
  :root .lead, :root .hero p.lead { font-size: 1.1rem !important; }
  :root section { padding: 56px 0; }
  :root .card { padding: 22px; }
  :root .form-card { padding: 20px; }
  :root footer .wrap { flex-direction: column; }
}
@media (max-width: 380px) { :root h1 { font-size: 2.1rem; } :root .wrap { padding: 0 16px; } }
table { display: block; overflow-x: auto; }
pre { max-width: 100%; }

.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 720px; margin: 0 auto; background: var(--ink); color: var(--ivory); border-radius: 16px; padding: 16px 20px; display: flex; gap: 16px; align-items: center; justify-content: space-between; box-shadow: 0 18px 50px rgba(0,0,0,.3); font-size: 14px; }
.consent p { margin: 0; line-height: 1.5; } .consent a { color: #9CC7EE; }
.consent div { display: flex; gap: 8px; flex: none; }
.consent .btn.ghost { color: var(--ivory); border-color: var(--ivory); }
@media (max-width: 560px) { .consent { flex-direction: column; align-items: stretch; } .consent div { justify-content: stretch; } .consent .btn { flex: 1; } }

@media (max-width: 860px) {
  :root .hero .art .d1 { width: 64px; height: 64px; top: 28px; left: 8px; }
  :root .hero .art .d2 { width: 36px; height: 36px; left: 96px; bottom: auto; top: 120px; }
  :root .hero .art .line { display: none; }
}

/* ---- dark theme ---- */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 40px; height: 40px; margin-left: 8px; background: none; border: 2px solid var(--line); border-radius: 50%; color: var(--ink); cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle .tl { display: none; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (max-width: 1180px) {
  :root header.nav.has-menu nav .theme-toggle { width: 100%; height: auto; border: 0; border-radius: 0; justify-content: flex-start; margin: 0; padding: 14px 4px; font: 400 18px Inter, sans-serif; }
  :root header.nav.has-menu nav .theme-toggle .tl { display: inline; }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #F1EFEA; --ivory: #141518; --white: #1D1F23; --line: #33363C; --muted: #A9ACB4;
  --lavender: #262A48; --paleblue: #15283C; --blue: #6FB0EA;
}
:root[data-theme="dark"] .nav { background: rgba(20,21,24,.92); }
:root[data-theme="dark"] .btn { color: #202124; }
:root[data-theme="dark"] .btn.ghost { color: var(--ink); }
:root[data-theme="dark"] .btn.dark { background: var(--ink); color: var(--ivory); }
:root[data-theme="dark"] .tag.now { color: #202124; }
:root[data-theme="dark"] section.ink, :root[data-theme="dark"] .featured, :root[data-theme="dark"] .consent { background: #0C0D10; color: #F1EFEA; }
:root[data-theme="dark"] section.ink h2, :root[data-theme="dark"] section.ink h3, :root[data-theme="dark"] .featured h2, :root[data-theme="dark"] .featured .more { color: #F1EFEA; }
:root[data-theme="dark"] .consent .btn.ghost { color: #F1EFEA; border-color: #F1EFEA; }
:root[data-theme="dark"] .avatar, :root[data-theme="dark"] ol.stepsbig .num { background: #F1EFEA; color: #141518; }
:root[data-theme="dark"] header.nav img, :root[data-theme="dark"] .sitefoot img, :root[data-theme="dark"] img[src$="/k.svg"], :root[data-theme="dark"] .hero .art img[src$="k.svg"] { filter: brightness(0) invert(1); }
:root[data-theme="dark"] .form-card { background: #fff; color: #202124; }
:root[data-theme="dark"] .stage.ivory { background: #FAF9F6; } :root[data-theme="dark"] .stage.white { background: #fff; } :root[data-theme="dark"] .stage.ink { background: #202124; }
:root[data-theme="dark"] .sw { border-color: #4a4d55; }
:root[data-theme="dark"] .tab.on, :root[data-theme="dark"] .chip[aria-pressed="true"] { background: #F1EFEA; color: #141518; border-color: #F1EFEA; }
:root[data-theme="dark"] .coll.build { color: #8FD46C; }
:root[data-theme="dark"] code { color: #F1EFEA; }

/* gravatar photos: the initials sit underneath and show if the image is missing */
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid var(--white); box-shadow: 0 4px 18px rgba(32,33,36,.15); background: var(--lavender); display: block; margin-bottom: 16px; }
.me-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 8px; }

/* buttons inside dark sections keep their own text color (the section link color must not win) */
:root section.ink a.btn { color: #202124; text-decoration: none; }
:root section.ink a.btn.ghost { color: #FAF9F6; border-color: #FAF9F6; }
:root section.ink a.btn.dark { background: #FAF9F6; color: #202124; }
:root a.btn:hover { color: #202124; }
:root a.btn.ghost:hover { color: var(--ink); }
:root section.ink a.btn.ghost:hover { color: #FAF9F6; }
:root a.btn.dark, :root a.btn.dark:hover { color: var(--ivory); }
:root[data-theme="dark"] a.btn.dark, :root[data-theme="dark"] a.btn.dark:hover { color: var(--ivory); }

.avatar.has-photo { background: transparent; color: transparent; }

/* ---- professional refinement layer (loaded last, applies to every site) ---- */
/* calmer headings */
:root h1, :root h2, :root h3 { font-weight: 700; letter-spacing: -.015em; }
:root h1 { font-size: clamp(2.2rem, 5.2vw, 3.75rem); line-height: 1.1; }
:root h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); line-height: 1.15; }
/* hero: quiet gradient, no playful shapes, the K becomes a faint watermark */
:root .hero { background: linear-gradient(180deg, #F4F2EE 0%, #E9EFF7 100%); border-bottom: 1px solid var(--line); }
:root[data-theme="dark"] .hero { background: linear-gradient(180deg, #17191E 0%, #131C28 100%); }
:root .hero .art .dot, :root .hero .art .line, :root .featured .art span { display: none; }
:root .hero .art .k, :root .hero .art img.k { opacity: .07; }
:root[data-theme="dark"] .hero .art .k, :root[data-theme="dark"] .hero .art img.k { opacity: .09; }
:root .featured .art { background: linear-gradient(135deg, #24486B, #1B3550); }
:root .featured .art img { opacity: .12; }
/* neutral chips and call-out panels instead of lavender */
:root .tag { background: rgba(32,33,36,.06); border: 1px solid var(--line); color: var(--ink); }
:root[data-theme="dark"] .tag { background: rgba(255,255,255,.06); }
:root .cta-inline { background: var(--white); border: 1px solid var(--line); }
:root .portrait { background: var(--line); }
/* amber is an accent: keep it on primary buttons and the active-nav underline only */
:root .card { border-radius: 10px; box-shadow: 0 1px 2px rgba(32,33,36,.04); }
:root .btn { border-radius: 8px; font-weight: 600; }
:root .btn:hover { transform: none; box-shadow: 0 2px 8px rgba(32,33,36,.15); }
:root section { padding: 80px 0; }
@media (max-width: 760px) { :root section { padding: 56px 0; } }
/* headings: first letter of each word capitalized */
:root h1, :root h2, :root h3 { text-transform: capitalize; }

/* ---- color themes (dropdown in the header; combine with light/dark) ---- */
:root[data-palette="ocean"]:not([data-theme="dark"]) { --ivory: #F4F8FB; --white: #fff; --lavender: #DDEBF7; --paleblue: #CFE4F4; --blue: #1F6FA8; --line: #D5E2EC; }
:root[data-theme="dark"][data-palette="ocean"] { --ivory: #0F1A22; --white: #16252F; --lavender: #1B3445; --paleblue: #123042; --blue: #6DB6E8; --line: #2A4252; }
:root[data-palette="forest"]:not([data-theme="dark"]) { --ivory: #F6F8F3; --white: #fff; --lavender: #E1EFD9; --paleblue: #D6EBDD; --blue: #2F7D4F; --line: #DCE5D6; }
:root[data-theme="dark"][data-palette="forest"] { --ivory: #121A15; --white: #1A251E; --lavender: #223A2A; --paleblue: #1B3328; --blue: #7CCB92; --line: #2D4034; }
:root[data-palette="sunset"]:not([data-theme="dark"]) { --ivory: #FBF6F0; --white: #fff; --lavender: #FBE4D5; --paleblue: #FCEFD0; --blue: #B5502B; --line: #EBDDD0; }
:root[data-theme="dark"][data-palette="sunset"] { --ivory: #1A1512; --white: #251D18; --lavender: #3A261C; --paleblue: #33281A; --blue: #F0955F; --line: #43342B; }
:root[data-palette="graphite"]:not([data-theme="dark"]) { --ivory: #F3F3F4; --white: #fff; --lavender: #E6E7EA; --paleblue: #DADCE1; --blue: #3C4658; --line: #D8D9DD; }
:root[data-theme="dark"][data-palette="graphite"] { --ivory: #101113; --white: #191A1D; --lavender: #24262B; --paleblue: #1E2025; --blue: #AEB8CC; --line: #303238; }
.palette-select { height: 40px; margin-left: 8px; padding: 0 28px 0 12px; font: 500 14px Inter, system-ui, sans-serif; color: var(--ink); background-color: var(--white); border: 2px solid var(--line); border-radius: 8px; cursor: pointer; }
.palette-select:hover { border-color: var(--ink); }
@media (max-width: 1180px) { :root header.nav.has-menu nav .palette-select { width: 100%; height: 44px; margin: 8px 0; font-size: 16px; } }

/* ---- modern style (Apple-like: big type, white space, frosted header, pill buttons). Opt in with the Style dropdown. ---- */
:root[data-style="modern"]:not([data-theme="dark"]) { --ivory: #FFFFFF; --white: #F5F5F7; --lavender: #F5F5F7; --paleblue: #F5F5F7; --line: #E8E8ED; --muted: #6E6E73; --ink: #1D1D1F; }
:root[data-theme="dark"][data-style="modern"] { --ivory: #000000; --white: #1D1D1F; --lavender: #1D1D1F; --paleblue: #1D1D1F; --line: #2C2C2E; --muted: #A1A1A6; --ink: #F5F5F7; }
:root[data-style="modern"] { --radius: 20px; --gap: 28px; letter-spacing: -.011em; }
:root[data-style="modern"] body { font-size: 18px; line-height: 1.5; }
:root[data-style="modern"] h1, :root[data-style="modern"] h2, :root[data-style="modern"] h3 { font-weight: 600; letter-spacing: -.03em; line-height: 1.07; }
:root[data-style="modern"] h1 { font-size: clamp(2.6rem, 7.5vw, 5.5rem); }
:root[data-style="modern"] h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
:root[data-style="modern"] .nav { background: rgba(255,255,255,.72); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
:root[data-style="modern"][data-theme="dark"] .nav { background: rgba(0,0,0,.72); }
:root[data-style="modern"] .nav .wrap { height: 56px; }
:root[data-style="modern"] .nav nav a { font-size: 14px; font-weight: 400; }
:root[data-style="modern"] .hero, :root[data-style="modern"] .hero.short { background: var(--ivory); text-align: center; }
:root[data-style="modern"] .hero .wrap { grid-template-columns: 1fr; justify-items: center; min-height: 0; padding-top: 96px; padding-bottom: 96px; }
:root[data-style="modern"] .hero .art, :root[data-style="modern"] .hero .k { display: none; }
:root[data-style="modern"] .hero p.lead, :root[data-style="modern"] .hero .lead { margin-left: auto; margin-right: auto; font-size: clamp(1.15rem, 2.2vw, 1.6rem); color: var(--muted); max-width: 30em; }
:root[data-style="modern"] section { padding: 112px 0; }
:root[data-style="modern"] section.alt { background: var(--white); }
:root[data-style="modern"] section > .wrap > h2, :root[data-style="modern"] section > .wrap > .eyebrow { text-align: center; }
:root[data-style="modern"] .card { border: 0; border-radius: 24px; background: var(--white); padding: 36px; box-shadow: none; }
:root[data-style="modern"] section.alt .card { background: var(--ivory); }
:root[data-style="modern"] .btn { background: var(--blue); color: #fff; border: 0; border-radius: 980px; padding: 12px 24px; font-weight: 500; }
:root[data-style="modern"][data-theme="dark"] .btn { color: #000; }
:root[data-style="modern"] .btn:hover { transform: none; box-shadow: none; opacity: .88; color: #fff; }
:root[data-style="modern"][data-theme="dark"] .btn:hover { color: #000; }
:root[data-style="modern"] .btn.ghost { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
:root[data-style="modern"] .btn.dark { background: var(--ink); color: var(--ivory); }
:root[data-style="modern"] .tag { background: var(--white); border-radius: 980px; }
:root[data-style="modern"] a { font-weight: 500; text-decoration: none; }
:root[data-style="modern"] a:hover { text-decoration: underline; }
:root[data-style="modern"] footer { border-top: 1px solid var(--line); background: var(--white); }

/* ---- header polish: no wrapping, compact controls ---- */
:root header.nav img { flex-shrink: 0; }
:root header.nav nav { align-items: center; gap: 22px; }
:root header.nav nav a { white-space: nowrap; }
:root .palette-select { height: 36px; margin-left: 0; padding: 0 22px 0 10px; font-size: 13px; width: auto; max-width: 110px; border-width: 1px; }
:root .theme-toggle { width: 36px; height: 36px; margin-left: 0; border-width: 1px; }
:root header.nav nav .btn.sm { padding: 8px 16px; font-size: 14px; }
:root[data-style="modern"] .hero .wrap > div, :root[data-style="modern"] .hero .wrap > div > p { justify-content: center; text-align: center; }
:root[data-style="modern"] .hero .wrap > div > p.lead { margin-left: auto; margin-right: auto; }

/* ---- one appearance icon with a small panel (mode, color, layout) ---- */
:root .appearance { position: relative; display: inline-flex; }
:root .ap-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 36px; height: 36px; padding: 0; background: none; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); cursor: pointer; }
:root .ap-btn:hover, :root .ap-btn[aria-expanded="true"] { border-color: var(--ink); }
:root .ap-btn .tl { display: none; }
:root .ap-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; width: 264px; padding: 14px; background: var(--ivory); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); text-align: left; }
:root .ap-panel[hidden] { display: none; }
:root .ap-group + .ap-group { margin-top: 12px; }
:root .ap-title { font: 600 11px Inter, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
:root .ap-row { display: flex; flex-wrap: wrap; gap: 6px; }
:root .ap-row button { font: 500 13px Inter, sans-serif; padding: 6px 12px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
:root .ap-row button:hover { border-color: var(--ink); }
:root .ap-row button[aria-pressed="true"] { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
@media (max-width: 1180px) {
  :root header.nav.has-menu nav .appearance { display: block; width: 100%; padding: 8px 0; }
  :root header.nav.has-menu nav .ap-btn { width: 100%; height: auto; border: 0; border-radius: 0; justify-content: flex-start; padding: 8px 4px; font: 400 18px Inter, sans-serif; }
  :root header.nav.has-menu nav .ap-btn .tl { display: inline; }
  :root header.nav.has-menu nav .ap-panel { position: static; width: 100%; box-shadow: none; margin-top: 6px; }
}
/* match the previous theme-toggle look exactly */
:root .ap-btn { width: 40px; height: 40px; margin-left: 8px; border: 2px solid var(--line); }
@media (max-width: 1180px) { :root header.nav.has-menu nav .ap-btn { margin-left: 0; border-width: 0; } }

/* ---- card typography: titles and text sized for cards, in both layouts ---- */
:root .card h2, :root[data-style="modern"] .card h2 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.2; letter-spacing: -.015em; margin-bottom: 10px; }
:root .card h3, :root[data-style="modern"] .card h3 { font-size: 1.1rem; line-height: 1.25; letter-spacing: -.01em; margin-bottom: 8px; }
:root .card p, :root .card li, :root[data-style="modern"] .card p, :root[data-style="modern"] .card li { font-size: 15.5px; line-height: 1.55; }
:root .card .small, :root .card p.small { font-size: 13.5px; }
:root[data-style="modern"] .card { padding: 28px; }

/* footer: small, quiet type in both layouts */
:root footer, :root footer .small, :root[data-style="modern"] footer { font-size: 12.5px; line-height: 1.5; }
:root footer a { font-weight: 500; }

/* experience: employer and role headings sized like card titles, not page headings */
:root .job-h h2, :root[data-style="modern"] .job-h h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.2; letter-spacing: -.015em; margin-bottom: 4px; }
:root .job h3, :root .job h4, :root[data-style="modern"] .job h3, :root[data-style="modern"] .job h4 { font-size: 1.05rem; line-height: 1.3; margin: 0 0 4px; }
:root .job-h .small, :root .job .small { font-size: 13.5px; }
:root .job p { font-size: 15.5px; }

/* diagrams: flow, sequence and class diagrams drawn as SVG (shared/diagram.mjs). Colors follow the theme. */
figure.diagram { margin: 28px 0; padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; }
.dg { display: block; max-width: 100%; height: auto; margin: 0 auto; font-family: Inter, system-ui, sans-serif; }
.dg .dg-node { fill: var(--ivory); stroke: var(--blue); stroke-width: 1.6; }
.dg .dg-store { fill: var(--lavender); }
.dg .dg-actor { fill: var(--blue); stroke: var(--blue); }
.dg .dg-actor + .dg-text { fill: #fff; }
.dg .dg-edge { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.dg .dg-dash { stroke-dasharray: 6 4; }
.dg .dg-life { stroke: var(--line); stroke-width: 1.4; stroke-dasharray: 3 4; }
.dg .dg-head { fill: var(--muted); }
.dg .dg-hollow { fill: var(--ivory); stroke: var(--muted); stroke-width: 1.4; }
.dg .dg-text { fill: var(--ink); font-size: 13.5px; font-weight: 600; }
.dg .dg-bold { font-weight: 800; }
.dg .dg-mono { fill: var(--ink); font: 500 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.dg .dg-elabel { fill: var(--muted); font-size: 12px; }
.dg-error { color: #b3261e; font-size: 14px; }

/* cards that are links: underline only the title on hover, never the whole card */
:root a.card, :root a.card:hover, :root a.linkcard, :root a.linkcard:hover, :root a.pcard, :root a.pcard:hover, :root a.card *, :root a.pcard * { text-decoration: none; }
:root a.card:hover h3, :root a.linkcard:hover h3, :root a.pcard:hover h3 { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
