/* Self-hosted: no third-party request at any point in the page's life.
   The platform-sans stack below each family is a last-resort safety net for a
   failed font load, never the intended voice. Both families are SIL OFL 1.1.
   See assets/fonts/README.md. */
@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("assets/fonts/courierprime-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("assets/fonts/courierprime-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* HuFi LLC — the public record */

:root {
  --tint:        #dbe6d9;  /* safety paper — the one optical condition */
  --tint-deep:   #cfdccd;  /* rule tint, field banding */
  --ink:         #13233a;  /* filing navy — the only body ink */
  --ink-soft:    #46566d;  /* secondary, tinted from the ink, never grey */
  --violet:      #5b2e8c;  /* legislated: NOT ON FILE. Nothing else, ever. */
  --red:         #a81e33;  /* legislated: live and verifiable */
  --rule:        1px solid var(--ink);
  --hair:        1px solid rgba(19, 35, 58, 0.28);
  --measure:     68ch;
  --gut:         clamp(1.25rem, 4vw, 3.5rem);
}

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

html {
  background: var(--tint);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--ink) var(--tint-deep);
}

body {
  margin: 0;
  background: var(--tint);
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

/* Browser surfaces carry the design too. */
::selection { background: var(--ink); color: var(--tint); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--tint-deep); }
::-webkit-scrollbar-thumb { background: var(--ink); border: 3px solid var(--tint-deep); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

a { color: inherit; }

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--tint);
  padding: 0.75rem 1rem; z-index: 10;
  font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.skip:focus { left: var(--gut); top: 0; }

.sheet {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 var(--gut);
}

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

/* ---- hero: the record, inked ----------------------------------------- */
/* The field starts as paper and the ink pours in, filling it. Type flips
   from navy-on-paper to paper-on-navy at the surface line. Two layers of the
   same content: the visible one carries the semantics, the ink copy is
   aria-hidden and clipped to the level. No new colour — ink and paper. */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--tint);
  color: var(--ink);
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4rem);
}
.hero-ink {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--ink);
  color: var(--tint);
  display: flex;
  align-items: center;
  padding: inherit;
  clip-path: inset(100% 0 0 0);
}
/* Built exactly like .sheet — same max-width, same gutter inside it — so the
   hero and the record share one left edge and one right edge at every width. */
.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* The pour, staged. It is a performer: it plays once, the ink level tracks
   its playhead, and it leaves. Sits behind the record's type and beneath the
   rising ink, so the level swallows it exactly as a real pour would. */
.pour-stage {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  right: 8vw;
  width: clamp(180px, 23vw, 380px);
  overflow: hidden;
  opacity: 0;
  background: var(--ink);
  transition: opacity 500ms ease-out;
}
.pouring .pour-stage { opacity: 1; }
.poured .pour-stage { opacity: 0; }
.pour-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Duotoned, not merely desaturated: luminosity over the ink ground maps the
     footage into this page's two colours, so the pour reads as ink in motion
     rather than as recognisable coffee. */
  mix-blend-mode: luminosity;
  filter: grayscale(1) contrast(1.3) brightness(1.05);
}

.entity {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.82;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.14em;
}
.e-hufi { font-size: clamp(4rem, 17vw, 15rem); }
.e-llc  { font-size: clamp(2rem, 6.4vw, 5.6rem); opacity: 0.5; }

.hero .lede {
  opacity: 0.78;
  max-width: 58ch;
  font-size: clamp(1.0625rem, 0.98rem + 0.5vw, 1.4rem);
  margin: clamp(1.5rem, 3.5vw, 2.5rem) 0 0;
}

.articles {
  list-style: none;
  margin: clamp(2.25rem, 5vw, 3.5rem) 0 0;
  padding: 0;
}
.articles li {
  display: flex;
  align-items: baseline;
  gap: clamp(0.9rem, 2.5vw, 2.25rem);
  padding: clamp(0.65rem, 1.6vw, 1rem) 0;
  position: relative;
}
.articles li::before,
.articles li:last-child::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: currentColor;
  opacity: 0.3;
}
.articles li::before { top: 0; }
.articles li:last-child::after { bottom: 0; }
.art-no {
  flex: none;
  width: 7rem;
  font-family: "Courier Prime", "Courier New", monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}
.art-txt {
  font-size: clamp(1.25rem, 3.2vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.1;
  text-wrap: balance;
}
.hero-mark {
  font-family: "Courier Prime", "Courier New", monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  text-align: right;
}

.art-tag {
  display: inline-block;
  min-width: 2.4rem;
  font-family: "Courier Prime", "Courier New", monospace;
  font-size: 0.75em;
  color: var(--ink-soft);
}

/* ---- the standing section index -------------------------------------- */

.index { display: none; }
@media (min-width: 68rem) {
  .index {
    display: block;
    position: fixed;
    top: 50%;
    right: clamp(1.25rem, 2.5vw, 2.25rem);
    transform: translateY(-50%);
    z-index: 5;
    mix-blend-mode: difference;
  }
  .index ol { list-style: none; margin: 0; padding: 0; text-align: right; }
  .index li + li { margin-top: 0.6rem; }
  .index a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    opacity: 0.5;
    transition: opacity 200ms ease-out;
  }
  .index a:hover, .index a:focus-visible { opacity: 1; }
  .index .dot {
    width: 5px; height: 5px;
    background: currentColor;
    opacity: 0;
    transition: opacity 200ms ease-out;
  }
  .index a[aria-current] { opacity: 1; }
  .index { transition: opacity 260ms ease-out; }
  
  .index a[aria-current] .dot { opacity: 1; }
}

/* ---- the register: rule-work is the grid ---------------------------- */

section { padding-top: 0.75rem; margin: clamp(3.5rem, 9vw, 7rem) 0; position: relative; }
main section::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--ink);
  transform-origin: left center;
}

h2 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 1.125rem;
}

/* Filing forms set their fields in paired columns; so does this one. */
@media (min-width: 62rem) {
  .fields--entity { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .fields--entity .row--full { grid-column: 1 / -1; }
  .fields--entity .row--full dt { max-width: 15rem; width: 100%; }
}

.fields { margin: 0; border-bottom: var(--hair); }

.row {
  display: grid;
  grid-template-columns: minmax(9rem, 15rem) 1fr;
  border-top: var(--hair);
}
.row dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.8rem 1.25rem 0.8rem 0;
  border-right: var(--hair);
}
.row dd {
  margin: 0;
  padding: 0.8rem 0 0.8rem 1.25rem;
  font-family: "Courier Prime", "Courier New", monospace;
  font-size: 1rem;
  line-height: 1.45;
}
.row dd .sub {
  display: block;
  font-family: Archivo, sans-serif;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin-top: 0.35rem;
  max-width: 48ch;
}

/* status lives in the value's own typography, never a separate badge column */
/* An unfilled field on a form is a ruled blank, not a stamp: it stays honest
   without shouting louder than the fields that are filled. */
.pending {
  font-family: "Courier Prime", monospace;
  font-size: 1rem;
  color: var(--violet);
}
.pending::before {
  content: "";
  display: inline-block;
  width: 1.35rem;
  height: 1px;
  background: var(--violet);
  vertical-align: 0.28em;
  margin-right: 0.55rem;
}
.live {
  font-family: "Courier Prime", monospace;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
}
.live::before {
  content: "";
  display: inline-block;
  width: 0.5rem; height: 0.5rem;
  background: var(--red);
  margin-right: 0.5rem;
  vertical-align: 0.06em;
}

/* ---- holdings ------------------------------------------------------- */

.holding { border-top: var(--rule); padding-top: 1.5rem; }

.holding-head {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  margin-bottom: 1.25rem;
}
.holding-mark {
  width: clamp(4.5rem, 9vw, 7rem);
  height: auto;
  flex: none;
  display: block;
}
.holding-name {
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0;
}
.holding-what {
  max-width: var(--measure);
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.25rem);
  margin: 0 0 1.75rem;
  text-wrap: pretty;
}

.action {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--ink);
  color: var(--tint);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  padding: 0.85rem 1.25rem;
  margin-top: 1.75rem;
  border: 2px solid var(--ink);
  transition: background-color 140ms ease-out, color 140ms ease-out,
              transform 140ms cubic-bezier(0.16, 1, 0.3, 1);
}
.action:hover, .action:focus-visible { background: var(--tint); color: var(--ink); }
.action:active { transform: scale(0.985); }
.action svg { width: 0.85em; height: 0.85em; flex: none; }

/* Reference material, offered rather than imposed: the particulars sit behind
   a disclosure so a curious reader can open them and everyone else reads on.
   Native <details>, so it works with no JavaScript and answers the keyboard. */
.entry { border-top: var(--hair); border-bottom: var(--hair); }
.entry + .action { margin-top: 1.5rem; }
.entry summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  cursor: pointer;
  list-style: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 160ms ease-out;
}
.entry summary::-webkit-details-marker { display: none; }
.entry summary:hover { color: var(--ink); }
.entry summary:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.entry-mark { width: 12px; height: 12px; flex: none; }
/* the mark is drawn, and closes from a plus to a minus */
.entry-bar-v { transform-origin: center; transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1); }
.entry[open] .entry-bar-v { transform: scaleY(0); }
.entry[open] summary { color: var(--ink); }
.entry .fields { border-bottom: 0; padding-bottom: 0.5rem; }

/* Animate the disclosure where the browser can; snap where it cannot.
   The content is in the DOM either way, so nothing depends on this. */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .entry::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 260ms cubic-bezier(0.16, 1, 0.3, 1),
                content-visibility 260ms allow-discrete;
  }
  .entry[open]::details-content { block-size: auto; }
}

/* the empty slot is designed as invitation, never hidden */
.slot {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  border: 2px dashed rgba(19, 35, 58, 0.35);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}
.slot p { margin: 0; max-width: 52ch; color: var(--ink-soft); }
.slot p strong { color: var(--ink); font-weight: 600; }

/* ---- filed statements ----------------------------------------------- */

.filed { display: grid; gap: 0; }
.statement { border-top: var(--hair); padding: 1.5rem 0; }
.statement:last-child { border-bottom: var(--hair); }
.statement h3 {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
}
.statement p { margin: 0 0 0.75rem; max-width: var(--measure); }
.statement p:last-child { margin-bottom: 0; }
.statement .quote {
  font-family: "Courier Prime", monospace;
  border-left: 1px solid var(--ink);
  padding-left: 1rem;
}
.statement .cite {
  display: block;
  font-family: Archivo, sans-serif;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}
.statement ul {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.1rem;
  font-family: "Courier Prime", monospace;
  font-size: 0.9375rem;
}
.statement li { margin-bottom: 0.2rem; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration-color: rgba(19, 35, 58, 0.4);
}
.check svg { width: 0.8em; height: 0.8em; flex: none; }
.check:hover { text-decoration-color: var(--ink); }

/* ---- footer --------------------------------------------------------- */

footer {
  border-top: 3px solid var(--ink);
  padding: 1.5rem 0 clamp(3rem, 6vw, 4.5rem);
  font-size: 0.875rem;
}
.foot-grid { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; align-items: baseline; }
.foot-name { font-weight: 700; letter-spacing: 0.02em; }
footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
footer a { text-decoration-color: rgba(19, 35, 58, 0.4); }
footer a:hover { text-decoration-color: var(--ink); }
.foot-note { color: var(--ink-soft); margin: 1rem 0 0; max-width: 60ch; font-size: 0.8125rem; }

/* ---- prose pages ---------------------------------------------------- */

.prose { max-width: var(--measure); }
/* reading pages keep a tighter rhythm than the record's chapter spacing */
.prose section { margin: clamp(2rem, 5vw, 3rem) 0; }
/* the closing rule aligns with the reading measure, not the frame */
.prose ~ footer { max-width: var(--measure); }
.prose h1 {
  font-size: clamp(2.25rem, 7vw, 4rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 0.95;
  margin: clamp(2.5rem, 7vw, 4.5rem) 0 1.5rem;
}
.prose h2 { margin-top: 2.5rem; }
.prose h3 {
  font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em;
  margin: 2rem 0 0.5rem;
}
.prose p, .prose li { text-wrap: pretty; }
.prose ul { padding-left: 1.1rem; }
.prose a { text-decoration-color: rgba(19, 35, 58, 0.4); }
.prose a:hover { text-decoration-color: var(--ink); }
.prose .updated {
  font-family: "Courier Prime", monospace;
  font-size: 0.875rem; color: var(--ink-soft);
}

/* ---- the one authored moment: the stamps settle onto the paper ------- */

@media (hover: hover) and (pointer: fine) {
  .check, footer a, .prose a {
    transition: text-decoration-color 160ms ease-out;
  }
}

/* Reduced motion, and any browser without the animation: the field is
   already inked. Nothing is ever left half-filled or unreadable. */
.hero-ink { clip-path: inset(0 0 0 0); }

@media (prefers-reduced-motion: no-preference) {
  /* One motion idea: a rule drawing itself onto the paper.
     Expressed at register scale on an unfilled field, and at article
     scale in the hero. Text is present throughout; only rules animate. */
  .pending::before {
    animation: rule-in 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .row:nth-of-type(2) .pending::before { animation-delay: 70ms; }
  .row:nth-of-type(3) .pending::before { animation-delay: 140ms; }
  .row:nth-of-type(4) .pending::before { animation-delay: 210ms; }
  .row:nth-of-type(5) .pending::before { animation-delay: 280ms; }
  .row:nth-of-type(6) .pending::before { animation-delay: 350ms; }
  @keyframes rule-in { from { width: 0; } to { width: 1.35rem; } }

  .articles li::before,
  .articles li:last-child::after {
    animation: draw 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .articles li:nth-child(1)::before { animation-delay: 60ms; }
  .articles li:nth-child(2)::before { animation-delay: 150ms; }
  .articles li:nth-child(3)::before { animation-delay: 240ms; }
  .articles li:nth-child(4)::before { animation-delay: 330ms; }
  .articles li:last-child::after    { animation-delay: 420ms; }
  @keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

  .live::before { animation: strike-sq 560ms cubic-bezier(0.16, 1, 0.3, 1) both; }
  @keyframes strike-sq { from { transform: scale(1.7); } to { transform: scale(1); } }

  /* The same idea carried down the scroll: each chapter's opening rule
     draws itself as the chapter arrives. Progressive — where the browser
     has no scroll timeline, every rule is simply already drawn. */
  @supports (animation-timeline: view()) {
    .pour-video {
      animation: wipe linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
    @keyframes wipe {
      from { clip-path: inset(0 0 100% 0); }
      to   { clip-path: inset(0 0 0 0); }
    }
    main section::before {
      animation: draw linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

@media (max-width: 46rem) {
  .articles li { display: block; padding: 0.85rem 0; }
  .art-no { display: block; width: auto; margin-bottom: 0.3rem; }
}

@media (max-width: 34rem) {
  .row { grid-template-columns: 1fr; }
  .row dt { border-right: 0; padding-bottom: 0.15rem; }
  .row dd { padding: 0 0 0.9rem; }
}
