/* VKorni: tactile controls and quiet materials around the original artwork. */
:root {
  --apple-radius: 24px;
  --apple-glass: rgba(28, 23, 22, .88);
  --apple-stroke: rgba(226, 195, 140, .19);
  --apple-shadow: 0 12px 42px rgba(0, 0, 0, .16);
  --memory-bg: #100e0e;
  --memory-panel: #1b1717;
  --memory-text: #f3eee6;
  --memory-muted: #c0b4a5;
  --memory-line: #66523d;
  --memory-gold: #e5c99b;
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
html[data-theme=day] {
  --apple-glass: rgba(255, 252, 247, .9);
  --apple-stroke: rgba(110, 78, 41, .18);
  --apple-shadow: 0 12px 38px rgba(79, 50, 25, .07);
  --memory-bg: #f5f1eb;
  --memory-panel: #fffcf7;
  --memory-text: #302820;
  --memory-muted: #6f6053;
  --memory-line: #d5c5b1;
  --memory-gold: #785222;
  color-scheme: light;
}
html { background: var(--memory-bg); }
body {
  background: var(--memory-bg);
  color: var(--memory-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .25s, color .25s;
}
h1, h2, h3, .caption {
  font-family: Georgia, 'Times New Roman', serif;
  font-optical-sizing: auto;
  letter-spacing: -.025em;
  text-wrap: balance;
}
p { text-wrap: pretty; }
button, input, textarea, select { font-family: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:not(.hotspot):not(.slot):not(.case), .quiet-navigation a, .house-nav a, .hall-tools a {
  min-height: 44px;
  transition: background-color .18s, border-color .18s, color .18s, box-shadow .18s;
}
button:not(.hotspot):not(.slot):not(.case):active, .gift-menu-item:active {
  filter: brightness(.94);
  box-shadow: inset 0 0 0 1px var(--apple-stroke);
}
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--memory-gold);
  outline-offset: 4px;
}
.site-header.compact-header, .memory-bar.hall-topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 20px;
  border: 0;
}
.compact-header h1 { font-size: clamp(25px, 3vw, 38px); line-height: 1.15; margin: 7px 0; }
.compact-header p { font: 14px/1.5 system-ui, sans-serif; color: var(--memory-muted); }
.eyebrow, .memory-brand { color: var(--memory-gold); font-family: system-ui, sans-serif; letter-spacing: .12em; }
.compact-theme { background: var(--apple-glass); border-color: var(--apple-stroke); width: 48px; height: 48px; }
/* The image, portrait and gift coordinates deliberately retain their original geometry. */
.scene-dock {
  width: min(1020px, calc(100% - 40px));
  max-width: calc(100% - 40px);
  margin: 18px auto 10px;
  padding: 10px 14px;
  background: var(--apple-glass);
  border: 1px solid var(--apple-stroke);
  border-radius: 28px;
  box-shadow: var(--apple-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
  backdrop-filter: blur(22px) saturate(125%);
}
.visual-gifts { gap: 8px; padding: 4px 0 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.visual-gifts::-webkit-scrollbar { display: none; }
.visual-gifts .gift-menu-item {
  flex: 0 0 100px;
  min-height: 112px;
  border-radius: 20px;
  padding: 9px 7px;
  gap: 8px;
  font: 500 13px/1.35 system-ui, sans-serif;
  scroll-snap-align: center;
}
.gift-menu-item img { width: 68px; height: 70px; }
.visual-gifts .gift-menu-item:hover { background: rgba(157, 119, 67, .1); }
.visual-gifts .bell-launch { border-color: var(--apple-stroke); background: rgba(157, 119, 67, .1); }
.dock-status { padding: 5px 8px; gap: 12px; font-size: 13px; }
.dock-status .timer { font-variant-numeric: tabular-nums; font-size: 13px; }
.quiet-navigation, .house-nav {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 22px;
  padding: 7px 0;
  gap: 4px;
  border: 0;
}
.quiet-navigation a, .quiet-navigation button, .house-nav a {
  padding: 11px 15px;
  border: 0;
  border-radius: 999px;
  font: 500 14px/1.45 system-ui, sans-serif;
  color: var(--memory-muted);
  background: transparent;
}
.house-nav a[aria-current=page] { background: var(--memory-panel); color: var(--memory-gold); box-shadow: inset 0 0 0 1px var(--apple-stroke); }
.quiet-navigation a:hover, .quiet-navigation button:hover, .house-nav a:hover { background: var(--memory-panel); color: var(--memory-text); }
.hall-tools { gap: 8px; margin: 0 auto 28px; padding: 0 16px; }
.hall-tools button, .hall-tools a { border-radius: 999px; background: var(--memory-panel); border-color: var(--apple-stroke); font-size: 13px; }
.memory-section { margin: 32px auto; padding: clamp(24px, 4vw, 50px); border-radius: 28px; border-color: var(--apple-stroke); box-shadow: 0 2px 8px #00000003; }
.memory-section h2, .memory-workspace h2 { font-size: clamp(28px, 3.1vw, 42px); line-height: 1.18; }
.memory-section p, .about p { line-height: 1.8; }
.memory-card { margin: 0; padding: 24px; border-color: var(--apple-stroke); border-radius: 22px; }
.memory-card h3 { font-size: 25px; }
.memory-card a { display: inline-block; padding: 10px 0; border: 0; background: none; font-size: 14px; text-underline-offset: 5px; }
.memory-section input, .memory-section textarea, .composer input, .composer textarea,
dialog input:not([type=checkbox]):not([type=range]), dialog textarea, dialog select {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--memory-bg);
  color: var(--memory-text);
  border-color: var(--apple-stroke);
  font-size: 16px;
  line-height: 1.6;
}
.memory-section input[type=checkbox] { width: 20px; height: 20px; flex: 0 0 20px; accent-color: #99744a; }
.memory-section input[type=file], .composer input[type=file] { max-width: 100%; white-space: normal; }
.memory-section button, .composer button, .dialog-actions button { border-radius: 14px; }
.memory-workspace { gap: 28px; margin-bottom: 64px; }
.memory-sidebar, .composer, .memory-feed .comment { border-color: var(--apple-stroke); border-radius: 24px; }
.memory-feed .comment { margin: 18px 0; box-shadow: 0 2px 12px #00000004; }
.memory-sidebar { padding: 24px; }
.memory-sidebar .stat { border: 0; border-radius: 16px; }
.stat strong { font-variant-numeric: tabular-nums; }
.composer { padding: 24px; }
.composer .message-label textarea { min-height: 104px; font-size: 16px; }
.quick-words { gap: 8px; }
.composer .quick-words button { min-height: 44px; padding: 10px 14px; border-radius: 999px; font-size: 13px; }
.composer summary, .memory-sidebar summary, .share-qr summary { padding-block: 10px; min-height: 44px; }
.composer .composer-bottom { gap: 16px; align-items: center; }
.composer .composer-bottom button { min-height: 48px; }
.feed-sort { border-radius: 999px; padding: 4px; background: var(--memory-panel); border: 1px solid var(--apple-stroke); }
.feed-sort button { border: 0; border-radius: 999px; font-size: 13px; }
.feed-sort button[aria-pressed=true] { background: var(--memory-bg); box-shadow: 0 1px 5px #0001; }
dialog, #atelierControls, .memory-share-dialog {
  width: min(720px, calc(100% - 40px));
  max-height: min(88dvh, 940px);
  padding: 30px;
  border: 1px solid var(--apple-stroke);
  border-radius: 30px;
  background: var(--apple-glass);
  color: var(--memory-text);
  box-shadow: 0 24px 100px #0005;
  -webkit-backdrop-filter: blur(28px) saturate(130%);
  backdrop-filter: blur(28px) saturate(130%);
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  transform-origin: center bottom;
}
dialog::backdrop { background: #08050488; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog h2 { padding-right: 34px; font-size: clamp(25px, 3vw, 34px); line-height: 1.2; color: var(--memory-gold); }
dialog .close, dialog .share-close { width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 50%; color: var(--memory-muted); background: transparent; border: 0; }
dialog p { line-height: 1.7; }
#catalog { gap: 12px; }
#catalog button { border-radius: 20px; border-color: var(--apple-stroke); background: var(--memory-bg); color: var(--memory-text); font: 500 14px/1.45 system-ui, sans-serif; }
#catalog button[aria-pressed=true] { border-color: var(--memory-gold); background: var(--memory-bg); box-shadow: inset 0 0 0 1px var(--memory-gold); }
#placeGift { min-height: 52px; border-radius: 16px; }
.apple-sheet-grip { display: none; }
html.apple-dialog-open { overflow: hidden; scrollbar-gutter: stable; }
.memory-share-trigger { min-height: 44px; }
.fund { background: var(--memory-panel); border-color: var(--apple-stroke); border-radius: 26px; padding: 30px; }
.reconstruction .intro, .fund-left, .fund-total span, .support-note { color: var(--memory-muted); }
.fund-percent, .fund-total { font-variant-numeric: tabular-nums; }
.about { color: var(--memory-text); }
.about h2 { color: var(--memory-gold); }
@media (hover: hover) {
  #catalog button:hover { border-color: var(--memory-gold); }
  .memory-card:hover { border-color: var(--memory-line); }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .site-header.compact-header, .memory-bar.hall-topbar { width: calc(100% - 32px); padding: 16px 0; }
  .compact-header h1 { font-size: 25px; }
  .compact-header p { font-size: 12px; }
  .scene-dock { width: calc(100% - 24px); max-width: calc(100% - 24px); margin-top: 12px; padding: 8px; border-radius: 24px; }
  .visual-gifts, .hall-scene-dock .visual-gifts { justify-content: flex-start; gap: 4px; }
  .visual-gifts .gift-menu-item, .hall-scene-dock .gift-menu-item { flex: 0 0 78px; min-height: 100px; padding: 8px 5px; font-size: 12px; }
  .gift-menu-item img { width: 56px; height: 60px; }
  .quiet-navigation { gap: 2px; margin-bottom: 16px; }
  .quiet-navigation a, .quiet-navigation button, .house-nav a { font-size: 13px; padding: 11px 12px; min-height: 44px; }
  .memory-section { width: calc(100% - 24px); margin: 20px auto; padding: 24px 20px; border-radius: 24px; }
  .memory-grid { gap: 14px; }
  .memory-workspace { width: calc(100% - 24px); gap: 20px; }
  .memory-sidebar { padding: 20px; }
  .composer { padding: 20px; }
  .composer .composer-bottom { flex-wrap: wrap; }
  .composer .composer-bottom .memory-status { font-size: 12px; }
  .composer .composer-bottom button { flex: 1 0 100%; font-size: 15px; }
  .feed-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .feed-sort { display: inline-flex; max-width: 100%; }
  .feed-sort button { padding: 10px 12px; }
  dialog, #atelierControls, .memory-share-dialog {
    position: fixed;
    inset: auto 0 0;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    padding: 26px 22px calc(24px + env(safe-area-inset-bottom));
    border-radius: 30px 30px 0 0;
    border-bottom: 0;
  }
  .apple-sheet-grip { display: block; width: 72px; height: 22px; margin: -17px auto 8px; touch-action: none; cursor: grab; user-select: none; }
  .apple-sheet-grip::before { content: ''; display: block; width: 36px; height: 5px; margin: 8px auto; border-radius: 99px; background: var(--memory-muted); opacity: .5; }
  dialog .close, dialog .share-close { top: 15px; right: 12px; }
  #atelierControls .control-row { grid-template-columns: 1fr; }
  #catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #catalog button { min-height: 160px; }
  .hall-heading { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  body, button, a, dialog { transition: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --apple-glass: #1b1717; }
  html[data-theme=day] { --apple-glass: #fffcf7; }
  dialog, .scene-dock { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --apple-stroke: var(--memory-gold); --apple-glass: var(--memory-panel); }
  dialog, .scene-dock { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
