:root {
    --brand: #1a2ecb;
    --brand-dark: #10197a;
    --ink: #1b1b1f;
    --muted: #55565b;
    --bg: #ffffff;
    --line: #e4e6ef;
    --font: "Franklin Gothic Demi Cond", "Franklin Gothic Medium", "Arial Narrow",
            "Segoe UI", Arial, sans-serif;
  }

  * { box-sizing: border-box; }

  html { -webkit-text-size-adjust: 100%; }

  body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
  }

  .wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 48px;
  }

  header.site {
    padding-top: 8px;
  }

  /* ---- Dynamic text logo ---- */
  .logo {
    max-width: 900px;
    user-select: none;
  }

  .logo-mark {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: clamp(10px, 1.8vw, 22px);
    line-height: 1;
  }

  .title-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .brand {
    font-family: "Impact", "Haettenschweiler", "Franklin Gothic Bold",
                 "Arial Narrow Bold", sans-serif;
    font-weight: 400;
    font-size: clamp(2.6rem, 10.5vw, 6.2rem);
    color: var(--brand);
    background: linear-gradient(180deg, #3340e6 0%, var(--brand) 55%, var(--brand-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    filter: drop-shadow(4px 7px 6px rgba(20, 20, 24, 0.6));
  }

  .tagline {
    font-family: "Arial Narrow", "Arial Black", Arial, sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    font-size: clamp(0.7rem, 2.15vw, 1.3rem);
    color: var(--brand);
    white-space: nowrap;
  }

  /* Reflection of the title only: rendered to a canvas and animated per raster line. */
  .logo-reflection {
    display: block;
    pointer-events: none;
    opacity: 0.62;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0.0) 94%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0.0) 94%);
  }

  /* Moving "water" light streak driven by the --shimmer custom property. */
  .definition {
    margin: 32px 0;
    padding: 20px 24px;
    border-left: 4px solid var(--brand);
    background: #f6f7fc;
    border-radius: 0 8px 8px 0;
  }

  .definition .term {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--brand-dark);
  }

  .definition .pron {
    color: var(--muted);
    font-style: normal;
    font-size: 1rem;
  }

  .definition .pos {
    font-style: italic;
    color: var(--muted);
    margin-right: 6px;
  }

  .definition p {
    margin: 10px 0 0;
    max-width: 62ch;
  }

  h2 {
    font-size: 1.15rem;
    color: var(--brand-dark);
    margin: 40px 0 16px;
    letter-spacing: .3px;
  }

  .lines {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 8px;
  }

  .lines a {
    display: inline-block;
    line-height: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(16, 25, 122, .18);
    transition: transform .15s ease, box-shadow .15s ease;
  }

  .lines a:hover,
  .lines a:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(16, 25, 122, .28);
    outline: none;
  }

  .lines img {
    display: block;
    width: 100%;
    max-width: 195px;
    height: auto;
  }

  .inquiries {
    margin-top: 32px;
  }

  .inquiries p {
    margin: 0 0 12px;
    max-width: 70ch;
  }

  a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
  }

  a:hover,
  a:focus-visible {
    text-decoration: underline;
  }

  footer.site {
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .85rem;
  }

  @media (max-width: 480px) {
    .lines img { max-width: 100%; }
    .lines a { flex: 1 1 140px; }
  }

  /* ================= Site chrome (nav, hero, sections, cards, footer) ================= */
  html { scroll-behavior: smooth; }

  /* ---- Top navigation ---- */
  .nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .nav-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .nav-logo {
    font-family: "Impact", "Haettenschweiler", "Arial Narrow Bold", sans-serif;
    font-weight: 400;
    font-size: 1.5rem;
    letter-spacing: .01em;
    color: var(--brand);
    text-decoration: none;
    white-space: nowrap;
  }
  .nav-logo:hover { color: var(--brand-dark); text-decoration: none; }
  .nav-links {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2.4vw, 26px);
  }
  .nav-links a {
    color: var(--ink);
    font-weight: 600;
    font-size: .98rem;
    text-decoration: none;
  }
  .nav-links a:hover { color: var(--brand); text-decoration: none; }

  /* ---- Buttons ---- */
  .btn {
    display: inline-block;
    border-radius: 999px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
  }
  .btn:hover { text-decoration: none; transform: translateY(-1px); }
  .btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(16,25,122,.28); }
  .btn-primary:hover { background: var(--brand-dark); color: #fff; }
  .btn-ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
  .btn-ghost:hover { background: var(--brand); color: #fff; }
  .btn-sm { padding: 7px 16px; font-size: .9rem; background: var(--brand); color: #fff; }
  .btn-sm:hover { background: var(--brand-dark); color: #fff; }

  /* ---- Hero ---- */
  .hero { padding: 44px 20px 12px; }
  .hero-inner { max-width: 1040px; margin: 0 auto; }
  .hero-sub {
    margin: 22px 0 0;
    max-width: 60ch;
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    color: var(--muted);
  }
  .hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

  /* ---- Sections ---- */
  .container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
  .section { padding: 44px 0; border-top: 1px solid var(--line); }
  .section:first-of-type { border-top: none; }
  section[id] { scroll-margin-top: 78px; }
  .section > h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--brand-dark);
    margin: 0 0 18px;
    letter-spacing: normal;
  }
  .lead { max-width: 68ch; font-size: 1.05rem; color: var(--ink); }

  /* ---- Card grids ---- */
  .cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 12px;
  }
  .card {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(16,25,122,.16); }
  .card > a { line-height: 0; }
  .card img { display: block; width: 100%; height: auto; }
  .card-body { padding: 14px 16px 18px; }
  .card h3 { margin: 0 0 6px; font-size: 1.15rem; color: var(--brand-dark); }
  .card p { margin: 0 0 10px; color: var(--muted); font-size: .95rem; }
  .card .more { font-weight: 700; color: var(--brand); }
  .card-meta { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 8px; }

  /* ---- Footer ---- */
  .site-footer { margin-top: 24px; background: #f6f7fc; border-top: 1px solid var(--line); }
  .footer-inner {
    max-width: 1040px; margin: 0 auto; padding: 36px 20px 22px;
    display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 24px;
  }
  .footer-brand .nav-logo { font-size: 1.7rem; }
  .footer-col h4 { margin: 0 0 10px; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .footer-col ul { list-style: none; margin: 0; padding: 0; }
  .footer-col li { margin: 0 0 8px; }
  .footer-col a { color: var(--ink); font-weight: 600; }
  .footer-bottom {
    max-width: 1040px; margin: 0 auto; padding: 14px 20px 26px;
    color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line);
  }

  @media (max-width: 720px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 520px) {
    .nav-links { gap: 14px; }
    .footer-inner { grid-template-columns: 1fr; }
  }

  /* ---- About page ---- */
  .page-hero { padding: 40px 20px 8px; }
  .page-hero .container { padding: 0 20px; }
  .page-title {
    font-size: clamp(2rem, 6vw, 3.4rem);
    color: var(--brand-dark);
    margin: 0 0 10px;
    letter-spacing: normal;
  }
  .page-hero .lead { color: var(--muted); font-size: clamp(1.05rem, 2.2vw, 1.3rem); }

  .about-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
  }
  .about-grid .prose p { max-width: 60ch; margin: 0 0 18px; font-size: 1.05rem; }
  .about-grid .prose p:first-child { margin-top: 0; }

  .founded {
    display: inline-block;
    margin: 6px 0 22px;
    padding: 8px 16px;
    border-radius: 999px;
    background: #f0f1fb;
    color: var(--brand-dark);
    font-weight: 700;
    letter-spacing: .03em;
    font-size: .95rem;
  }

  .subject figure { margin: 0; }
  .subject img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 10px 28px rgba(16, 25, 122, .18);
  }
  .subject figcaption {
    margin-top: 10px;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.4;
  }

  @media (max-width: 760px) {
    .about-grid { grid-template-columns: 1fr; }
    .subject { order: -1; }
  }


  /* ---- Blog page ---- */
  .blog-layout {
    display: grid;
    grid-template-columns: 1fr minmax(200px, 240px);
    gap: clamp(28px, 5vw, 56px);
    align-items: start;
  }
  .posts { min-width: 0; }
  .post {
    padding: 0 0 34px;
    margin: 0 0 34px;
    border-bottom: 1px solid var(--line);
  }
  .post:last-child { border-bottom: none; margin-bottom: 0; }
  .post-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--brand-dark);
    margin: 0 0 8px;
    letter-spacing: normal;
    scroll-margin-top: 84px;
  }
  .post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0 0 16px;
    color: var(--muted);
    font-size: .9rem;
  }
  .post-meta .tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #f0f1fb;
    color: var(--brand-dark);
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .03em;
  }
  .post-body p { max-width: 66ch; margin: 0 0 16px; font-size: 1.05rem; }
  .post-body p:last-child { margin-bottom: 0; }
  .post-body h3 { color: var(--brand-dark); margin: 22px 0 10px; font-size: 1.2rem; }
  .post-body ul { max-width: 66ch; margin: 0 0 16px; padding-left: 22px; }
  .post-body li { margin: 0 0 6px; }

  .blog-toc {
    position: sticky;
    top: 92px;
    border-left: 1px solid var(--line);
    padding-left: 20px;
  }
  .blog-toc h4 {
    margin: 0 0 12px;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
  }
  .blog-toc ul { list-style: none; margin: 0; padding: 0; }
  .blog-toc li { margin: 0 0 12px; line-height: 1.35; }
  .blog-toc a { font-weight: 600; }
  .blog-toc .toc-date { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }

  .blog-empty { color: var(--muted); font-style: italic; }

  @media (max-width: 760px) {
    .blog-layout { grid-template-columns: 1fr; }
    .blog-toc { position: static; border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  }


  /* ---- Reference document (tables) ---- */
  .doc-lead { max-width: 74ch; font-size: 1.08rem; color: var(--ink); }
  .doc-note {
    max-width: 74ch;
    margin: 18px 0 28px;
    padding: 16px 20px;
    background: #f6f7fc;
    border-left: 4px solid var(--brand);
    border-radius: 0 8px 8px 0;
    color: var(--ink);
  }
  .doc-note strong { color: var(--brand-dark); }

  .table-wrap { overflow-x: auto; margin: 12px 0 8px; border: 1px solid var(--line); border-radius: 12px; }
  table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .97rem;
    background: #fff;
    min-width: 720px;
  }
  table.data-table caption {
    caption-side: bottom;
    text-align: left;
    padding: 12px 16px;
    color: var(--muted);
    font-size: .85rem;
  }
  table.data-table thead th {
    text-align: left;
    background: var(--brand-dark);
    color: #fff;
    font-weight: 700;
    padding: 12px 16px;
    letter-spacing: .01em;
    vertical-align: bottom;
    border-bottom: 1px solid var(--brand-dark);
  }
  table.data-table th[scope="row"] {
    text-align: left;
    font-weight: 700;
    color: var(--brand-dark);
    white-space: nowrap;
  }
  table.data-table td, table.data-table th[scope="row"] {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
  }
  table.data-table tbody tr:nth-child(even) { background: #f9fafe; }
  table.data-table tbody tr:hover { background: #f0f1fb; }
  table.data-table tbody tr:last-child td,
  table.data-table tbody tr:last-child th { border-bottom: none; }
  table.data-table .mono {
    font-family: "Consolas", "SF Mono", Menlo, monospace;
    white-space: nowrap;
    color: var(--ink);
  }
  table.data-table sup { font-size: .72em; }
  .row-note { color: var(--muted); font-style: italic; }
  .pill {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 999px;
    background: #eef0fb;
    color: var(--brand-dark);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .03em;
    margin-left: 4px;
    vertical-align: middle;
  }
  .pill.speculative { background: #fbeeee; color: #8a2b2b; }

  .doc-logo { margin: 8px 0 6px; }
  .doc-logo .brand { font-size: clamp(2rem, 7vw, 3.6rem); }


  /* ---- Papers / publications page ---- */
  .pub-list { display: flex; flex-direction: column; gap: 0; }
  .pub {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 22px;
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
    align-items: start;
  }
  .pub:first-child { padding-top: 6px; }
  .pub:last-child { border-bottom: none; }
  .pub.no-cover { grid-template-columns: 1fr; }

  .pub-cover {
    display: block;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #f6f7fc;
    box-shadow: 0 4px 14px rgba(16, 25, 122, .12);
  }
  .pub-cover img { display: block; width: 100%; height: auto; }

  .pub-title {
    font-size: 1.2rem;
    color: var(--brand-dark);
    margin: 0 0 6px;
    letter-spacing: normal;
    line-height: 1.3;
    scroll-margin-top: 84px;
  }
  .pub-title a { color: var(--brand-dark); }
  .pub-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin: 0 0 10px;
    color: var(--muted);
    font-size: .88rem;
  }
  .pub-meta .type {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #f0f1fb;
    color: var(--brand-dark);
    font-weight: 700;
    font-size: .76rem;
    letter-spacing: .03em;
  }
  .pub-meta .ref { font-family: "Consolas", monospace; font-size: .8rem; }
  .pub-summary { margin: 0 0 12px; max-width: 64ch; color: var(--ink); }
  .pub-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
  .pub-links a { font-weight: 700; font-size: .92rem; }
  .pub-links a::after { content: " \2192"; }
  .pub-links a.file::before { content: "\2b07  "; font-weight: 400; }
  .pub-links a.file::after { content: ""; }

  @media (max-width: 560px) {
    .pub { grid-template-columns: 1fr; }
    .pub-cover { max-width: 160px; }
  }
