/* Mock — by Soundheart Studios. One stylesheet for the landing page and the portal (ADR-18). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/inter-600.woff2") format("woff2"); }

:root {
  /* Brand palette */
  --charcoal: #20221F;
  --canvas: #F7F6F2;
  --terracotta: #CB674D;
  --sage: #DCE6D9;
  --stone: #E9E7E1;
  --muted: #777B73;
  /* Derived */
  --surface: #FFFFFE;
  --terracotta-deep: #A9513A;
  --sage-deep: #4F6B4A;
  --line: var(--stone);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(32, 34, 31, .06), 0 8px 24px rgba(32, 34, 31, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); background: var(--canvas); color: var(--charcoal); }
a { color: var(--charcoal); text-decoration-color: var(--terracotta); text-underline-offset: 3px; }
a:hover { color: var(--terracotta-deep); }
:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; font-weight: 600; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--stone); padding: 1px 6px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Wordmark */
.wordmark { font-weight: 600; font-size: 20px; letter-spacing: -.02em; text-decoration: none; color: var(--charcoal); }
.wordmark span { color: var(--terracotta); }

/* Buttons */
.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 14px/1 var(--font); padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--charcoal); background: var(--charcoal); color: var(--canvas);
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.button:hover, button:hover { background: #343631; color: var(--canvas); }
.button.secondary, button.ghost { background: transparent; color: var(--charcoal); border-color: var(--line); }
.button.secondary:hover, button.ghost:hover { border-color: var(--charcoal); background: transparent; color: var(--charcoal); }
button.danger { background: transparent; color: var(--terracotta-deep); border-color: transparent; }
button.danger:hover { background: #F5E3DD; color: var(--terracotta-deep); }
button.small, .button.small { padding: 6px 10px; font-size: 13px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.button.github::before { content: ""; width: 18px; height: 18px; background: currentColor; mask: url("/static/github.svg") center / contain no-repeat; -webkit-mask: url("/static/github.svg") center / contain no-repeat; }

/* Portal header */
.topbar { background: var(--canvas); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tabs a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--charcoal); background: var(--stone); }
.tabs a[aria-current="page"] { color: var(--charcoal); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.tabs .badge { margin-left: 6px; }
.me { display: flex; align-items: center; gap: 10px; }
.me img { width: 28px; height: 28px; border-radius: 50%; background: var(--stone); }
.me .login { font-weight: 500; }
.me form { margin: 0; }

/* Portal content */
main.portal { padding: 32px 0 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.drop {
  border: 1.5px dashed #CFCBC1; border-radius: var(--radius); padding: 28px 20px; text-align: center;
  background: var(--surface); margin-bottom: 24px; transition: background .15s, border-color .15s;
}
.drop.over { border-color: var(--sage-deep); background: var(--sage); }
.drop strong { font-weight: 600; }
.drop .link { color: var(--terracotta-deep); text-decoration: underline; cursor: pointer; }
.hint { color: var(--muted); min-height: 1.5em; margin: 6px 0 0; font-size: 14px; }
.hint.error { color: var(--terracotta-deep); font-weight: 500; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.list { width: 100%; border-collapse: collapse; }
.list th, .list td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list th { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.list tr.expired { opacity: .5; }
.list .name { font-weight: 600; }
.list .sub { display: block; color: var(--muted); font-size: 13px; }
.list .share a { word-break: break-all; color: var(--charcoal); }
.list .actions { white-space: nowrap; text-align: right; }
.list .actions button { margin: 2px 0 2px 2px; }
.list .owner { display: inline-flex; align-items: center; gap: 8px; }
.list .owner img { width: 22px; height: 22px; border-radius: 50%; background: var(--stone); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--stone); color: var(--charcoal); }
.badge.locked { background: #F5E3DD; color: var(--terracotta-deep); }
.badge.new { background: var(--sage); color: var(--sage-deep); }
.history { background: var(--canvas); }
.history td { padding: 8px 14px 14px; }
.history ul { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 4px 0; }
.empty { color: var(--muted); text-align: center; padding: 48px 16px; }
.portal-foot { margin-top: 32px; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .list thead { display: none; }
  .list, .list tbody, .list tr, .list td { display: block; width: 100%; }
  .list tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .list td { border: 0; padding: 4px 14px; }
  .list td::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .list .actions { text-align: left; white-space: normal; }
  .topbar .wrap { gap: 12px; padding-top: 8px; padding-bottom: 8px; }
  .tabs { order: 3; flex-basis: 100%; }
}

/* Simple centered pages (sign-in, not invited, sign-in failed) */
body.center main { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; width: min(440px, 100%); }
.panel h1 { font-size: 22px; margin: 16px 0 8px; }
.panel p { color: var(--muted); margin: 0 0 16px; }
.panel .button { width: 100%; }
.panel .back { display: inline-block; margin-top: 16px; font-size: 14px; }

/* Forms and dialogs */
.inline-form { display: flex; align-items: center; gap: 10px; padding: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.inline-form label { font-weight: 500; }
input[type="text"], input:not([type]), input[type="password"] {
  font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--canvas); color: var(--charcoal); min-width: 0; flex: 1;
}
input:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 1px; }
dialog { border: 0; padding: 0; color: var(--charcoal); }
dialog::backdrop { background: rgba(32, 34, 31, .35); }
dialog.panel { padding: 28px; width: min(520px, calc(100vw - 32px)); }
dialog h2 { margin: 0 0 6px; font-size: 20px; }
dialog code { display: block; padding: 12px; word-break: break-all; margin: 12px 0 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
select { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--canvas); color: var(--charcoal); flex: 1; min-width: 0; }
.share-dialog .inline-form { padding: 0; margin: 16px 0; }
.sharees { list-style: none; margin: 0 0 16px; padding: 0; }
.sharees li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.sharees li .owner { flex: 1; }
.sharees img { width: 24px; height: 24px; border-radius: 50%; }
.usage { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
meter { width: 160px; height: 8px; }
meter::-webkit-meter-bar { background: var(--stone); border: 0; border-radius: 999px; height: 8px; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value { background: var(--sage-deep); border-radius: 999px; }
meter::-moz-meter-bar { background: var(--sage-deep); border-radius: 999px; }
.owners { padding: 16px 20px; margin-bottom: 20px; }
.owners h2 { font-size: 15px; margin: 0 0 8px; }
.owners ul { list-style: none; margin: 0; padding: 0; columns: 2 220px; }
.owners li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; break-inside: avoid; }

/* ---------- Landing page ---------- */
body.landing { background: var(--canvas); }
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.hero { padding: 40px 0 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--terracotta-deep); }
.hero h1 { font-size: clamp(36px, 5.2vw, 60px); line-height: 1.04; letter-spacing: -.035em; margin: 0 0 20px; }
.lede { font-size: 18px; line-height: 1.6; color: #4A4D47; margin: 0 0 28px; max-width: 34em; }
.cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cta .button { padding: 13px 20px; font-size: 15px; }
.cta-note { color: var(--muted); font-size: 14px; }

.frame { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 2px 4px rgba(32,34,31,.04), 0 24px 60px rgba(32,34,31,.10); overflow: hidden; transform: rotate(.6deg); }
.frame-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--canvas); }
.frame-bar > span { width: 10px; height: 10px; border-radius: 50%; background: var(--stone); }
.frame-bar > span:first-child { background: var(--terracotta); }
.frame-url { margin-left: 10px; flex: 1; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.frame-body { padding: 18px; display: grid; gap: 10px; }
.frame-drop { border: 1.5px dashed var(--sage-deep); background: var(--sage); border-radius: 10px; padding: 14px; font-size: 13px; color: var(--sage-deep); display: flex; align-items: center; gap: 10px; }
.chip { background: var(--surface); color: var(--charcoal); border-radius: 6px; padding: 3px 8px; font-weight: 500; box-shadow: 0 1px 2px rgba(32,34,31,.08); }
.frame-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.frame-row strong { display: block; font-size: 14px; }
.frame-row small { color: var(--muted); font-size: 12px; }
.faces { display: flex; }
.faces i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -6px; display: block; }
.faces .f1 { background: var(--terracotta); }
.faces .f2 { background: var(--sage-deep); }
.faces .f3 { background: var(--charcoal); }

.section-title { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; margin: 0 0 28px; }
.features { padding: 64px 0; border-top: 1px solid var(--line); }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature svg { width: 28px; height: 28px; fill: none; stroke: var(--terracotta); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 16px; margin: 14px 0 6px; }
.feature p { margin: 0; color: #575A54; font-size: 14px; }

.how { padding: 64px 0; background: var(--stone); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.step .num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--charcoal); color: var(--canvas); font-weight: 600; font-size: 14px; }
.step h3 { font-size: 17px; margin: 14px 0 6px; }
.step p { margin: 0; color: #4A4D47; }
.step code { background: var(--canvas); }

.invite { padding: 72px 0; }
.invite-card { background: var(--charcoal); color: var(--canvas); border-radius: 20px; padding: 40px; display: grid; gap: 12px; justify-items: start; }
.invite-card h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); }
.invite-card p { margin: 0 0 8px; color: #CFCDC6; max-width: 36em; }
.invite-card .button { background: var(--canvas); color: var(--charcoal); border-color: var(--canvas); }
.invite-card .button:hover { background: var(--sage); border-color: var(--sage); }

.site-foot { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
.site-foot .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.wordmark.small { font-size: 16px; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .frame { transform: none; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero { padding: 16px 0 48px; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .invite-card { padding: 28px 22px; }
  .cta .button { width: 100%; }
}
