/* Hale & Heirs · the landing. One sealed letter on a dark desk. The envelope carries the advisory and a wax seal
   you hold to break; inside, the site is a single typeset letter on laid paper. After hours the desk goes to
   the water, the ink spreads, and the margins fill with red. Iron-gall, brushed (Nov 25): display Grenze Gotisch,
   letter Alegreya, labels Alegreya SC, the red in Nanum Brush Script, signature Herr Von Muellerhoff. Paper is the
   calm tile under the words and the full grain at the edges; ink filters live in ink.js. */
:root {
  --desk: #14100d; --desk2: #1d1712; --paper: #f4ecd9; --paper2: #efe4cc; --ink: #2a221a; --muted: #5a4430; --rule: #d6c7a6;
  --blood: #8c2418; --wax: #8a2219; --gold: #c09a5f; --deskink: #e9dfcb; --deskmuted: #b39c82; --lab: #4e3622;
  --display: "Grenze Gotisch", "Alegreya", Georgia, serif; --old: "Alegreya", Georgia, serif;
  --ui: "Alegreya", Georgia, serif; --label: "Alegreya SC", "Alegreya", Georgia, serif; --num: "Alegreya SC", Georgia, serif;
  --brush: "Nanum Brush Script", "Alegreya", cursive; --hand: "Herr Von Muellerhoff", "Alegreya", cursive;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--desk) radial-gradient(ellipse at 50% 0%, #2a2018, var(--desk) 70%) fixed; color: var(--deskink); font: 17px/1.6 var(--ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background-color 1.4s; }
body.night { --desk: #071012; --desk2: #0d1a1c; --paper: #e6dcc4; --paper2: #ddd0b4; background: var(--desk) radial-gradient(ellipse at 50% 0%, #0f2224, var(--desk) 70%) fixed; }
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

#fissure { position: fixed; top: 0; right: 6vw; width: 56px; height: 100vh; pointer-events: none; z-index: 40; mix-blend-mode: screen; }
#fissure path { fill: none; stroke: #c9bfa9; stroke-width: 1.2; stroke-linecap: round; opacity: .55; }
.night #fissure path { stroke: #9fb3b0; }
@media (max-width: 700px) { #fissure { right: 2px; width: 26px; } }

/* the desk */
.desk-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; align-items: center; gap: 16px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--desk) 86%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--desk); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 22px var(--display); color: var(--deskink); }
.seal { width: 34px; height: 34px; display: block; flex: none; }
.seal.big { width: 58px; height: 58px; }
.links { display: none; gap: 20px; margin-left: auto; font: 500 16px var(--label); color: var(--deskmuted); }
.links a { text-decoration: none; } .links .label-turned { color: #e3a4a4; }
@media (min-width: 760px) { .links { display: flex; } }
.lang { margin-left: auto; display: flex; gap: 2px; }
@media (min-width: 760px) { .lang { margin-left: 0; } }
.lang button { background: none; border: 1px solid transparent; color: var(--deskmuted); font: 500 15px var(--label); border-radius: 6px; padding: 6px 8px; min-height: 36px; cursor: pointer; }
.lang button[aria-pressed="true"] { border-color: #4a3b2c; color: var(--deskink); }

/* the envelope */
.envelope { padding: 18px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); display: grid; place-items: center; min-height: calc(100svh - 70px); }
.envelope.open { min-height: 0; padding-bottom: 8px; }
.env-face { position: relative; isolation: isolate; width: 100%; max-width: 560px; background: #ecdfc3 url(/assets/tex/paper_calm.webp) 0 0/580px auto repeat; color: var(--ink); border-radius: 4px; padding: 22px 22px 18px; box-shadow: 0 40px 80px -30px #000, inset 0 0 70px rgba(90, 60, 20, .22); display: grid; gap: 14px; background-blend-mode: multiply; transition: transform .9s cubic-bezier(.6,0,.2,1), opacity .9s; }
.env-face::after, .letter::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; mix-blend-mode: multiply;
  background: radial-gradient(ellipse at 50% 45%, transparent 52%, rgba(110, 70, 25, .26) 100%), url(/assets/tex/paper_grain.webp) 0 0/580px auto repeat;
  -webkit-mask: radial-gradient(ellipse at 50% 45%, transparent 56%, #000 100%); mask: radial-gradient(ellipse at 50% 45%, transparent 56%, #000 100%); }
.env-face::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 46%; background: linear-gradient(to bottom right, transparent 49.6%, rgba(90, 60, 20, .16) 50%, transparent 50.4%), linear-gradient(to bottom left, transparent 49.6%, rgba(90, 60, 20, .16) 50%, transparent 50.4%); pointer-events: none; }
.env-face > * { position: relative; }
.envelope.opening .env-face { transform: translateY(-30px) rotate(-1.5deg); opacity: 0; }
.envelope.open .env-face { padding: 14px 18px; gap: 6px; }
.envelope.open .env-face::before { display: none; }
.envelope.open .advisory ul, .envelope.open .advisory p:not(.post), .envelope.open .env-to, .envelope.open .env-from { display: none; }
.env-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 700 14px var(--label); letter-spacing: .05em; color: var(--lab); }
.stamp { border: 1.5px solid var(--blood); color: var(--blood); padding: 1px 7px; transform: rotate(6deg); font: 700 15px var(--label); filter: url(#ink-t); }
.env-to { margin: 6px 0 0; font: 600 clamp(28px, 7vw, 38px)/1.1 var(--display); filter: url(#ink-d); }
.advisory { border: 1px solid #b9a37c; padding: 12px 14px; background: rgba(255, 252, 240, .4); }
.advisory b { font: 700 15px var(--label); letter-spacing: .04em; color: var(--blood); }
.advisory p { margin: 6px 0 0; font: 500 17px/1.45 var(--old); }
.advisory ul { margin: 6px 0 0; padding-left: 20px; font: 500 17.5px/1.45 var(--old); }
.advisory .post { font: 700 14px/1.45 var(--label); letter-spacing: .02em; color: var(--lab); }
.breakwrap { display: grid; justify-items: center; gap: 8px; padding: 6px 0 2px; }
.wax { position: relative; width: 124px; height: 124px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: none; touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .2s; }
.wax .waxsvg { position: absolute; inset: 0; }
.wax .sealring { position: absolute; inset: -10px; width: calc(100% + 20px); height: calc(100% + 20px); transform: rotate(-90deg); pointer-events: none; }
.wax .sealring circle { fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-linecap: round; }
.wax:active { transform: scale(.96); }
.holdmsg { margin: 0; font: 700 14px var(--label); letter-spacing: .03em; color: var(--lab); }
.env-from { margin: 0; font: italic 500 15px var(--old); color: var(--muted); text-align: right; }
.broken { margin: 0; font: 26px/1.1 var(--brush); color: var(--blood); filter: url(#ink-brush); transform: rotate(-1deg); }

/* the letter */
.letter { position: relative; isolation: isolate; width: calc(100% - 2 * max(16px, env(safe-area-inset-left, 0px))); max-width: 680px; margin: 10px auto 40px; background: var(--paper) url(/assets/tex/paper_calm.webp) 0 0/640px auto repeat; color: var(--ink); padding: 26px 22px 34px; border-radius: 3px; box-shadow: 0 40px 90px -40px #000, inset 0 0 80px rgba(90, 60, 20, .16); font: 500 18.5px/1.6 var(--old); background-blend-mode: multiply; }
.letter > * { position: relative; }
body:not(.opened) .letter { display: none; }
@media (min-width: 700px) { .letter { padding: 44px 56px 52px; } }
.lh { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid rgba(90, 65, 35, .28); margin-bottom: 18px; }
.lh b { font: 600 27px/1.1 var(--display); display: block; filter: url(#ink-d); }
.lh small { font: 700 13.5px/1.4 var(--label); letter-spacing: .05em; color: var(--lab); }
.lh time { grid-column: 1 / -1; justify-self: end; font: italic 500 15.5px var(--old); color: var(--muted); }
.dear { margin: 0 0 6px; }
.letter h1 { font: 600 clamp(38px, 8.2vw, 62px)/1.04 var(--display); margin: 0 0 14px; letter-spacing: 0; text-wrap: balance; color: #2b1a10; filter: url(#ink-d); }
.letter h1 em { display: inline-block; color: var(--blood); font: 400 1.62em/.8 var(--brush); transform: rotate(-2.5deg); filter: url(#ink-brush); }
.letter .lede { margin: 0 0 18px; font-size: 19.5px; }
.letter .lede, .letter .dear, .clauses li, .refs q, .next li { filter: url(#ink-b); }
.letter h2 { font: 700 15px var(--label); letter-spacing: .06em; color: var(--lab); margin: 28px 0 10px; padding-top: 14px; border-top: 1px solid rgba(90, 65, 35, .22); }
.photo { position: relative; margin: 8px -6px 10px; transform: rotate(-1.2deg); background: #fff; padding: 8px 8px 0; box-shadow: 0 14px 28px -16px rgba(0,0,0,.6); }
.photo img { display: block; width: 100%; height: auto; filter: sepia(.35) contrast(1.05); }
.photo .crack { position: absolute; inset: 8px 8px 34px; width: calc(100% - 16px); height: calc(100% - 42px); opacity: 0; transition: opacity 1.2s; }
.night .photo .crack { opacity: 1; }
.photo figcaption { font: italic 500 16px var(--old); color: var(--muted); padding: 6px 2px 8px; }
.night .photo figcaption { color: var(--blood); }
.clip { position: absolute; top: -12px; left: 22px; width: 16px; height: 44px; border: 2px solid #8c8c8c; border-radius: 8px; z-index: 2; }
.clauses { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.clauses .cl { display: block; font: 700 14px var(--label); letter-spacing: .05em; color: var(--lab); }
.clauses li b { font-weight: 700; }
.clauses .margin { display: block; font: 30px/1.1 var(--brush); color: var(--blood); transform: rotate(-1.6deg); margin: 4px 0 0 12px; filter: url(#ink-brush); }
.refs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.refs q { display: block; font-style: italic; quotes: "“" "”"; }
.refs span { font: 700 14px var(--label); letter-spacing: .04em; color: var(--lab); }
.letter .note { font: 700 14px var(--label); letter-spacing: .03em; color: var(--lab); margin: 8px 0 0; }
.night .letter .note { color: var(--blood); }
.next { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.trust { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 22px 0 0; font: 700 14px var(--label); letter-spacing: .03em; color: var(--lab); }
.sig { margin: 24px 0 6px; display: grid; }
.sig .hand { font: 66px/1 var(--hand); color: #3a2213; filter: url(#ink-h); }
.sig small { font: 700 14px var(--label); letter-spacing: .04em; color: var(--lab); }
.cta { margin-top: 22px; display: grid; gap: 8px; justify-items: start; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 22px; border-radius: 999px; background: #2b1a10; color: var(--paper); text-decoration: none; font: 700 17px var(--ui); letter-spacing: .01em; }
.cta .note { margin: 0; }
.hours-line { margin: 24px 0 0; font-size: 16px; }

/* thumb reach: once the seal is broken, the door stays within reach */
.stick { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 35; min-height: 50px; display: inline-flex; align-items: center; padding: 12px 22px; border-radius: 999px; background: var(--wax); color: #f6e3d3; text-decoration: none; font: 700 17px var(--ui); box-shadow: 0 16px 30px -12px #000; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }

.desk-foot { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); font: 500 14.5px/1.5 var(--label); letter-spacing: .02em; color: var(--deskmuted); }
.hours { margin-top: 6px; background: none; border: 1px solid #4a3b2c; color: var(--deskmuted); border-radius: 999px; padding: 8px 14px; min-height: 40px; font: 500 14.5px var(--label); cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 90; background: #111; color: #eee; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: min(92vw, 420px); transition: opacity .3s, transform .3s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .env-face, .photo .crack { transition: none; } html { scroll-behavior: auto; } }
