/* DRIPYARD landing. Default = the static page (no WebGL2, reduced motion, no JS).
   html.has-3d = one WebGL canvas; the words are printed in the yard, HTML keeps the navbar, the gate prompt,
   the depth meter and the closing plate. Self-contained: design tokens from BRIEF.md. */
:root {
  --bg: #F3F1EC; --paper: #FAF9F6; --ink: #1E1D1A; --ink-2: #55524B; --line: #D9D5CC; --steel: #8D8A82;
  --brass: #A8915F; --drip: #12B886; --drip-ink: #0B7A59; --warn: #C2410C;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --r: 14px; --nav-h: 58px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 1px 2px rgba(30, 29, 26, .06), 0 10px 30px -12px rgba(30, 29, 26, .18);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: inherit; }
button { font: inherit; color: inherit; }
kbd { font: 600 .85em/1 var(--sans); padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
:focus-visible { outline: 2px solid var(--drip-ink); outline-offset: 3px; }
.dy-skiplink { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 999px; text-decoration: none; font-weight: 600; }
.dy-skiplink:focus { top: 10px; }

/* ── navbar ─────────────────────────────────────────────── */
.dy-nav { position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 40; display: flex; align-items: center; gap: 26px;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(243, 241, 236, .94), rgba(243, 241, 236, .7) 70%, rgba(243, 241, 236, 0)); }
.dy-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font: 650 19px/1 var(--display); letter-spacing: .09em; color: var(--ink); font-variation-settings: "opsz" 72; }
.dy-mark { width: 24px; height: 24px; flex: none; }
.dy-links { display: flex; gap: 22px; }
.dy-links a { text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 6px 0; }
.dy-links a:hover { color: var(--ink); }
.dy-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.dy-ic { display: inline-grid; place-items: center; width: 36px; height: 36px; color: var(--ink-2); background: none; border: 0; border-radius: 999px; cursor: pointer; text-decoration: none; }
.dy-ic svg { width: 17px; height: 17px; }
.dy-ic:hover { color: var(--ink); background: rgba(30, 29, 26, .05); }
.dy-menu { display: none; }
.dy-ca-chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; margin-right: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(250, 249, 246, .8); color: var(--ink-2); cursor: pointer; font-size: 13px; font-weight: 500; }
.dy-ca-chip .lbl { font-weight: 700; font-size: 11px; letter-spacing: .12em; color: var(--ink); }
.dy-ca-chip svg { width: 14px; height: 14px; }
.dy-ca-chip:hover { border-color: var(--steel); color: var(--ink); }
.dy-buy { display: inline-flex; align-items: center; height: 34px; padding: 0 16px; margin-right: 6px; border-radius: 999px; background: var(--drip); color: #fff; text-decoration: none; font-weight: 700; font-size: 13px; white-space: nowrap; }
.dy-buy:hover { background: var(--drip-ink); }
@media (max-width: 860px) {
  .dy-nav { gap: 12px; padding: 0 8px 0 14px; }
  .dy-menu { display: inline-grid; }
  .dy-links { display: none; position: absolute; top: calc(var(--nav-h) - 6px); right: 10px; flex-direction: column; gap: 0; min-width: 190px; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
  .dy-links.open { display: flex; }
  .dy-links a { padding: 10px 12px; border-radius: 9px; font-size: 15px; }
  .dy-links a:hover { background: var(--bg); }
  .dy-ca-chip .addr { display: none; }
  .dy-ca-chip { padding: 0 10px; margin-right: 0; }
  .dy-buy-x { display: none; }
}
@media (max-width: 400px) {
  .dy-brand span { font-size: 17px; letter-spacing: .06em; }
  .dy-right { gap: 2px; }
  .dy-ic { width: 32px; }
  .dy-buy { padding: 0 13px; margin-right: 2px; }
}

/* ── shared bits ────────────────────────────────────────── */
.kick { margin: 0 0 10px; font: 700 11px/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--steel); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; text-decoration: none; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn-drip { background: var(--drip); color: #fff; }
.btn-drip:hover { background: var(--drip-ink); }
.btn-line { border-color: var(--line); background: var(--paper); color: var(--ink); }
.btn-line:hover { border-color: var(--steel); }
.dy-toast { position: fixed; left: 50%; bottom: 26px; z-index: 90; transform: translate(-50%, 20px); opacity: 0; transition: .25s; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); pointer-events: none; }
.dy-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── closing plate ──────────────────────────────────────── */
.dy-plate-in { position: relative; background: var(--paper); border-radius: 18px; padding: 28px 30px 24px; box-shadow: 0 0 0 1px var(--line), 0 0 0 6px #E9E3D6, 0 0 0 7px rgba(168, 145, 95, .55), var(--shadow); }
.dy-plate h2 { margin: 0 0 6px; font: 600 clamp(26px, 3.2vw, 36px)/1.08 var(--display); letter-spacing: -.01em; font-variation-settings: "opsz" 120; }
.dy-plate .sub { margin: 0 0 18px; color: var(--ink-2); font-size: 15px; }
.dy-ca button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: pointer; text-align: left; }
.dy-ca .lbl { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.dy-ca code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 13px/1.3 var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dy-ca .ic { flex: none; display: inline-flex; color: var(--ink-2); }
.dy-ca svg { width: 16px; height: 16px; }
.dy-ca button:hover { border-color: var(--steel); }
.dy-plate-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 18px; }
.dy-launch { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.dy-launch .when { margin: 0; font-size: 13px; color: var(--ink-2); }
.dy-launch .when span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--steel); }
.dy-launch .when b { font-weight: 600; color: var(--ink); }
.dy-cd { display: flex; gap: 6px; }
.dy-cd-c { display: grid; justify-items: center; min-width: 50px; padding: 6px 6px 5px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.dy-cd-c b { font: 600 22px/1 var(--display); font-variant-numeric: tabular-nums lining-nums; }
.dy-cd-c i { font-style: normal; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--steel); margin-top: 3px; }
.dy-cd-note { font-weight: 700; color: var(--drip-ink); }
.dy-social { display: flex; gap: 18px; margin-top: 14px; font-size: 14px; font-weight: 600; }
.dy-social a { text-decoration: none; color: var(--ink-2); }
.dy-social a:hover { color: var(--ink); text-decoration: underline; }
.dy-foot p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }

/* ── static page (default) ──────────────────────────────── */
#yard, .only-3d { display: none; }
html:not(.has-3d) body { padding-top: var(--nav-h); }
.dy-outline { max-width: 760px; margin: 0 auto; padding: 40px 22px 10px; }
.dy-outline:focus { outline: none; }
.st { position: relative; padding: 26px 0 26px 46px; }
.st::before { content: ""; position: absolute; left: 14px; top: 0; bottom: 0; width: 4px; border-radius: 4px; background: linear-gradient(to right, #E7E2D7, #F8F6F1 55%, #E2DCCF); box-shadow: 0 0 0 1px var(--line); }
.st::after { content: ""; position: absolute; left: 9px; top: 32px; width: 14px; height: 18px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--steel); }
.st[data-st="4"]::after, .st[data-st="5"]::after, .st[data-st="6"]::after { background: var(--drip); }
.st h1 { margin: 0 0 12px; font: 650 clamp(38px, 7vw, 66px)/1.02 var(--display); letter-spacing: -.02em; font-variation-settings: "opsz" 144; }
.st h2 { margin: 0 0 6px; font: 600 clamp(24px, 3.4vw, 32px)/1.12 var(--display); letter-spacing: -.01em; font-variation-settings: "opsz" 96; }
.st p { margin: 0 0 8px; color: var(--ink-2); max-width: 56ch; }
.st-hero { padding-top: 18px; }
.st-hero p:not(.kick) { font-size: 18px; }
.st .live { display: inline-flex; gap: 10px; align-items: baseline; padding: 6px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 14px; }
.st .live .lbl { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--steel); }
.st .live [data-live] { font-weight: 700; color: var(--drip-ink); }
.dy-plate { max-width: 760px; margin: 18px auto 0; padding: 0 22px 26px; }
.dy-foot { max-width: 760px; margin: 0 auto; padding: 10px 22px 40px; }

/* ── 3D page ────────────────────────────────────────────── */
html.has-3d body { padding-top: 0; }
html.has-3d #yard { display: block; position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; touch-action: pan-y; }
html.has-3d .only-3d { display: block; }
html.has-3d .dy-track { position: relative; z-index: -1; pointer-events: none; }
html.has-3d.in-gate body { overflow: hidden; }
html.has-3d .dy-outline { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html.has-3d .dy-outline:focus-within { position: absolute !important; }

/* the plate rides over the 3D enamel plaque at the end */
html.has-3d .dy-plate { position: fixed; left: 0; top: 0; z-index: 20; margin: 0; padding: 0; max-width: none; width: min(560px, calc(100vw - 24px)); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .35s, visibility 0s .35s; }
html.has-3d .dy-plate.on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .45s; }
html.has-3d .dy-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; margin: 0; max-width: none; padding: 22px 20px max(12px, env(safe-area-inset-bottom)); text-align: center; background: linear-gradient(to bottom, rgba(243, 241, 236, 0), rgba(243, 241, 236, .92) 40%); opacity: 0; visibility: hidden; transition: opacity .35s, visibility 0s .35s; }
html.has-3d .dy-foot.on { opacity: 1; visibility: visible; transition: opacity .45s; }
html.has-3d .dy-foot p { max-width: 760px; margin: 0 auto; font-size: 12px; }

/* loader veil */
html.has-3d .dy-load { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--bg); transition: opacity .7s .1s, visibility 0s .8s; }
html.has-3d.ready .dy-load { opacity: 0; visibility: hidden; }
.dy-load-drop { width: 22px; height: 30px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: var(--drip); transform: rotate(0deg); animation: dy-bob 1.4s ease-in-out infinite; }
.dy-load i { position: absolute; left: 50%; top: calc(50% + 34px); width: 120px; height: 2px; margin-left: -60px; border-radius: 2px; background: var(--line); overflow: hidden; }
.dy-load i::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(var(--p, .05)); transition: transform .3s; }
@keyframes dy-bob { 50% { transform: translateY(6px) scale(.96, 1.04); } }

/* gate */
html.has-3d .dy-gate { display: none; }
html.has-3d.in-gate .dy-gate { display: block; position: fixed; inset: 0; z-index: 30; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
html.has-3d.in-gate .dy-gate.grab { cursor: grabbing; }
.dy-ring { position: absolute; left: 0; top: 0; width: 200px; height: 200px; pointer-events: none; overflow: visible; }
.dy-ring .trk { fill: none; stroke: rgba(30, 29, 26, .12); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.dy-ring .val { fill: none; stroke: var(--drip); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transform: rotate(-90deg); transform-origin: 100px 100px; }
.dy-gate-copy { position: absolute; left: 50%; bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px)); transform: translateX(-50%); text-align: center; width: min(92vw, 460px); padding: 16px 18px 14px; border-radius: 22px; background: radial-gradient(closest-side, rgba(243, 241, 236, .94), rgba(243, 241, 236, .82) 70%, rgba(243, 241, 236, 0)); pointer-events: none; }
.dy-gate-title { margin: 0; font: 600 26px/1.1 var(--display); font-variation-settings: "opsz" 96; }
.dy-gate-how { margin: 6px 0 12px; font-size: 14px; color: var(--ink-2); }
.dy-skip { pointer-events: auto; min-height: 40px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: rgba(250, 249, 246, .85); font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.dy-skip:hover { color: var(--ink); border-color: var(--steel); }
.dy-turn { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; }
.dy-gate.touched .dy-gate-how { opacity: .55; }
@media (pointer: coarse) { .kbd-hint { display: none; } }
@media (max-width: 599px) {
  html.has-3d.in-gate .dy-gate-copy { bottom: auto; display: flex; align-items: center; justify-content: center; gap: 12px; width: auto; padding: 6px 6px 6px 16px; border-radius: 999px; background: rgba(250, 249, 246, .9); box-shadow: 0 0 0 1px var(--line); white-space: nowrap; }
  .dy-gate-title { font-size: 19px; }
  .dy-gate-how { display: none; }
  .dy-skip { min-height: 34px; padding: 0 14px; }
}

/* hero dock: CA + Buy + countdown */
.dy-herocta-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 10px; }
.dy-herocta-in .dy-ca button { padding: 0 14px; min-height: 44px; background: var(--paper); }
.dy-herocta-in .btn-drip { min-height: 44px; padding: 0 22px; }
.dy-cd-mini { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: var(--ink-2); text-align: center; }
.dy-cd-mini b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.dy-cd-mini:empty { display: none; }
.dy-herocta-static { max-width: 560px; margin-top: 18px; }
.dy-herocta-static .dy-cd-mini { text-align: left; }
html.has-3d .dy-herocta { position: fixed; left: 50%; bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px)); z-index: 35; width: min(520px, calc(100vw - 24px)); transform: translate(-50%, 0); opacity: 0; visibility: hidden; transition: opacity .35s, transform .35s, visibility 0s .35s; }
html.has-3d .dy-herocta.show, html.has-3d.in-gate .dy-herocta { opacity: 1; visibility: visible; transition: opacity .45s, transform .45s; }
html.has-3d .dy-herocta .dy-herocta-in { padding: 10px; border-radius: 20px; background: rgba(250, 249, 246, .9); box-shadow: 0 0 0 1px var(--line), var(--shadow); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
/* in the gate the dock sits at the bottom and the faucet prompt moves up above it */
html.has-3d.in-gate .dy-gate-copy { bottom: calc(max(18px, env(safe-area-inset-bottom) + 10px) + 112px); }
html.has-3d.ready:not(.in-gate) .dy-herocta:not(.show) { transform: translate(-50%, 12px); }
@media (max-width: 520px) {
  .dy-herocta-in .btn-drip { padding: 0 16px; }
  .dy-herocta-in .dy-ca code { font-size: 12px; }
}

/* depth meter */
html.has-3d .dy-depth { position: fixed; right: max(14px, env(safe-area-inset-right)); top: 50%; z-index: 15; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; transition: opacity .4s; }
html.in-gate .dy-depth, html.at-end .dy-depth { opacity: 0; }
.dy-depth-tube { position: relative; width: 10px; height: min(46vh, 380px); border-radius: 10px; background: linear-gradient(to right, rgba(255, 255, 255, .9), rgba(250, 249, 246, .55) 50%, rgba(217, 213, 204, .8)); box-shadow: 0 0 0 1px var(--line), inset 0 1px 2px rgba(30, 29, 26, .08); overflow: hidden; }
.dy-depth-tube .fill { position: absolute; left: 2px; right: 2px; top: 2px; height: calc((100% - 4px) * var(--d, 0)); border-radius: 6px; background: var(--drip); }
.dy-depth-tube .tick { position: absolute; left: 0; width: 4px; height: 1px; top: calc(2px + (100% - 4px) * var(--t) / 7); background: rgba(30, 29, 26, .35); }
.dy-depth-read { margin: 0; display: flex; flex-direction: column; align-items: center; font-size: 11px; line-height: 1.1; color: var(--ink-2); }
.dy-depth-read b { font: 600 15px/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums lining-nums; }
@media (max-width: 600px) { .dy-depth-tube { height: 30vh; width: 8px; } html.has-3d .dy-depth { right: 8px; } }

/* scroll hint */
html.has-3d .dy-hint { position: fixed; left: 50%; bottom: 150px; z-index: 15; margin: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; color: var(--ink-2); opacity: 0; transition: opacity .5s; pointer-events: none; }
.dy-hint.show { opacity: 1 !important; }
.dy-hint i { width: 1px; height: 26px; background: linear-gradient(var(--ink-2), transparent); animation: dy-hint 1.6s ease-in-out infinite; }
@keyframes dy-hint { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

@media (max-width: 520px) {
  .dy-plate-in { padding: 22px 18px 18px; }
  .dy-plate-row .btn { flex: 1 1 auto; padding: 0 14px; }
  .dy-plate-row .btn-drip { flex-basis: 100%; }
  .dy-cd-c { min-width: 44px; }
  .dy-cd-c b { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
