/* Hold Door · demo3 — ink night, cream type, amber lamp, danger only on 112 */
:root {
  --ink: #0E0C0A;
  --cream: #F6EFE4;
  --amber: #E0A35A;
  --alert: #B83228;
  --dim: #8A8074;
  --recess: #161310;
  --rule: #2A241C;
  --type: 20px;
  --lead: 24px;
  --loud: 28px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body,
.shell {
  overflow: hidden;
  height: 100dvh;
  max-height: 100dvh;
}

html,
body {
  background: var(--ink);
  color: var(--cream);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  font-size: var(--type);
  font-weight: 500;
  line-height: 1.25;
}

body {
  display: flex;
  justify-content: center;
}

button,
input,
a {
  font: inherit;
  font-weight: 500;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

.shell {
  width: min(375px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--ink);
}

.banner {
  flex: 0 0 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: var(--recess);
  color: var(--cream);
  border-bottom: 1px solid var(--rule);
}

.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 16px 0;
}

.leaf {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  gap: 8px;
}

.leaf.is-open {
  display: flex;
}

.leaf-title {
  font-size: var(--lead);
  font-weight: 500;
  margin-bottom: 4px;
}

.latch {
  position: relative;
  width: 168px;
  height: 168px;
  flex: 0 0 168px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.halo {
  position: absolute;
  inset: 0;
  width: 168px;
  height: 168px;
}

.halo-track {
  fill: none;
  stroke: var(--rule);
  stroke-width: 3;
}

.halo-meter {
  fill: none;
  stroke: var(--amber);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  transform: rotate(-90deg);
  transform-origin: 80px 80px;
}

.lamp {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  border-radius: 50%;
  background: var(--amber);
}

.wick {
  position: absolute;
  left: 50%;
  top: 28%;
  width: 18px;
  height: 28px;
  margin-left: -9px;
  border-radius: 50% 50% 45% 45%;
  background: var(--cream);
  opacity: 0.85;
  animation: ember 6s ease-in-out infinite;
}

@keyframes ember {
  0%,
  100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.say {
  font-size: var(--lead);
  font-weight: 500;
  text-align: center;
  max-width: 22ch;
}

.say-hi {
  font-size: var(--lead);
  font-weight: 500;
}

.cue {
  font-size: 16px;
  font-weight: 500;
  color: var(--dim);
  text-align: center;
}

.care,
.text-act {
  font-size: 16px;
  font-weight: 500;
  color: var(--dim);
  min-height: 40px;
  padding: 0 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.kin-list,
.kin-on-card {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kin {
  background: var(--recess);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 8px 10px;
}

.kin strong {
  display: block;
  font-size: var(--type);
  font-weight: 600;
}

.kin span {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: var(--cream);
}

.kin textarea {
  width: 100%;
  min-height: 36px;
  max-height: 48px;
  margin-top: 4px;
  background: var(--ink);
  color: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 4px 6px;
  font: inherit;
  font-size: 16px;
  resize: none;
}

.doors {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.door {
  width: 100%;
  min-height: 64px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--recess);
  border: 1px solid var(--rule);
  font-size: var(--type);
  font-weight: 500;
  text-align: center;
}

.door-112,
.alert-112 {
  background: var(--alert);
  border-color: var(--alert);
  color: var(--cream);
}

.quiet {
  width: 100%;
  background: var(--recess);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quiet-en,
.quiet-hi {
  font-size: var(--type);
  font-weight: 500;
}

.kin-on-card .kin {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  padding: 6px 0 0;
}

.helpbar {
  flex: 0 0 auto;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 6px 12px 0;
}

.helpbar.is-on {
  display: flex;
}

.alert-112 {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  border-radius: 12px;
  font-size: var(--type);
  font-weight: 600;
  text-decoration: none;
  background: var(--alert);
  color: var(--cream);
}

.leave {
  display: flex;
  gap: 8px;
}

.leave-btn {
  flex: 1;
  min-height: 56px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--recess);
  font-size: 16px;
  font-weight: 500;
}

.rail {
  flex: 0 0 64px;
  height: 64px;
  display: flex;
  border-top: 1px solid var(--rule);
}

.rail button {
  flex: 1;
  min-height: 64px;
  font-size: var(--type);
  font-weight: 500;
  color: var(--dim);
}

.rail button.is-on {
  color: var(--cream);
}

.note {
  flex: 0 0 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--dim);
}

.shell.is-inside .note {
  display: none;
}

.shell.is-inside .latch {
  width: 96px;
  height: 96px;
  flex-basis: 96px;
}

.shell.is-inside .halo {
  width: 96px;
  height: 96px;
}

.shell.is-inside .lamp {
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
}

.shell.is-inside #leaf-talk {
  display: none;
}

.shade {
  position: fixed;
  inset: 0;
  background: rgba(14, 12, 10, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.shade.is-on {
  display: flex;
}

.shade-card {
  width: min(320px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.pin {
  width: 100%;
  min-height: 64px;
  text-align: center;
  letter-spacing: 0.4em;
  background: var(--recess);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-size: var(--loud);
}

.hear-row {
  font-size: var(--type);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
  .wick {
    animation: none;
    opacity: 0.9;
  }

  .halo-meter {
    transition: none;
  }
}
