/* Day 6: Rest is today's work.
   The shore before sunrise: a wide gold horizon, flat water, thirty lamps with
   one dark, a page on the water. The work sits on the shore deck below. */

.hp {
  --d6-night: var(--house-color-ground-night);
  --d6-deep: #07090f;
  --d6-indigo: #171324;
  --d6-water: #0b1a1c;
  --d6-deck: #1a1308;
  --d6-gold: var(--house-color-gold-base);
  --d6-gold-hi: var(--house-color-gold-hi);
  --d6-gold-light: var(--house-color-gold-light);
  --d6-gold-mid: var(--house-color-gold-mid);
  --d6-gold-deep: var(--house-color-gold-deep);
  --d6-ice: var(--house-color-scene-ice);
  --d6-ink: var(--house-color-text-ink);
  --d6-ink-2: var(--house-color-text-secondary);
  --d6-ink-3: var(--house-color-text-tertiary);
  --d6-line: var(--house-color-line-quiet);
  --d6-line-2: var(--house-color-line-strong);
  --d6-paper: var(--house-color-dawn-paper);
  --d6-paper-deep: var(--house-color-dawn-paper-deep);
  --d6-on-paper: var(--house-color-dawn-ink);
  --d6-ease: var(--house-motion-easing-standard);
  --d6-silk: var(--house-motion-easing-silk);
  position: relative;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--d6-night);
  color: var(--d6-ink);
  font-family: var(--house-type-family-body);
  font-size: var(--house-type-size-body);
  line-height: var(--house-type-line-height-body);
  -webkit-font-smoothing: antialiased;
}
.hp *, .hp *::before, .hp *::after { box-sizing: border-box; }

.d6-skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 30;
  background: var(--d6-paper);
  color: var(--d6-on-paper);
  padding: 12px 16px;
  border-radius: 8px;
  font: 600 14px/1 var(--house-type-family-body);
  text-decoration: none;
  transition: top 200ms var(--d6-ease);
}
.d6-skip:focus { top: 12px; outline: 2px solid var(--d6-gold-hi); outline-offset: 3px; }

/* The scene */
.hp-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--d6-night);
}
.d6-sky {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 58%;
  background:
    radial-gradient(80% 50% at 50% 100%, rgba(255,243,214,.5) 0%, rgba(255,243,214,0) 62%),
    linear-gradient(180deg, #07060c 0%, #0c0a12 30%, #1c1626 56%, #4a3a1e 78%, #b08a45 90%, #f3d9a0 100%);
}
.d6-sky-deep {
  position: absolute;
  inset: 0 0 auto;
  height: 52%;
  background: linear-gradient(180deg, #07060c 0%, rgba(7,6,12,.55) 60%, rgba(7,6,12,0) 100%);
}
.d6-sky-band {
  position: absolute;
  left: -12%; right: -12%; bottom: -8%;
  height: 42%;
  background: radial-gradient(56% 100% at 50% 100%, #fffaf0 0%, #fff3d6 18%, #f3d9a0 38%, #d9b46a 62%, rgba(176,138,69,0) 84%);
  filter: blur(6px);
  opacity: .95;
  animation: d6-breathe-sky 12s var(--house-motion-easing-breathe) infinite;
}
.d6-sun {
  position: absolute;
  left: 50%;
  bottom: -10%;
  width: min(58vw, 430px);
  height: min(58vw, 430px);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, #fffaf0 0%, #fff3d6 20%, rgba(243,217,160,.6) 42%, rgba(243,217,160,0) 70%);
  opacity: .92;
  animation: d6-sun 14s var(--house-motion-easing-breathe) infinite;
}
.d6-rose {
  position: absolute;
  left: 0; right: 0;
  top: 42%;
  height: 22%;
  background: linear-gradient(180deg, rgba(217,160,160,0) 0%, rgba(217,160,160,.14) 50%, rgba(217,160,160,0) 100%);
  mix-blend-mode: screen;
}
.d6-star {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: var(--d6-gold-light);
  opacity: var(--o, .2);
  animation: d6-twinkle var(--dur, 9s) var(--d6-ease) infinite alternate;
}
.d6-horizon {
  position: absolute;
  left: 0; right: 0;
  top: 58%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,243,214,0), rgba(255,243,214,.9) 50%, rgba(255,243,214,0));
  box-shadow: 0 0 22px rgba(255,243,214,.5);
}
.d6-water {
  position: absolute;
  left: 0; right: 0; top: 58%; bottom: 0;
  background: linear-gradient(180deg, #f3d9a0 0%, #b08a45 3%, #2a3a3a 9%, #0b1a1c 38%, #06100f 100%);
}
.d6-reflection {
  position: absolute;
  left: 50%; top: 0;
  width: 44%; height: 74%;
  transform: translateX(-50%);
  background: radial-gradient(50% 100% at 50% 0%, rgba(255,207,138,.55) 0%, rgba(255,207,138,0) 72%);
  filter: blur(2px);
}
.d6-shimmer {
  position: absolute;
  left: 50%; top: var(--y, 20%);
  width: var(--w, 40%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(255,243,214,0), rgba(255,243,214,.55) 50%, rgba(255,243,214,0));
  animation: d6-shimmer 7s var(--house-motion-easing-breathe) infinite alternate;
}
.d6-house {
  position: absolute;
  right: 7%;
  bottom: 42%;
  width: min(26vw, 168px);
  height: min(10vw, 64px);
  z-index: 2;
}
.d6-house-body {
  position: absolute;
  inset: 24% 0 0;
  border-radius: 2px;
  background: #080a0e;
  box-shadow: 0 0 0 1px rgba(243,217,160,.14);
}
.d6-house-roof {
  position: absolute;
  left: 6%; right: 6%; top: 0;
  height: 30%;
  background: #080a0e;
  clip-path: polygon(0 100%, 16% 0, 84% 0, 100% 100%);
}
.d6-house-window {
  position: absolute;
  top: 48%;
  width: 8%;
  height: 18%;
  background: rgba(255,243,214,.12);
  transition: background 600ms linear, box-shadow 600ms linear;
}
.d6-house.is-awake .d6-house-awake {
  background: var(--d6-gold-light);
  box-shadow: 0 0 14px rgba(255,243,214,.8);
}
.d6-page {
  position: absolute;
  left: 9%;
  top: 61%;
  width: min(28vw, 118px);
  height: 64px;
  transform: rotate(-5deg);
  border: 1px solid rgba(255,243,214,.2);
  background: linear-gradient(150deg, rgba(255,243,214,.14), rgba(255,243,214,.04));
  box-shadow: 0 0 24px rgba(255,243,214,.08);
  animation: d6-float 13s var(--house-motion-easing-breathe) infinite alternate;
}
.d6-page-fold {
  position: absolute;
  right: 0; top: 0;
  width: 14px; height: 14px;
  background: linear-gradient(225deg, rgba(5,3,8,.4), rgba(255,243,214,0) 70%);
}
.d6-page-line {
  display: block;
  height: 1px;
  margin: 9px 10px 0;
  background: rgba(255,243,214,.34);
}
.d6-page-line:nth-child(2) { width: 70%; }
.d6-page-line:nth-child(3) { width: 84%; }
.d6-page-line:nth-child(4) { width: 52%; }
.d6-line-water {
  position: absolute;
  left: 50%;
  top: 62%;
  width: min(80vw, 720px);
  margin: 0;
  transform: translateX(-50%);
  color: var(--d6-gold-light);
  font-family: var(--house-type-family-display);
  font-size: clamp(18px, 3.4vw, 32px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.015em;
  text-align: center;
  text-shadow: 0 2px 26px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.9);
  opacity: 0;
  transition: opacity 700ms linear;
  z-index: 3;
}
.d6-line-water.is-set { opacity: 1; }
.d6-lamps {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(42% - 2px);
  height: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3%;
}
.d6-lamp {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--d6-gold-light);
  box-shadow: 0 0 8px rgba(255,243,214,.6);
  opacity: .85;
  animation: d6-lamp 6s var(--house-motion-easing-breathe) infinite;
  animation-delay: calc(var(--i) * -0.21s);
  transition: opacity 400ms linear, background 400ms linear, box-shadow 400ms linear;
}
.d6-lamp.is-dark { background: rgba(255,255,255,.14); box-shadow: none; opacity: .5; animation: none; }
.d6-lamp.is-lit { background: var(--d6-gold-light); box-shadow: 0 0 12px rgba(255,243,214,.8); opacity: 1; }
.d6-deck {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 32%;
  background: linear-gradient(180deg, rgba(42,26,8,0) 0%, rgba(42,26,8,.72) 12%, #2a1a08 38%, #1a1208 100%);
}
.d6-deck-edge {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(243,217,160,0), rgba(243,217,160,.5) 50%, rgba(243,217,160,0));
}
.d6-scrim {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 44%;
  z-index: 4;
  background: linear-gradient(180deg, rgba(14,9,4,0) 0%, rgba(14,9,4,.34) 26%, rgba(14,9,4,.82) 66%, rgba(14,9,4,.94) 100%);
}

/* Chrome */
.hp-top {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: var(--house-space-4);
  min-height: 56px;
  padding: 10px var(--house-space-gutter) 0;
}
.hp-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--d6-ink-2);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 220ms linear;
}
.hp-back:hover { color: var(--d6-gold-light); }
.hp-back:focus-visible { outline: 2px solid var(--d6-gold-hi); outline-offset: 3px; border-radius: 4px; }
.hp-back-arrow { font-size: 16px; letter-spacing: 0; }
.hp-back-quiet { color: var(--d6-ink-3); }
.hp-brand { margin: 0 0 0 auto; color: var(--d6-ink-3); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.hp-day { margin: 0; color: var(--d6-gold); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
@media (max-width: 520px) { .hp-brand { display: none; } .hp-day { margin-left: auto; } }

.hp-main {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - 56px);
  padding: 0 var(--house-space-gutter) var(--house-space-5);
}
.hp-head {
  position: relative;
  z-index: 6;
  max-width: 690px;
  padding: clamp(8px, 3vh, 30px) 0 0;
}
.hp-numeral {
  position: absolute;
  right: -8px;
  top: -26px;
  z-index: -1;
  font-family: var(--house-type-family-display);
  font-size: clamp(120px, 32vw, 280px);
  font-weight: 600;
  line-height: .8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,.06);
  pointer-events: none;
  user-select: none;
}
.hp-eyebrow {
  margin: 0 0 var(--house-space-3);
  color: var(--d6-gold);
  font-size: var(--house-type-size-eyebrow);
  letter-spacing: var(--house-type-tracking-eyebrow);
  text-transform: uppercase;
}
.hp-title {
  margin: 0;
  max-width: 13ch;
  color: var(--d6-ink);
  font-family: var(--house-type-family-display);
  font-size: clamp(40px, 9vw, 86px);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.hp-sub {
  margin: var(--house-space-4) 0 0;
  max-width: 46ch;
  color: var(--d6-ink-2);
  font-size: var(--house-type-size-lede);
  line-height: 1.45;
}
.hp-stage {
  position: relative;
  z-index: 6;
  display: flex;
  flex: 1;
  align-items: flex-end;
  padding: var(--house-space-2) 0 var(--house-space-3);
}
.hp-panel {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}
.hp-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--house-space-4);
  min-height: 40px;
  border-top: 1px solid var(--d6-line);
}
.hp-progress-label { margin: 0; color: var(--d6-ink-3); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; white-space: nowrap; }
.hp-lights { display: flex; flex-shrink: 0; gap: 5px; }
.hp-light { display: block; width: 10px; height: 2px; border-radius: 2px; background: rgba(255,255,255,.15); transition: background 300ms linear, box-shadow 300ms linear; }
.hp-light[data-state="lit"] { background: var(--d6-gold); box-shadow: 0 0 10px rgba(243,217,160,.45); }
.hp-light[data-state="now"] { background: var(--d6-gold-light); animation: d6-now 2.8s var(--house-motion-easing-breathe) infinite; }
.hp-body { position: relative; transition: opacity 180ms linear, transform 180ms var(--d6-ease); }
.hp-body.is-swap { opacity: 0; transform: translateY(6px); }
.hp-note { min-height: 22px; margin: 4px 0 0; color: var(--d6-ink-3); font-size: 13.5px; line-height: 1.45; }
.hp-note[data-tone="good"] { color: var(--d6-gold-light); }
.hp-note[data-tone="wait"] { color: var(--d6-ice); }
.hp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hp-foot {
  position: relative;
  z-index: 7;
  display: flex;
  flex-wrap: wrap;
  gap: 6px var(--house-space-4);
  justify-content: space-between;
  padding: var(--house-space-3) var(--house-space-gutter) var(--house-space-4);
  color: var(--d6-ink-3);
  font-size: 11px;
  letter-spacing: .04em;
}
.hp-foot-care { color: var(--d6-ink-2); }

/* Intro */
.hp-intro { max-width: 560px; padding: 8px 0 var(--house-space-2); }
.hp-ornament { display: block; width: 46px; height: 1px; margin-bottom: var(--house-space-4); background: linear-gradient(90deg, var(--d6-gold), rgba(243,217,160,0)); }
.hp-intro-line { margin: 0 0 var(--house-space-2); color: var(--d6-ink); font-size: var(--house-type-size-lede); line-height: 1.45; max-width: 42ch; }
.hp-intro-line:first-of-type { font-size: clamp(19px, 2.4vw, 23px); }
.hp-hint { margin: var(--house-space-3) 0 0; max-width: 44ch; color: var(--d6-ink-3); font-size: 13px; line-height: 1.5; }
.hp-care { margin: 6px 0 0; color: var(--d6-ink-3); font-size: 12px; letter-spacing: .02em; }
.hp-care::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 7px; border-radius: 50%; background: var(--d6-gold); vertical-align: 1px; }

/* Buttons: squarer than day five, warmer at rest. */
.hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--d6-line-2);
  border-radius: 12px;
  background: rgba(5,3,8,.42);
  color: var(--d6-ink);
  font: 600 15px/1 var(--house-type-family-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 220ms var(--d6-ease), border-color 220ms linear, background 220ms linear, color 220ms linear;
}
.hp-btn:hover { border-color: rgba(243,217,160,.62); background: rgba(243,217,160,.08); color: var(--d6-gold-light); }
.hp-btn:active { transform: translateY(1px); }
.hp-btn:focus-visible { outline: var(--house-light-focus-width) solid var(--d6-gold-hi); outline-offset: var(--house-light-focus-offset); }
.hp-primary { border-color: rgba(243,217,160,.58); background: linear-gradient(160deg, rgba(255,243,214,.16), rgba(217,180,106,.08)); color: var(--d6-gold-light); box-shadow: 0 0 26px -14px rgba(243,217,160,.7); }
.hp-ghost { color: var(--d6-ink-2); }
.d6-quiet-link { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--d6-ink-3); font: 500 13.5px/1.4 var(--house-type-family-body); text-decoration: underline; text-decoration-color: rgba(255,255,255,.28); text-underline-offset: 4px; cursor: pointer; }
.d6-quiet-link:hover { color: var(--d6-ink); }
.d6-quiet-link:focus-visible { outline: 2px solid var(--d6-gold-hi); outline-offset: 3px; }

/* The movements */
.d6-phase {
  position: relative;
  max-width: 700px;
  padding: clamp(14px, 3vw, 22px);
  border: 1px solid rgba(243,217,160,.16);
  border-radius: 16px;
  background: linear-gradient(180deg, #120d06 0%, #0a0704 100%);
  box-shadow: var(--house-light-lift);
}
.d6-phase::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 1px; background: linear-gradient(90deg, rgba(243,217,160,0), rgba(243,217,160,.6) 50%, rgba(243,217,160,0)); }
.d6-micro { margin: 0; color: var(--d6-gold); font-size: var(--house-type-size-eyebrow); letter-spacing: var(--house-type-tracking-eyebrow); text-transform: uppercase; }
.d6-h2 { margin: var(--house-space-2) 0 var(--house-space-2); color: var(--d6-ink); font-family: var(--house-type-family-display); font-size: clamp(28px, 4.6vw, 46px); font-weight: 600; line-height: 1.02; letter-spacing: -.025em; }
.d6-lede { margin: 0 0 var(--house-space-3); max-width: 56ch; color: var(--d6-ink-2); font-size: var(--house-type-size-lede); line-height: 1.5; }
.d6-field { margin: var(--house-space-3) 0 var(--house-space-2); }
.d6-field-label { display: block; }
.d6-field-label > span { display: block; margin-bottom: 2px; color: var(--d6-gold); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
.d6-input {
  width: 100%;
  min-height: 52px;
  padding: 8px 2px;
  border: 0;
  border-bottom: 1px solid rgba(243,217,160,.5);
  border-radius: 0;
  background: transparent;
  color: var(--d6-ink);
  font: 600 clamp(17px, 3vw, 22px)/1.4 var(--house-type-family-display);
}
.d6-input::placeholder { color: var(--d6-ink-3); font-weight: 400; }
.d6-input:focus { outline: 2px solid var(--d6-gold-hi); outline-offset: 4px; }
.d6-samples { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--house-space-3); }
.d6-sample {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--d6-line);
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  color: var(--d6-ink-2);
  font: 500 12.5px/1.35 var(--house-type-family-body);
  text-align: left;
  cursor: pointer;
  transition: border-color 200ms linear, color 200ms linear, background 200ms linear;
}
.d6-sample:hover { border-color: rgba(243,217,160,.5); color: var(--d6-ink); background: rgba(243,217,160,.06); }
.d6-sample:focus-visible { outline: 2px solid var(--d6-gold-hi); outline-offset: 2px; }
.d6-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--house-space-3); margin-top: var(--house-space-2); }
.d6-read-hint { margin: var(--house-space-3) 0 0; color: var(--d6-ink-3); font-size: 13px; line-height: 1.5; }

/* The sort */
.d6-deck-cards {
  position: relative;
  height: clamp(150px, 21vh, 190px);
  margin: var(--house-space-3) 0 var(--house-space-3);
  perspective: 900px;
}
.d6-ghost {
  position: absolute;
  left: 50%;
  width: min(78%, 470px);
  height: 100%;
  transform: translateX(-50%);
  border-radius: 4px;
  background: linear-gradient(150deg, rgba(255,243,214,.1), rgba(230,207,154,.04));
  border: 1px solid rgba(255,243,214,.1);
}
.d6-ghost-2 { top: 10px; width: min(72%, 440px); opacity: .5; }
.d6-ghost-1 { top: 5px; width: min(75%, 455px); opacity: .7; }
.d6-card {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(78%, 470px);
  height: 100%;
  transform: translateX(-50%);
  padding: clamp(16px, 3vw, 24px);
  border-radius: 4px;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%),
    linear-gradient(150deg, var(--d6-paper) 0%, var(--d6-paper-deep) 100%);
  color: var(--d6-on-paper);
  box-shadow: 0 26px 60px -34px rgba(0,0,0,.9), 0 0 0 1px rgba(255,243,214,.16);
  animation: d6-card-in 460ms var(--d6-silk) both;
  cursor: grab;
  touch-action: pan-y;
}
.d6-card:active { cursor: grabbing; }
.d6-card:focus-visible { outline: 2px solid var(--d6-gold-hi); outline-offset: 3px; }
.d6-card-text { margin: 0; font-family: var(--house-type-family-display); font-size: clamp(22px, 4vw, 32px); font-weight: 600; line-height: 1.14; letter-spacing: -.02em; }
.d6-card-meta { position: absolute; left: clamp(16px,3vw,24px); bottom: 14px; margin: 0; color: rgba(22,16,30,.5); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; }
.d6-card.is-out-right { transform: translate(120%, 12px) rotate(8deg); opacity: 0; transition: transform 320ms var(--d6-ease), opacity 320ms linear; }
.d6-card.is-out-left { transform: translate(-120%, 12px) rotate(-8deg); opacity: 0; transition: transform 320ms var(--d6-ease), opacity 320ms linear; }
.d6-buckets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d6-bucket {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--d6-line-2);
  border-radius: 12px;
  background: rgba(5,3,8,.5);
  color: var(--d6-ink);
  font: 600 14px/1 var(--house-type-family-body);
  cursor: pointer;
  transition: border-color 220ms linear, background 220ms linear, color 220ms linear;
}
.d6-bucket:hover { border-color: rgba(243,217,160,.55); background: rgba(243,217,160,.07); color: var(--d6-gold-light); }
.d6-bucket:focus-visible { outline: 2px solid var(--d6-gold-hi); outline-offset: 2px; }
.d6-arrow { color: var(--d6-gold); font-size: 16px; }
.d6-tools { display: flex; justify-content: center; margin: 4px 0 0; }
.d6-undo { min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--d6-ink-3); font: 500 13px/1.4 var(--house-type-family-body); text-decoration: underline; text-decoration-color: rgba(255,255,255,.24); text-underline-offset: 4px; cursor: pointer; }
.d6-undo:hover { color: var(--d6-ink); }
.d6-undo:disabled { opacity: .4; cursor: default; }
.d6-undo:focus-visible { outline: 2px solid var(--d6-gold-hi); outline-offset: 3px; }
.d6-sort-note { min-height: 22px; margin: 4px 0 0; color: var(--d6-ink-3); font-size: 13px; line-height: 1.45; }
.d6-sort-done { position: relative; max-width: 640px; padding: clamp(14px,3vw,22px); border: 1px solid rgba(243,217,160,.16); border-radius: 16px; background: linear-gradient(180deg, #120d06, #0a0704); box-shadow: var(--house-light-lift); }
.d6-kept { display: flex; flex-wrap: wrap; gap: 7px; margin: var(--house-space-3) 0; }
.d6-kept-chip { padding: 7px 11px; border: 1px solid rgba(243,217,160,.32); border-radius: 10px; color: var(--d6-gold-light); font-size: 12px; }

/* The line moment: the shelf steps away and the line is on the water. */
.hp.is-line-moment .d6-line-phase { background: transparent; border-color: transparent; box-shadow: none; }
.hp.is-line-moment .d6-line-phase .d6-micro,
.hp.is-line-moment .d6-line-phase .d6-h2,
.hp.is-line-moment .d6-line-phase .d6-lede,
.hp.is-line-moment .d6-line-phase .d6-field,
.hp.is-line-moment .d6-line-phase .d6-samples { display: none; }
.hp.is-line-moment .d6-line-water { opacity: 1; }
.hp.is-line-moment .d6-read-hint { color: var(--d6-ink-2); }

/* The kept card */
.d6-keep-card {
  position: relative;
  max-width: 520px;
  margin: var(--house-space-5) 0 var(--house-space-4);
  padding: clamp(22px, 5vw, 34px);
  border-radius: 4px;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(255,255,255,.6), rgba(255,255,255,0) 60%),
    linear-gradient(150deg, var(--d6-paper) 0%, var(--d6-paper-deep) 100%);
  color: var(--d6-on-paper);
  box-shadow: 0 34px 90px -44px rgba(0,0,0,.9), 0 0 0 1px rgba(255,243,214,.18);
}
.d6-keep-card::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(184,134,47,.35); border-radius: 2px; pointer-events: none; }
.d6-keep-head { display: flex; align-items: center; gap: 10px; }
.d6-keep-lamp { display: block; width: 12px; height: 12px; border-radius: 50%; background: rgba(22,16,30,.2); box-shadow: 0 0 0 1px rgba(184,134,47,.5); }
.d6-keep-kicker { color: var(--house-color-dawn-gold-deep); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.d6-keep-title { margin: 14px 0 16px; font-family: var(--house-type-family-display); font-size: clamp(28px, 5.4vw, 38px); font-weight: 600; line-height: 1.04; letter-spacing: -.025em; }
.d6-keep-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.d6-keep-row { padding-bottom: 10px; border-bottom: 1px solid rgba(22,16,30,.18); }
.d6-keep-label { display: block; margin-bottom: 3px; color: rgba(22,16,30,.55); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }
.d6-keep-value { display: block; font-family: var(--house-type-family-display); font-size: clamp(17px, 3.2vw, 21px); font-weight: 600; line-height: 1.35; }
.d6-keep-card .d6-keep-dark { margin: 0 0 14px; color: rgba(22,16,30,.72); font-size: 13px; line-height: 1.45; }
.d6-keep-card .d6-keep-foot { margin: 0; color: rgba(22,16,30,.64); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; }
.d6-keep-card .d6-keep-note { margin: 8px 0 0; color: rgba(22,16,30,.54); font-size: 11px; }
.d6-card-actions { display: flex; flex-wrap: wrap; gap: var(--house-space-2); max-width: 520px; }
.d6-card-actions .hp-btn { background: rgba(5,3,8,.45); }
.d6-end-head { max-width: 660px; padding: var(--house-space-3) 0 0; }
.d6-end-actions { display: flex; flex-wrap: wrap; gap: var(--house-space-3); margin-top: var(--house-space-4); }
.hp-done { padding-bottom: var(--house-space-5); }

/* Ending light */
.hp[data-ending="rest"] .d6-sky-band, .hp[data-ending="rest"] .d6-sun { opacity: 1; }
.hp[data-ending="rest"] .d6-house.is-awake .d6-house-awake { background: var(--d6-gold-light); box-shadow: 0 0 18px rgba(255,243,214,.9); }
.hp[data-ending="work"] .d6-sky-band { opacity: .72; }
.hp[data-ending="work"] .d6-sun { opacity: .6; }
.hp[data-ending="work"] .d6-lamp { opacity: .55; }
.hp[data-ending="empty"] .d6-lamp:nth-child(2) { background: var(--d6-gold-light); box-shadow: 0 0 12px rgba(255,243,214,.8); opacity: 1; }
.hp[data-ending="all"] .d6-lamp:not(.is-dark) { background: var(--d6-gold-light); box-shadow: 0 0 12px rgba(255,243,214,.8); opacity: 1; }
.hp[data-ending="skipped"] .d6-sky-band { opacity: .8; }
.hp[data-phase="play"] .d6-line-water { opacity: 1; }
.hp[data-phase="play"] .hp-title { font-size: clamp(22px, 4.4vw, 30px); max-width: none; }
.hp[data-phase="play"] .hp-sub,
.hp[data-phase="play"] .hp-eyebrow { display: none; }
.hp[data-phase="play"] .hp-head { padding-top: 0; }
.hp[data-phase="done"] .hp-head { display: none; }
.hp[data-phase="done"] .hp-main { min-height: calc(100svh - 56px); }

/* Motion */
@keyframes d6-breathe-sky {
  0%, 100% { opacity: .9; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.03); }
}
@keyframes d6-sun {
  0%, 100% { opacity: .88; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.03); }
}
@keyframes d6-twinkle {
  from { opacity: calc(var(--o, .2) * .5); }
  to { opacity: var(--o, .2); }
}
@keyframes d6-lamp {
  0%, 100% { opacity: .7; }
  50% { opacity: 1; }
}
@keyframes d6-now {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}
@keyframes d6-shimmer {
  from { opacity: .2; transform: translateX(-50%) scaleX(.8); }
  to { opacity: .8; transform: translateX(-50%) scaleX(1.1); }
}
@keyframes d6-float {
  from { transform: rotate(-5deg) translateY(0); }
  to { transform: rotate(-3.6deg) translateY(-5px); }
}
@keyframes d6-card-in {
  from { opacity: 0; transform: translate(-50%, 14px) rotate(-1.2deg); }
  to { opacity: 1; transform: translate(-50%, 0) rotate(0); }
}

/* Responsive */
@media (max-width: 720px) {
  .hp-title { max-width: 11ch; }
  .hp-stage { padding-bottom: 2px; }
  .d6-h2 { font-size: clamp(26px, 7vw, 36px); }
  .d6-deck-cards { height: 150px; }
  .d6-card-text { font-size: 21px; }
  .d6-house { width: min(34vw, 130px); height: 50px; bottom: 42%; }
  .d6-line-water { top: 62%; font-size: 18px; }
  .d6-keep-rows { gap: 9px; }
  .d6-keep-card { padding: 22px; }
}
@media (max-width: 380px) {
  .hp-title { font-size: 38px; }
  .d6-card-text { font-size: 19px; }
  .d6-bucket { font-size: 13px; padding: 0 10px; }
}
@media (min-width: 900px) {
  .hp-head { max-width: 60%; }
  .hp-sub { font-size: 20px; }
  .hp-stage { align-items: flex-end; }
  .hp-panel { margin: 0; }
  .d6-phase { max-width: 720px; }
  .d6-sky { height: 60%; }
  .d6-horizon, .d6-water { top: 60%; }
  .d6-deck { height: 30%; }
  .d6-lamps { bottom: calc(40% - 2px); }
  .d6-scrim { height: 42%; }
  .d6-house { bottom: 40%; right: 9%; }
  .d6-page { top: 63%; }
  .d6-line-water { top: 64%; }
}

/* Reduced motion: the same shore, held still. */
@media (prefers-reduced-motion: reduce) {
  .d6-star, .d6-lamp, .d6-sky-band, .d6-sun, .d6-shimmer, .d6-page, .hp-light[data-state="now"] { animation: none !important; }
  .d6-card { animation: none; }
  .d6-card.is-out-right, .d6-card.is-out-left { transition-duration: 400ms; }
  .hp-body.is-swap { transform: none; }
  .d6-line-water, .d6-house-window, .d6-lamp, .hp-body { transition-duration: 400ms !important; }
}
.hp[data-reduced="true"] .d6-star,
.hp[data-reduced="true"] .d6-lamp,
.hp[data-reduced="true"] .d6-sky-band,
.hp[data-reduced="true"] .d6-sun,
.hp[data-reduced="true"] .d6-shimmer,
.hp[data-reduced="true"] .d6-page,
.hp[data-reduced="true"] .hp-light[data-state="now"] { animation: none !important; }
.hp[data-reduced="true"] .d6-card { animation: none; }

/* The same piece inside a lesson beat. The lesson owns the ground. */
.hp-layer { min-height: 0; background: radial-gradient(120% 90% at 50% 0%, rgba(255,207,138,.16), rgba(5,3,8,0) 62%); }
.hp-layer .hp-scene { display: none; }
.hp-layer .hp-main { min-height: 0; padding: 0; }
.hp-layer .hp-stage { padding: 0; }
.hp-layer .hp-panel { max-width: none; }
.hp-layer .hp-foot, .hp-layer .hp-top, .hp-layer .hp-head { display: none; }
.hp-layer .d6-phase { padding-top: 0; }

/* Print the kept card, and only the kept card. */
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; }
  .hp-scene, .hp-top, .hp-head, .hp-panel-top, .hp-progress-label, .hp-lights, .hp-note, .hp-foot,
  .d6-end-head, .d6-end-actions, .d6-card-actions, .d6-keep-note, .hp-sr, .d6-skip { display: none !important; }
  .hp, .hp-main, .hp-stage, .hp-panel, .hp-body, .hp-done { position: static !important; display: block !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; background: none !important; box-shadow: none !important; max-width: none !important; }
  .d6-keep-card { max-width: none; width: 100%; margin: 0; box-shadow: none; border: 1px solid #b8862f; }
}
