  :root {
    color-scheme: light;

    /* White ground; everything else is a step along one blue ramp. */
    --bg:          #ffffff;
    --bg-blur:     rgba(255, 255, 255, 0.85);
    --panel:       #ffffff;
    --surface:     #f4f8ff;  /* tinted fill for chips and quiet blocks */

    --ink:         #0d1b3e;  /* deep navy, headings */
    --ink-2:       #35415e;  /* blue-grey, body copy */
    --muted:       #5b6885;
    --faint:       #6f7c9c;

    --rule:        #d7e2f8;
    --rule-soft:   #edf3fe;

    --accent:      #1d4ed8;  /* the dominant blue */
    --accent-deep: #12307a;
    --accent-soft: #e5edfd;
    --on-accent:   #ffffff;  /* text sitting on the accent blue */
    --accent-shadow: rgba(29, 78, 216, 0.16);  /* accent, for hover lift shadows only */

    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --nav-h: 3.05rem;
  }

  * { box-sizing: border-box; }

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

  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  .wrap {
    max-width: 47rem;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 5vw, 2.5rem);
  }

  a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .15s ease, color .15s ease;
  }
  a:hover { border-bottom-color: currentColor; }
  a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
  }

  .skip {
    position: absolute;
    left: -9999px;
    top: 0;
  }
  .skip:focus {
    left: 0.75rem;
    top: 0.75rem;
    z-index: 20;
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    font-family: var(--mono);
    font-size: 0.78rem;
  }

  /* ---------- sticky nav ---------- */

  .nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-blur);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--rule);
    padding-top: env(safe-area-inset-top, 0px);
  }
  .nav-inner {
    max-width: 47rem;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 5vw, 2.5rem);
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: 1.25rem;
  }

  .nav-name {
    font-family: var(--mono);
    font-size: 0.755rem;
    letter-spacing: 0.06em;
    color: var(--ink);
    font-weight: 500;
    white-space: nowrap;
    border-bottom: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(2px);
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
  }
  .nav.scrolled .nav-name {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear 0s;
  }

  .nav-links {
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }

  .nav-links a {
    display: block;
    font-family: var(--mono);
    font-size: 0.715rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.35rem 0.55rem;
    border-radius: 4px;
    border-bottom: none;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease;
  }
  .nav-links a:hover {
    color: var(--ink);
    background: var(--rule-soft);
  }
  .nav-links a[aria-current="page"] {
    color: var(--accent);
    background: var(--accent-soft);
  }

  /* ---------- masthead ---------- */

  header.masthead {
    padding: clamp(3rem, 9vw, 5.25rem) 0 clamp(2.25rem, 6vw, 3.25rem);
    border-bottom: 1px solid var(--rule);
  }

  h1 {
    margin: 0;
    font-size: clamp(2.1rem, 7.5vw, 3.35rem);
    font-weight: 600;
    letter-spacing: -0.031em;
    line-height: 1.04;
    color: var(--ink);
  }
  h1::after {
    content: "";
    display: block;
    width: 3.25rem;
    height: 3px;
    margin-top: 1.15rem;
    border-radius: 2px;
    background: var(--accent);
  }

  .tagline {
    margin: 1.1rem 0 0;
    max-width: 36rem;
    font-size: clamp(1rem, 2.4vw, 1.115rem);
    line-height: 1.58;
    color: var(--ink-2);
  }

  .facts {
    margin: 1.25rem 0 0;
    padding: 0;
    max-width: 36rem;
    list-style: none;
    display: grid;
    gap: 0.42rem;
    font-size: clamp(1rem, 2.4vw, 1.115rem);
    line-height: 1.45;
    color: var(--ink-2);
  }
  .facts li {
    position: relative;
    padding-left: 1.05rem;
  }
  .facts li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 6px;
    height: 2px;
    border-radius: 1px;
    background: var(--accent);
    opacity: 0.55;
  }
  .creed {
    margin: 1.35rem 0 0;
    max-width: 36rem;
    font-size: clamp(1rem, 2.4vw, 1.115rem);
    line-height: 1.5;
    color: var(--ink);
    font-weight: 500;
  }

  .contact {
    margin: 1.85rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.35rem;
    font-family: var(--mono);
    font-size: 0.815rem;
  }
  .contact li { display: flex; align-items: baseline; gap: 0.5rem; }
  .contact .key {
    color: var(--faint);
    text-transform: uppercase;
    font-size: 0.69rem;
    letter-spacing: 0.1em;
  }

  /* ---------- sections ---------- */

  section {
    padding: clamp(2.75rem, 7vw, 4rem) 0;
    scroll-margin-top: calc(var(--nav-h) + 0.75rem);
  }
  section + section { border-top: 1px solid var(--rule-soft); }

  .label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0 0 2.1rem;
    font-family: var(--mono);
    font-size: 0.69rem;
    font-weight: 500;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .label .num { color: var(--accent); }
  .label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rule);
  }

  /* ---------- timeline ---------- */

  .entry {
    display: grid;
    grid-template-columns: 8.25rem 1fr;
    gap: 0 1.75rem;
  }
  .entry + .entry { margin-top: 2.9rem; }

  .when {
    font-family: var(--mono);
    font-size: 0.755rem;
    line-height: 1.75;
    letter-spacing: 0.035em;
    color: var(--muted);
    padding-top: 0.28rem;
    white-space: nowrap;
  }
  .when .place {
    display: block;
    color: var(--faint);
    letter-spacing: 0.02em;
  }

  .body {
    position: relative;
    padding-left: 1.6rem;
    border-left: 1px solid var(--rule);
  }
  .body::before {
    content: "";
    position: absolute;
    left: -3.5px;
    top: 0.72rem;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 1px;
  }

  .org {
    margin: 0;
    font-size: 1.105rem;
    font-weight: 600;
    letter-spacing: -0.012em;
    line-height: 1.35;
    color: var(--accent-deep);
  }
  .role {
    margin: 0.22rem 0 0;
    font-size: 0.925rem;
    color: var(--ink-2);
  }
  .blurb {
    margin: 0.5rem 0 0;
    font-size: 0.855rem;
    color: var(--muted);
    font-style: italic;
  }

  .group {
    margin: 1.15rem 0 0;
    font-family: var(--mono);
    font-size: 0.665rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
  }

  ul.points {
    margin: 0.7rem 0 0;
    padding: 0;
    list-style: none;
  }
  ul.points li {
    position: relative;
    padding-left: 1.05rem;
    margin-top: 0.62rem;
    font-size: 0.925rem;
    line-height: 1.6;
    color: var(--ink-2);
  }
  ul.points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 6px;
    height: 2px;
    border-radius: 1px;
    background: var(--accent);
    opacity: 0.55;
  }
  ul.points li strong {
    color: var(--ink);
    font-weight: 600;
  }

  /* ---------- closing block ---------- */

  .rows { display: grid; gap: 1.55rem; }
  .row {
    display: grid;
    grid-template-columns: 8.25rem 1fr;
    gap: 0 1.75rem;
  }
  .row .key {
    font-family: var(--mono);
    font-size: 0.69rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    padding-top: 0.28rem;
  }
  .row .val {
    margin: 0;
    font-size: 0.925rem;
    color: var(--ink-2);
    line-height: 1.6;
  }

  .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .chips li {
    font-family: var(--mono);
    font-size: 0.755rem;
    color: var(--accent-deep);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.16rem 0.5rem;
  }

  /* ---------- video ---------- */

  .video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 6px;
  }
  .video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
  }
  .video-meta {
    margin: 0.85rem 0 0;
    font-family: var(--mono);
    font-size: 0.715rem;
    letter-spacing: 0.04em;
    color: var(--faint);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
  }
  .entry[id] { scroll-margin-top: calc(var(--nav-h) + 0.75rem); }
  .video-note {
    margin: 0.55rem 0 1.05rem;
    max-width: 36rem;
    font-size: 0.925rem;
    line-height: 1.6;
    color: var(--ink-2);
  }

  /* masthead portrait. Square crop: the source is 480x300, so a 1:1 window
     keeps the full height of the frame and only trims the sides. */
  .mast-row {
    display: flex;
    align-items: flex-start;
    gap: clamp(1.25rem, 4vw, 2.25rem);
  }
  .mast-text { flex: 1 1 auto; min-width: 0; }
  .portrait {
    flex: none;
    width: 14rem;
    margin: 0.3rem 0 0;
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 6px;
  }
  .portrait img {
    display: block;
    width: 100%;
    height: auto;          /* whole frame, nothing trimmed */
    transition: transform .25s ease;
  }
  .portrait:hover img { transform: scale(1.04); }
  @media (max-width: 34rem) {
    .mast-row { flex-direction: column; align-items: flex-start; }
    .portrait { width: 9.5rem; margin: 0 0 0.2rem; }
  }

  footer {
    border-top: 1px solid var(--rule);

    padding: 2rem 0 calc(3.25rem + env(safe-area-inset-bottom, 0px));
    font-family: var(--mono);
    font-size: 0.715rem;
    letter-spacing: 0.04em;
    color: var(--faint);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    justify-content: space-between;
  }

  /* ---------- cover ---------- */

  header.masthead.cover {
    position: relative;
    overflow: hidden;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2.5rem, 7vw, 4.5rem) 0;
    border-bottom: none;
  }

  /* Decorative node-link motif. Purely ornamental (not a chart of real data),
     drawn only from existing tokens so it stays on the one blue ramp. */
  .cover-motif {
    position: absolute;
    z-index: -1;
    top: -8%;
    right: -6%;
    width: clamp(14rem, 34vw, 22rem);
    height: auto;
    opacity: .55;
    pointer-events: none;
  }
  @media (max-width: 34rem) {
    .cover-motif { display: none; }
  }

  @media (prefers-reduced-motion: no-preference) {
    header.masthead.cover > h1,
    header.masthead.cover > .mast-row,
    header.masthead.cover > .contact,
    header.masthead.cover > .tiles {
      animation: cover-rise .5s ease-out both;
    }
    header.masthead.cover > .mast-row  { animation-delay: .08s; }
    header.masthead.cover > .contact   { animation-delay: .16s; }
    header.masthead.cover > .tiles     { animation-delay: .24s; }
  }
  @keyframes cover-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
  }

  .tiles {
    margin: 2.35rem 0 0;
    padding: 0;
    max-width: 36rem;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.7rem;
  }
  .tile {
    display: block;
    padding: 0.95rem 1.05rem;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--surface);
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease;
  }
  .tile:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--accent-shadow);
  }
  .tile-num {
    display: block;
    font-family: var(--mono);
    font-size: 0.665rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-bottom: 0.4rem;
  }
  .tile-name {
    display: block;
    font-size: 0.955rem;
    font-weight: 600;
    color: var(--ink);
  }
  .tile:hover .tile-name { color: var(--accent-deep); }

  /* ---------- page header (section pages) ---------- */

  .page-head {
    padding: clamp(2.25rem, 6vw, 3.5rem) 0 clamp(1.75rem, 5vw, 2.5rem);
    border-bottom: 1px solid var(--rule);
  }
  .page-head .label { margin-bottom: 1.1rem; }
  .page-head h1 { font-size: clamp(1.85rem, 6vw, 2.6rem); }
  .page-head .tagline { margin: 0.9rem 0 0; }

  main.page-body { padding: clamp(2.75rem, 7vw, 4rem) 0; }

  /* ---------- experience lens filter ---------- */

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .lens-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 clamp(1.75rem, 4vw, 2.5rem);
  }
  .lens-btn {
    margin: 0;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--rule);
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 0.755rem;
    color: var(--accent-deep);
    background: var(--surface);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  }
  .lens-btn:hover { border-color: var(--accent); }
  .lens-btn[aria-pressed="true"] {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
  }

  .entry.lens-dim,
  ul.points li.lens-dim {
    opacity: .28;
  }

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

  .project-card {
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--panel);
    padding: clamp(1.4rem, 4vw, 2.1rem);
  }
  .project-card + .project-card { margin-top: 1.5rem; }
  .project-card-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.9rem;
    margin: 0 0 1rem;
  }
  .in-progress-tag {
    display: inline-block;
    margin: 0;
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 0.665rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-deep);
    background: var(--accent-soft);
  }
  .project-meta {
    font-family: var(--mono);
    font-size: 0.715rem;
    letter-spacing: 0.04em;
    color: var(--faint);
  }
  .project-card h2 {
    margin: 0;
    font-size: clamp(1.4rem, 4vw, 1.65rem);
    font-weight: 600;
    letter-spacing: -0.022em;
    line-height: 1.2;
    color: var(--ink);
  }
  .project-lede {
    margin: 0.55rem 0 0;
    max-width: 36rem;
    font-size: 1.04rem;
    line-height: 1.55;
    font-weight: 500;
    color: var(--ink);
  }
  .project-why {
    margin: 0.9rem 0 0;
    max-width: 36rem;
    font-size: 0.955rem;
    line-height: 1.62;
    color: var(--ink-2);
  }

  .flow-label {
    margin: 1.75rem 0 0.7rem;
    font-family: var(--mono);
    font-size: 0.665rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .flow {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 0.5rem;
  }
  .flow li {
    font-family: var(--mono);
    font-size: 0.755rem;
    color: var(--accent-deep);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.2rem 0.55rem;
    white-space: nowrap;
  }
  .flow li + li { position: relative; margin-left: 1.15rem; }
  .flow li + li::before {
    content: "";
    position: absolute;
    left: -1.15rem;
    top: 50%;
    width: 1.15rem;
    height: 1px;
    background: var(--rule);
  }
  .flow li.flow-end {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
  }
  .flow-note {
    margin: 0.7rem 0 0;
    max-width: 36rem;
    font-size: 0.855rem;
    line-height: 1.55;
    color: var(--muted);
  }

  .project-preview { margin: 1.5rem 0 0; }
  .project-preview a {
    display: block;
    max-width: 26rem;
    margin-inline: auto;
    border: 1px solid var(--rule);
    border-radius: 6px;
    overflow: hidden;
    line-height: 0;
    transition: border-color .15s ease;
  }
  .project-preview a:hover { border-color: var(--accent); }
  .project-preview img {
    display: block;
    width: 100%;
    height: auto;
  }
  .project-preview figcaption {
    margin: 0.7rem 0 0;
    font-family: var(--mono);
    font-size: 0.715rem;
    letter-spacing: 0.03em;
    line-height: 1.55;
    color: var(--faint);
  }

  .project-card .rows {
    margin-top: 1.9rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--rule-soft);
  }

  .more-note {
    margin: 1.1rem 0 0;
    font-size: 0.925rem;
    color: var(--ink-2);
  }

  .project-slots {
    margin: 0.85rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.85rem;
  }
  .project-slot {
    min-height: 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--rule);
    border-radius: 6px;
    padding: 1.1rem 1.15rem;
    font-family: var(--mono);
    font-size: 0.715rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    text-align: center;
  }

  /* ---------- narrow ---------- */

  @media (max-width: 40rem) {
    .entry, .row {
      grid-template-columns: 1fr;
      gap: 0;
    }
    .when {
      padding-top: 0;
      margin-bottom: 0.5rem;
      white-space: normal;
    }
    .when .place { display: inline; }
    .when .place::before { content: " · "; color: var(--rule); }
    .row .key { padding-top: 0; margin-bottom: 0.3rem; }
    .body { padding-left: 1.15rem; }
    .nav-inner { gap: 0.75rem; }
    .nav-name { display: none; }
    .nav-links { margin-left: 0; width: 100%; }
    .flow { flex-direction: column; align-items: flex-start; row-gap: 0; }
    .flow li + li { margin-left: 0; margin-top: 1rem; }
    .flow li + li::before { left: 1.1rem; top: -1rem; width: 1px; height: 1rem; }
  }

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

  @media print {
    body { background: var(--bg); color: var(--ink); }
    .nav, .skip, .video, .cover-motif { display: none; }
    section, main.page-body { padding: 1.25rem 0; }
  }
