/* ==========================================================================
   adrientorris.github.io — "Console" theme
   Light by default; dark when <html data-theme="dark"> (toggled by site.js).
   ========================================================================== */

:root {
  color-scheme: light;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --bg: #F6F8FB;
  --grid: #E9EEF5;
  --surface: #FFFFFF;
  --surface-2: #F1F4F9;
  --surface-3: #F8FAFC;
  --border: #D8DFE9;
  --border-soft: #EDF1F6;
  --border-dashed: #B8C3D3;
  --text: #334155;
  --text-strong: #0F172A;
  --text-soft: #475569;
  --muted: #5B6678;
  --faint: #94A3B8;

  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-soft: #E9F0FD;
  --on-accent: #FFFFFF;

  --syn-kw: #7C3AED;
  --syn-str: #15803D;
  --syn-num: #C2410C;
  --syn-type: #0E7490;
  --syn-fn: #1D4ED8;
  --syn-comment: #6B7280;
  --syn-pink: #BE185D;

  --note-bg: #FFF8EC;
  --note-border: #F0C98A;
  --note-label: #9A3412;
  --note-icon: #C2410C;

  --li-bg: #E8F0FE;  --li-fg: #1D4ED8;
  --so-bg: #FFF1E6;  --so-fg: #C2410C;
  --tw-bg: #E6F6FB;  --tw-fg: #0E7490;
  --gh-bg: #F1ECFE;  --gh-fg: #6D28D9;

  --radius: 12px;
  --gutter: clamp(16px, 4vw, 48px);
  --page-w: 1200px;
  --article-w: 860px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0B1120;
  --grid: #121B2D;
  --surface: #0F172A;
  --surface-2: #162036;
  --surface-3: #111A2E;
  --border: #26344D;
  --border-soft: #1C283E;
  --border-dashed: #3A4A66;
  --text: #CBD5E1;
  --text-strong: #F1F5F9;
  --text-soft: #B4C0D0;
  --muted: #94A3B8;
  --faint: #64748B;

  --accent: #60A5FA;
  --accent-hover: #93C5FD;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --on-accent: #0B1120;

  --syn-kw: #C4B5FD;
  --syn-str: #86EFAC;
  --syn-num: #FDBA74;
  --syn-type: #67E8F9;
  --syn-fn: #93C5FD;
  --syn-comment: #94A3B8;
  --syn-pink: #F9A8D4;

  --note-bg: #231A0E;
  --note-border: #6B4E1F;
  --note-label: #FDBA74;
  --note-icon: #FB923C;

  --li-bg: rgba(96, 165, 250, 0.14);  --li-fg: #93C5FD;
  --so-bg: rgba(251, 146, 60, 0.14);  --so-fg: #FDBA74;
  --tw-bg: rgba(34, 211, 238, 0.12);  --tw-fg: #67E8F9;
  --gh-bg: rgba(167, 139, 250, 0.16); --gh-fg: #C4B5FD;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  text-align: left;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
code, kbd, pre, samp { font-family: var(--font-mono); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--on-accent); }

.icon { width: 18px; height: 18px; flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 8px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--text-strong);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
}
.brand:hover { color: var(--text-strong); }
.brand__mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--text-strong);
  color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.brand__tilde { color: var(--muted); font-weight: 400; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 20px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-strong);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav__link:hover { color: var(--accent); }
.site-nav__link[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

.site-nav__tools { display: flex; align-items: center; gap: 12px; }

.lang-switch { display: flex; align-items: center; gap: 6px; }
.lang-switch__label { color: var(--muted); }
.lang-switch__item {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-strong);
  text-decoration: none;
}
a.lang-switch__item:hover { border-color: var(--accent); color: var(--accent); }
.lang-switch__item--current {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.theme-toggle {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-strong);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.icon-links { display: flex; gap: 2px; }
.icon-link {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text);
}
.icon-link:hover { color: var(--accent); background: var(--surface-2); }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 36px var(--gutter) 72px;
}

.layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px;
}
.layout__aside { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.layout__main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 10px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.panel__bar--tabs { align-items: flex-end; padding: 0 12px; }

.panel__bar-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-strong);
}

.panel__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 -1px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-color: var(--surface);
  border-top: 2px solid var(--accent);
  border-radius: 8px 8px 0 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-strong);
}

.panel__body { padding: clamp(20px, 3.5vw, 36px); }

.prompt-sign { color: var(--accent); }

/* --------------------------------------------------------------------------
   Buttons, chips
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--mono { font-family: var(--font-mono); font-size: 14px; font-weight: 700; }
.btn--block { width: 100%; }
.btn--small { min-height: 36px; padding: 0 12px; font-size: 13px; margin: 6px 0; }
.panel__bar--tabs .btn--small { margin-left: auto; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-3);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-strong);
}

/* --------------------------------------------------------------------------
   Profile sidebar
   -------------------------------------------------------------------------- */

.profile { padding: 18px; display: flex; flex-direction: column; gap: 16px; }

.profile__photo {
  display: block;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.profile__name {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

.profile__actions { display: flex; flex-direction: column; gap: 8px; }

.link-list { margin: 0; padding: 0; list-style: none; }
.link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-strong);
  text-decoration: none;
}
.link-list li:last-child .link-row { border-bottom: 0; }
.link-row:hover { background: var(--surface-3); color: var(--text-strong); }
.link-row__icon {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.link-row__icon--linkedin { background: var(--li-bg); color: var(--li-fg); }
.link-row__icon--stackoverflow { background: var(--so-bg); color: var(--so-fg); }
.link-row__icon--twitter { background: var(--tw-bg); color: var(--tw-fg); }
.link-row__icon--github { background: var(--gh-bg); color: var(--gh-fg); }
.link-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.link-row__name { font-weight: 600; }
.link-row__handle { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.link-row__arrow { color: var(--muted); }

/* --------------------------------------------------------------------------
   README-style prose (home intro, resume)
   -------------------------------------------------------------------------- */

.readme { display: flex; flex-direction: column; gap: 18px; }
.readme > * { margin: 0; }

.readme__lead {
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

.md-h2 {
  margin-top: 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-strong);
}
.md-h2__hash { font-family: var(--font-mono); font-weight: 400; color: var(--faint); }

.md-sub { margin-top: -10px !important; font-style: italic; color: var(--muted); }

.md-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.md-list > li { display: flex; gap: 12px; }
.md-list > li::before {
  content: "-";
  content: "-" / "";
  flex: 0 0 auto;
  font-family: var(--font-mono);
  color: var(--faint);
}
.md-list strong { color: var(--text-strong); }

.code-name { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--syn-type); }
.code-ref { font-family: var(--font-mono); font-size: 14px; color: var(--syn-kw); }

.comment-line {
  padding: 18px 20px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: clamp(18px, 2vw, 21px);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-strong);
}
.comment-line__mark { font-family: var(--font-mono); font-weight: 400; color: var(--syn-str); }

.code-block {
  margin: 0;
  padding: 16px 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-3);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-strong);
}
.tok-kw { color: var(--syn-kw); }
.tok-str { color: var(--syn-str); }
.tok-num { color: var(--syn-num); }
.tok-type { color: var(--syn-type); }
.tok-comment { color: var(--syn-comment); }

/* --------------------------------------------------------------------------
   Notice (French home: "this blog is mostly in English")
   -------------------------------------------------------------------------- */

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 20px 24px;
  border: 1px solid var(--note-border);
  border-radius: var(--radius);
  background: var(--note-bg);
}
.notice__icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border: 1px solid var(--note-border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--note-icon);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notice__body { flex: 1 1 340px; min-width: 0; }
.notice__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--note-label);
}
.notice__title { margin: 2px 0 0; font-size: 18px; font-weight: 700; color: var(--text-strong); }
.notice__text { margin: 4px 0 0; font-size: 15px; color: var(--text-soft); }
.notice .btn--ghost { border-color: var(--text-strong); }
.notice--accent {
  --note-bg: var(--accent-soft);
  --note-border: var(--border);
  --note-icon: var(--li-fg);
}

/* --------------------------------------------------------------------------
   Article lists
   -------------------------------------------------------------------------- */

.post-list { margin: 0; padding: 0; list-style: none; }

.post-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px 28px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-soft);
}
.post-item__body { flex: 1 1 360px; min-width: 0; }
.post-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.post-item__title { margin: 6px 0 0; font-size: 19px; font-weight: 600; line-height: 1.35; }
.post-item__title a { color: var(--text-strong); text-decoration: none; }
.post-item__title a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-item__excerpt { margin: 6px 0 0; font-size: 15px; color: var(--text-soft); }
.post-item__media {
  flex: 0 1 200px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.tag { font-family: var(--font-mono); font-weight: 500; color: var(--muted); }
.tag--purple { color: var(--syn-kw); }
.tag--teal { color: var(--syn-type); }
.tag--orange { color: var(--syn-num); }
.tag--green { color: var(--syn-str); }
.tag--blue { color: var(--syn-fn); }
.tag--pink { color: var(--syn-pink); }

.post-archive__title {
  margin: 0;
  padding: 18px 24px 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.post-archive { margin: 0; padding: 0 24px 12px; list-style: none; }
.post-archive__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.post-archive__item:last-child { border-bottom: 0; }
.post-archive__date { flex: 0 0 96px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.post-archive__link { flex: 1 1 360px; min-width: 0; color: var(--text-strong); text-decoration: none; font-size: 15px; font-weight: 500; }
.post-archive__link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Page heading (side projects, resume)
   -------------------------------------------------------------------------- */

.page-head { margin-bottom: 36px; }
.page-head__prompt { margin: 0; font-family: var(--font-mono); font-size: 14px; color: var(--muted); }
.page-head__title {
  margin: 8px 0 0;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
.page-head__intro { margin: 14px 0 0; max-width: 640px; font-size: 18px; color: var(--text-soft); }

/* --------------------------------------------------------------------------
   Side projects
   -------------------------------------------------------------------------- */

.projects { display: flex; flex-direction: column; gap: 24px; }

.project__kind { color: var(--syn-str); }

.project__body {
  padding: clamp(18px, 3vw, 28px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px 32px;
}
.project__info { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.project__head { display: flex; align-items: center; gap: 16px; }
.project__logo {
  flex: 0 0 auto;
  width: 64px; height: 64px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  object-fit: cover;
}
.project__logo--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}
.project__name {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
.project__pitch { margin: 0; color: var(--text-soft); }
.project__links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.project__url { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.project__url-key { color: var(--syn-str); }
.project__gallery {
  flex: 2 1 480px;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 12px;
}
.project__gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.icon-btn {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------------------------
   Resume
   -------------------------------------------------------------------------- */

.timeline {
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 24px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.timeline__item { position: relative; display: flex; flex-direction: column; gap: 6px; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 6px;
  width: 14px; height: 14px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
}
.timeline__item--current::before { background: var(--accent); }
.timeline__title { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.35; color: var(--text-strong); }
.timeline__at { font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: var(--syn-kw); }
.timeline__meta { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.timeline__body { margin-top: 8px; display: flex; flex-direction: column; gap: 12px; }
.timeline__body > * { margin: 0; }
.timeline__text { margin: 0; color: var(--text-soft); }
.timeline__label { margin: 0; font-weight: 600; color: var(--text-strong); }
.timeline__block { display: flex; flex-direction: column; gap: 6px; }
.timeline__block .md-list { gap: 4px; }
.timeline__sub { margin: 8px 0 0; font-size: 16px; font-weight: 700; color: var(--text-strong); }
.timeline__period {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-soft);
  font-size: 15px;
}
.timeline__period > p { margin: 0; }
.timeline__period-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.timeline__period-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--text-strong); }
.timeline__period-dates { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.timeline__env { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.timeline__env-key { color: var(--syn-str); }

/* --------------------------------------------------------------------------
   Article pages (markup inherited from the original blog)
   -------------------------------------------------------------------------- */

#main_ctn.post_ctn {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
}

#arianne_wrapper,
#main_ctn > #post_ctn,
#relatedpostlist_ctn {
  width: min(var(--article-w), calc(100% - 2 * var(--gutter)));
  margin-left: auto;
  margin-right: auto;
}

#arianne_wrapper { margin-top: 32px; margin-bottom: 12px; }
#arianne_wrapper ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
#arianne_wrapper li::after { content: "/"; content: "/" / ""; margin: 0 8px; color: var(--faint); }
#arianne_wrapper li.active { display: none; }
#arianne_wrapper a { color: var(--muted); text-decoration: none; }
#arianne_wrapper a:hover { color: var(--accent); text-decoration: underline; }

#main_ctn > #post_ctn {
  margin-bottom: 56px;
  padding: clamp(22px, 5vw, 56px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 17px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

#post_ctn h1 {
  margin: 0 0 28px;
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
#post_ctn h2,
#post_ctn h3,
#post_ctn h4 { color: var(--text-strong); line-height: 1.3; }
#post_ctn h2 { margin: 44px 0 14px; font-size: 25px; font-weight: 700; }
#post_ctn h3 { margin: 32px 0 10px; font-size: 20px; font-weight: 700; }
#post_ctn h4 { margin: 24px 0 8px; font-size: 17px; font-weight: 700; }
#post_ctn h2::before { content: "## "; content: "## " / ""; font-family: var(--font-mono); font-weight: 400; color: var(--faint); }
#post_ctn h3::before { content: "### "; content: "### " / ""; font-family: var(--font-mono); font-weight: 400; color: var(--faint); }

#post_ctn p { margin: 0 0 18px; }
#post_ctn ul,
#post_ctn ol { margin: 0 0 18px; padding-left: 1.4em; }
#post_ctn li { margin: 4px 0; }
#post_ctn li::marker { color: var(--faint); }
#post_ctn a { color: var(--accent); text-underline-offset: 3px; }
#post_ctn strong { color: var(--text-strong); }
#post_ctn hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

#post_ctn :not(pre) > code {
  padding: 1px 6px;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 0.86em;
  color: var(--text-strong);
}

#post_ctn pre {
  margin: 0 0 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-3);
  overflow: hidden;
}
#post_ctn pre > code {
  display: block;
  padding: 16px 20px;
  overflow-x: auto;
  background: transparent;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-strong);
  -moz-tab-size: 4;
  tab-size: 4;
}

#post_ctn blockquote,
#post_ctn span.blockquote {
  display: block;
  margin: 0 0 22px;
  padding: 16px 20px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-style: italic;
}
#post_ctn blockquote > :last-child { margin-bottom: 0; }

#post_ctn table { width: 100%; border-collapse: collapse; font-size: 15px; }
#post_ctn th,
#post_ctn td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
#post_ctn th { background: var(--surface-2); color: var(--text-strong); font-weight: 600; }
#post_ctn div.table_wrapper { margin: 0 0 22px; overflow-x: auto; }

#post_ctn div.pic_wrapper { clear: both; margin: 0 0 22px; text-align: center; }
#post_ctn div.pic_wrapper img,
#post_ctn p > img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

#post_ctn div.video-wrapper {
  position: relative;
  height: 0;
  margin: 0 0 22px;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: 10px;
}
#post_ctn div.video-wrapper > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

#post_ctn p.ttl { font-weight: 700; font-size: 1.1em; color: var(--text-strong); }
#post_ctn ul.steps { padding-left: 1.4em; }
#post_ctn li:has(> span.step_number) { list-style: none; }
#post_ctn span.step_number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}
#post_ctn span.thnclwrd { font-style: italic; letter-spacing: 0.08em; }

#post_ctn div#crdny {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
#post_ctn div#tags_wrapper ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#post_ctn div#tags_wrapper li {
  margin: 0;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-3);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--syn-type);
}
#post_ctn div#tags_wrapper li::before { content: "#"; content: "#" / ""; color: var(--faint); }

#relatedpostlist_ctn { margin-bottom: 48px; }
#relatedpostlist_ctn h2 { font-size: 20px; color: var(--text-strong); }

div.toolbar { display: none !important; }

/* highlight.js tokens (v9) — colors follow the active theme */
.hljs { background: transparent; color: var(--text-strong); }
.hljs-comment,
.hljs-quote { color: var(--syn-comment); font-style: italic; }
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-tag,
.hljs-name { color: var(--syn-kw); }
.hljs-string,
.hljs-regexp,
.hljs-meta-string,
.hljs-addition { color: var(--syn-str); }
.hljs-number,
.hljs-symbol,
.hljs-bullet,
.hljs-link { color: var(--syn-num); }
.hljs-built_in,
.hljs-type,
.hljs-class .hljs-title,
.hljs-attr,
.hljs-attribute,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo { color: var(--syn-type); }
.hljs-title,
.hljs-function .hljs-title,
.hljs-section { color: var(--syn-fn); }
.hljs-meta,
.hljs-doctag,
.hljs-subst,
.hljs-params { color: var(--text); }
.hljs-deletion { color: var(--syn-pink); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .site-nav { gap: 0 14px; font-size: 13px; }
  .site-nav__tools { width: 100%; justify-content: space-between; padding-bottom: 6px; }
  .page { padding-top: 20px; }
  .profile__photo { max-width: 160px; }
  .panel__body { padding-left: 16px; padding-right: 16px; }
  .timeline { padding-left: 18px; }
  .timeline__item::before { left: -26px; }
  .timeline__period { padding: 12px; }
  .post-item { padding: 18px 16px; }
  .post-archive__title { padding-left: 16px; padding-right: 16px; }
  .post-archive { padding-left: 16px; padding-right: 16px; }
  #main_ctn > #post_ctn { font-size: 16px; }
  #post_ctn h2 { font-size: 22px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .icon-btn, .theme-toggle, .lang-switch__item, .site-nav__link, .link-row, .icon-link {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }
}

@media print {
  body { background: #FFFFFF; }
  .site-header, .site-footer, .theme-toggle, .skip-link { display: none; }
  .panel, #main_ctn > #post_ctn { border: 0; }
}
