/* Site chrome shared by every page (homepage, inner pages, CV, 404): header, phone menu,
   footer, and the dark theme for inner pages. Markup: scripts/chrome.mjs. */

/* dark theme tokens (the homepage defines the same values in its own stylesheet) */
html[data-theme="dark"] {
  --paper: #0f0f0c; --paper-2: #17171a; --ink: #f0ece4; --ink-soft: #b8b3a8; --ink-mute: #8a857c;
  --rule: #2a2a26; --accent: oklch(0.75 0.16 265); --accent-soft: oklch(0.28 0.07 265);
  color-scheme: dark;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in oklab, var(--paper, #fbfaf7) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule, #e6e3dc);
  font-family: 'IBM Plex Sans', system-ui, sans-serif; color: var(--ink, #14140f);
}
.sh-in {
  max-width: 1200px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.site-header a, .site-footer a { text-decoration: none; }
.sh-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink, #14140f); flex: 0 0 auto; }
.sh-brand svg { width: 26px; height: 26px; display: block; }
.sh-brand .wm { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px; font-weight: 500; letter-spacing: .02em; }
.sh-brand .sl { color: var(--accent, #4a5bd4); margin: 0 2px; }
.site-header .sh-brand:hover { color: var(--ink, #14140f); }

.sh-nav { display: flex; gap: 2px; }
.sh-nav a, .sh-panel a {
  padding: 8px 13px; border-radius: 999px; font-size: 14px; line-height: 1.2;
  color: var(--ink-soft, #4a4a44); transition: color .15s, background .15s;
}
.sh-nav a:hover, .sh-nav a[aria-current="page"] { color: var(--ink, #14140f); background: var(--paper-2, #f4f1ea); }
.sh-nav a[aria-current="page"] { font-weight: 600; }

.sh-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.site-header .sh-cta {
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500; white-space: nowrap;
  background: var(--ink, #14140f); color: var(--paper, #fbfaf7); transition: transform .15s, box-shadow .15s;
}
.site-header .sh-cta:hover { color: var(--paper, #fbfaf7); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,.12); }

.sh-lang { display: inline-flex; border: 1px solid var(--rule, #e6e3dc); border-radius: 999px; padding: 3px; }
.sh-lang a {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; font-weight: 500; letter-spacing: .06em;
  padding: 5px 10px; border-radius: 999px; color: var(--ink-mute, #67625a);
}
.sh-lang a:hover { color: var(--ink, #14140f); }
.sh-lang a.on, .sh-lang a.active { background: var(--ink, #14140f); color: var(--paper, #fbfaf7); }

.sh-icon {
  width: 38px; height: 38px; border: 1px solid var(--rule, #e6e3dc); background: transparent; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--ink-soft, #4a4a44); transition: background .15s, color .15s, border-color .15s; list-style: none;
}
.sh-icon::-webkit-details-marker { display: none; }
.sh-icon:hover { background: var(--paper-2, #f4f1ea); color: var(--ink, #14140f); border-color: var(--ink-mute, #67625a); }
.sh-icon svg { width: 17px; height: 17px; }
.sh-icon .i-sun { display: none; }
html[data-theme="dark"] .sh-icon .i-sun { display: block; }
html[data-theme="dark"] .sh-icon .i-moon { display: none; }
.site-header a:focus-visible, .sh-icon:focus-visible, .site-footer a:focus-visible { outline: 2px solid var(--accent, #4a5bd4); outline-offset: 2px; }

/* phone and tablet menu */
.sh-menu { display: none; position: static; }
.sh-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  display: flex; flex-direction: column; gap: 2px; padding: 12px 20px 20px;
  background: var(--paper, #fbfaf7); border-bottom: 1px solid var(--rule, #e6e3dc);
  box-shadow: 0 18px 40px rgba(0,0,0,.12);
}
.sh-panel a { font-size: 17px; padding: 13px 14px; border-radius: 10px; color: var(--ink, #14140f); }
.sh-panel a:hover, .sh-panel a[aria-current="page"] { background: var(--paper-2, #f4f1ea); }
.sh-panel a[aria-current="page"] { font-weight: 600; }
.site-header .sh-panel .sh-cta { margin-top: 10px; text-align: center; padding: 13px 16px; font-size: 16px; }
.sh-menu[open] .b1 { transform: translate(0, 5px) rotate(45deg); transform-origin: 12px 7px; }
.sh-menu[open] .b2 { opacity: 0; }
.sh-menu[open] .b3 { transform: translate(0, -5px) rotate(-45deg); transform-origin: 12px 17px; }
.sh-menu svg path { transition: transform .2s, opacity .2s; }

@media (max-width: 1060px) {
  .sh-nav, .sh-actions > .sh-cta { display: none; }
  .sh-menu { display: block; }
}
@media (max-width: 420px) {
  .sh-in { padding: 12px 16px; gap: 10px; }
  .sh-brand .wm { font-size: 12px; }
  .sh-actions { gap: 6px; }
}

/* ---------- footer ---------- */
.site-footer {
  background: #0f1118; color: #a9aebd; margin-top: 0;
  font-family: 'IBM Plex Sans', system-ui, sans-serif; font-size: 14px; line-height: 1.6;
}
.sf-in {
  max-width: 1200px; margin: 0 auto; padding: 56px 28px 8px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.site-footer .sh-brand { color: #eef0f5; }
.site-footer .sh-brand:hover { color: #fff; }
.site-footer .sh-brand .sl { color: #9aabf7; }
.site-footer svg { --accent: #9aabf7; }
.sf-about p { margin-top: 14px; max-width: 38ch; color: #a9aebd; font-size: 14px; }
.site-footer h2 {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .14em; color: #7d8396; margin: 4px 0 14px; border: 0; padding: 0;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 9px; }
.site-footer li a { color: #dfe2ea; }
.site-footer li a:hover { color: #9aabf7; }
.sf-bottom {
  max-width: 1200px; margin: 32px auto 0; padding: 22px 28px 30px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; color: #7d8396;
}
@media (max-width: 860px) {
  .sf-in { grid-template-columns: 1fr 1fr; gap: 28px; padding-top: 44px; }
  .sf-about { grid-column: 1 / -1; }
}

/* ---------- inner pages in the dark theme (assets/page.css) ---------- */
html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .btns-light .btn { background: var(--ink); color: var(--paper); border-color: var(--ink); }
html[data-theme="dark"] .shot a { box-shadow: 0 18px 50px rgba(0,0,0,.5); }

/* ---------- CV pages: the header sits above the printable sheet ---------- */
body.cv-page { padding-top: 0 !important; }
body.cv-page > .site-header { margin: 0 -20px 40px; }
body.cv-page > .site-footer { margin: 56px -20px -40px; }
@media (max-width: 720px) {
  body.cv-page > .site-header { margin: 0 0 16px; }
  body.cv-page > .site-footer { margin: 32px 0 -16px; }
}

@media print {
  .site-header, .site-footer { display: none !important; }
}
.site-header, .site-footer { text-align: left; hyphens: manual; }
