/* HUSH — quiet color sort */

:root {
  --hush-ink: #1a1612;
  --hush-paper: #e6dcc8;
  --hush-muted: #8a7f70;
  --hush-line: rgba(230, 220, 200, 0.14);
  --hush-walnut: #3d2b1f;
  --hush-warm: #c4a07a;
  --hush-device: 28rem;
  --hush-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", Georgia, serif;
  --hush-sans: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --hush-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.hush-body,
.hush-body * {
  box-sizing: border-box;
}

.hush-body {
  margin: 0;
  min-height: 100dvh;
  color: var(--hush-paper);
  font-family: var(--hush-sans);
  background: #120e0c;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  touch-action: manipulation;
}

#hush-root {
  min-height: 100dvh;
  min-height: 100svh;
}

.hush-atmosphere {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hush-atmosphere__desk {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) brightness(0.55);
  transform: scale(1.04);
}

.hush-atmosphere__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(80, 70, 90, 0.18), transparent 46%),
    linear-gradient(180deg, rgba(12, 10, 9, 0.2), rgba(12, 10, 9, 0.72));
  pointer-events: none;
}

.hush-grain {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.55'/></svg>");
  animation: hush-grain 1.8s steps(2) infinite;
}

@keyframes hush-grain {
  to { transform: translate3d(2%, -1%, 0); }
}

.hush-device {
  position: relative;
  min-height: 0;
  z-index: 2;
  width: min(100vw, var(--hush-device));
  height: 100dvh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(22, 18, 16, 0.72), rgba(16, 13, 12, 0.92));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

@media (min-width: 720px) {
  .hush-device {
    height: min(92dvh, 860px);
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(230, 220, 200, 0.08);
  }
}

.hush-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: calc(0.7rem + env(safe-area-inset-top)) 1rem calc(0.75rem + env(safe-area-inset-bottom));
}

.hush-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.2rem;
}

.hush-wordmark {
  font-family: var(--hush-serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  text-transform: lowercase;
  color: var(--hush-paper);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.hush-muted,
.hush-kicker {
  color: var(--hush-muted);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hush-icon-btn,
.hush-text-btn,
.hush-cta,
.hush-ghost {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.hush-icon-btn {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--hush-line);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
}

.hush-icon-btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

.hush-cta,
.hush-ghost {
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  font-family: var(--hush-serif);
  font-style: italic;
  font-size: 1.05rem;
}

.hush-cta {
  border: 0;
  background: var(--hush-paper);
  color: var(--hush-ink);
}

.hush-ghost {
  border: 1px solid var(--hush-line);
  background: transparent;
}

.hush-text-btn {
  background: none;
  border: 0;
  color: var(--hush-muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.hush-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.4rem;
  padding-bottom: 1.5rem;
}

.hush-title__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hush-title .hush-screen {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(18, 14, 12, 0.1) 20%, rgba(14, 11, 10, 0.82) 70%, rgba(12, 10, 9, 0.94));
}

.hush-title h1 {
  margin: 0;
  font-family: var(--hush-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(3.4rem, 16vw, 5.4rem);
  letter-spacing: -0.04em;
  line-height: 0.85;
}

.hush-title p {
  margin: 0;
  max-width: 18rem;
  color: color-mix(in srgb, var(--hush-paper) 78%, transparent);
  line-height: 1.55;
  font-size: 0.98rem;
}

.hush-title__actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: flex-start;
  margin-top: 0.5rem;
}

.hush-title__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.4rem;
}

.hush-exit {
  position: absolute;
  top: calc(0.7rem + env(safe-area-inset-top));
  left: 1rem;
  z-index: 3;
  color: color-mix(in srgb, var(--hush-paper) 70%, transparent);
  text-decoration: none;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (max-width: 719px) {
  .hush-exit {
    display: none;
  }
}

.hush-painting-wrap {
  display: grid;
  place-items: center;
  padding: 0.35rem 0 0.4rem;
  flex: 0 1 auto;
  min-height: 0;
}

.hush-painting {
  position: relative;
  width: min(100%, 18.5rem);
  aspect-ratio: 4 / 3;
  max-height: min(32vh, 14.5rem);
  border-radius: 4px;
  overflow: hidden;
  background: #f4e6c8;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.hush-painting[data-frame='oak'] {
  box-shadow: 0 0 0 7px #6b4e32, 0 18px 40px rgba(0, 0, 0, 0.35);
}

.hush-painting[data-frame='charcoal'] {
  box-shadow: 0 0 0 6px #2b2724, 0 18px 40px rgba(0, 0, 0, 0.35);
}

.hush-painting[data-frame='linen'] {
  box-shadow: 0 0 0 10px #d9d0be, 0 18px 40px rgba(0, 0, 0, 0.28);
}

.hush-painting img,
.hush-painting canvas,
.hush-colorbook {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.hush-colorbook {
  background: #f4e6c8;
}

.hush-colorbook :is(path, ellipse, circle, rect) {
  transition: fill 0.45s var(--hush-ease);
}

.hush-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  padding: 0.1rem 0 0.25rem;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.hush-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.72rem;
  color: var(--hush-muted);
  font-family: var(--hush-serif);
}

.hush-legend i {
  display: block;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.hush-legend span.is-on {
  color: var(--hush-paper);
}

.hush-painting__fog {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(30, 26, 22, 0.28);
  mix-blend-mode: multiply;
  transition: opacity 1s var(--hush-ease);
}

.hush-painting.is-clear .hush-painting__fog {
  opacity: 0;
}

.hush-evening-copy {
  text-align: center;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  padding-bottom: 0.35rem;
}

.hush-evening-copy h2 {
  margin: 0;
  font-family: var(--hush-serif);
  font-weight: 500;
  font-style: italic;
  font-size: 1.15rem;
}

.hush-evening-copy p {
  margin: 0.25rem 0 0;
  color: var(--hush-muted);
  font-size: 0.82rem;
  min-height: 1.2em;
}

.hush-board {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0 0.45rem;
  min-height: 6.5rem;
  overflow: hidden;
  position: relative;
  z-index: 3;
}

.hush-vials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.55rem 0.7rem;
  width: 100%;
  max-width: 24rem;
}

.hush-vial {
  width: 3.15rem;
  height: 7.4rem;
  position: relative;
  z-index: 6;
  pointer-events: auto;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.28s var(--hush-ease);
}

.hush-vial.is-selected {
  transform: translateY(-10px);
}

.hush-vial.is-selected .hush-vial__glass {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 0 0 2px rgba(230, 220, 200, 0.42),
    0 12px 18px rgba(0, 0, 0, 0.28);
}

.hush-vial__num {
  position: absolute;
  left: 50%;
  bottom: -0.15rem;
  transform: translateX(-50%);
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: #f4ead6;
  color: #1a1612;
  font-family: var(--hush-serif);
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  z-index: 4;
  pointer-events: none;
}

.hush-vial.is-hushed {
  filter: saturate(0.82);
}

.hush-vial.is-hint {
  animation: hush-hint 1.4s ease-in-out infinite;
}

@keyframes hush-hint {
  50% { transform: translateY(-7px); }
}

.hush-vial__glass {
  position: absolute;
  left: 0.28rem;
  right: 0.28rem;
  top: 1.2rem;
  bottom: 0.2rem;
  border-radius: 1.05rem 1.05rem 1.5rem 1.5rem;
  background: linear-gradient(180deg, rgba(214, 204, 188, 0.42), rgba(186, 174, 158, 0.28));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    inset -12px 0 14px rgba(255, 255, 255, 0.08),
    inset 7px 0 12px rgba(0, 0, 0, 0.14),
    0 12px 18px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.hush-vial__glass::before {
  content: '';
  position: absolute;
  left: 0.32rem;
  top: 0.45rem;
  bottom: 0.7rem;
  width: 0.28rem;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.04));
  pointer-events: none;
  z-index: 3;
}

.hush-vial[data-style='ceramic'] .hush-vial__glass {
  border-radius: 0.2rem 0.2rem 0.45rem 0.45rem;
  background: linear-gradient(180deg, rgba(240, 230, 214, 0.08), rgba(60, 45, 35, 0.2));
}

.hush-vial[data-style='stone'] .hush-vial__glass {
  border-radius: 0.55rem 0.55rem 0.9rem 0.9rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 16px rgba(0, 0, 0, 0.22);
}

.hush-vial[data-style='paper'] .hush-vial__glass {
  border-radius: 0.15rem;
  background: rgba(232, 220, 196, 0.06);
}

.hush-vial__neck {
  position: absolute;
  left: 50%;
  top: 0.52rem;
  width: 1.35rem;
  height: 0.78rem;
  transform: translateX(-50%);
  border-radius: 0.22rem 0.22rem 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.hush-vial__cork {
  position: absolute;
  left: 50%;
  top: 0.18rem;
  width: 1.05rem;
  height: 0.55rem;
  transform: translateX(-50%) scale(0.4);
  border-radius: 0.12rem;
  background: #8a6a48;
  opacity: 0;
  transition: 0.4s var(--hush-ease);
}

.hush-vial.is-hushed .hush-vial__cork {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.hush-vial__layers {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column-reverse;
}

.hush-layer {
  height: 1.35rem;
  width: 100%;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.hush-layer::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0.28rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent);
  opacity: 0.45;
}

.hush-layer.is-empty {
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.hush-layer.is-empty::after {
  display: none;
}

.hush-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  flex-shrink: 0;
}

.hush-tool {
  border: 1px solid var(--hush-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--hush-paper);
  border-radius: 0.9rem;
  padding: 0.55rem 0.2rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  cursor: pointer;
}

.hush-tool small {
  color: var(--hush-muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hush-tool[disabled] {
  opacity: 0.38;
}

.hush-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: auto;
  padding: 0.4rem 0 1rem;
  flex: 1;
}

.hush-row,
.hush-card {
  border: 1px solid var(--hush-line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  color: inherit;
  text-align: left;
  width: 100%;
}

.hush-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.hush-row[disabled] {
  opacity: 0.4;
  cursor: default;
}

.hush-row strong,
.hush-card h3 {
  font-family: var(--hush-serif);
  font-style: italic;
  font-weight: 500;
}

.hush-chapter {
  margin: 1rem 0 0.4rem;
  color: var(--hush-muted);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hush-shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  overflow: auto;
  padding-bottom: 1rem;
}

.hush-shop-item {
  border: 1px solid var(--hush-line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 1rem;
  padding: 0.9rem;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 7.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hush-shop-item.is-on {
  box-shadow: inset 0 0 0 1px var(--hush-paper);
}

.hush-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  overflow: auto;
  padding-bottom: 1rem;
}

.hush-gallery figure {
  margin: 0;
}

.hush-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.4rem;
  display: block;
  filter: grayscale(0.15);
}

.hush-gallery figcaption {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--hush-muted);
  font-family: var(--hush-serif);
  font-style: italic;
}

.hush-complete {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.1rem;
  text-align: left;
}

.hush-complete h2 {
  margin: 0;
  font-family: var(--hush-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 2.2rem;
  line-height: 1;
}

.hush-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: rgba(10, 8, 7, 0.62);
  display: grid;
  place-items: end center;
  padding: 1.2rem;
}

.hush-sheet {
  width: min(100%, 22rem);
  background: #1e1916;
  border: 1px solid var(--hush-line);
  border-radius: 1.4rem;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.hush-sheet h3 {
  margin: 0;
  font-family: var(--hush-serif);
  font-style: italic;
  font-weight: 500;
}

.pigment-fly {
  position: fixed;
  z-index: 20;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50% 50% 45% 55%;
  pointer-events: none;
  filter: blur(0.2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.46s var(--hush-ease), opacity 0.46s var(--hush-ease);
}

.hush-toast {
  position: absolute;
  left: 50%;
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(20, 16, 14, 0.92);
  border: 1px solid var(--hush-line);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  color: var(--hush-paper);
  z-index: 5;
  pointer-events: none;
}

.hush-settings {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-top: 1rem;
}

.hush-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--hush-line);
  padding: 0.9rem 0;
}

@media (prefers-reduced-motion: reduce) {
  .hush-grain,
  .hush-vial.is-hint {
    animation: none;
  }
  .hush-painting img,
  .pigment-fly,
  .hush-vial {
    transition: none;
  }
}
