:root {
  --ink: #0b1731;
  --ink-soft: #3f4d66;
  --muted: #6a758b;
  --blue: #165bbd;
  --blue-deep: #0a3f8f;
  --blue-pale: #edf4ff;
  --line: #dfe6f0;
  --line-strong: #cbd7e7;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --paper: #fcfdff;
  --accent: #b8e600;
  --accent-dark: #405500;
  --shadow-soft: 0 8px 24px rgba(13, 33, 68, .055);
  --shadow-cover: 0 16px 32px rgba(13, 33, 68, .12);
  --radius: 13px;
  --content: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.58;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-deep); text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { color: var(--blue); }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { display: block; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.container { width: min(calc(100% - 2.5rem), var(--content)); margin-inline: auto; }
.skip-link { position: fixed; left: 1rem; top: -100px; z-index: 1000; padding: .8rem 1rem; background: var(--ink); color: #fff; border-radius: 9px; }
.skip-link:focus { top: 1rem; }

/* Header and navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(223, 230, 240, .82);
  background: rgba(252, 253, 255, .92);
  backdrop-filter: blur(18px);
  transition: box-shadow .2s ease, background .2s ease;
}
.site-header[data-scrolled="true"] { box-shadow: 0 8px 28px rgba(11, 23, 49, .07); background: rgba(255, 255, 255, .96); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--blue-deep);
  font-size: 1.18rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.13em;
  padding-right: .12em;
}
.brand-name { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.site-nav { display: flex; align-items: center; gap: clamp(.9rem, 1.8vw, 1.55rem); font-size: .91rem; font-weight: 680; }
.site-nav a { position: relative; padding: 1.85rem 0 1.65rem; text-decoration: none; color: var(--ink-soft); white-space: nowrap; }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 1.15rem; height: 2px; border-radius: 2px; background: var(--blue-deep); transform: scaleX(0); transform-origin: center; transition: transform .2s ease; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--blue-deep); }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav-toggle { display: none; border: 1px solid var(--line); background: white; border-radius: 10px; width: 44px; height: 44px; color: var(--ink); font-size: 1.2rem; }

/* Hero */
.hero { padding: clamp(4.2rem, 7vw, 6.6rem) 0 clamp(4rem, 6vw, 5.8rem); overflow: hidden; background: radial-gradient(circle at 82% 31%, rgba(226, 238, 255, .88) 0, rgba(226, 238, 255, 0) 34%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(390px, .88fr); gap: clamp(2rem, 5vw, 5.2rem); align-items: center; }
.hero-copy-column { min-width: 0; }
h1 { margin: 0 0 .9rem; font-size: clamp(3.6rem, 6.6vw, 6.35rem); line-height: .98; letter-spacing: -.065em; white-space: nowrap; }
.hero-subline { margin: 0 0 .6rem; color: var(--blue-deep); font-size: clamp(1.06rem, 1.75vw, 1.32rem); font-weight: 770; }
.name-note { margin: 0 0 1.45rem; color: var(--muted); font-size: .93rem; }
.hero-copy { max-width: 760px; margin: 0; font-size: clamp(1rem, 1.25vw, 1.1rem); color: var(--ink-soft); line-height: 1.72; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1.75rem; }
.hero-actions { gap: .8rem 1rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: .72rem 1.05rem; border-radius: 9px; border: 1px solid var(--line); text-decoration: none; font-weight: 760; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue-deep); color: white; border-color: var(--blue-deep); box-shadow: 0 9px 22px rgba(10, 63, 143, .18); }
.btn-primary:hover { color: white; background: var(--blue); border-color: var(--blue); }
.btn-secondary { background: white; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: #a9bad1; color: var(--blue-deep); }
.btn-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.inline-action { font-size: .92rem; font-weight: 720; text-decoration: none; padding: .6rem .25rem; }
.hero-art { min-height: 455px; display: grid; place-items: center; }
.hero-photo-frame { position: relative; width: min(370px, 100%); aspect-ratio: 1589 / 2048; margin: 0; border-radius: 24px; overflow: hidden; background: #edf2f8; border: 1px solid #d8e3f1; box-shadow: 0 24px 54px rgba(11, 23, 49, .12); }
.hero-photo-frame::before { content: ""; position: absolute; inset: auto -32px -28px auto; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(22,91,189,.14), rgba(22,91,189,0)); z-index: 0; pointer-events: none; }
.hero-photo { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center center; border-radius: 0; background: #edf2f8; }

/* Shared sections and headings */
section { scroll-margin-top: 92px; }
.section { padding: clamp(4rem, 6vw, 5.4rem) 0; }
.section-soft { background: var(--surface-soft); border-block: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 2rem; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 3.3vw, 2.75rem); letter-spacing: -.045em; line-height: 1.08; }
.section-heading p { margin: .4rem 0 0; color: var(--muted); max-width: 720px; }
.compact-heading { margin-bottom: 1.55rem; }
.text-link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 760; white-space: nowrap; text-decoration: none; }
.text-link svg, .panel-footer-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.card-icon { display: grid; place-items: center; width: 45px; height: 45px; flex: 0 0 45px; border-radius: 11px; background: var(--blue-pale); color: var(--blue-deep); margin-bottom: .9rem; }
.card-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-green { background: #eaf8ef; color: #118543; }
.icon-purple { background: #f1ecfb; color: #6840a8; }
.icon-teal { background: #e6f6f7; color: #137c82; }
.icon-red { background: #fff0ed; color: #c7462c; }
.icon-lime { background: #eff8d5; color: #4f6900; }

/* Profile */
.profile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.profile-card { padding: 1.25rem; min-height: 218px; }
.profile-card h3, .tool-card h3, .project-card h3 { margin: 0 0 .65rem; font-size: 1.06rem; line-height: 1.28; }
.profile-card ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: .92rem; }
.profile-card li + li { margin-top: .22rem; }
.profile-card .nested-list { margin: .4rem 0 .15rem; padding-left: 1.15rem; color: var(--muted); font-size: .88em; }
.profile-card .nested-list li + li { margin-top: .3rem; }

/* Books */
.book-group + .book-group { margin-top: 3rem; }
.group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.group-heading h3 { margin: 0; font-size: 1.2rem; letter-spacing: -.025em; }
.group-heading span { color: var(--muted); font-size: .88rem; }
.book-grid { display: grid; gap: clamp(1rem, 2vw, 1.55rem); align-items: start; }
.book-grid-published { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.book-grid-announced { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 940px; margin-inline: auto; }
.book-card { min-width: 0; }
.book-cover-wrap { position: relative; display: grid; place-items: center; aspect-ratio: 2 / 3; padding: .58rem; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-cover); transition: transform .2s ease, box-shadow .2s ease; }
.book-card:hover .book-cover-wrap { transform: translateY(-4px); box-shadow: 0 22px 40px rgba(13, 33, 68, .16); }
.book-cover { width: 100%; height: 100%; object-fit: contain; border-radius: 5px; background: #f5f6f8; }
.book-meta { padding: .9rem .15rem 0; }
.book-meta h3 { margin: 0; font-size: 1.01rem; line-height: 1.32; }
.book-meta p { margin: .32rem 0 0; color: var(--muted); font-size: .87rem; line-height: 1.45; }
.book-status { display: inline-block; margin-top: .55rem; color: var(--blue-deep); font-size: .76rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }

/* Publications and BSI projects */
.split-grid { display: grid; grid-template-columns: minmax(390px, .86fr) minmax(0, 1.14fr); gap: 1.2rem; align-items: start; }
.panel { padding: 1.25rem; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading h2 { margin: 0; font-size: 1.55rem; letter-spacing: -.035em; line-height: 1.12; }
.panel-kicker { display: block; margin-bottom: .25rem; color: var(--blue-deep); font-size: .72rem; font-weight: 820; letter-spacing: .09em; text-transform: uppercase; }
.publication-list { display: grid; gap: .48rem; }
.publication-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 18px; gap: .82rem; align-items: center; padding: .78rem .8rem; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); text-decoration: none; background: white; transition: border-color .18s ease, background .18s ease; }
.publication-row:hover { border-color: #abc4e8; background: #f9fbff; }
.publication-year { display: inline-grid; place-items: center; min-height: 30px; padding: .15rem .25rem; border-radius: 7px; background: var(--blue-pale); color: var(--blue-deep); font-weight: 820; font-size: .82rem; }
.publication-title { display: block; font-size: .91rem; line-height: 1.34; font-weight: 690; }
.publication-medium { display: block; margin-top: .13rem; color: var(--muted); font-size: .75rem; line-height: 1.3; }
.row-arrow { width: 17px; height: 17px; fill: none; stroke: #8a97aa; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.panel-footer-link { display: inline-flex; align-items: center; gap: .38rem; margin-top: 1rem; font-size: .9rem; font-weight: 760; text-decoration: none; }
.project-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.project-card { padding: 1rem; min-height: 152px; text-align: left; box-shadow: none; display: flex; flex-direction: column; justify-content: flex-start; }
.project-card .card-icon { margin-bottom: .7rem; }
.panel-intro { margin: 0 0 1rem; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.project-card p { margin: 0; color: var(--ink-soft); font-size: .82rem; line-height: 1.45; }
.topic-tag { display: inline-block; margin: .15rem 0 0; padding: .2rem .45rem; border-radius: 5px; background: #fff4ce; color: #714c00; font-size: .66rem; font-weight: 820; letter-spacing: .02em; }
.role-note { display: block; margin-top: .58rem; padding-top: .52rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .7rem; line-height: 1.35; font-weight: 650; }

/* Open source */
.tools-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .82rem; }
.tool-card { padding: 1rem; min-height: 242px; position: relative; display: flex; flex-direction: column; }
.tool-card p { margin: 0; color: var(--ink-soft); font-size: .83rem; line-height: 1.5; }
.tool-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: .8rem 0 2.45rem; }
.tool-tags span { padding: .18rem .45rem; border-radius: 5px; background: var(--surface-soft); color: var(--muted); font-size: .68rem; font-weight: 740; }
.tool-link { position: absolute; left: 1rem; bottom: .9rem; display: inline-flex; gap: .4rem; align-items: center; font-weight: 760; font-size: .85rem; text-decoration: none; }
.tool-link svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }

/* TeamTweak */
.teamtweak-shell { overflow: hidden; border: 1px solid #dbe6bf; background: #fff; border-radius: 18px; box-shadow: 0 16px 40px rgba(39, 58, 5, .08); }
.teamtweak-grid { display: grid; grid-template-columns: 1.08fr .92fr; min-height: 550px; }
.teamtweak-copy { padding: clamp(2rem, 4.5vw, 3.7rem); background: radial-gradient(circle at 15% 10%, rgba(184, 230, 0, .15), transparent 32%), #fff; }
.teamtweak-kicker { color: #587000; font-weight: 830; letter-spacing: .08em; text-transform: uppercase; font-size: .75rem; }
.hh-logo { width: min(360px, 76%); max-height: 165px; object-fit: contain; object-position: left center; margin: .55rem 0 .75rem; }
.teamtweak-copy h2 { margin: 0 0 .8rem; font-size: clamp(2rem, 3.7vw, 3.25rem); letter-spacing: -.045em; }
.teamtweak-copy > p { margin: 0; color: var(--ink-soft); font-size: 1rem; max-width: 620px; }
.teamtweak-cards { display: grid; gap: .65rem; margin-top: 1.35rem; }
.teamtweak-mini { display: grid; grid-template-columns: 48px 1fr; gap: .82rem; align-items: center; padding: .78rem; border: 1px solid #dce8c1; border-radius: 10px; background: rgba(255, 255, 255, .9); }
.teamtweak-mini img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.teamtweak-mini .card-icon { width: 48px; height: 48px; margin: 0; }
.teamtweak-mini strong { display: block; font-size: .94rem; }
.teamtweak-mini span { display: block; color: var(--muted); font-size: .81rem; line-height: 1.4; }
.teamtweak-visual { position: relative; min-height: 550px; background: #f2f5eb; display: grid; place-items: center; overflow: hidden; }
.teamtweak-visual::before { content: ""; position: absolute; inset: 0; background: url('../images/hacker-history/hacker-history-visual.webp') center/cover; opacity: .09; filter: grayscale(.1); }
.teamtweak-poster { position: relative; z-index: 2; height: min(495px, 88%); width: auto; filter: drop-shadow(0 22px 38px rgba(0, 0, 0, .18)); transform: rotate(1deg); }

/* Contact and footer */
.contact-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2rem; padding: 2.25rem; border-radius: 16px; background: var(--ink); color: white; }
.contact-kicker { display: block; margin-bottom: .25rem; color: #8db9ef; font-size: .74rem; font-weight: 820; letter-spacing: .09em; text-transform: uppercase; }
.contact-box h2 { margin: 0 0 .45rem; font-size: 2.05rem; letter-spacing: -.035em; }
.contact-box p { margin: 0; max-width: 850px; color: #cbd6e7; }
.contact-details { margin-top: 1rem; display: grid; gap: .15rem; color: #fff; }
.contact-details a { color: #fff; }
.site-footer { padding: 2.2rem 0; background: #07162f; color: #c9d4e6; font-size: .9rem; }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .85rem 1rem; }
.site-footer a { color: white; }

/* Secondary pages */
.legal-note { display: inline-block; padding: .45rem .7rem; border-radius: 8px; background: #fff1d7; color: #744c00; font-size: .88rem; font-weight: 720; }
.page-hero { padding: 4rem 0 2.3rem; background: linear-gradient(180deg, #f1f6ff, var(--paper)); }
.page-hero h1 { white-space: normal; font-size: clamp(2.8rem, 6vw, 5.2rem); }
.page-hero p { max-width: 800px; color: var(--ink-soft); font-size: 1.08rem; }
.content-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2.2rem; align-items: start; }
.toc { position: sticky; top: 98px; padding: 1rem; }
.toc strong { display: block; margin-bottom: .55rem; }
.toc a { display: block; padding: .42rem .35rem; text-decoration: none; font-size: .9rem; }
.prose { min-width: 0; }
.prose-section { padding: 1.45rem; margin-bottom: 1rem; }
.prose-section h2 { margin: 0 0 .85rem; font-size: 1.8rem; letter-spacing: -.03em; }
.prose-section h3 { margin: 1.3rem 0 .35rem; font-size: 1.12rem; }
.prose-section p, .prose-section li { color: #42506a; }
.bib-entry { padding: 1rem 0; border-top: 1px solid var(--line); }
.bib-entry:first-of-type { border-top: 0; }
.bib-entry strong { color: var(--ink); }
.entry-meta { color: #667188; font-size: .92rem; }
.entry-links { margin-top: .4rem; display: flex; flex-wrap: wrap; gap: .75rem; font-size: .9rem; }
.placeholder { color: #975a00; background: #fff8e8; border: 1px dashed #e1b75f; padding: .35rem .55rem; border-radius: 8px; }
.legal-summary { margin: 1.25rem 0 2rem; padding: 1rem 1.1rem; border-left: 4px solid var(--blue); background: var(--blue-pale); border-radius: 0 10px 10px 0; color: var(--ink-soft); }
.legal-meta { display: grid; gap: .55rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.legal-meta strong { color: var(--ink); }
.legal-list { padding-left: 1.25rem; }
.legal-list li + li { margin-top: .35rem; }
.code-placeholder { display: inline-block; padding: .1rem .38rem; border-radius: .35rem; background: #fff2f2; color: #8b1e1e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }

/* Interaction and accessibility */
:focus-visible { outline: 3px solid #78aef0; outline-offset: 4px; border-radius: 5px; }
.btn[aria-disabled="true"] { opacity: .68; cursor: not-allowed; transform: none; }

/* Responsive layout */
@media (max-width: 1180px) {
  .site-nav { gap: .9rem; font-size: .85rem; }
  .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 2.5rem; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card { min-height: 176px; }
  .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .site-nav { display: none; position: absolute; top: 68px; left: 1rem; right: 1rem; flex-direction: column; align-items: stretch; gap: 0; padding: .65rem; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 42px rgba(11, 23, 49, .14); }
  .site-nav[data-open="true"] { display: flex; }
  .site-nav a { padding: .72rem .8rem; }
  .site-nav a::after { display: none; }
  .site-nav a[aria-current="page"] { background: var(--blue-pale); border-radius: 8px; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .hero-grid { grid-template-columns: 1fr .72fr; }
  h1 { white-space: normal; font-size: clamp(3.5rem, 8vw, 5.7rem); }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-grid-published { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-grid-announced { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .teamtweak-grid { grid-template-columns: 1fr; }
  .teamtweak-visual { min-height: 480px; }
  .content-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 1.5rem), var(--content)); }
  .header-inner { min-height: 68px; }
  .hero { padding-top: 3.6rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .hero-copy { max-width: 680px; }
  .hero-art { min-height: 340px; }
  .hero-photo-frame { width: min(340px, 82vw); }
  .section-heading { display: block; }
  .section-heading .text-link { margin-top: .75rem; }
  .book-grid-announced { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
  .book-grid-announced .book-card:last-child { grid-column: 1 / -1; width: calc(50% - .55rem); justify-self: center; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-box { grid-template-columns: 1fr; }
  .footer-grid { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .container { width: min(calc(100% - 1.1rem), var(--content)); }
  h1 { font-size: clamp(3rem, 15vw, 4.25rem); }
  .hero-subline { font-size: 1rem; }
  .hero-art { min-height: 300px; }
  .hero-photo-frame { width: min(300px, 78vw); }
  .section { padding: 3.4rem 0; }
  .section-heading h2 { font-size: 2rem; }
  .profile-grid, .tools-grid { grid-template-columns: 1fr; }
  .profile-card { min-height: auto; }
  .book-grid-published, .book-grid-announced { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
  .book-grid-announced .book-card:last-child { width: calc(50% - .45rem); }
  .book-cover-wrap { padding: .4rem; border-radius: 9px; }
  .book-meta { padding-top: .65rem; }
  .book-meta h3 { font-size: .9rem; }
  .book-meta p { font-size: .76rem; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card { min-height: auto; }
  .publication-row { grid-template-columns: 48px minmax(0, 1fr); }
  .row-arrow { display: none; }
  .teamtweak-copy { padding: 1.45rem; }
  .hh-logo { width: min(330px, 92%); }
  .teamtweak-poster { max-width: 72%; height: auto; }
  .contact-box { padding: 1.5rem; }
}

@media (max-width: 380px) {
  .book-grid-published, .book-grid-announced { grid-template-columns: 1fr; }
  .book-grid-announced .book-card:last-child { grid-column: auto; width: auto; }
  .book-card { max-width: 260px; margin-inline: auto; }
  .actions { align-items: stretch; }
  .actions .btn { width: 100%; }
  .inline-action { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .site-footer, .nav-toggle, .actions { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .prose-section { box-shadow: none !important; border-color: #bbb !important; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; }
}

/* v1.2 final polish: robust wrapping for long technical names */
.project-card h3,
.tool-card h3,
.book-meta h3,
.publication-title {
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* v1.5 publication polish */
.book-cover-wrap:is(a) { text-decoration: none; color: inherit; }
.book-links { display: flex; flex-wrap: wrap; gap: .55rem .8rem; margin-top: .65rem; }
.book-links a { display: inline-flex; align-items: center; gap: .3rem; font-size: .79rem; font-weight: 780; text-decoration: none; }
.book-links svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.book-grid-featured { grid-template-columns: minmax(0, 300px); justify-content: center; }
.book-grid-future { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 650px; margin-inline: auto; }
.teamtweak-cards-single { max-width: 620px; }
@media (max-width: 620px) {
  .book-grid-future { grid-template-columns: 1fr; max-width: 330px; }
  .book-grid-featured { max-width: 330px; margin-inline: auto; }
}
