:root {
  --bone: #f7f6f3; --paper: #ffffff; --surface: #fbfbfa;
  --ink: #23211e; --muted: #787774; --line: #eaeaea; --line-2: #c9c4bc;
  --sans: -apple-system, "SF Pro Display", "Helvetica Neue", "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, "Menlo", monospace;
  --green-bg: #edf3ec; --green-fg: #346538;
  --yellow-bg: #fbf3db; --yellow-fg: #956400;
  --red-bg: #fdebec; --red-fg: #9f2f2d;
  --blue-bg: #e1f3fe; --blue-fg: #1f6c9f;
  --gray-bg: #f0efec; --gray-fg: #6b6963;
  --accent: var(--green-fg);
  --accent-tint: #eef3ed;
  /* motion — one curve, few durations (the "premium" tell) */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-press: 120ms; --t-hover: 160ms; --t-enter: 240ms; --t-stage: 320ms;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bone); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; }

.wordmark { font-family: var(--serif); font-size: 2.6rem; letter-spacing: -0.03em; line-height: 1; font-weight: 500; }
.wordmark.sm { font-size: 1.35rem; }
.wordmark .dot { color: var(--green-fg); }

/* ---------- Buttons ---------- */
.btn { font-family: var(--sans); font-size: 0.85rem; font-weight: 500; padding: 0.6rem 1rem; border-radius: 7px; border: 1px solid transparent; cursor: pointer; transition: transform var(--t-press) var(--ease), background var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease); line-height: 1; display: inline-flex; align-items: center; gap: 0.45rem; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: #16150f; color: #fff; }
.btn-primary:hover { background: #322f27; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { padding: 0.42rem 0.7rem; font-size: 0.78rem; }
.btn-lg { padding: 0.8rem 1.3rem; font-size: 0.95rem; }
.btn-danger { color: var(--red-fg); border-color: var(--line); background: transparent; }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red-bg); }
.btn-block { width: 100%; justify-content: center; }
.linkbtn { background: none; border: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; padding: 0; }
.ico { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.6; fill: none; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 25rem; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 2.75rem; }
.auth-sub { color: var(--muted); margin: 0.5rem 0 2rem; font-size: 0.95rem; }
.auth-card form { display: grid; gap: 1rem; }
label { display: grid; gap: 0.35rem; font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
input, select { font-family: var(--sans); font-size: 0.95rem; color: var(--ink); padding: 0.62rem 0.72rem; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); text-transform: none; letter-spacing: 0; }
input:focus, select:focus { outline: none; border-color: var(--ink); }
.auth-error { color: var(--red-fg); background: var(--red-bg); border-radius: 7px; padding: 0.55rem 0.75rem; margin: 0 0 1rem; font-size: 0.85rem; }
.btn-google { justify-content: center; width: 100%; background: var(--paper); color: var(--ink); border: 1px solid var(--line); padding: 0.72rem; font-size: 0.92rem; }
.btn-google:hover { background: var(--surface); }
.gicon { width: 18px; height: 18px; }
.auth-note { font-size: 0.8rem; color: var(--muted); margin: 0.85rem 0 0; text-align: center; }
.auth-divider { text-align: center; border-bottom: 1px solid var(--line); line-height: 0.1em; margin: 1.9rem 0; }
.auth-divider span { background: var(--paper); color: var(--muted); padding: 0 0.7rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.auth-toggle { margin-top: 1.4rem; font-size: 0.85rem; color: var(--muted); text-align: center; }

/* ---------- Topbar + avatar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(247, 246, 243, 0.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 68rem; margin: 0 auto; padding: 0.85rem 1.5rem; display: flex; align-items: center; gap: 1.2rem; }
.brandlink { text-decoration: none; color: inherit; }
.topbar-nav { display: flex; gap: 0.3rem; margin-left: 0.5rem; }
.navlink { font-size: 0.85rem; color: var(--muted); text-decoration: none; padding: 0.4rem 0.6rem; border-radius: 6px; }
.navlink:hover { background: var(--surface); color: var(--ink); }
.navlink.active { color: var(--ink); font-weight: 500; }
.topbar-right { margin-left: auto; position: relative; }
.avatar { width: 34px; height: 34px; border-radius: 999px; background: var(--ink); color: #fff; border: none; cursor: pointer; font-family: var(--sans); font-size: 0.85rem; font-weight: 600; display: grid; place-items: center; }
.avatar img { width: 100%; height: 100%; border-radius: 999px; object-fit: cover; }
.menu { position: absolute; right: 0; top: 44px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem; min-width: 15rem; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08); }
.menu .who { padding: 0.6rem 0.7rem; }
.menu .who .em { font-family: var(--mono); font-size: 0.8rem; }
.menu .who .rl { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.15rem; }
.menu hr { border: none; border-top: 1px solid var(--line); margin: 0.4rem 0; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: none; font: inherit; padding: 0.5rem 0.7rem; border-radius: 7px; cursor: pointer; color: var(--ink); }
.menu button:hover { background: var(--surface); }

/* ---------- Layout ---------- */
.wrap { max-width: 68rem; margin: 0 auto; padding: 3rem 1.5rem 6rem; }
.block { margin-top: 3rem; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.4rem; gap: 1rem; }
.block h2 { font-size: 1.7rem; margin: 0; }
.block-sub { color: var(--muted); font-size: 0.88rem; margin: 0 0 1.4rem; }
.hint { color: var(--muted); font-size: 0.82rem; margin-top: 0.9rem; }

/* ---------- Sites grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 1.5rem; transition: box-shadow var(--t-hover) var(--ease), transform var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease); }
.card:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); transform: translateY(-2px); border-color: var(--line-2); }
.card.justnow { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.card .name { font-family: var(--serif); font-size: 1.3rem; margin: 0 0 0.15rem; }
.card .url { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem; word-break: break-all; }
.card .url:hover { color: var(--blue-fg); }
.card-meta { display: flex; align-items: center; gap: 0.55rem; margin: 0.9rem 0 1.1rem; }
.card-actions { display: flex; gap: 0.4rem; align-items: center; border-top: 1px solid var(--line); padding-top: 1rem; }
.card-actions .spacer { flex: 1; }
.shared-tag { font-size: 0.72rem; color: var(--muted); font-family: var(--mono); }
.iconbtn { background: none; border: 1px solid transparent; border-radius: 7px; padding: 0.4rem; cursor: pointer; color: var(--muted); line-height: 0; }
.iconbtn:hover { background: var(--surface); color: var(--ink); }
.card-tpl { margin-top: 0.7rem; font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 0.4rem; }

/* ---------- Badges ---------- */
.badge { font-size: 0.68rem; letter-spacing: 0.04em; font-weight: 500; padding: 0.22rem 0.55rem 0.22rem 0.45rem; border-radius: 999px; display: inline-flex; align-items: center; gap: 0.35rem; }
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.badge.live { background: var(--green-bg); color: var(--green-fg); }
.badge.building, .badge.queued { background: var(--yellow-bg); color: var(--yellow-fg); }
.badge.building .dot { animation: pulse 1.2s var(--ease) infinite; }
.badge.failed { background: var(--red-bg); color: var(--red-fg); }
.badge.empty, .badge.superseded { background: var(--gray-bg); color: var(--gray-fg); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- Stat line / usage ---------- */
.usewrap { color: var(--muted); font-size: 0.85rem; }

/* ---------- Empty state ---------- */
.empty { text-align: center; max-width: 34rem; margin: 1rem auto 0; padding: 2rem 1rem; }
.empty img { width: 170px; height: 170px; object-fit: contain; mix-blend-mode: multiply; opacity: 0.95; }
.empty h3 { font-size: 1.6rem; margin: 0.5rem 0 0.4rem; }
.empty p { color: var(--muted); margin: 0 auto 1.5rem; max-width: 26rem; }
.steps3 { display: flex; gap: 1.2rem; justify-content: center; margin: 1.2rem 0 1.6rem; flex-wrap: wrap; }
.steps3 .s { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.steps3 .n { width: 22px; height: 22px; border-radius: 999px; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 0.72rem; color: var(--ink); }

/* ---------- Deploy hero (dropzone) ---------- */
.deploy { max-width: 42rem; margin: 0 auto; padding: 4rem 1.5rem; text-align: center; }
.deploy h1 { font-size: 2.6rem; margin: 0 0 0.5rem; }
.deploy .sub { color: var(--muted); font-size: 1rem; margin: 0 auto 2.2rem; max-width: 32rem; }
.dropzone { position: relative; background: var(--paper); border: 2px dashed var(--line-2); border-radius: 16px; padding: 3.5rem 2rem; transition: border-color var(--t-hover) var(--ease), background var(--t-hover) var(--ease), transform var(--t-hover) var(--ease), box-shadow var(--t-hover) var(--ease); cursor: pointer; }
.dropzone:hover { background: var(--surface); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04); }
.dropzone:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.dropzone.dragging { border-style: solid; border-color: var(--accent); background: var(--accent-tint); transform: scale(1.006); }
.dropzone .dzicon { width: 52px; height: 52px; color: var(--muted); margin: 0 auto 1rem; display: block; stroke-width: 1.4; }
.dropzone.dragging .dzicon { color: var(--accent); animation: bob 0.7s var(--ease) 2; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.dropzone .dztitle { font-family: var(--serif); font-size: 1.5rem; }
.dropzone .dzhint { color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; }
.deploy .limits { color: var(--muted); font-size: 0.8rem; margin-top: 1rem; }
.deploy .alt { margin-top: 1.6rem; font-size: 0.9rem; }
body.dragging-file .dropzone { border-color: var(--accent); background: var(--accent-tint); }

/* upload / build progress */
.filechip { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--mono); font-size: 0.82rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.8rem; margin-bottom: 1.2rem; }
.bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; max-width: 26rem; margin: 0 auto; }
.bar > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.25s var(--ease); }
.stage { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0; max-width: 24rem; margin: 0 auto; text-align: left; }
.stage .g { width: 22px; height: 22px; flex: none; display: grid; place-items: center; }
.stage.pending { color: var(--muted); }
.stage.active { color: var(--ink); }
.stage.done { color: var(--ink); }
.ring { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 999px; animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage .check { color: var(--accent); }

/* success */
.success { max-width: 34rem; margin: 0 auto; text-align: center; animation: rise var(--t-enter) var(--ease-back) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.checkmark { width: 68px; height: 68px; margin: 0 auto 1rem; }
.checkmark circle { stroke: var(--accent); stroke-width: 2.5; fill: none; stroke-dasharray: 166; stroke-dashoffset: 166; animation: draw 0.45s var(--ease) forwards; }
.checkmark path { stroke: var(--accent); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw 0.25s var(--ease) 0.38s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success h1 { font-size: 2.2rem; margin: 0 0 1.3rem; }
.urlpill { display: flex; align-items: center; gap: 0.5rem; justify-content: center; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 0.85rem 1rem; font-family: var(--mono); font-size: 1rem; word-break: break-all; margin-bottom: 1.2rem; }
.success-actions { display: flex; gap: 0.6rem; justify-content: center; }
.livebadge { font-size: 0.78rem; color: var(--green-fg); background: var(--green-bg); border-radius: 999px; padding: 0.2rem 0.6rem; display: inline-block; margin-top: 1.2rem; }

/* ---------- Connect page ---------- */
.connect { max-width: 40rem; margin: 0 auto; padding: 3rem 1.5rem 6rem; }
.connect h1 { font-size: 2.2rem; margin: 0 0 0.4rem; }
.connect .lead { color: var(--muted); margin: 0 0 2.2rem; }
.cstep { display: grid; grid-template-columns: 40px 1fr; gap: 1rem; margin-bottom: 1rem; }
.cstep .node { width: 30px; height: 30px; border-radius: 999px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 0.85rem; }
.cstep.done .node { background: var(--accent); }
.cstep .body { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 1.3rem 1.5rem; }
.cstep h3 { font-size: 1.2rem; margin: 0 0 0.35rem; }
.cstep p { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; }
.callout { border-radius: 9px; padding: 0.7rem 0.9rem; font-size: 0.83rem; margin-top: 0.9rem; }
.callout.blue { background: var(--blue-bg); color: var(--blue-fg); }
.callout.yellow { background: var(--yellow-bg); color: var(--yellow-fg); }
.tokenrow { display: flex; gap: 0.5rem; align-items: center; }
.tokenrow input { flex: 1; font-family: var(--mono); font-size: 0.85rem; }
.connected { text-align: center; padding: 2rem 1rem; animation: rise var(--t-enter) var(--ease-back) both; }
.connected img { width: 150px; height: 150px; object-fit: contain; mix-blend-mode: multiply; }
.connected h1 { font-size: 2rem; margin: 0.5rem 0; }

/* ---------- Modal / sheet ---------- */
.modal-root { position: fixed; inset: 0; background: rgba(35, 33, 30, 0.32); display: grid; place-items: center; padding: 1.5rem; z-index: 50; animation: fade 0.15s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; width: 100%; max-width: 30rem; animation: rise var(--t-enter) var(--ease) both; }
.modal.wide { max-width: 34rem; }
.modal h3 { font-size: 1.5rem; margin: 0 0 1.3rem; }
.modal form { display: grid; gap: 1rem; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 0.5rem; }
.secret { font-family: var(--mono); font-size: 0.82rem; background: var(--bone); border: 1px solid var(--line); border-radius: 7px; padding: 0.7rem; word-break: break-all; }
.notice { font-size: 0.82rem; color: var(--yellow-fg); background: var(--yellow-bg); border-radius: 7px; padding: 0.5rem 0.7rem; }

/* choice cards (create flow) */
.choices { display: grid; gap: 0.7rem; }
.choice { display: flex; gap: 0.9rem; align-items: flex-start; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: 1rem 1.1rem; cursor: pointer; transition: border-color var(--t-hover) var(--ease), background var(--t-hover) var(--ease); font: inherit; }
.choice:hover { border-color: var(--line-2); background: var(--surface); }
.choice .ci { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; flex: none; }
.choice .ct { font-weight: 600; }
.choice .cd { color: var(--muted); font-size: 0.85rem; }
.choice.small { padding: 0.7rem 1.1rem; }
.choice.small .ci { display: none; }

/* team rows */
.rows { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.row { background: var(--paper); padding: 0.85rem 1.2rem; display: flex; align-items: center; gap: 1rem; }
.row .em { font-family: var(--mono); font-size: 0.8rem; }
.row .nm { color: var(--muted); font-size: 0.82rem; }
.row .r { margin-left: auto; }

/* accordion */
.acc { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.acc summary { padding: 1.1rem 1.3rem; cursor: pointer; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 0.6rem; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .chev { margin-left: auto; transition: transform var(--t-hover) var(--ease); }
.acc[open] summary .chev { transform: rotate(90deg); }
.acc .accbody { padding: 0 1.3rem 1.3rem; }

/* toast */
.toasts { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 0.5rem; }
.toast { background: var(--ink); color: #fff; border-radius: 10px; padding: 0.75rem 1rem; font-size: 0.88rem; display: flex; align-items: center; gap: 0.8rem; animation: rise var(--t-enter) var(--ease) both; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15); }
.toast a, .toast button { color: #fff; }

/* skeleton */
.sk { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 1.5rem; }
.sk .l { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 25%, var(--surface) 37%, var(--line) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease-in-out infinite; margin-bottom: 0.7rem; }

@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* reveal */
.reveal { opacity: 0; transform: translateY(12px); }
.reveal.in { opacity: 1; transform: none; transition: opacity var(--t-enter) var(--ease), transform var(--t-enter) var(--ease); }

@media (prefers-reduced-motion: reduce) { * { animation-duration: 1ms !important; transition-duration: 1ms !important; } .reveal { opacity: 1; transform: none; } }
@media (max-width: 680px) { .grid { grid-template-columns: 1fr; } .topbar-in, .wrap { padding-left: 1rem; padding-right: 1rem; } .deploy h1 { font-size: 2rem; } }
