/* PRATA, the Orquestra visual language: white paper, near-black ink, chrome metal on the
   main action, glass on the panels. Helvetica speaks, Silkscreen annotates. */
@font-face {
  font-family: 'Silkscreen'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/silkscreen-latin.woff2) format('woff2');
}
:root {
  --paper: #ffffff; --paper-2: #f4f4f5; --card: #ffffff;
  --ink: #0a0a0a; --ink-2: #45464a; --mist: #8a8b8f; --line: #e6e6e8;
  --on-ink: #ffffff; --ink-hover: #2a2a2a;
  --signal: #2ad26b; --signal-ink: #1d8a47; --alert: #ff4d3d;
  --glass-bg: rgba(255,255,255,.55); --glass-rim: rgba(255,255,255,.6);
  --r-xs: 8px; --r-sm: 14px; --r-md: 24px; --r-lg: 32px; --r-pill: 999px;
  --shadow-1: 0 2px 6px rgba(20,20,30,.06); --shadow-2: 0 18px 50px rgba(20,20,30,.12);
  --glow-1: rgba(160,168,182,.55); --glow-2: rgba(196,203,214,.6);
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif; --font-px: 'Silkscreen', ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000000; --paper-2: #161618; --card: #0b0b0c;
    --ink: #f5f5f6; --ink-2: #b3b5ba; --mist: #7e8086; --line: #1f2023;
    --on-ink: #111111; --ink-hover: #dcdad5; --signal-ink: #2ad26b;
    --glass-bg: rgba(24,25,29,.6); --glass-rim: rgba(255,255,255,.14);
    --shadow-1: 0 2px 6px rgba(0,0,0,.4); --shadow-2: 0 18px 50px rgba(0,0,0,.45);
    --glow-1: rgba(110,118,132,.35); --glow-2: rgba(80,86,98,.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; line-height: 1.45; min-height: 100dvh; overflow-x: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }

/* light glows behind everything */
.canvas { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.canvas i { position: absolute; border-radius: 50%; filter: blur(80px); }
.canvas i:nth-child(1) { width: 60vmax; height: 60vmax; left: -20vmax; top: -25vmax; background: var(--glow-1); }
.canvas i:nth-child(2) { width: 50vmax; height: 50vmax; right: -18vmax; top: 30vh; background: var(--glow-2); }
.canvas i:nth-child(3) { width: 40vmax; height: 40vmax; left: 20vw; bottom: -25vmax; background: var(--glow-1); opacity: .6; }

.px { font-family: var(--font-px); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.mist { color: var(--mist); }
.ink2 { color: var(--ink-2); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 620px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; padding: 12px 0; }
.top .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; --r: var(--r-pill); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand .star { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); }
.brand small { font-weight: 400; }

/* materials */
.glass { position: relative; isolation: isolate; border-radius: var(--r, var(--r-md)); background: var(--glass-bg); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); box-shadow: var(--shadow-2), var(--shadow-1), inset 0 0 0 1px var(--glass-rim); }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; box-shadow: var(--shadow-1); }
.chrome-text { background: linear-gradient(180deg,#fff 0%,#d7dade 22%,#6b6f78 46%,#1a1b1f 50%,#9aa0aa 60%,#f4f5f7 78%,#8d929c 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (prefers-color-scheme: light) { .chrome-text { background: linear-gradient(180deg,#5b5f67 0%,#1a1b1f 45%,#0a0a0a 55%,#6b6f78 100%); -webkit-background-clip: text; background-clip: text; } }

/* buttons */
.btn { font-size: 14px; font-weight: 500; padding: 12px 22px; min-height: 44px; border-radius: var(--r-pill); border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; text-decoration: none; white-space: nowrap; transition: transform .15s, filter .15s, background .15s; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.ink { background: var(--ink); color: var(--on-ink); } .btn.ink:hover { background: var(--ink-hover); }
.btn.chrome { color: #111; border: 1px solid #8a8f98; background: linear-gradient(180deg,#fff 0%,#e4e6ea 40%,#b9bdc4 52%,#eceef1 100%); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 2px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.12); }
.btn.chrome:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn.danger { background: transparent; color: var(--alert); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--alert) 40%, transparent); }
.btn.sm { padding: 7px 13px; min-height: 34px; font-size: 13px; } .btn.lg { padding: 16px 28px; font-size: 16px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--mist); }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }

/* forms */
label.f { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.input, textarea.input, select.input { width: 100%; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); font-size: 16px; color: var(--ink); min-height: 46px; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--ink); }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }

/* hero */
.hero { padding-top: 56px; padding-bottom: 28px; text-align: center; }
.hero h1 { font-size: clamp(40px, 8vw, 76px); line-height: .98; letter-spacing: -.04em; font-weight: 600; }
.hero p.lead { margin: 18px auto 0; max-width: 520px; font-size: 18px; color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--glass-bg); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 25%, transparent); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 40px 0; }
.step h3 { font-size: 17px; margin: 10px 0 4px; letter-spacing: -.01em; }
.step p { font-size: 14px; color: var(--ink-2); }
.step .n { font-family: var(--font-px); font-size: 12px; color: var(--mist); }

.panel { padding: 24px; }
.panel h2 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 4px; }
.section { margin-top: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 20px; letter-spacing: -.02em; }

/* group header */
.ghead { padding-top: 28px; padding-bottom: 8px; }
.ghead h1 { font-size: clamp(30px, 6vw, 48px); letter-spacing: -.035em; line-height: 1.02; font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.note { margin-top: 14px; color: var(--ink-2); white-space: pre-wrap; }

/* lists */
.list { display: grid; gap: 8px; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; color: #111; background: linear-gradient(180deg,#fff 0%,#e4e6ea 40%,#b9bdc4 52%,#eceef1 100%); box-shadow: inset 0 0 0 1px #9aa0a9; }
.person .who { flex: 1; min-width: 0; }
.person .who b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .who span { font-size: 12px; }
.person .acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-family: var(--font-px); font-size: 10px; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--paper-2); color: var(--ink-2); }
.badge.ok { color: var(--signal-ink); background: color-mix(in srgb, var(--signal) 14%, transparent); }
.names { display: flex; flex-wrap: wrap; gap: 6px; }
.names span { padding: 6px 11px; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: 14px; background: var(--card); }
.rule { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); font-size: 14px; }

.copybox { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); }
.copybox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.callout { padding: 14px 16px; border-radius: var(--r-sm); background: var(--paper-2); font-size: 14px; color: var(--ink-2); }
.callout.warn { background: color-mix(in srgb, #ffb020 14%, var(--card)); color: var(--ink); }

/* reveal */
.gift { position: relative; margin: 10px auto 0; width: 190px; height: 190px; cursor: pointer; border: 0; background: none; display: block; }
.gift .box { position: absolute; left: 15px; right: 15px; bottom: 0; height: 120px; border-radius: 18px; background: repeating-linear-gradient(90deg, rgba(255,255,255,0) 0 1px, rgba(255,255,255,.16) 1px 2px, rgba(0,0,0,.05) 2px 3px, rgba(255,255,255,0) 3px 5px), linear-gradient(180deg,#f1f2f4 0%,#cfd2d6 18%,#b9bcc2 45%,#d8dadd 60%,#a9adb3 100%); box-shadow: var(--shadow-2), inset 0 0 0 1px #9aa0a9; }
.gift .lid { position: absolute; left: 5px; right: 5px; top: 40px; height: 40px; border-radius: 14px; background: linear-gradient(180deg,#fdfdfe 0%,#eceef1 18%,#cdd1d7 36%,#9aa0a9 45%,#2c2f34 49.5%,#1c1e22 53%,#3d4148 62%,#60656d 76%,#9ba1aa 90%,#d3d7dc 100%); box-shadow: var(--shadow-1); transition: transform .6s cubic-bezier(.34,1.56,.64,1); transform-origin: 20% 100%; }
.gift .ribbon { position: absolute; left: 50%; width: 22px; margin-left: -11px; top: 40px; bottom: 0; background: var(--ink); opacity: .9; border-radius: 4px; }
.gift:hover .lid { transform: translateY(-6px) rotate(-4deg); }
.gift.open .lid { transform: translate(-30px, -70px) rotate(-28deg); opacity: 0; transition: transform .7s, opacity .7s .2s; }
@keyframes wiggle { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-3deg) } 75% { transform: rotate(3deg) } }
.gift:not(.open) { animation: wiggle 2.6s ease-in-out infinite; }
.result { text-align: center; padding: 10px 0 6px; }
.result .name { font-size: clamp(40px, 10vw, 68px); font-weight: 600; letter-spacing: -.04em; line-height: 1.02; margin: 8px 0 4px; word-break: break-word; }
@keyframes pop { 0% { opacity: 0; transform: scale(.9) } 60% { opacity: 1; transform: scale(1.03) } 100% { opacity: 1; transform: none } }
.pop { animation: pop .5s cubic-bezier(.22,1,.36,1) both; }
.wish { margin-top: 16px; text-align: left; padding: 16px; border-radius: var(--r-sm); background: var(--paper-2); white-space: pre-wrap; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; padding: 12px 18px; border-radius: var(--r-pill); background: var(--ink); color: var(--on-ink); font-size: 14px; z-index: 60; transition: all .25s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--alert); color: #fff; }

footer { padding: 40px 0 calc(30px + env(safe-area-inset-bottom)); text-align: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg) } }

.mygroups a { display: flex; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); text-decoration: none; background: var(--card); }
.mygroups a:hover { border-color: var(--ink); }

@media (max-width: 680px) {
  .wrap { padding: 0 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; margin: 28px 0; }
  .hero { padding-top: 36px; padding-bottom: 16px; }
  .panel { padding: 18px; }
  .person { flex-wrap: wrap; }
  .person .acts { width: 100%; justify-content: flex-start; padding-left: 48px; }
  .brand small { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
