:root { --bg:#ece8df; --paper:#f7f4ee; --line:#2a2a2e; --dim:rgba(42,42,46,.38); --accent:#b8492f; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  color: var(--line); background-color: var(--bg);
  background-image:
    linear-gradient(rgba(42,42,46,.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42,42,46,.10) 1px, transparent 1px),
    linear-gradient(rgba(42,42,46,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42,42,46,.05) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  display: grid; place-items: center;
}
.sheet-label { position: fixed; top: 12px; font-size: 11px; letter-spacing: .12em; color: var(--dim); z-index: 1; }
.top-left { left: 16px; } .top-right { right: 16px; }
main { position: relative; z-index: 2; padding: 16px; width: 100%; display: grid; place-items: center; margin-bottom: 18vh; }
.card {
  background: var(--paper); border: 2px solid var(--line); padding: 28px 24px 32px;
  max-width: 460px; width: 100%; text-align: center; position: relative;
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px var(--dim), 0 18px 40px rgba(42,42,46,.15);
  animation: rise .8s ease-out both;
}
.hidden { display: none; }
.tag { font-size: 11px; letter-spacing: .15em; color: var(--accent); margin-bottom: 14px; }
h1 { font-size: clamp(1.35rem, 5.5vw, 1.8rem); margin: 0 0 26px; font-weight: 600; letter-spacing: .02em; }
.buttons { display: flex; gap: 18px; justify-content: center; align-items: center; min-height: 56px; }
.btn {
  font: inherit; font-weight: 700; font-size: 1rem; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; padding: 14px 30px; border: 2px solid var(--line); background: transparent; color: var(--line);
  transition: transform .15s, background .15s, color .15s;
}
.yes { background: var(--accent); border-color: var(--accent); color: #fff; }
.yes:hover { transform: scale(1.07); }
.no.dodging { position: fixed; z-index: 10; transition: left .18s ease-out, top .18s ease-out; }
form { display: grid; gap: 16px; }
label { display: grid; gap: 6px; text-align: left; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
input { font: inherit; padding: 12px; background: #fff; color: var(--line); border: 1px solid var(--line); color-scheme: light; }

/* bridge */
#bridge { position: fixed; left: 0; bottom: 0; width: 100%; height: min(42vh, 320px); pointer-events: none; z-index: 1; }
#bridge .line { fill: none; stroke: var(--line); stroke-width: 2; }
#bridge .thin { stroke-width: 1; stroke: var(--dim); }
#bridge .cable path { stroke-width: 3; }
#bridge .deck path { stroke: var(--accent); stroke-width: 6; }
#bridge .draw path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s ease-out var(--d, 0s) forwards; }
#bridge .gap path { animation: none; stroke-dashoffset: 1; }
body.connected #bridge .gap path { animation: draw 1.2s ease-out forwards; }
#bridge .hanger { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .8s ease-out forwards; }
.water path { fill: none; stroke: var(--dim); stroke-width: 1.5; animation: sway 4s ease-in-out infinite alternate; }
.water path + path { animation-duration: 5.5s; animation-direction: alternate-reverse; opacity: .6; }
.heart { opacity: 0; }
body.connected .heart { animation: cross 4s ease-in-out 1.2s forwards; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes sway { from { transform: translateX(-20px); } to { transform: translateX(20px); } }
@keyframes cross { 0% { opacity: 1; transform: translateX(0); } 100% { opacity: 1; transform: translateX(1260px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; animation-delay: 0s !important; } }
