/* ═══════════════════════════════════════════════════════════════════
   GRATUS.CC · the app, v4. Three doors: Ground · Grow · Give.
   One idea per viewport. Deep space between ideas. One figure per screen.
   Mobile first at 375; body type does not shrink; display type does the talking.
   ═══════════════════════════════════════════════════════════════════ */
html, body { height: 100%; }
body.app { overflow: hidden; position: fixed; inset: 0; overscroll-behavior: none; }
#views { position: relative; height: 100%; }
.view { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(24px + var(--sat)) 20px calc(120px + var(--sab)); scrollbar-width: none; }
.view[hidden] { display: none; }
.view::-webkit-scrollbar { display: none; }
.wrap { max-width: 560px; margin: 0 auto; }

/* ── acts and sections: the space is the stage ── */
.act { position: relative; min-height: calc(100svh - 160px - var(--sat) - var(--sab)); display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 24px 0; }
.sec { position: relative; padding: 96px 0 0; display: grid; gap: 16px; }
.sec h2 { margin-bottom: 4px; }
.sec .lead { max-width: 30em; }
.eyebrow { display: flex; align-items: center; gap: 10px; min-height: 20px; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--h, var(--hue)); flex: none; }
.statement { font-family: var(--display); font-weight: 500; font-size: 16px; line-height: 24px; color: var(--ink-3); }

/* ── the figures ── */
.fig-horizon { position: absolute; left: 50%; top: 42%; width: 140%; height: 46%; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; z-index: 0; background: radial-gradient(ellipse at 50% 50%, var(--hue-16) 0%, var(--hue-04) 42%, transparent 68%); animation: breathe-light 12s ease-in-out infinite; }
.act > * { position: relative; z-index: 1; }
.fig-dome { position: absolute; left: 50%; top: 40%; width: 420px; height: 420px; transform: translate(-50%, -50%); pointer-events: none; z-index: 0; }
.fig-dome circle { fill: none; stroke: var(--hair-2); stroke-width: 1; }
.fig-dome circle:nth-child(1) { stroke: var(--hue-48); }
.fig-dome circle:nth-child(2) { stroke: var(--hue-16); }
.fig-dome .mark { fill: var(--ink); }

/* ── GROUND: the question, the writing, the seeds, the feeling, the act ── */
.q { min-height: 44px; text-align: left; }
.q button { text-align: left; font: inherit; color: inherit; line-height: inherit; }
.write { min-height: 132px; font-size: 18px; line-height: 28px; padding: 14px 16px; border-radius: var(--r-8); }
.write.big { min-height: 200px; }
.hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hint .orbs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.hint .orbs::-webkit-scrollbar { display: none; }
.hint .felt { flex: none; font-family: var(--display); font-weight: 500; font-size: 14px; line-height: 20px; color: var(--violet-text); padding: 6px 10px; border-radius: var(--r-6); background: var(--raise); border: 1px solid var(--hair); }
.feels { display: grid; grid-template-columns: repeat(4, minmax(0, 88px)); justify-content: center; gap: 10px; }
.feels .orb { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--r-16); font-size: 28px; gap: 6px; }
.feels .orb small { font-family: var(--body); font-size: 13px; line-height: 16px; color: var(--ink-2); }
.feels .orb.on { border-color: var(--h); box-shadow: var(--lit-hover), 0 0 0 1px color-mix(in oklab, var(--h) 40%, transparent); }
.keep-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.keep-row .tools { display: flex; gap: 6px; }
.tool { width: 40px; height: 40px; border-radius: var(--r-6); display: grid; place-items: center; color: var(--violet-text); background: var(--raise); border: 1px solid var(--hair); cursor: pointer; }
.tool.on { border-color: var(--hue-48); color: var(--ink); animation: breathe-light 1.4s ease-in-out infinite; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.photoprev { display: grid; gap: 8px; justify-items: start; }
.photoprev img { max-height: 160px; border-radius: var(--r-8); }
.grace { display: grid; gap: 6px; padding: 16px 18px; border-radius: var(--r-16); }
.grace .who { display: flex; align-items: center; gap: 8px; }
.grace p { color: var(--ink-2); }
.grace .ask { color: var(--gold); }
.entries { display: grid; gap: 10px; }
.entry { display: grid; gap: 6px; padding: 14px 16px; text-align: left; width: 100%; border-radius: var(--r-16); color: var(--ink); }
.entry .meta { display: flex; align-items: center; gap: 8px; }
.entry .text { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.entry .row-seeds { display: flex; gap: 6px; font-family: var(--emoji); font-size: 18px; }
.band { display: flex; gap: 4px; height: 10px; }
.band i { flex: 1; border-radius: 2px; background: var(--raise-2); border: 1px solid var(--hair); }
.band i.lit { background: color-mix(in oklab, var(--h) 40%, var(--ground)); border-color: color-mix(in oklab, var(--h) 60%, transparent); }
.days-card { display: grid; gap: 12px; padding: 16px; }
.dow { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.dgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dcell { aspect-ratio: 1; border-radius: var(--r-5); display: grid; place-items: center; position: relative; background: var(--raise); border: 1px solid var(--hair); color: var(--ink-2); font-size: 14px; }
.dcell.blank { background: transparent; border: 0; }
.dcell.lit { background: color-mix(in oklab, var(--h) 24%, var(--ground)); border-color: color-mix(in oklab, var(--h) 60%, transparent); color: var(--ink); }
.dcell.today { border-color: var(--ink); }
.dcell.sel { box-shadow: 0 0 0 1px var(--violet-text); }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.links button, .links a { color: var(--violet-text); font-weight: 500; font-size: 15px; line-height: 24px; text-decoration: none; }
.links button:hover, .links a:hover { color: var(--ink); }
.insight { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--hair); }
.insight:first-child { border-top: 0; padding-top: 0; }
.insight .emoji { font-size: 22px; flex: none; width: 28px; text-align: center; }
.insight p { color: var(--ink-2); }
.hold-wrap { display: grid; place-items: center; gap: 14px; padding: 8px 0; }
.hold { position: relative; -webkit-user-select: none; user-select: none; touch-action: none; }
.hold .ring { position: absolute; inset: -6px; border-radius: 50%; background: conic-gradient(var(--violet-text) calc(var(--p, 0) * 1%), transparent 0); -webkit-mask: radial-gradient(circle, transparent calc(50% - 3px), #000 calc(50% - 2px)); mask: radial-gradient(circle, transparent calc(50% - 3px), #000 calc(50% - 2px)); opacity: 0; transition: opacity var(--t-fast); pointer-events: none; }
.hold.holding .ring { opacity: 1; }
.btn.hold .ring { border-radius: var(--r-6); inset: -3px; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 2px; background: conic-gradient(var(--ink) calc(var(--p, 0) * 1%), transparent 0); }
.ground-live { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; align-content: center; gap: 22px; background: var(--ground); }
.ground-live[hidden] { display: none; }
.breath { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 40px 12px rgba(244,240,255,.28), 0 0 120px 40px var(--hue-16); animation: breathe-light 8s ease-in-out infinite; }
.clock { font-family: var(--display); font-weight: 500; font-size: 52px; line-height: 1.1; }
.bell-spot { position: fixed; left: 50%; bottom: calc(96px + var(--sab)); transform: translateX(-50%); width: 88px; height: 88px; border-radius: 50%; background: radial-gradient(circle, rgba(244,240,255,.22), transparent 70%); animation: breathe-light 1.6s ease-in-out infinite; z-index: 26; }
.bell-spot[hidden] { display: none; }
.gift-lift { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 500; font-size: 24px; color: var(--gold); animation: lift 1.6s var(--ease) forwards; z-index: 27; pointer-events: none; }
@keyframes lift { 0% { opacity: 0; transform: translate(-50%, 40px) } 20% { opacity: 1 } 100% { opacity: 0; transform: translate(-50%, -160px) } }

/* ── GROW: the field of emojis, then the models ── */
.field-fig { position: relative; width: 100%; max-width: 360px; aspect-ratio: 1; margin: 0 auto; }
.field-fig .orb { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(var(--s, 1)); }
.field-fig .orb.rest { border-color: var(--hair); }
.field-fig .orb.lit { border-color: color-mix(in oklab, var(--h) 45%, transparent); }
.field-fig .orb:hover { transform: translate(-50%, -50%) scale(calc(var(--s, 1) * 1.06)); }
.motion { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.motion .emoji { font-size: 22px; }
.models { display: grid; gap: 8px; }
.sheet .fam { display: grid; gap: 8px; padding-top: 8px; }
.sheet .fam h3 { font-size: 20px; line-height: 28px; }
.model { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center; padding: 14px 16px; text-align: left; width: 100%; border-radius: var(--r-16); color: var(--ink); }
.model .f { display: flex; align-items: center; gap: 4px; font-family: var(--emoji); font-size: 20px; line-height: 1; width: 108px; }
.model .f .res { font-family: var(--body); font-size: 16px; color: var(--ink); margin-left: 4px; white-space: nowrap; }
.model .f .res.dim { color: var(--violet-text); }
.model .f.hidden-f { font-family: var(--display); color: var(--violet-text); font-size: 18px; letter-spacing: normal; gap: 8px; }
.model .name { font-weight: 500; }
.model .cat { grid-column: 3; }
.model .line { grid-column: 2 / -1; color: var(--ink-2); font-size: 14px; line-height: 20px; }
.model.near .line { color: var(--violet-text); }
.arc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-family: var(--emoji); font-size: 22px; }
.arc .arrow { font-family: var(--body); color: var(--violet-text); font-size: 16px; }
.arc .dim { opacity: .35; }
.loop { width: 100%; max-width: 280px; height: 96px; margin: 0 auto; }
.loop * { fill: none; stroke: var(--hue-48); stroke-width: 1.2; }
.loop .g { stroke: var(--gold); }
.loop .fill { fill: var(--hue-16); stroke: none; }

/* ── GIVE: honor as one number, the dome behind it ── */
.honor { display: grid; gap: 6px; justify-items: center; text-align: center; }
.honor .big { font-family: var(--display); font-weight: 500; font-size: 64px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.honor .big small { font-size: 22px; color: var(--violet-text); margin-left: 6px; }
.rows { display: grid; }
.row-item { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 0; border-top: 1px solid var(--hair); color: var(--ink); text-align: left; width: 100%; }
.row-item:first-child { border-top: 0; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item strong { font-weight: 500; display: block; }
.row-item .cap { display: block; }
.row-item .end { color: var(--violet-text); font-size: 14px; white-space: nowrap; }
.row-item .emoji { font-size: 24px; width: 32px; text-align: center; flex: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gtiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gtile { display: grid; justify-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: var(--r-8); background: var(--raise); border: 1px solid var(--hair); color: var(--ink-2); font-size: 12px; line-height: 16px; }
.gtile .emoji { font-size: 26px; }
.gtile.on { border-color: var(--hue-48); background: var(--hue-16); color: var(--ink); }
.settings .row-item { min-height: 56px; }
.settings .row-item:has(.seg) { flex-wrap: wrap; }
.settings .row-item .seg { flex-basis: 100%; justify-content: stretch; }
.settings .row-item .seg button { flex: 1; }
.toggle { width: 46px; height: 28px; border-radius: 999px; background: var(--raise-2); border: 1px solid var(--hair-2); position: relative; transition: background var(--t-fast); flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-3); transition: transform var(--t-fast) var(--ease); }
.toggle.on { background: var(--hue-48); }
.toggle.on::after { transform: translateX(18px); background: #fff; }
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-6); background: var(--raise); border: 1px solid var(--hair); }
.seg button { min-height: 32px; padding: 0 10px; border-radius: var(--r-5); font-size: 14px; color: var(--ink-2); }
.seg button.on { background: var(--hue-16); color: var(--ink); }
.colophon { padding: 96px 0 24px; display: grid; gap: 6px; }
.colophon p { color: var(--ink-3); font-size: 14px; line-height: 20px; }
.colophon .statement { color: var(--ink-2); }
.qr-wrap canvas { border-radius: var(--r-8); background: #fff; padding: 8px; width: 180px; height: 180px; }
.glyph-wrap { display: grid; place-items: center; gap: 8px; }
.glyph-wrap svg { width: 96px; height: 96px; }

/* ── the tab bar: three words ── */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); height: calc(60px + var(--sab)); padding-bottom: var(--sab); background: var(--chrome); border-top: 1px solid var(--hair); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tabs button { position: relative; font-family: var(--display); font-weight: 500; font-size: 15px; line-height: 20px; color: var(--violet-text); transition: color var(--t-fast); }
.tabs button.on { color: var(--ink); }
.tabs button.on::after { content: ""; position: absolute; left: 50%; bottom: 10px; width: 4px; height: 4px; border-radius: 50%; background: var(--hue); transform: translateX(-50%); }
.tabs button .dot { position: absolute; top: 14px; right: calc(50% - 30px); width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.tabs button .dot[hidden] { display: none; }
body.editing .tabs { display: none; }

/* ── sheets ── */
.scrim { position: fixed; inset: 0; z-index: 30; background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade var(--t) var(--ease); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: calc(100dvh - 32px - var(--sat)); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 20px calc(24px + var(--sab)); border-radius: var(--r-24) var(--r-24) 0 0; background: var(--chrome); border-top: 1px solid var(--hair-2); box-shadow: var(--lit-rest); display: grid; gap: 16px; align-content: start; animation: sheet-in var(--t) var(--ease); scrollbar-width: none; }
.sheet::-webkit-scrollbar { display: none; }
.sheet .grabber { width: 36px; height: 4px; border-radius: 2px; background: var(--hair-2); margin: 0 auto 4px; }
.sheet h2 { font-size: 24px; line-height: 32px; }
.sheet.out { animation: sheet-out var(--t-fast) var(--ease) forwards; }
.sheet .hero { display: grid; place-items: center; gap: 8px; text-align: center; }
.sheet .actions { display: grid; gap: 8px; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes sheet-out { to { transform: translateY(24px); opacity: 0 } }
.safety { display: grid; gap: 8px; }
.safety a { font-weight: 500; }

/* ── ceremonies: one emoji, one line, the ground ── */
#ceremony { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: var(--ground); animation: fade var(--t) var(--ease); padding: 24px; }
#ceremony[hidden] { display: none; }
.cer { display: grid; place-items: center; gap: 16px; text-align: center; width: min(92vw, 420px); --h: #6D48FF; }
.cer .big { font-family: var(--emoji); font-size: 104px; line-height: 1; padding: 12px; animation: rise var(--t) var(--ease) both; }
.cer h2 { animation: rise var(--t) var(--ease) 120ms both; }
.cer p { color: var(--ink-2); animation: rise var(--t) var(--ease) 240ms both; }
.cer .label { animation: rise var(--t) var(--ease) 360ms both; }
.cer .morph { position: relative; width: 160px; height: 130px; display: grid; place-items: center; }
.cer .morph span { position: absolute; font-family: var(--emoji); font-size: 96px; line-height: 1; }
.cer .morph .from { animation: morph-out 1.4s var(--ease) forwards; }
.cer .morph .to { animation: morph-in 1.2s var(--ease) .8s both; }
.cer .pair { display: flex; align-items: center; gap: 10px; font-family: var(--emoji); font-size: 56px; line-height: 1; }
.cer .pair .op { font-family: var(--body); color: var(--violet-text); font-size: 24px; }
.cer .pair .res { animation: morph-in 1.2s var(--ease) .9s both; }
@keyframes morph-out { 0% { opacity: 1; transform: scale(1) } 100% { opacity: 0; transform: scale(.6) } }
@keyframes morph-in { 0% { opacity: 0; transform: scale(.6) } 100% { opacity: 1; transform: scale(1) } }

/* ── the twelve laws: one line, one room, arriving out of blur ── */
#laws { position: fixed; inset: 0; z-index: 44; background: var(--ground); overflow-y: auto; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
#laws::-webkit-scrollbar { display: none; }
#laws[hidden] { display: none; }
#laws .skip { position: fixed; right: 20px; top: calc(20px + var(--sat)); z-index: 2; }
.law { min-height: 100svh; scroll-snap-align: start; display: grid; align-content: center; justify-items: center; gap: 20px; text-align: center; padding: 24px; }
.law h1 { font-size: clamp(32px, 9.6vw, 56px); line-height: 1.14; max-width: 14em; text-wrap: balance; }
.law .label { color: var(--violet-text); }
.law.last { gap: 28px; }
.law .mark { width: 72px; height: 72px; border-radius: 50%; filter: drop-shadow(0 0 24px var(--hue-48)); }
.law .statement { max-width: 24em; text-wrap: balance; }
html.anim .law > * { opacity: 0; filter: blur(10px); transform: translateY(16px); }
html.anim .law.on > * { opacity: 1; filter: blur(0); transform: none; transition: opacity 1s ease, filter 1.1s ease, transform 1s cubic-bezier(.16, 1, .3, 1); }
html.anim .law.on > :nth-child(2) { transition-delay: 120ms; }
html.anim .law.on > :nth-child(3) { transition-delay: 240ms; }
body.laws-open .tabs { display: none; }

/* ── the arrival: one line, one room, then the door ── */
#arrival { position: fixed; inset: 0; z-index: 45; background: var(--ground); display: grid; place-items: center; padding: 24px; }
#arrival[hidden] { display: none; }
.arr { width: min(92vw, 480px); display: grid; gap: 28px; justify-items: center; text-align: center; }
.arr .mark { width: 96px; height: 96px; border-radius: 50%; filter: drop-shadow(0 0 24px var(--hue-48)); animation: rise var(--t) var(--ease) both; }
.arr h1 { font-size: clamp(34px, 10vw, 52px); line-height: 1.11; animation: rise var(--t) var(--ease) both; }
.arr .door { display: grid; gap: 12px; width: 100%; max-width: 360px; }
.arr .handle { display: flex; align-items: center; gap: 8px; }
.arr .handle .field { flex: 1; }
.arr .skip { position: fixed; right: 20px; top: calc(20px + var(--sat)); }

/* ── toast · dev ── */
#toast { position: fixed; left: 50%; bottom: calc(80px + var(--sab)); transform: translate(-50%, 12px); z-index: 50; padding: 10px 16px; border-radius: var(--r-8); background: var(--chrome); border: 1px solid var(--hair-2); box-shadow: var(--lit-rest); font-size: 15px; line-height: 20px; color: var(--ink); opacity: 0; transition: opacity var(--t-fast) var(--ease), transform var(--t) var(--ease); pointer-events: none; max-width: 88vw; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#dev { position: fixed; left: 8px; bottom: calc(72px + var(--sab)); z-index: 25; padding: 6px; border-radius: var(--r-8); background: var(--chrome); border: 1px solid var(--hair-2); display: grid; gap: 4px; max-width: 200px; font-size: 13px; }
#dev button { min-height: 30px; padding: 0 8px; border-radius: var(--r-5); background: var(--raise-2); color: var(--ink); font-size: 12px; text-align: left; }
#dev:not(.open) button { display: none; }
#dev .label { cursor: pointer; min-height: 24px; display: flex; align-items: center; }
#dev[hidden] { display: none; }
.noscript { position: fixed; inset: 20px; z-index: 99; display: grid; place-content: center; text-align: center; padding: 24px; }
.onboard { display: grid; gap: 12px; }
@media (min-width: 768px) { .view { padding-left: 32px; padding-right: 32px; } .sec { padding-top: 120px; } }
html.rm *, html.rm *::before, html.rm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
