/* ==========================================================================
   The Quiet Hour — styles. Loaded after styles.css; uses its variables.
   ========================================================================== */
.qh-inner { max-width: 1100px; margin: 0 auto; padding: 24px 20px 70px; }
.qh-header { margin: 10px 0 10px; max-width: 760px; }
.qh-header h2 { font-family: var(--serif); font-weight: 500; font-style: italic; font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.01em; margin: 4px 0 10px; color: var(--ink); animation: qh-settle 1.1s cubic-bezier(.2,.8,.2,1) both; }
.qh-header h2 em { font-style: normal; color: var(--clay); }
@keyframes qh-settle { from { opacity: 0; transform: translateY(10px); letter-spacing: 0.08em; } to { opacity: 1; transform: none; letter-spacing: -0.01em; } }
.qh-stage { min-height: 300px; }

/* tabs */
.qh-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 22px; }
.qh-tab { font-family: var(--serif); font-style: italic; font-size: 1.08rem; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(43,42,34,0.18); background: rgba(255,255,255,0.55); color: var(--ink-soft); cursor: pointer; transition: all .2s; }
.qh-tab:hover { border-color: var(--clay); color: var(--ink); }
.qh-tab.is-active { background: var(--forest-deep); color: var(--linen); border-color: var(--forest-deep); }

/* gallery */
.qh-group { margin: 0 0 34px; }
.qh-group-title { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; margin: 0 0 4px; }
.qh-group-note { color: var(--ink-soft); font-style: italic; margin: 0 0 14px; max-width: 640px; }
.qh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.qh-group--labyrinth .qh-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.qh-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 18px; border: 1px solid rgba(43,42,34,0.12); background: rgba(255,255,255,0.6); cursor: pointer; text-align: left; transition: transform .25s, box-shadow .25s, border-color .25s; animation: qh-card-in .6s both; }
.qh-card:nth-child(2) { animation-delay: .05s } .qh-card:nth-child(3) { animation-delay: .1s } .qh-card:nth-child(4) { animation-delay: .15s } .qh-card:nth-child(5) { animation-delay: .2s } .qh-card:nth-child(6) { animation-delay: .25s } .qh-card:nth-child(7) { animation-delay: .3s } .qh-card:nth-child(8) { animation-delay: .35s } .qh-card:nth-child(n+9) { animation-delay: .4s }
@keyframes qh-card-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.qh-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(43,42,34,0.12); border-color: rgba(176,131,85,0.6); }
.qh-card-art { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #fff; }
.qh-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s; }
.qh-card:hover .qh-card-art img { transform: scale(1.04) rotate(2deg); }
.qh-card-title { font-family: var(--serif); font-size: 1.02rem; color: var(--ink); padding: 0 2px 2px; }
.qh-bulb { position: absolute; top: 14px; right: 14px; font-size: 15px; opacity: .55; filter: grayscale(.2); transition: opacity .2s, transform .2s; }
.qh-card:hover .qh-bulb { opacity: 1; transform: rotate(-12deg) scale(1.15); }
.qh-resume { margin: -8px 0 18px; }
.qh-link { background: none; border: 0; padding: 0; color: var(--forest); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(60,82,64,0.35); }
.qh-link:hover { color: var(--forest-deep); text-decoration-color: currentColor; }
.qh-footer { color: var(--ink-soft); font-size: 13.5px; font-style: italic; margin: 26px 0 0; max-width: 620px; }

/* story */
.qh-story { max-width: 680px; }
.qh-story-part { margin: 0 0 40px; }
.qh-story-title { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(1.7rem, 3.8vw, 2.4rem); margin: 0 0 16px; color: var(--ink); opacity: 0; transform: translateY(12px); transition: opacity .9s, transform .9s; }
.qh-story-p { font-family: var(--serif); font-size: 1.12rem; line-height: 1.72; color: var(--ink); margin: 0 0 16px; opacity: 0; transform: translateY(10px); transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i, 0) * 0.08s); }
.qh-story-title.is-in, .qh-story-p.is-in { opacity: 1; transform: none; }
.qh-dropcap::first-letter { font-family: var(--serif); font-size: 3.4em; float: left; line-height: .82; padding: 6px 10px 0 0; color: var(--clay); font-style: italic; }
.qh-sources { font-size: 13px; color: var(--ink-soft); font-style: italic; border-top: 1px solid rgba(43,42,34,0.12); padding-top: 14px; }

/* painter */
.qh-painter { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px 28px; align-items: start; }
.qh-painter-top { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.qh-painter-title { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(1.6rem, 3.6vw, 2.3rem); margin: 0; color: var(--ink); }
.qh-bulb-btn { margin-left: auto; font: inherit; font-size: 14px; color: var(--ink-soft); background: rgba(255,255,255,0.6); border: 1px dashed rgba(176,131,85,0.6); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: all .2s; }
.qh-bulb-btn:hover, .qh-bulb-btn[aria-expanded="true"] { background: #fff7e3; border-style: solid; color: var(--ink); }
.qh-bubble { grid-column: 1 / -1; position: relative; background: #fff8e6; border: 1px solid rgba(176,131,85,0.45); border-radius: 18px 18px 18px 4px; padding: 14px 18px 12px; max-width: 640px; font-family: var(--serif); font-size: 1.05rem; line-height: 1.55; color: var(--ink); animation: qh-pop .35s cubic-bezier(.2,.9,.3,1.3) both; }
.qh-bubble p { margin: 0 0 8px; }
.qh-bubble::before { content: ""; position: absolute; left: -1px; bottom: -12px; width: 0; height: 0; border-left: 0 solid transparent; border-right: 14px solid transparent; border-top: 12px solid rgba(176,131,85,0.45); }
.qh-bubble::after { content: ""; position: absolute; left: 0; bottom: -10px; border-right: 13px solid transparent; border-top: 11px solid #fff8e6; }
@keyframes qh-pop { from { opacity: 0; transform: scale(.94) translateY(6px); } to { opacity: 1; transform: none; } }
.qh-mood { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-style: italic; color: var(--ink-soft); animation: qh-pop .4s both; }
.qh-mood label { display: flex; gap: 10px; align-items: center; }
.qh-mood input { font: inherit; font-family: var(--serif); font-style: italic; font-size: 1.05rem; padding: 6px 10px; border: 0; border-bottom: 1px solid rgba(43,42,34,0.35); background: transparent; color: var(--ink); min-width: 180px; outline: none; }
.qh-mood input:focus { border-bottom-color: var(--clay); }
.qh-canvas-wrap { position: relative; }
.qh-canvas { position: relative; width: 100%; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 18px 40px rgba(43,42,34,0.14); touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.qh-layers { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.qh-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.qh-canvas.is-panning { cursor: grab; }
.qh-canvas.is-panning:active { cursor: grabbing; }
.qh-zoom { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; align-items: center; z-index: 2; }
.qh-zoom-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(43,42,34,0.18); background: rgba(255,255,255,0.88); color: var(--ink); font: 600 20px/1 var(--sans); cursor: pointer; box-shadow: 0 2px 8px rgba(43,42,34,0.12); display: grid; place-items: center; transition: all .15s; -webkit-tap-highlight-color: transparent; }
.qh-zoom-btn:hover { border-color: var(--clay); }
.qh-zoom-btn.is-active { background: var(--forest-deep); color: var(--linen); border-color: var(--forest-deep); }
.qh-zoom-fit { font-size: 12px; letter-spacing: .02em; }
.qh-zoom-fit, .qh-zoom-hand, .qh-zoom-level { display: none; }
.qh-zoom.is-zoomed .qh-zoom-fit, .qh-zoom.is-zoomed .qh-zoom-hand, .qh-zoom.is-zoomed .qh-zoom-level { display: grid; }
.qh-zoom-level { font-size: 12px; color: var(--ink-soft); background: rgba(255,255,255,0.8); border-radius: 8px; padding: 4px 7px; }
@media (max-width: 560px) { .qh-zoom-btn { width: 44px; height: 44px; } }
.qh-lines { mix-blend-mode: multiply; }
.qh-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-style: italic; color: var(--ink-soft); pointer-events: none; }
.qh-hint { min-height: 22px; font-style: italic; color: var(--ink-soft); font-size: 14.5px; margin: -6px 0 0; transition: opacity .3s; }
.qh-question { grid-column: 1; background: rgba(255,255,255,0.65); border: 1px solid rgba(60,82,64,0.25); border-radius: 16px; padding: 16px 18px; font-family: var(--serif); font-size: 1.1rem; line-height: 1.5; animation: qh-pop .5s both; }
.qh-question p { margin: 0 0 10px; }
.qh-question .qh-mood { font-size: .95rem; }

/* toolbar */
.qh-toolbar { display: flex; flex-direction: column; gap: 14px; grid-row: span 2; }
.qh-row { display: flex; flex-direction: column; gap: 8px; }
.qh-row-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--clay); font-weight: 600; }
.qh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qh-chip { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13.5px; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(43,42,34,0.16); background: rgba(255,255,255,0.65); color: var(--ink); cursor: pointer; transition: all .15s; }
.qh-chip:hover { border-color: var(--clay); }
.qh-chip.is-active { background: var(--forest-deep); color: var(--linen); border-color: var(--forest-deep); }
.qh-chip--auto { border-style: dashed; }
.qh-ico { width: 14px; height: 14px; border-radius: 50%; background: currentColor; opacity: .75; display: inline-block; }
.qh-ico--tap { border-radius: 4px; }
.qh-ico--pour { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.qh-ico--brush { border-radius: 2px; width: 6px; height: 16px; transform: rotate(35deg); }
.qh-ico--sprinkle { background: radial-gradient(circle at 30% 30%, currentColor 25%, transparent 28%), radial-gradient(circle at 75% 60%, currentColor 20%, transparent 23%), radial-gradient(circle at 40% 80%, currentColor 15%, transparent 18%); }
.qh-ico--erase { border-radius: 3px; background: transparent; border: 2px solid currentColor; box-sizing: border-box; }
.qh-ico--walk { background: transparent; border: 2px solid currentColor; box-sizing: border-box; border-radius: 50%; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px currentColor; }
.qh-chip--mat .qh-swatch { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,0.12); }
.qh-mat-flat .qh-swatch { background: #8b8577; }
.qh-mat-water .qh-swatch { background: radial-gradient(circle at 35% 35%, #c6dced, #6f9fc0 70%); }
.qh-mat-crayon .qh-swatch { background: repeating-linear-gradient(45deg, #c97a5b 0 2px, #e3a98f 2px 4px); }
.qh-mat-glass .qh-swatch { background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(120,170,200,.5)); }
.qh-mat-gold .qh-swatch { background: linear-gradient(135deg, #f9e79f, #d4af37 45%, #8a6508 60%, #f5d778); }
.qh-mat-silver .qh-swatch { background: linear-gradient(135deg, #fff, #c9ced6 45%, #6e7580 60%, #e8ebf0); }
.qh-mat-copper .qh-swatch { background: linear-gradient(135deg, #f7c9a3, #b87333 45%, #6e3f12 60%, #e29a5c); }
.qh-mat-rose .qh-swatch { background: linear-gradient(135deg, #fce4e0, #e0a89e 45%, #9c5c55 60%, #f2c5be); }
.qh-mat-pearl .qh-swatch { background: linear-gradient(135deg, #fff, #f6e8f2 30%, #dcebf7 55%, #fbf3da 80%, #fff); }
.qh-mat-holo .qh-swatch { background: linear-gradient(135deg, #ff8fb1, #ffd36e, #9af0c7, #8fc9ff, #d29cff); }
.qh-chip.is-active .qh-swatch { box-shadow: 0 0 0 2px var(--linen); }
.qh-palettes { display: flex; flex-wrap: wrap; gap: 6px; }
.qh-pal { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; padding: 4px 9px 4px 5px; border-radius: 999px; border: 1px solid rgba(43,42,34,0.14); background: rgba(255,255,255,0.6); color: var(--ink-soft); cursor: pointer; }
.qh-pal span { width: 34px; height: 12px; border-radius: 6px; display: inline-block; }
.qh-pal.is-active { border-color: var(--ink); color: var(--ink); }
.qh-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.qh-colour { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 1px 4px rgba(0,0,0,0.18); cursor: pointer; padding: 0; transition: transform .15s; position: relative; }
.qh-colour:hover { transform: scale(1.1); }
.qh-colour.is-active { box-shadow: 0 0 0 2px var(--ink), 0 1px 4px rgba(0,0,0,0.18); }
.qh-colour--custom { display: grid; place-items: center; color: #fff; font-weight: 700; text-shadow: 0 0 3px rgba(0,0,0,.5); overflow: hidden; }
.qh-colour--custom input { position: absolute; inset: -10px; opacity: 0; cursor: pointer; }
.qh-row--opts { gap: 10px; }
.qh-opt { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink); }
.qh-opt--size input { flex: 1; accent-color: var(--forest); }
.qh-opt--toggle input { accent-color: var(--forest); width: 16px; height: 16px; }
.qh-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qh-action { font: inherit; font-size: 14px; padding: 9px 14px; border-radius: 12px; border: 1px solid rgba(43,42,34,0.18); background: rgba(255,255,255,0.7); color: var(--ink); cursor: pointer; transition: all .15s; }
.qh-action:hover { border-color: var(--clay); }
.qh-action--primary { background: var(--forest-deep); color: var(--linen); border-color: var(--forest-deep); }
.qh-action--primary:hover { background: var(--forest); }

@media (max-width: 860px) {
  .qh-painter { grid-template-columns: 1fr; }
  .qh-toolbar { grid-row: auto; }
  .qh-canvas { border-radius: 14px; }
  .qh-inner { padding: 18px 14px 60px; }
}

/* home mode card */
.mode-card--qh { background: linear-gradient(150deg, rgba(201,162,74,0.22) 0%, rgba(176,131,85,0.12) 50%, rgba(251,248,241,0.9) 100%); border-color: rgba(201,162,74,0.45); grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 18px; padding: 18px 22px; position: relative; }
.mode-card--qh .mode-eyebrow { position: absolute; top: 12px; right: 16px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--clay); font-weight: 600; }
.mode-card--qh .mode-icon { color: var(--forest); width: 44px; height: 44px; flex-shrink: 0; }
.mode-card--qh .mode-card-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-right: 150px; }
.mode-card--qh:hover { border-color: rgba(201,162,74,0.85); }
@media (max-width: 560px) { .mode-card--qh { flex-direction: column; align-items: flex-start; padding-top: 34px; } .mode-card--qh .mode-card-text { padding-right: 0; } }
