  :root {
    --primary: #1F2847;
    --accent: #B6CEC0;
    --bg: #ffffff;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { height: 100%; overflow-x: hidden; visibility: visible; }   /* clip full-bleed (100vw) overflow at the root so mobile can't scroll sideways */

  /* accessible name / SEO heading kept out of the visual layout (brand is shown as the logo art) */
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  body {
    min-height: 100%;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--primary);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
  }

  main {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
  }

  .hero {
    /* headroom up top so bubbles rising the neck have room to fade out */
    padding: clamp(2.5rem, 7vh, 5rem) 1rem 1.5rem;
  }
  /* ---- hero: cylindrical liquid vessel ---- */
  /* seal = flask + curved "ANMOKU LABORATORIES" ring (Figma node 12:7, text circle r=305.638 around the body) */
  .seal {
    position: relative;
    width: min(100%, 540px, 68vh);   /* square; capped by width and viewport height */
    aspect-ratio: 1;
    margin: 0 auto;
  }
  .seal__text {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
  }
  .seal__word {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 66px;            /* viewBox units → scales with the seal */
    letter-spacing: -5px;
    fill: var(--primary);
  }
  /* flask sits inside the seal, concentric with the text ring (seal viewBox -141 -54 720 720) */
  .vessel {
    position: absolute;
    left: 14.22%;   /* flask x=0 → (0-−87)/612 */
    top: 0%;        /* flask y=0 → (0-0)/612    */
    width: 71.57%;  /* 438/612 */
    height: 85.78%; /* 525/612 */
  }
  .vessel__cylinder,
  .vessel__liquid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
  }
  .vessel__cylinder {
    fill: none;
    stroke: var(--primary);
    stroke-width: 12;           /* viewBox units → scales with the flask (no non-scaling-stroke) */
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .vessel__waterline {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
  }
  .vessel__bubbles {
    position: absolute;
    inset: 0;
    overflow: visible;
  }
  /* halftone "liquid" texture — clipped per-frame (JS) to below the waterline, inside the inner wall.
     The dots live on an oversized, 30deg-rotated pseudo so the clip stays in the upright vessel frame. */
  .vessel__halftone {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
  .vessel__halftone::before {
    content: "";
    position: absolute;
    inset: -40%;
    background-image: radial-gradient(var(--primary) 30%, transparent 32%);
    background-size: 3.25px 3.25px;
    background-position: center;
    transform: rotate(30deg);
  }
  .vessel__label {
    position: absolute;
    left: 50%;
    top: 61%;
    width: 82.5%;   /* sits a touch lower in the round body */
    /* float in the body, with a slight tilt for depth */
    transform: translate(-50%, -50%) perspective(640px) rotateX(14deg);
    transform-origin: center 40%;
    pointer-events: none;
  }
  .vessel__label .logo {
    width: 100%;
    /* lower glyphs removed: enlarge the 暗黙 mark and recenter it on the round body */
    transform-origin: 57% 30%;
    transform: translateY(16%) scale(1.32);
  }

  .logo {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    pointer-events: none;
  }

  .layer { position: absolute; }
  .layer > .inner { position: absolute; inset: 0; }
  .layer svg { width: 100%; height: 100%; display: block; overflow: visible; }

  .upper-back { inset: 10.83% 18.00% 52.25% 24.38%; }
  .upper-front{ inset: 13.96% 16.84% 50.60% 17.71%; }

  .upper-back > .inner { inset:  -4.52% -4.34%  -4.52% -2.89%; }
  .upper-front> .inner { inset:  -7.06% -3.82%  -7.05% -3.82%; }

  .upper-back svg path {
    stroke: var(--primary);
  }
  .upper-back {
    animation: opacityPulse 6s ease-in-out infinite;
  }
  @keyframes opacityPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
  }

  /* hero upper-back: keep the original pulsing navy (#1F2847) echo — no hero override */

  @media (prefers-reduced-motion: reduce) {
    .upper-back { animation: none; opacity: 1; }
    .bubble { display: none; animation: none; }
  }

  .contact {
    color: var(--primary);
    text-decoration: none;
    font-size: clamp(1rem, 2.4vw, 1.25rem);
    letter-spacing: 0.02em;
    border-bottom: 1px solid transparent;
    transition: border-color 160ms ease;
  }
  .contact:hover,
  .contact:focus-visible {
    border-bottom-color: var(--accent);
    outline: none;
  }

  /* ---- project sections ---- */
  .project {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    padding: 0.5rem 0;
  }
  .project__logo { width: 100%; }
  .project__logo .logo { width: 100%; }
  .project__body h2 {
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: 0.5rem;
  }
  .project__body p {
    font-size: clamp(0.95rem, 2.2vw, 1.05rem);
    line-height: 1.6;
    max-width: 52ch;
    opacity: 0.85;
  }
  .project__logo-link {
    display: block;
    width: 100%;
    transition: opacity 160ms ease;
  }
  .project__logo-link:hover,
  .project__logo-link:focus-visible { opacity: 0.82; outline: none; }
  .project__link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 160ms ease;
  }
  .project__link:hover,
  .project__link:focus-visible { border-bottom-color: var(--accent); outline: none; }
  /* Hype League Football icon (Figma node 54:2) — moon face with blinking eyes */
  .hype { position: relative; width: 100%; aspect-ratio: 215.34 / 165.17; }
  .hype__body { width: 100%; height: 100%; display: block; }
  .hype__face { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .hype__eye--open  { opacity: 1; animation: hypeEyeOpen 2.6s infinite; }
  .hype__eye--closed { opacity: 0; animation: hypeEyeClosed 2.6s infinite; }
  @keyframes hypeEyeOpen   { 0%,93%{opacity:1} 94%,96.5%{opacity:0} 97.5%,100%{opacity:1} }
  @keyframes hypeEyeClosed { 0%,93%{opacity:0} 94%,96.5%{opacity:1} 97.5%,100%{opacity:0} }
  @media (prefers-reduced-motion: reduce) {
    .hype__eye--open, .hype__eye--closed { animation: none; }
  }
  /* Electronic DJ Model icon (electronicdjmodel.com) — decks + speakers + head; speakers pulse, head bobs */
  .edm { position: relative; width: 100%; aspect-ratio: 640 / 680; }
  .edm img { position: absolute; display: block; }
  .edm__decks { left: 0; top: 0; width: 100%; height: 100%; z-index: 0; }
  .edm__spkr--left  { left: 11.25%; top: 13.97%; width: 17.34%; height: 17.06%; z-index: 1; }
  .edm__spkr--right { left: 72.66%; top: 13.24%; width: 17.50%; height: 16.32%; z-index: 1; }
  .edm__head        { left: 42.97%; top: 14.71%; width: 20.31%; height: 17.50%; z-index: 2; }
  .edm__spkr { animation: edmSpeakerPulse 0.5s ease-in-out infinite; transform-origin: center center; }
  .edm__head { animation: edmHeadBob 0.5s ease-in-out infinite; }
  @keyframes edmSpeakerPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
  @keyframes edmHeadBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4%); } }
  @media (prefers-reduced-motion: reduce) {
    .edm__spkr, .edm__head { animation: none; }
  }

  /* ---- liquid-surface divider (full-bleed, spans the whole viewport) ---- */
  .divider {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    height: 96px;
    pointer-events: none;
  }
  .divider__wave {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
  }
  /* bubble layer: clipped to the area ABOVE the waterline (mask set per-frame by JS) */
  .divider__bubbles {
    position: absolute;
    inset: 0;
    overflow: visible;
  }
  .bubble {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--d, 20px);
    height: var(--d, 20px);
    margin-left: calc(var(--d, 20px) / -2);
    margin-top: calc(var(--d, 20px) / -2);
    border: 4px solid var(--primary);
    border-radius: 50%;
    background: transparent;
    opacity: 0;
    will-change: transform, opacity;
    animation: rise var(--dur, 2.4s) ease-out forwards;
  }
  /* starts submerged (hidden by the waterline mask); the mask reveals it as it crosses the line */
  @keyframes rise {
    0%   { opacity: 1; transform: translate(var(--x), var(--y0)) scale(1); }
    55%  { opacity: 1; }
    88%  { opacity: 0; }                 /* fully faded before reaching the top of the box */
    100% { opacity: 0;
           transform: translate(calc(var(--x) + var(--drift)), calc(var(--y0) - var(--rise))) scale(0.24); }
  }
  /* vessel bubbles travel much further (up through the body and the neck) — stay visible
     most of the way, only fading right at the top */
  /* vessel bubbles: size + border set in JS (scaled to the flask); fade late so they stay visible up the neck */
  .vessel__bubbles .bubble { animation-name: riseVessel; }
  @keyframes riseVessel {
    0%   { opacity: 1; transform: translate(var(--x), var(--y0)) scale(1); }
    84%  { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(var(--x) + var(--drift)), calc(var(--y0) - var(--rise))) scale(0.5); }
  }

  /* ---- footer ---- */
  .site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0 1.5rem;
  }
  .site-footer__legal {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    opacity: 0.55;
  }

  @media (max-width: 640px) {
    .project {
      grid-template-columns: 1fr;
      text-align: center;
      gap: 1rem;
    }
    .project__logo,
    .project__logo-link { width: 120px; justify-self: center; }   /* centre the icon */
    .project__body { justify-self: stretch; }                     /* body fills width so text wraps */
    .project__body p { max-width: none; }
    .divider { height: 76px; }
  }


  /* ============================================================
     Multi-page additions (nav, prose, lead, writing index)
     ============================================================ */

  /* ---- shared site navigation ---- */
  .nav {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding: 0.25rem 0 1.25rem;
  }
  .nav__brand {
    display: inline-block;
    white-space: nowrap;
    color: var(--primary);
    text-decoration: none;
  }
  .nav__mark { height: 2.2rem; width: auto; vertical-align: middle; margin-right: 0.55rem; }
  .nav__wordmark {
    position: relative;
    top: 0.12em;           /* nudge the wordmark down a touch (mark stays put) */
    font-weight: 700;
    font-size: clamp(0.95rem, 2.4vw, 1.1rem);
    letter-spacing: 0.1em;
    border-bottom: 1px solid transparent;
    transition: border-color 160ms ease;
  }
  .nav__brand:hover .nav__wordmark,
  .nav__brand:focus-visible .nav__wordmark { border-bottom-color: var(--accent); }
  .nav__links {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: clamp(1rem, 3vw, 2rem);
    list-style: none;
  }
  .nav__links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;                          /* match the brand wordmark */
    font-size: clamp(0.95rem, 2.4vw, 1.1rem);  /* match the brand wordmark */
    letter-spacing: 0.1em;                      /* match the brand wordmark */
    opacity: 0.72;
    border-bottom: 1px solid transparent;
    transition: border-color 160ms ease, opacity 160ms ease;
  }
  .nav__links a:hover,
  .nav__links a:focus-visible { opacity: 1; border-bottom-color: var(--accent); outline: none; }
  .nav__links a[aria-current="page"] { opacity: 1; border-bottom-color: var(--accent); }

  /* ---- home: tagline + mission under the hero seal ---- */
  .hero__tagline {
    text-align: center;
    font-size: clamp(1.1rem, 3vw, 1.45rem);
    font-weight: 600;
    font-style: italic;
    letter-spacing: 0.01em;
    margin-top: 0.5rem;
  }
  .hero__mission {
    margin: 1rem auto 0;
    text-align: center;
    max-width: 56ch;
  }

  /* ---- long-form prose (about page, writing posts) ---- */
  .prose { max-width: 66ch; }
  .prose > * + * { margin-top: 1rem; }
  .prose h1 {
    font-size: clamp(1.9rem, 5vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.12;
    margin-top: 0;
  }
  .prose h2 {
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-top: 2rem;
  }
  .prose h3 {
    font-size: clamp(1.05rem, 2.4vw, 1.25rem);
    font-weight: 600;
    margin-top: 1.5rem;
  }
  .prose p,
  .prose li {
    font-size: clamp(0.95rem, 2.2vw, 1.05rem);
    line-height: 1.7;
    opacity: 0.85;
  }
  .prose ul,
  .prose ol { padding-left: 1.4rem; }
  .prose li + li { margin-top: 0.35rem; }
  .prose a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
    transition: opacity 160ms ease;
  }
  .prose a:hover,
  .prose a:focus-visible { opacity: 0.7; outline: none; }
  .prose strong { font-weight: 700; }
  .prose blockquote {
    margin-left: 0;
    padding-left: 1rem;
    border-left: 3px solid var(--accent);
    opacity: 0.9;
  }
  .prose code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: rgba(31, 40, 71, 0.06);
    padding: 0.12em 0.36em;
    border-radius: 4px;
  }
  .prose pre {
    background: rgba(31, 40, 71, 0.05);
    border: 1px solid rgba(31, 40, 71, 0.1);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    overflow-x: auto;
    line-height: 1.5;
  }
  .prose pre code { background: none; padding: 0; font-size: 0.85rem; }

  /* lead paragraph (home mission, post intro) */
  .lead {
    font-size: clamp(1.05rem, 2.6vw, 1.3rem);
    line-height: 1.55;
    max-width: 60ch;
  }
  /* About: same lead formatting + centered block placement as the splash mission,
     but the text reads left-aligned (not centered). */
  .page-lead {
    margin: 0.5rem auto 0;
    max-width: 56ch;
    text-align: left;
  }
  .page-lead p + p { margin-top: 1.25rem; }

  /* static brand mark image (non-home pages) */
  .mark {
    display: block;
    width: clamp(64px, 18vw, 120px);
    height: auto;
    margin: 0 auto 1.5rem;
  }

  /* ---- writing index ---- */
  .post-list { list-style: none; }
  .post-list__item { padding: 0.5rem 0; }
  .post-list__title {
    font-size: clamp(1.2rem, 3vw, 1.55rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: 0.35rem;
  }
  .post-list__title a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 160ms ease;
  }
  .post-list__title a:hover,
  .post-list__title a:focus-visible { border-bottom-color: var(--accent); outline: none; }
  .post-list__meta {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    opacity: 0.55;
    margin-bottom: 0.5rem;
  }
  .post-list__excerpt {
    font-size: clamp(0.95rem, 2.2vw, 1.05rem);
    line-height: 1.6;
    opacity: 0.85;
    max-width: 60ch;
  }
  .post-list__excerpt + .post-list__excerpt { margin-top: 0.75rem; }
  .post-list__excerpt a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
    transition: opacity 160ms ease;
  }
  .post-list__excerpt a:hover { opacity: 0.7; }

  /* post footer meta (back-link, etc.) */
  .post-foot { margin-top: 2.5rem; font-size: 0.95rem; }
  .post-foot a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
  }

  @media (max-width: 640px) {
    .nav { justify-content: center; text-align: center; }
    .nav__links { justify-content: center; }
    .prose,
    .lead,
    .hero__mission,
    .post-list__excerpt { max-width: none; }
  }

  /* ---- accessibility: visible keyboard focus + unambiguous current page ---- */
  /* High-contrast navy focus ring for keyboard users (hover stays sage). These
     come last in source order so they override the earlier `outline: none` rules. */
  .nav__brand:focus-visible,
  .nav__links a:focus-visible,
  .contact:focus-visible,
  .project__link:focus-visible,
  .project__logo-link:focus-visible,
  .prose a:focus-visible,
  .post-list__title a:focus-visible,
  .post-list__excerpt a:focus-visible,
  .post-foot a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 2px;
  }
  .prose a:focus-visible { opacity: 1; }
  /* current page: navy bold underline (not the low-contrast sage) so it is unambiguous */
  .nav__links a[aria-current="page"] {
    font-weight: 700;
    border-bottom-color: var(--primary);
  }

  /* prose tables (e.g. the EDM results table) */
  .prose .table-wrap { overflow-x: auto; margin: 1.25rem 0; }
  .prose table { border-collapse: collapse; width: 100%; font-size: clamp(0.8rem, 1.7vw, 0.95rem); }
  .prose th, .prose td { border: 1px solid rgba(31, 40, 71, 0.15); padding: 0.4rem 0.6rem; text-align: left; white-space: nowrap; }
  .prose thead th { font-weight: 700; background: rgba(31, 40, 71, 0.05); }
