:root {
  color-scheme: dark;
  --bg: #070A0F;
  --bg-deep: #05070B;
  --stone: #0D121A;
  --stone-strong: #101720;
  --stone-soft: rgba(13, 18, 26, 0.72);
  --line: rgba(120, 140, 170, 0.18);
  --line-strong: rgba(180, 190, 210, 0.24);
  --line-warm: rgba(158, 146, 120, 0.16);
  --text-main: #DDE2EA;
  --text-soft: #C7CFDD;
  --text-muted: #7E8796;
  --text-faint: rgba(126, 135, 150, 0.62);
  --accent: #A9B5C7;
  --accent-warm: #A99A7B;
  --shadow-stone: 0 20px 54px rgba(0, 0, 0, 0.28), 0 7px 24px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.014);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ui-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --quote-serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --page-x: clamp(18px, 5.2vw, 30px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  color: var(--text-main);
  background:
    radial-gradient(76% 52% at 50% -12%, rgba(102, 116, 138, 0.105) 0%, rgba(93, 106, 128, 0.032) 40%, transparent 70%),
    radial-gradient(86% 70% at 14% 96%, rgba(113, 103, 84, 0.060) 0%, transparent 60%),
    linear-gradient(180deg, #080C12 0%, var(--bg) 48%, #05080D 100%);
  font-family: var(--ui-sans);
  font-weight: 300;
  letter-spacing: 0;
  padding: max(22px, env(safe-area-inset-top)) var(--page-x) max(24px, env(safe-area-inset-bottom));
}

body.is-night {
  --text-main: #C9D0DA;
  --text-soft: #AEB7C6;
  --text-muted: #6F7887;
  --stone: #090E15;
  background:
    radial-gradient(70% 48% at 50% -12%, rgba(74, 87, 108, 0.11) 0%, rgba(74, 87, 108, 0.035) 36%, transparent 68%),
    radial-gradient(90% 72% at 12% 94%, rgba(95, 85, 68, 0.08) 0%, transparent 58%),
    linear-gradient(180deg, #05080D 0%, #05070B 50%, #03050A 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255,255,255,0.0055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.0045) 1px, transparent 1px);
  background-size: 116px 116px;
  mask-image: radial-gradient(circle at 50% 36%, rgba(0,0,0,0.36), transparent 78%);
  animation: groundBreath 18s ease-in-out infinite;
}

body::after {
  opacity: 0.24;
  background-image:
    radial-gradient(circle at 16% 22%, rgba(255,255,255,0.036) 0 0.6px, transparent 1.3px),
    radial-gradient(circle at 42% 68%, rgba(255,255,255,0.030) 0 0.75px, transparent 1.5px),
    radial-gradient(circle at 78% 38%, rgba(255,255,255,0.026) 0 0.65px, transparent 1.45px),
    radial-gradient(circle at 62% 82%, rgba(169,154,123,0.022) 0 0.75px, transparent 1.55px);
  background-size: 191px 191px, 251px 251px, 329px 329px, 397px 397px;
  background-position: 0 0, 34px 20px, -28px 44px, 20px -30px;
  mix-blend-mode: screen;
  animation: airDrift 19s ease-in-out 900ms infinite;
}

body.is-night::before {
  opacity: 0.52;
}

body.is-night::after {
  opacity: 0.32;
  background-size: 163px 163px, 217px 217px, 291px 291px, 353px 353px;
}

body.modal-open {
  overflow: hidden;
}

body.note-layer-open {
  overflow: hidden;
}

body.memory-layer-open {
  overflow: hidden;
}

body.intro-open {
  overflow: hidden;
}

body.note-layer-open .brand,
body.note-layer-open .time-whisper,
body.note-layer-open .visit-whisper,
body.note-layer-open .practice-card,
body.note-layer-open .actions {
  opacity: 0.82;
  filter: none;
  transition: opacity 620ms var(--ease), filter 620ms var(--ease);
}

body.note-layer-open .quote-shell {
  opacity: 0.72;
  filter: none;
  transition: opacity 620ms var(--ease), filter 620ms var(--ease);
}

body.memory-layer-open .brand,
body.memory-layer-open .time-whisper,
body.memory-layer-open .visit-whisper,
body.memory-layer-open .touch-card,
body.memory-layer-open .practice-card,
body.memory-layer-open .actions {
  opacity: 0.42;
  transition: opacity 620ms var(--ease), filter 620ms var(--ease);
}

body.memory-layer-open .quote-shell {
  opacity: 0.48;
  filter: blur(1.8px) saturate(86%);
  transition: opacity 620ms var(--ease), filter 620ms var(--ease);
}

body.reading-layer-open .brand,
body.reading-layer-open .time-whisper,
body.reading-layer-open .visit-whisper,
body.reading-layer-open .touch-card,
body.reading-layer-open .actions,
body.reading-layer-open .site-record {
  opacity: 0.24;
  filter: blur(1.1px) saturate(80%);
  transition: opacity 840ms var(--ease), filter 840ms var(--ease);
}

body.reading-layer-open .quote-shell {
  opacity: 0.32;
  filter: blur(2.6px) saturate(76%);
  transition: opacity 840ms var(--ease), filter 840ms var(--ease);
}

html.intro-pending .time-whisper,
html.intro-pending .visit-whisper,
html.intro-pending .touch-card,
html.intro-pending .quote-shell,
html.intro-pending .actions,
html.intro-pending .site-record,
body.intro-open .time-whisper,
body.intro-open .visit-whisper,
body.intro-open .touch-card,
body.intro-open .quote-shell,
body.intro-open .actions,
body.intro-open .site-record {
  opacity: 0;
  pointer-events: none;
}

html.intro-pending .brand,
body.intro-open .brand {
  opacity: 0.58;
  transition: opacity 900ms var(--ease), filter 900ms var(--ease);
}

html.intro-pending .quote-shell,
body.intro-open .quote-shell {
  filter: blur(2px) saturate(82%);
  transform: translateY(10px);
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: min(100%, 540px);
  min-height: calc(100dvh - max(22px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(24px, 5vh, 46px);
  padding: clamp(24px, 5vh, 42px) 0 clamp(116px, 17vh, 176px);
  animation: none;
}

.brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  user-select: none;
  opacity: 0.82;
  animation: quietEnter 680ms var(--ease) 160ms both;
}

.brand-mark-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(56px, 14vw, 76px);
  aspect-ratio: 1;
  pointer-events: none;
}

.brand-mark-wrap::before {
  content: "";
  position: absolute;
  width: 108%;
  height: 108%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.030), rgba(190, 205, 230, 0.012) 38%, transparent 72%);
  opacity: 0.82;
  filter: blur(18px);
}

.brand-mark {
  position: relative;
  width: clamp(45px, 12vw, 64px);
  height: auto;
  opacity: 0.76;
  filter:
    invert(91%)
    sepia(10%)
    saturate(160%)
    hue-rotate(182deg)
    brightness(88%)
    contrast(84%)
    blur(0.28px);
  mix-blend-mode: screen;
  animation: logoBreath 16s ease-in-out 1400ms infinite;
}

.brand-copy {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.brand-name {
  color: rgba(221, 226, 234, 0.78);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.24em;
  font-weight: 400;
}

.brand-ritual {
  color: rgba(169, 181, 199, 0.64);
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.14em;
  font-weight: 300;
}

.time-whisper,
.visit-whisper {
  min-height: 18px;
  max-width: min(82vw, 340px);
  margin: 10px auto 0;
  color: rgba(180, 190, 205, 0.45);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  font-weight: 300;
  text-align: center;
  text-wrap: pretty;
  user-select: none;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 860ms var(--ease), transform 860ms var(--ease), color 860ms var(--ease), margin 860ms var(--ease), max-height 860ms var(--ease);
}

.visit-whisper {
  margin-top: 1px;
  color: rgba(180, 190, 205, 0.34);
}

.time-whisper:empty,
.visit-whisper:empty {
  display: none;
}

.quote-shell {
  position: relative;
  overflow: visible;
  width: 100%;
  min-height: clamp(300px, 44dvh, 410px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(18px, 4vh, 30px) 0 clamp(72px, 10dvh, 112px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: opacity 920ms var(--ease), filter 920ms var(--ease), transform 920ms var(--ease);
  animation: quietEnter 860ms var(--ease) 360ms both;
}

.quote-shell::before,
.quote-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.quote-shell::before {
  display: none;
}

.quote-shell::after {
  display: none;
}

.quote-label {
  position: relative;
  z-index: 1;
  justify-self: start;
  display: none;
  align-items: center;
  gap: 10px;
  color: rgba(126, 135, 150, 0.56);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.18em;
  font-weight: 300;
  text-transform: uppercase;
  transition: opacity 680ms var(--ease), transform 680ms var(--ease), filter 680ms var(--ease);
}

.quote-label::before,
.quote-label::after {
  content: "";
  display: block;
  width: 20px;
  height: 1px;
  background: rgba(126, 135, 150, 0.18);
}

.quote-label::after {
  display: none;
}

.quote-stack {
  /* The stack owns alignment so quote, original text, and source move as one centered unit. */
  position: relative;
  z-index: 1;
  width: min(100%, 29ch);
  max-width: 360px;
  min-width: 0;
  display: grid;
  justify-items: stretch;
  margin: 0 auto;
  padding: 0;
  text-align: left;
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition: opacity 1120ms var(--ease), transform 1120ms var(--ease), filter 1120ms var(--ease);
  will-change: opacity, transform, filter;
}

.quote-text {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  padding: 0;
  color: rgba(222, 228, 238, 0.84);
  text-align: inherit;
  font-family: var(--quote-serif);
  font-size: 22px;
  font-weight: 300;
  line-height: 1.88;
  letter-spacing: 0;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  line-break: loose;
  text-wrap: wrap;
}

.quote-shell.short-quote .quote-stack {
  width: min(80%, 420px);
  max-width: 80%;
  justify-items: center;
  text-align: center;
}

.quote-shell.short-quote .quote-text {
  font-size: 24px;
  line-height: 1.72;
}

.quote-shell.long-quote .quote-stack {
  width: min(100%, 29ch);
  max-width: 360px;
  text-align: left;
}

.quote-shell.long-quote .quote-text {
  font-size: 21px;
  line-height: 1.92;
}

.quote-shell.classic-quote .quote-stack {
  width: min(100%, 30ch);
  max-width: 370px;
  text-align: left;
}

.quote-shell.classic-quote.is-compact-quote .quote-stack {
  width: min(80%, 420px);
  max-width: 80%;
  justify-items: center;
  text-align: center;
}

.quote-shell.classic-quote .quote-text {
  font-size: 22px;
  line-height: 1.96;
  white-space: pre-line;
}

.quote-shell.classic-quote.is-readable-quote .quote-text {
  font-size: 21px;
}

.quote-original {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin-top: clamp(22px, 3.6vh, 32px);
  color: rgba(170, 180, 195, 0.58);
  font-family: var(--quote-serif);
  font-size: 14px;
  font-style: italic;
  line-height: 1.85;
  letter-spacing: 0;
  font-weight: 300;
  text-align: inherit;
  white-space: pre-line;
  transition: opacity 680ms var(--ease), transform 680ms var(--ease), filter 680ms var(--ease);
}

.quote-original.is-hidden {
  display: none;
}

.quote-source {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  min-width: 0;
  color: rgba(170, 180, 195, 0.40);
  font-size: 12px;
  line-height: 1.72;
  letter-spacing: 0.12em;
  font-weight: 300;
  margin-top: 18px;
  text-align: inherit;
  transition: opacity 680ms var(--ease), transform 680ms var(--ease), filter 680ms var(--ease);
}

.quote-shell.is-fading .quote-stack {
  opacity: 0.045;
  transform: translateY(7px);
  filter: blur(7px);
  transition-duration: 360ms;
}

.quote-shell.is-awaiting .quote-stack {
  opacity: 0;
  transform: translateY(6px);
  filter: blur(10px);
}

.touch-card {
  display: none !important;
  width: min(92%, 386px);
  margin: -2px auto 0;
  text-align: center;
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
  animation: quietEnter 660ms var(--ease) 380ms both;
}

.touch-card.is-hidden {
  display: none;
}

.touch-text {
  color: rgba(180, 190, 205, 0.68);
  font-size: 13px;
  line-height: 1.92;
  letter-spacing: 0.055em;
  font-weight: 300;
}

.touch-text::before {
  content: "";
  display: block;
  width: 24px;
  height: 1px;
  margin: 0 auto 12px;
  background: rgba(169, 154, 123, 0.24);
}

.actions {
  position: fixed;
  left: 50%;
  bottom: calc(max(34px, env(safe-area-inset-bottom)) + 4px);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  width: calc(100% - 36px);
  max-width: 300px;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%);
  animation: none;
  transition: opacity 720ms var(--ease), visibility 720ms var(--ease);
}

.actions.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.site-record {
  position: fixed;
  left: 50%;
  bottom: max(9px, env(safe-area-inset-bottom));
  z-index: 30;
  width: calc(100% - 32px);
  max-width: 520px;
  padding: 0;
  text-align: center;
  opacity: 0.24;
  pointer-events: auto;
  transform: translateX(-50%);
  transition: opacity 620ms var(--ease), filter 620ms var(--ease);
}

.site-record-link {
  color: rgba(126, 135, 150, 0.72);
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  font-weight: 300;
  text-decoration: none;
}

.site-record-link:hover {
  color: rgba(170, 180, 195, 0.82);
}


html.entry-pending .time-whisper,
html.entry-pending .visit-whisper {
  max-height: 0;
  min-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(5px);
}

html.entry-pending.greeting-visible .time-whisper {
  max-height: 96px;
  min-height: 18px;
  margin-top: 10px;
  opacity: 1;
  transform: translateY(0);
}

html.entry-pending.greeting-settled .time-whisper,
html.greeting-settled .time-whisper {
  opacity: 0.38;
}

html.entry-pending .visit-whisper,
html.greeting-settled .visit-whisper {
  display: none;
}

html.entry-pending .quote-shell {
  opacity: 0;
  pointer-events: none;
  filter: blur(10px) saturate(86%);
  transform: translateY(12px);
  animation: none;
}

html.entry-pending.quote-ready .quote-shell {
  opacity: 1;
  pointer-events: auto;
  filter: blur(0) saturate(100%);
  transform: translateY(0);
  transition: opacity 1280ms var(--ease), filter 1280ms var(--ease), transform 1280ms var(--ease);
}

html.entry-pending .actions.is-visible {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

html.entry-pending.actions-ready .actions.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}


html.entry-complete .quote-shell {
  animation: none;
}

.secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 4vw, 18px);
  width: min(76%, 320px);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 46px;
  overflow: hidden;
  padding: 0 13px;
  border: 1px solid rgba(180, 190, 210, 0.030);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0.006) 42%, rgba(0,0,0,0.030)),
    rgba(255, 255, 255, 0.006);
  color: rgba(183, 193, 208, 0.62);
  font-family: var(--ui-sans);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.075em;
  font-weight: 300;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.014), inset 0 -1px 0 rgba(0,0,0,0.12);
  transition:
    transform 560ms var(--ease),
    border-color 560ms var(--ease),
    background-color 560ms var(--ease),
    color 560ms var(--ease),
    box-shadow 560ms var(--ease),
    opacity 560ms var(--ease);
  backdrop-filter: blur(14px) saturate(108%);
  -webkit-backdrop-filter: blur(14px) saturate(108%);
}

.btn::before {
  content: "";
  position: absolute;
  inset: 1px 12px auto;
  height: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.085), transparent);
  opacity: 0.42;
  pointer-events: none;
}

.btn:hover {
  color: rgba(221, 226, 234, 0.72);
  border-color: rgba(180, 190, 210, 0.052);
  background-color: rgba(255, 255, 255, 0.010);
  transform: translateY(-0.5px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.018), inset 0 -1px 0 rgba(0,0,0,0.13);
}

.btn:active {
  transform: translateY(1.5px) scale(0.996);
  transition-duration: 180ms;
}

.btn:focus-visible,
.modal-close:focus-visible,
.note-input:focus-visible {
  outline: 1px solid rgba(199, 207, 221, 0.58);
  outline-offset: 3px;
}

.btn-reading-entry {
  width: 100%;
  min-height: 44px;
  color: rgba(221, 226, 234, 0.66);
  border-color: rgba(180, 190, 210, 0.038);
  background: rgba(255, 255, 255, 0.006);
  box-shadow: none;
}

.btn-reading-entry:hover {
  color: rgba(232, 236, 242, 0.88);
  border-color: rgba(180, 190, 210, 0.088);
  background-color: rgba(255, 255, 255, 0.018);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.010), inset 0 1px 0 rgba(255,255,255,0.024), inset 0 -1px 0 rgba(0,0,0,0.15);
}

.btn-reading-entry.is-pressing {
  transform: translateY(2px) scale(0.994);
  color: rgba(221, 226, 234, 0.78);
  background-color: rgba(255, 255, 255, 0.010);
}

.secondary-actions .btn {
  min-height: 44px;
  color: rgba(190, 200, 220, 0.46);
  border-color: rgba(180, 190, 210, 0.030);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.012), rgba(255,255,255,0.004) 52%, rgba(0,0,0,0.022)),
    rgba(255, 255, 255, 0.004);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.010);
}

.secondary-actions .btn:hover {
  color: rgba(210, 218, 232, 0.60);
  border-color: rgba(180, 190, 210, 0.048);
  background-color: rgba(255, 255, 255, 0.008);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.014);
}

.actions .btn,
.actions .secondary-actions .btn {
  width: 100%;
  min-height: 44px;
  padding: 0 6px;
  border-color: rgba(180, 190, 210, 0.036);
  background: rgba(255, 255, 255, 0.006);
  color: rgba(190, 200, 220, 0.54);
  box-shadow: none;
  backdrop-filter: blur(12px) saturate(108%);
  -webkit-backdrop-filter: blur(12px) saturate(108%);
}

.actions .btn:hover {
  color: rgba(221, 226, 234, 0.68);
  border-color: rgba(180, 190, 210, 0.060);
  background: rgba(255, 255, 255, 0.010);
  box-shadow: none;
}

body.modal-open .actions,
body.modal-open .site-record,
body.note-layer-open .actions,
body.note-layer-open .site-record,
body.memory-layer-open .actions,
body.memory-layer-open .site-record,
body.reading-layer-open .actions,
body.reading-layer-open .site-record {
  opacity: 0;
  pointer-events: none;
}

.btn-subtle {
  min-height: 44px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: rgba(160, 170, 186, 0.76);
}

.btn-subtle:hover {
  border-color: transparent;
  background: transparent;
  color: rgba(221, 226, 234, 0.86);
  box-shadow: none;
}

.records-card {
  width: 100%;
  border: 1px solid rgba(120, 140, 170, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.024), transparent 52%),
    rgba(9, 13, 19, 0.62);
}

.intro-layer {
  position: fixed;
  inset: 0;
  z-index: 78;
  min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) var(--page-x) max(34px, env(safe-area-inset-bottom));
  background: rgba(2, 5, 9, 0.48);
  backdrop-filter: blur(6px) saturate(108%);
  -webkit-backdrop-filter: blur(6px) saturate(108%);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 880ms var(--ease), visibility 880ms var(--ease), backdrop-filter 880ms var(--ease), -webkit-backdrop-filter 880ms var(--ease);
}

.intro-layer.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-card {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(86vw, 420px);
  max-height: calc(100dvh - max(56px, env(safe-area-inset-top)) - max(64px, env(safe-area-inset-bottom)));
  overflow: hidden auto;
  display: grid;
  gap: 30px;
  padding: 34px 30px;
  border: 1px solid rgba(190, 200, 220, 0.10);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(14, 18, 26, 0.86), rgba(7, 10, 15, 0.78));
  color: rgba(226, 232, 240, 0.84);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
  transform: translate(-50%, -52%) scale(1);
  transition: opacity 860ms var(--ease), transform 860ms var(--ease), filter 860ms var(--ease);
  animation: introFloatIn 1080ms var(--ease) both;
}

.intro-layer.is-hidden .intro-card {
  opacity: 0;
  transform: translate(-50%, -54%) scale(0.985);
  filter: blur(6px);
}

.intro-card::before,
.intro-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.intro-card::before {
  background:
    radial-gradient(circle at 58% 18%, rgba(255, 255, 255, 0.035), transparent 34%),
    radial-gradient(circle at 92% 66%, rgba(0, 0, 0, 0.24), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 28%);
  opacity: 0.82;
}

.intro-card::after {
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.042), transparent) top / 74% 1px no-repeat,
    radial-gradient(circle at 28% 34%, rgba(255, 255, 255, 0.012) 0 1px, transparent 1.4px);
  background-size: 74% 1px, 17px 17px;
  opacity: 0.44;
  mix-blend-mode: screen;
}

.intro-card::-webkit-scrollbar {
  width: 4px;
}

.intro-card::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(126, 135, 150, 0.24);
}

.intro-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 15px;
  color: rgba(226, 232, 240, 0.84);
  font-family: var(--quote-serif);
  font-size: 18px;
  line-height: 2;
  letter-spacing: 0;
  font-weight: 300;
  text-align: left;
}

.intro-copy p {
  margin: 0;
}

.intro-sign {
  margin-top: 18px;
  color: rgba(180, 190, 205, 0.38);
  font-family: var(--ui-sans);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.12em;
}

.intro-start {
  position: relative;
  z-index: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 48px;
  min-height: 48px;
  padding: 0 28px;
  border: 1px solid rgba(190, 200, 220, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(220, 226, 235, 0.66);
  font-family: var(--ui-sans);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.12em;
  font-weight: 300;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: color 520ms var(--ease), background-color 520ms var(--ease), border-color 520ms var(--ease), transform 520ms var(--ease);
}

.intro-start:hover {
  color: rgba(230, 235, 242, 0.78);
  border-color: rgba(180, 190, 210, 0.12);
  background: rgba(255, 255, 255, 0.045);
}

.intro-start:active {
  transform: translateY(1px);
}

.intro-start:focus-visible {
  outline: 1px solid rgba(199, 207, 221, 0.48);
  outline-offset: 3px;
}

.note-layer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  min-height: 100dvh;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transition: opacity 620ms var(--ease), visibility 620ms var(--ease);
}

.note-layer-backdrop.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.memory-prompt-backdrop {
  position: fixed;
  inset: 0;
  z-index: 82;
  min-height: 100dvh;
  background: rgba(3, 6, 10, 0.50);
  backdrop-filter: blur(3.5px);
  -webkit-backdrop-filter: blur(3.5px);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 620ms var(--ease), visibility 620ms var(--ease);
}

.memory-prompt-backdrop.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.note-card {
  position: fixed;
  top: auto;
  bottom: calc(max(82px, env(safe-area-inset-bottom)) + var(--note-y-offset, 0px));
  left: 50%;
  z-index: 90;
  width: calc(100% - 36px);
  max-width: 300px;
  max-height: min(56dvh, 420px);
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 18px 2px 10px;
  border: 0;
  border-top: 1px solid rgba(180, 190, 210, 0.052);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(5, 8, 13, 0.08), rgba(5, 8, 13, 0.50) 36%, rgba(5, 8, 13, 0.72));
  box-shadow: none;
  backdrop-filter: blur(12px) saturate(104%);
  -webkit-backdrop-filter: blur(12px) saturate(104%);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%);
  transition:
    opacity 620ms var(--ease),
    transform 620ms var(--ease),
    visibility 620ms var(--ease);
}

.note-card.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 10px);
}

.note-card::-webkit-scrollbar {
  width: 4px;
}

.note-card::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(126, 135, 150, 0.28);
}

.memory-prompt-card {
  position: fixed;
  top: 50dvh;
  left: 50%;
  z-index: 92;
  width: min(86vw, 382px);
  display: grid;
  gap: 20px;
  padding: 26px 24px 20px;
  border: 1px solid rgba(180, 190, 210, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(90% 90% at 50% 0%, rgba(180, 190, 210, 0.055), transparent 66%),
    rgba(8, 12, 18, 0.82);
  color: rgba(221, 226, 234, 0.88);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.032);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition:
    opacity 640ms var(--ease),
    transform 640ms var(--ease),
    visibility 640ms var(--ease);
}

.memory-prompt-card.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 14px));
}

.memory-prompt-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(126, 135, 150, 0.66);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.14em;
  font-weight: 300;
}

.memory-prompt-label::before {
  content: "";
  width: 20px;
  height: 1px;
  background: rgba(169, 154, 123, 0.30);
}

.memory-prompt-copy {
  display: grid;
  gap: 10px;
}

.memory-prompt-title {
  color: rgba(221, 226, 234, 0.90);
  font-family: var(--quote-serif);
  font-size: 18px;
  line-height: 1.72;
  letter-spacing: 0.04em;
  font-weight: 300;
}

.memory-prompt-text {
  color: rgba(190, 200, 220, 0.55);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.045em;
  font-weight: 300;
}

.memory-prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.memory-prompt-actions .btn {
  min-height: 44px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.memory-prompt-secondary {
  color: rgba(150, 160, 176, 0.70);
}

.memory-prompt-primary {
  color: rgba(221, 226, 234, 0.84);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.018);
  box-shadow: inset 0 0 0 1px rgba(180, 190, 210, 0.07), 0 10px 30px rgba(0, 0, 0, 0.10);
}

.memory-prompt-actions .btn:hover {
  color: rgba(221, 226, 234, 0.86);
  background: rgba(255, 255, 255, 0.018);
  box-shadow: none;
}

.records-card {
  width: 100%;
  border: 1px solid rgba(120, 140, 170, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.024), transparent 52%),
    rgba(9, 13, 19, 0.62);
}

.note-head,
.records-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.note-title {
  color: rgba(221, 226, 234, 0.78);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.05em;
  font-weight: 300;
}

.records-title {
  color: rgba(221, 226, 234, 0.92);
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  font-weight: 300;
}

.note-meta {
  margin-top: 0;
  color: rgba(126, 135, 150, 0.42);
  font-size: 12px;
  line-height: 1.82;
  letter-spacing: 0.04em;
}

.note-meta:empty {
  display: none;
}

.records-count {
  margin-top: 5px;
  color: rgba(126, 135, 150, 0.76);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.04em;
}

.note-input {
  width: 100%;
  min-height: 72px;
  max-height: 220px;
  padding: 10px 0 8px;
  border: 0;
  border-bottom: 1px solid rgba(180, 190, 210, 0.075);
  border-radius: 0;
  resize: none;
  outline: none;
  overflow-y: auto;
  background: transparent;
  color: rgba(221, 226, 234, 0.86);
  caret-color: rgba(190, 200, 220, 0.70);
  font-family: var(--quote-serif);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  font-weight: 300;
}

.note-input::placeholder {
  color: rgba(180, 190, 210, 0.28);
}

.note-input:focus-visible {
  outline: none;
}

.note-input:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 2px;
}

.note-status {
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  color: rgba(180, 190, 205, 0.46);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  font-weight: 300;
  white-space: pre-line;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 680ms var(--ease), transform 680ms var(--ease), max-height 680ms var(--ease);
}

.note-status.is-saving {
  color: rgba(199, 207, 221, 0.48);
}

.note-status.is-saved {
  color: rgba(190, 200, 220, 0.56);
}

.note-status.is-visible {
  max-height: 120px;
  opacity: 1;
  transform: translateY(0);
}

.note-tools {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
}

.note-tool {
  min-height: 44px;
  min-width: 0;
  padding: 0 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(150, 160, 176, 0.72);
}

.note-tool:hover {
  color: rgba(221, 226, 234, 0.82);
  background: transparent;
  box-shadow: none;
}

.future-echo {
  position: fixed;
  left: 50%;
  bottom: calc(max(124px, env(safe-area-inset-bottom)) + 18px);
  z-index: 28;
  width: min(78vw, 320px);
  display: grid;
  gap: 7px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 8px);
  filter: blur(5px);
  transition: opacity 1100ms var(--ease), transform 1100ms var(--ease), filter 1100ms var(--ease);
}

.future-echo.is-visible {
  opacity: 0.46;
  transform: translate(-50%, 0);
  filter: blur(0);
}

.future-echo-date {
  color: rgba(150, 160, 176, 0.42);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.12em;
  font-weight: 300;
}

.future-echo-text {
  color: rgba(210, 218, 232, 0.56);
  font-family: var(--quote-serif);
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.03em;
  font-weight: 300;
}

.note-leave {
  color: rgba(221, 226, 234, 0.84);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.018);
  box-shadow: inset 0 0 0 1px rgba(180, 190, 210, 0.07), 0 10px 30px rgba(0, 0, 0, 0.10);
}

.note-leave:hover {
  background: rgba(255, 255, 255, 0.028);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) var(--page-x) max(18px, env(safe-area-inset-bottom));
  perspective: 1200px;
  background:
    radial-gradient(82% 64% at 50% 12%, rgba(120, 140, 170, 0.072), transparent 64%),
    rgba(3, 5, 9, 0.88);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(16px) saturate(108%);
  -webkit-backdrop-filter: blur(16px) saturate(108%);
  transition: opacity 840ms var(--ease), visibility 840ms var(--ease), background-color 840ms var(--ease), backdrop-filter 840ms var(--ease);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  width: min(100%, 464px);
  max-height: min(84dvh, 720px);
  overflow-y: auto;
  border: 1px solid rgba(120, 140, 170, 0.105);
  border-radius: 20px 20px 18px 18px;
  background:
    radial-gradient(92% 60% at 50% 0%, rgba(221, 230, 244, 0.036), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,0.018), transparent 30%),
    #080D14;
  box-shadow: 0 -14px 62px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255,255,255,0.022);
  opacity: 0;
  transform: translateY(28px) scale(0.986);
  transform-origin: 50% 100%;
}

.modal-overlay.show .modal-card {
  animation: sheetOpen 840ms var(--ease) both;
}

.modal-card::-webkit-scrollbar {
  width: 4px;
}

.modal-card::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(126, 135, 150, 0.35);
}

.modal-top {
  position: relative;
  padding: 28px 26px 18px;
  border-bottom: 1px solid rgba(120, 140, 170, 0.11);
  text-align: left;
}

.modal-era,
.records-modal-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: rgba(126, 135, 150, 0.74);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.18em;
  font-weight: 300;
}

.modal-era::before,
.records-modal-label::before {
  content: "";
  width: 22px;
  height: 1px;
  background: rgba(169, 154, 123, 0.34);
}

.modal-author {
  margin-bottom: 9px;
  color: rgba(180, 190, 205, 0.62);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.06em;
}

.modal-title {
  padding-right: 46px;
  color: rgba(221, 226, 234, 0.92);
  font-family: var(--quote-serif);
  font-size: 22px;
  line-height: 1.58;
  letter-spacing: 0.05em;
  font-weight: 300;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(180, 190, 210, 0.095);
  border-radius: 50%;
  background: rgba(255,255,255,0.012);
  color: rgba(199, 207, 221, 0.58);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 520ms var(--ease), border-color 520ms var(--ease), background-color 520ms var(--ease), transform 520ms var(--ease);
}

.modal-close:hover {
  color: rgba(221, 226, 234, 0.84);
  border-color: rgba(180, 190, 210, 0.16);
  background: rgba(255,255,255,0.024);
  transform: translateY(-1px);
}

.modal-body {
  padding: 26px 26px 28px;
}

.modal-desc {
  display: grid;
  gap: 36px;
  text-align: left;
}

.modal-desc p {
  color: rgba(211, 218, 228, 0.84);
  font-family: var(--quote-serif);
  font-size: 17px;
  line-height: 2.05;
  letter-spacing: 0.045em;
  font-weight: 300;
}

.background-section {
  display: grid;
  gap: 20px;
}

.background-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(126, 135, 150, 0.72);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.16em;
  font-weight: 300;
}

.background-label::before {
  content: "";
  width: 22px;
  height: 1px;
  background: rgba(169, 154, 123, 0.34);
}

.background-section.is-context {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.background-section.is-context p {
  color: rgba(211, 218, 228, 0.84);
  font-family: var(--quote-serif);
  font-size: 17px;
  line-height: 2.16;
  letter-spacing: 0.045em;
  font-weight: 300;
}

.background-section.is-companion {
  margin-top: 0;
  padding-top: 28px;
  border-top: 1px solid rgba(120, 140, 170, 0.13);
  gap: 15px;
}

.background-section.is-companion p {
  color: rgba(155, 166, 184, 0.68);
  font-family: var(--ui-sans);
  font-size: 13.5px;
  line-height: 1.92;
  letter-spacing: 0.035em;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 26px 24px;
}

.modal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(169, 154, 123, 0.62);
}

.modal-meta {
  color: rgba(126, 135, 150, 0.68);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.16em;
}

.records-modal-card {
  max-width: 464px;
}

.records-modal-desc {
  margin-top: 12px;
  padding-right: 42px;
  color: rgba(160, 170, 186, 0.70);
  font-size: 13px;
  line-height: 1.86;
  letter-spacing: 0.04em;
}

.records-card {
  display: grid;
  gap: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.records-list {
  display: grid;
  gap: 12px;
}

.record-item {
  width: 100%;
  padding: 17px 16px 15px;
  border: 1px solid rgba(120, 140, 170, 0.14);
  border-radius: 14px;
  background: rgba(255,255,255,0.018);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 420ms var(--ease), border-color 420ms var(--ease), background-color 420ms var(--ease);
}

.record-item:hover {
  transform: translateY(-1px);
  border-color: rgba(180, 190, 210, 0.22);
  background: rgba(255,255,255,0.028);
}

.record-quote {
  color: rgba(221, 226, 234, 0.90);
  font-family: var(--quote-serif);
  font-size: 15px;
  line-height: 1.82;
  letter-spacing: 0.04em;
}

.record-source {
  margin-top: 9px;
  color: rgba(126, 135, 150, 0.74);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.08em;
}

.record-note {
  margin-top: 12px;
  color: rgba(199, 207, 221, 0.78);
  font-size: 13px;
  line-height: 1.86;
  letter-spacing: 0.035em;
  white-space: pre-wrap;
}

.record-time {
  margin-top: 12px;
  color: rgba(126, 135, 150, 0.58);
  font-size: 11px;
  line-height: 1.5;
}

.record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.record-action {
  min-height: 44px;
  padding: 0 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.record-delete {
  color: rgba(160, 170, 186, 0.56);
}

.record-delete:hover {
  color: rgba(221, 226, 234, 0.82);
}

.records-empty {
  padding: 28px 8px 14px;
  color: rgba(126, 135, 150, 0.72);
  text-align: center;
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.05em;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes quietEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logoBreath {
  0%, 100% {
    opacity: 0.74;
    filter:
      invert(91%)
      sepia(10%)
      saturate(160%)
      hue-rotate(182deg)
      brightness(86%)
      contrast(84%)
      blur(0.28px);
  }
  50% {
    opacity: 0.82;
    filter:
      invert(91%)
      sepia(10%)
      saturate(160%)
      hue-rotate(182deg)
      brightness(94%)
      contrast(84%)
      blur(0.24px);
  }
}

@keyframes quoteCardEnter {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes stoneBreathe {
  0%, 100% {
    box-shadow: var(--shadow-stone), inset 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    box-shadow: var(--shadow-stone), inset 0 0 30px rgba(255, 255, 255, 0.0045);
  }
}

@keyframes groundBreath {
  0%, 100% {
    opacity: 0.28;
    transform: scale(1);
  }
  50% {
    opacity: 0.38;
    transform: scale(1.006);
  }
}

@keyframes airDrift {
  0%, 100% {
    opacity: 0.19;
    transform: translate3d(0, 0, 0);
    background-position: 0 0, 32px 18px, -24px 42px, 18px -28px;
  }
  50% {
    opacity: 0.28;
    transform: translate3d(0, -1.5px, 0);
    background-position: 7px -9px, 25px 27px, -17px 35px, 11px -21px;
  }
}

@keyframes panelReveal {
  from {
    opacity: 0;
    transform: translateY(-8px) scaleY(0.985);
    transform-origin: top center;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    transform-origin: top center;
  }
}

@keyframes sheetOpen {
  from {
    opacity: 0;
    transform: translateY(34px) scale(0.982);
    filter: blur(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes introFloatIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.985);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -52%) scale(1);
    filter: blur(0);
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .btn,
  .intro-card,
  .modal-overlay,
  .note-layer-backdrop,
  .note-card,
  .memory-prompt-backdrop,
  .memory-prompt-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (min-height: 820px) {
  .page {
    gap: 28px;
  }
}

@media (max-width: 420px) {
  :root {
    --page-x: 16px;
  }

  body {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  .page {
    width: 100%;
    gap: clamp(22px, 4.6vh, 38px);
    justify-content: flex-start;
    min-height: calc(100dvh - max(18px, env(safe-area-inset-top)) - max(28px, env(safe-area-inset-bottom)));
    padding-top: clamp(22px, 5vh, 40px);
    padding-bottom: clamp(120px, 18vh, 170px);
  }

  .brand {
    gap: 9px;
  }

  .brand-mark-wrap {
    width: clamp(54px, 16vw, 72px);
  }

  .brand-mark {
    width: clamp(44px, 13vw, 60px);
  }

  .brand-name {
    font-size: 10px;
    letter-spacing: 0.24em;
  }

  .brand-ritual {
    font-size: 12px;
  }

  .time-whisper,
  .visit-whisper {
    color: rgba(180, 190, 205, 0.36);
    font-size: 13px;
    margin-top: 9px;
    max-width: min(82vw, 330px);
  }

  .quote-shell {
    min-height: clamp(292px, 43dvh, 390px);
    padding: 16px 0 clamp(70px, 10dvh, 104px);
  }

  .quote-original {
    font-size: 13px;
  }

  .quote-source {
    font-size: 11.5px;
  }

  .intro-layer {
    padding: max(24px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
  }

  .intro-card {
    width: min(86vw, 420px);
    max-height: calc(100dvh - max(48px, env(safe-area-inset-top)) - max(58px, env(safe-area-inset-bottom)));
    gap: 26px;
    padding: 32px 28px;
    border-radius: 32px;
  }

  .intro-copy {
    gap: 14px;
    font-size: 17px;
    line-height: 2;
  }

  .intro-start {
    min-height: 48px;
  }

  .actions {
    bottom: calc(max(34px, env(safe-area-inset-bottom)) + 2px);
    gap: 8px;
    width: calc(100vw - 32px);
    margin: 0;
  }

  .site-record {
    bottom: max(9px, env(safe-area-inset-bottom));
    width: calc(100vw - 32px);
    padding: 0;
  }

  .site-record-link {
    font-size: 10px;
  }

  .btn {
    min-height: 45px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.05em;
  }

  .btn-reading-entry {
    width: 100%;
    min-height: 44px;
  }

  .secondary-actions {
    width: min(78%, 318px);
    gap: 12px;
  }

  .secondary-actions .btn {
    min-height: 44px;
  }

  .note-card {
    width: calc(100vw - 32px);
    max-height: min(58dvh, 420px);
    padding: 16px 0 8px;
    border-radius: 0;
  }

  .note-title {
    font-size: 15px;
  }

  .records-title {
    font-size: 17px;
  }

  .note-input {
    min-height: 80px;
    max-height: 210px;
    font-size: 16px;
  }

  .future-echo {
    bottom: calc(max(118px, env(safe-area-inset-bottom)) + 14px);
    width: min(82vw, 300px);
  }

  .note-footer {
    align-items: center;
    flex-direction: row;
  }

  .note-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .modal-top,
  .modal-body,
  .modal-footer {
    padding-left: 22px;
    padding-right: 22px;
  }

  .modal-title {
    font-size: 20px;
  }

  .modal-desc p {
    font-size: 16px;
    line-height: 2;
  }
}

@media (max-width: 350px) {
  :root {
    --page-x: 12px;
  }

  .quote-shell {
    min-height: clamp(274px, 41dvh, 360px);
    padding-left: 0;
    padding-right: 0;
  }

  .quote-text {
    font-size: 20px;
  }

  .intro-card {
    width: min(88vw, 420px);
    padding: 28px 24px;
    border-radius: 28px;
  }

  .intro-copy {
    font-size: 16.5px;
    line-height: 1.94;
  }

  .actions,
  .note-card {
    width: calc(100vw - 24px);
  }

  .btn {
    font-size: 11px;
    letter-spacing: 0.03em;
  }

  .time-whisper,
  .visit-whisper {
    font-size: 12px;
  }
}

@media (max-height: 700px) {
  .page {
    justify-content: flex-start;
    padding-bottom: clamp(92px, 14vh, 128px);
  }

  .quote-shell {
    min-height: 260px;
    padding-bottom: clamp(46px, 8vh, 72px);
  }

  .quote-text {
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .note-card {
    top: auto;
    max-height: min(58dvh, 420px);
  }

  .future-echo {
    bottom: calc(max(104px, env(safe-area-inset-bottom)) + 10px);
  }

  .intro-layer {
    padding-top: max(22px, env(safe-area-inset-top));
  }

  .intro-card {
    max-height: calc(100dvh - max(44px, env(safe-area-inset-top)) - max(48px, env(safe-area-inset-bottom)));
    gap: 20px;
    padding-top: 26px;
    padding-bottom: 22px;
  }

  .intro-copy {
    gap: 10px;
    font-size: 16px;
    line-height: 1.88;
  }
}

@media (max-width: 420px) and (max-height: 700px) {
  .quote-shell {
    min-height: clamp(250px, 40dvh, 330px);
  }

  .quote-text {
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
