.infini-page {
  --iw-arc: #38b9ff;
  --iw-ember: #ff6842;
  --iw-root: #74c86b;
  --iw-ward: #bd9cff;
  --iw-glass: #9decf2;
  --iw-ledger: #f2b300;
  --iw-active: var(--iw-arc);
}

.infini-page h1,
.infini-page h2,
.infini-page h3 {
  text-wrap: balance;
}

.infini-page p {
  text-wrap: pretty;
}

.iw-hero {
  min-height: calc(100svh - 4.75rem);
  overflow: hidden;
  border-bottom: 1px solid #27272d;
  background: #09090b;
  color: #f7f3ea;
  --text: #f7f3ea;
  --muted: #9898a2;
  --rule: #27272d;
}

.iw-hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: center;
  min-height: calc(100svh - 4.75rem);
  padding-block: clamp(4rem, 9vw, 8rem);
}

.iw-hero-copy {
  z-index: 2;
  grid-column: 1 / span 7;
}

.iw-hero h1 {
  max-width: none;
  margin: 1.25rem 0 1rem;
  font-size: clamp(5rem, 11vw, 11rem);
  line-height: 0.68;
  letter-spacing: -0.06em;
}

.iw-proposition {
  margin: 1.75rem 0 1rem;
  color: var(--iw-ledger);
  font: 0.82rem/1.4 var(--mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.iw-hero .product-deck {
  max-width: 54ch;
  margin: 0;
  color: #d8d5ce;
  font-size: clamp(1.05rem, 1.5vw, 1.28rem);
}

.iw-button {
  border-color: var(--iw-ledger);
  background: var(--iw-ledger);
  color: #09090b;
}

.iw-hero-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 48rem;
  margin: 3rem 0 0;
  border-top: 1px solid #50505a;
  border-left: 1px solid #50505a;
}

.iw-hero-facts div {
  min-width: 0;
  padding: 1rem;
  border-right: 1px solid #50505a;
  border-bottom: 1px solid #50505a;
}

.iw-hero-facts dt,
.iw-hero-facts dd {
  margin: 0;
}

.iw-hero-facts dt {
  color: #9898a2;
  font: 0.65rem/1.35 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.iw-hero-facts dd {
  margin-top: 0.45rem;
  color: #f7f3ea;
  font-size: 0.9rem;
}

.iw-key-figure {
  position: relative;
  grid-column: 8 / -1;
  margin: 0;
}

.iw-key-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid #50505a;
  background: #050506;
  box-shadow: 1.25rem 1.25rem 0 #141417;
}

.iw-key-frame::before,
.iw-key-frame::after {
  position: absolute;
  z-index: 2;
  width: 0.65rem;
  height: 0.65rem;
  border: 1px solid #d8d5ce;
  content: "";
  transform: rotate(45deg);
}

.iw-key-frame::before {
  top: 1rem;
  left: 1rem;
  background: var(--iw-arc);
}

.iw-key-frame::after {
  right: 1rem;
  bottom: 1rem;
  background: var(--iw-ledger);
}

.iw-key-frame img {
  width: 100%;
  height: auto;
  transform: translate(var(--iw-hero-x, 0), var(--iw-hero-y, 0)) scale(1.035);
  image-rendering: pixelated;
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

.iw-cast-line {
  position: absolute;
  z-index: 3;
  right: 18%;
  bottom: 21%;
  width: 26%;
  height: 1px;
  background: var(--iw-arc);
  box-shadow: 0 0 0 1px #09090b;
  transform: rotate(-38deg);
  transform-origin: right;
}

.iw-cast-line::before,
.iw-cast-line::after {
  position: absolute;
  top: -0.25rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--iw-arc);
  content: "";
  transform: rotate(45deg);
}

.iw-cast-line::before { left: 0; }
.iw-cast-line::after { right: 0; }

.iw-key-figure figcaption,
.iw-media-plate figcaption,
.iw-story-figure figcaption,
.iw-boss-figure figcaption {
  margin-top: 1rem;
  color: #9898a2;
  font: 0.65rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.iw-section {
  padding-block: clamp(5rem, 10vw, 9rem);
  border-bottom: 1px solid var(--rule);
}

.iw-section-header {
  display: grid;
  grid-template-columns: 2fr 7fr 3fr;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.iw-section-header > .folio,
.iw-counter-copy > .folio,
.iw-writing-copy > .folio,
.iw-campaign-copy > .folio,
.iw-record-grid .folio {
  color: var(--iw-ledger);
}

.iw-section-header h2,
.iw-counter-copy h2,
.iw-writing-copy h2,
.iw-campaign-copy h2,
.iw-record-grid h2 {
  margin: 0;
  font-size: clamp(3.25rem, 6.5vw, 7rem);
  line-height: 0.86;
}

.iw-section-header p,
.iw-counter-copy > p,
.iw-writing-copy > p,
.iw-campaign-copy > p,
.iw-record-grid > div > p {
  max-width: 58ch;
  color: var(--muted);
}

.iw-section-header img {
  justify-self: end;
  width: min(100%, 17rem);
  height: auto;
  border: 1px solid var(--rule);
  background: #09090b;
  image-rendering: pixelated;
}

.iw-stanza-section {
  background: var(--canvas);
}

.iw-phase-instrument {
  border: 1px solid var(--rule);
  background: var(--surface);
}

.iw-phase-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--rule);
}

.iw-phase-controls button,
.iw-counter-controls button,
.iw-account-choices button {
  min-height: 4.5rem;
  border: 0;
  border-right: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: 0.74rem/1.35 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.iw-phase-controls button:last-child,
.iw-counter-controls button:last-child,
.iw-account-choices button:last-child {
  border-right: 0;
}

.iw-phase-controls button span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.62rem;
}

.iw-phase-controls button:hover,
.iw-phase-controls button[aria-pressed="true"] {
  background: #09090b;
  color: #f7f3ea;
}

.iw-phase-controls button[aria-pressed="true"] {
  box-shadow: inset 0 -3px 0 var(--iw-ledger);
}

.iw-phase-display {
  position: relative;
  min-height: 22rem;
  padding: clamp(2rem, 6vw, 5rem);
  overflow: hidden;
  background: #09090b;
  color: #f7f3ea;
}

.iw-phase-display::after {
  position: absolute;
  right: clamp(2rem, 6vw, 5rem);
  bottom: clamp(2rem, 5vw, 4rem);
  width: clamp(7rem, 18vw, 13rem);
  aspect-ratio: 1;
  border: 1px solid #50505a;
  content: "";
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: inset 0 0 0 2.25rem #141417;
}

.iw-phase-display h3 {
  max-width: 10ch;
  margin: 0.7rem 0 1.25rem;
  font-size: clamp(3rem, 6vw, 6rem);
  line-height: 0.9;
}

.iw-phase-display p {
  max-width: 52ch;
  color: #d8d5ce;
  font-size: 1.1rem;
}

.iw-phase-index,
.iw-phase-rule {
  color: var(--iw-ledger);
  font: 0.7rem/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.iw-phase-rule {
  margin-top: 2.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #50505a;
}

.iw-phase-fallback {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.iw-phase-fallback li {
  min-height: 9rem;
  padding: 1.25rem;
  border-top: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.iw-phase-fallback strong,
.iw-phase-fallback span {
  display: block;
}

.iw-phase-fallback strong {
  font: 0.72rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.iw-phase-fallback span {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.js .iw-phase-fallback {
  display: none;
}

.iw-counter-section,
.iw-account-section {
  background: var(--paper);
  color: var(--ink);
  --text: var(--ink);
  --muted: var(--iron);
  --rule: #c9c4b9;
  --focus: var(--spectral);
}

.iw-counter-grid,
.iw-writing-grid,
.iw-campaign-grid,
.iw-record-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: center;
}

.iw-media-plate {
  grid-column: 1 / span 5;
  margin: 0;
  padding-right: clamp(1rem, 4vw, 4rem);
}

.iw-media-plate img,
.iw-story-figure img,
.iw-boss-figure img {
  width: 100%;
  height: auto;
  border: 1px solid #50505a;
  background: #09090b;
  image-rendering: pixelated;
}

.iw-counter-copy {
  grid-column: 6 / -1;
}

.iw-counter-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 2.5rem;
  border: 1px solid var(--rule);
}

.iw-counter-controls button span {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.55rem;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

.iw-counter-controls button[data-iw-counter="arc"] span { background: var(--iw-arc); }
.iw-counter-controls button[data-iw-counter="ember"] span { background: var(--iw-ember); }
.iw-counter-controls button[data-iw-counter="root"] span { background: var(--iw-root); }
.iw-counter-controls button[data-iw-counter="ward"] span { background: var(--iw-ward); }

.iw-counter-controls button:hover,
.iw-counter-controls button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.iw-counter-display {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1.5rem;
  align-items: center;
  min-height: 10rem;
  padding: 1.5rem;
  border: 1px solid #50505a;
  border-top: 0;
  background: #09090b;
  color: #f7f3ea;
}

.iw-counter-mark {
  width: 4.5rem;
  aspect-ratio: 1;
  border: 1px solid var(--iw-active);
  background: #141417;
  clip-path: polygon(50% 0, 84% 16%, 100% 50%, 84% 84%, 50% 100%, 16% 84%, 0 50%, 16% 16%);
  box-shadow: inset 0 0 0 1.25rem #09090b;
}

.iw-counter-display[data-counter="arc"] { --iw-active: var(--iw-arc); }
.iw-counter-display[data-counter="ember"] { --iw-active: var(--iw-ember); }
.iw-counter-display[data-counter="root"] { --iw-active: var(--iw-root); }
.iw-counter-display[data-counter="ward"] { --iw-active: var(--iw-ward); }

.iw-counter-display p {
  margin: 0.5rem 0 0;
  color: #d8d5ce;
}

.iw-counter-display .iw-phase-index {
  color: var(--iw-active);
}

.iw-rule-ledger {
  margin: 2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.iw-rule-ledger li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}

.iw-rule-ledger strong {
  font: 0.72rem/1.4 var(--mono);
}

.iw-rule-ledger span {
  color: var(--muted);
}

.iw-writing-section,
.iw-campaign-section,
.iw-record-section {
  background: var(--canvas);
}

.iw-writing-copy {
  grid-column: 1 / span 7;
}

.iw-story-figure,
.iw-boss-figure {
  margin: 0;
}

.iw-story-figure {
  grid-column: 9 / -1;
}

.iw-manuscript {
  margin-top: 2.5rem;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.iw-manuscript div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--rule);
}

.iw-manuscript div:first-child { border-top: 0; }

.iw-manuscript span {
  color: var(--muted);
  font: 0.68rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.iw-manuscript strong {
  font-weight: 500;
}

.iw-manuscript .iw-patch {
  border-left: 3px solid var(--iw-arc);
  background: #0d1417;
  color: #f7f3ea;
}

.iw-footnote,
.iw-status-note {
  padding-left: 1rem;
  border-left: 2px solid var(--iw-ledger);
  font-size: 0.92rem;
}

.iw-account-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--rule);
}

.iw-account-choices button {
  display: block;
  min-height: 9rem;
  padding: 1.5rem;
  text-align: left;
}

.iw-account-choices button span {
  display: block;
}

.iw-account-choices button span:last-child {
  margin-top: 0.65rem;
  color: var(--muted);
  font-family: var(--sans);
  letter-spacing: 0;
  text-transform: none;
}

.iw-account-choices button:hover,
.iw-account-choices button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.iw-account-choices button[aria-pressed="true"] span:last-child {
  color: var(--ash);
}

.iw-choice-label {
  font-size: 0.82rem;
}

.iw-account-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--ink);
  border-top: 0;
  background: var(--paper);
}

.iw-account-preview > div {
  min-height: 8rem;
  padding: 1.25rem;
  border-right: 1px solid var(--rule);
}

.iw-account-preview span,
.iw-account-preview strong {
  display: block;
}

.iw-account-preview span {
  color: var(--muted);
  font: 0.66rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.iw-account-preview strong {
  margin-top: 0.75rem;
  font: 2.75rem/1 var(--serif);
  font-weight: 450;
}

.iw-account-preview p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}

.iw-account-preview[data-choice="send"] strong { color: #355e59; }
.iw-account-preview[data-choice="keep"] strong { color: #6e171d; }

.iw-campaign-copy {
  grid-column: 1 / span 8;
}

.iw-boss-figure {
  grid-column: 10 / -1;
}

.iw-evidence-list {
  margin: 2.5rem 0 0;
  border-top: 1px solid var(--rule);
}

.iw-evidence-list div {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}

.iw-evidence-list dt,
.iw-evidence-list dd {
  margin: 0;
}

.iw-evidence-list dt {
  color: var(--muted);
  font: 0.68rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.iw-record-grid > img {
  grid-column: 1 / span 3;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  image-rendering: pixelated;
}

.iw-record-grid > div {
  grid-column: 5 / -1;
}

.iw-status-note {
  margin-top: 2rem;
}

.iw-reading-aside img {
  width: min(11rem, 100%);
  height: auto;
  margin-bottom: 2rem;
  border: 1px solid var(--rule);
  image-rendering: pixelated;
}

.infini-reading-page .reading-content h1 {
  line-height: 0.78;
}

.infini-reading-page .reading-content li {
  margin-block: 0.45rem;
}

@media (prefers-reduced-motion: no-preference) {
  .iw-cast-line {
    animation: iw-cast-signal 2200ms steps(4) infinite;
  }

  .iw-key-frame::before {
    animation: iw-node-signal 2200ms steps(2) infinite;
  }

  @keyframes iw-cast-signal {
    0%, 48%, 100% { opacity: 0.28; }
    52%, 72% { opacity: 1; }
  }

  @keyframes iw-node-signal {
    0%, 50%, 100% { background: #141417; }
    56%, 74% { background: var(--iw-arc); }
  }
}

@media (max-width: 64rem) {
  .iw-hero-copy { grid-column: 1 / span 7; }
  .iw-key-figure { grid-column: 8 / -1; }
  .iw-counter-copy { grid-column: 6 / -1; }
  .iw-writing-copy { grid-column: 1 / span 7; }
  .iw-story-figure { grid-column: 9 / -1; }
}

@media (max-width: 48rem) {
  .iw-hero-grid {
    display: flex;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .iw-hero h1 {
    font-size: clamp(5rem, 25vw, 8rem);
  }

  .iw-hero-facts {
    grid-template-columns: 1fr 1fr;
  }

  .iw-key-figure {
    width: min(100%, 34rem);
    margin: 3rem auto 0;
  }

  .iw-section-header,
  .iw-counter-grid,
  .iw-writing-grid,
  .iw-campaign-grid,
  .iw-record-grid {
    display: block;
  }

  .iw-section-header > .folio {
    margin-bottom: 1.25rem;
  }

  .iw-section-header img {
    width: min(16rem, 70vw);
    margin-top: 2rem;
  }

  .iw-phase-controls {
    grid-template-columns: 1fr 1fr;
  }

  .iw-phase-controls button {
    border-bottom: 1px solid var(--rule);
  }

  .iw-phase-controls button:last-child {
    grid-column: 1 / -1;
  }

  .iw-phase-display {
    padding: 2rem;
  }

  .iw-phase-display::after {
    position: relative;
    right: auto;
    bottom: auto;
    display: block;
    width: 7rem;
    margin-top: 3rem;
  }

  .iw-phase-fallback {
    grid-template-columns: 1fr;
  }

  .iw-phase-fallback li {
    min-height: 0;
  }

  .iw-media-plate,
  .iw-story-figure,
  .iw-boss-figure {
    width: min(100%, 28rem);
    margin: 0 auto 3rem;
    padding: 0;
  }

  .iw-story-figure,
  .iw-boss-figure {
    margin-top: 3rem;
    margin-bottom: 0;
  }

  .iw-counter-controls {
    grid-template-columns: 1fr 1fr;
  }

  .iw-counter-controls button:nth-child(2) {
    border-right: 0;
  }

  .iw-counter-controls button:nth-child(-n + 2) {
    border-bottom: 1px solid var(--rule);
  }

  .iw-account-preview {
    grid-template-columns: 1fr 1fr;
  }

  .iw-account-preview > div:nth-child(2) {
    border-right: 0;
  }

  .iw-account-preview > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--rule);
  }

  .iw-record-grid > img {
    width: min(14rem, 55vw);
    margin-bottom: 2rem;
  }
}

@media (max-width: 30rem) {
  .iw-counter-display {
    grid-template-columns: 1fr;
  }

  .iw-account-choices,
  .iw-account-preview {
    grid-template-columns: 1fr;
  }

  .iw-account-choices button,
  .iw-account-preview > div {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .iw-account-preview > div:nth-child(n) {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .iw-manuscript div,
  .iw-evidence-list div,
  .iw-rule-ledger li {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iw-cast-line,
  .iw-key-frame::before {
    animation: none;
  }

  .iw-key-frame img {
    transform: scale(1.035);
  }
}

@media (forced-colors: active) {
  .iw-key-frame,
  .iw-media-plate,
  .iw-story-figure,
  .iw-boss-figure,
  .iw-section-header img,
  .iw-record-grid > img {
    forced-color-adjust: none;
  }

  .iw-counter-mark,
  .iw-phase-display::after,
  .iw-cast-line {
    display: none;
  }
}
