/* Tertom Launch: follows the apex homepage's light look (site/homepage). */
:root {
  --page: #ffffff;
  --page-soft: #f6f7f4;
  --ink: #161817;
  --muted: #666b67;
  --line: #d9dcd7;
  --line-strong: #b8bdb7;
  --accent: #173f35;
  --accent-soft: #e9f0ed;
  --success: #197a4b;
  --warn: #9a6a12;
  --warn-soft: #fbf3e2;
  --danger: #a3312b;
  --danger-soft: #fbeceb;
  --brand-ingot: #e0a62c;
  --shadow: 0 18px 50px rgba(22, 24, 23, 0.08);
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.container {
  width: min(var(--max-width), calc(100% - 44px));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 76px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.site-header nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img { width: 52px; height: 52px; object-fit: contain; }

.nav-links { display: flex; align-items: center; gap: 6px; }

.nav-links a,
.nav-links button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.nav-links a:hover { border-color: var(--line); background: var(--page-soft); color: var(--ink); }
.nav-links .nav-cta { border-color: var(--ink); border-radius: 2px; background: var(--ink); color: #fff; }
.nav-links .nav-cta:hover { background: var(--accent); border-color: var(--accent); }

/* Shared type */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 6.4vw, 80px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
}

.rule { display: block; width: 92px; height: 4px; margin-top: 26px; background: var(--ink); }

.lede {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.7;
}

.lede strong { color: var(--ink); }

/* Guest view */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 64px;
  align-items: start;
  padding: 64px 0 90px;
}

.tiers {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 40px;
}

.tier {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--page);
}

.tier-lite { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--brand-ingot); }

.tier-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tier h2 { margin: 0; font-family: Georgia, serif; font-size: 28px; font-weight: 500; letter-spacing: -0.03em; }
.tier-pitch { margin: 6px 0 14px; font-weight: 700; font-size: 14px; }
.tier ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.75; }

.tag {
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.tag-open { border-color: var(--success); color: var(--success); background: var(--accent-soft); }

/* A light mention of Pro under the Lite card (D12: Pro is the owner's only, for now). */
.pro-tease {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 16px;
  border-left: 2px solid var(--line-strong);
  background: var(--page-soft);
}

.pro-tease p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.pro-tease strong { color: var(--ink); }

/* Auth panel */
.auth-panel {
  position: sticky;
  top: 100px;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #fff;
  box-shadow: var(--shadow);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  padding: 0 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
}

.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.auth-form, .card { display: grid; gap: 16px; }

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.hint { color: var(--muted); font-weight: 500; }

input:not([type="checkbox"]) {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

label.check {
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
}

label.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); }

.form-error { margin: 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.form-error:empty { display: none; }

.form-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--page-soft);
  color: var(--muted);
  font-size: 13px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font: inherit;
  font-size: 14px;
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: 0.55; cursor: progress; }
.button-primary { background: var(--ink); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.button-secondary { background: #fff; color: var(--ink); }
.button-secondary:hover:not(:disabled) { background: var(--page-soft); }
.button-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.button-danger:hover:not(:disabled) { background: var(--danger-soft); }

/* Profile view */
.profile { padding: 56px 0 90px; }

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

.profile-head h1 { font-size: clamp(38px, 5.4vw, 64px); overflow-wrap: anywhere; }

.status-badge {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-badge.is-active { color: var(--success); background: var(--accent-soft); }
.status-badge.is-pending { color: var(--warn); background: var(--warn-soft); }

.section-label {
  margin: 44px 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.app-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
}

.app-card img { width: 48px; height: 48px; object-fit: contain; }
.app-card h3 { margin: 0 0 4px; font-size: 17px; }
.app-card p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.app-card .button { min-height: 40px; padding: 0 14px; font-size: 13px; }

.app-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 750;
}

.app-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.app-state.is-ready { color: var(--success); }
.app-state.is-waiting { color: var(--warn); }
.app-state.is-off { color: var(--muted); }

.app-card-soon { border-style: dashed; background: var(--page-soft); }

.settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
}

.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
}

.card h3 { margin: 0; font-size: 16px; }
.card-copy { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.card-danger { border-color: #e6c3c0; }

.key-intro { max-width: 680px; margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.key-status { margin: 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.key-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.key-actions .button { flex: 1 1 100px; }

dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.loading { padding: 80px 0; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 44px; }
  .auth-panel { position: static; }
}

@media (max-width: 620px) {
  .container { width: calc(100% - 32px); }
  .site-header { height: 64px; }
  .brand { font-size: 14px; gap: 8px; }
  .brand img { width: 40px; height: 40px; }
  .nav-links a[href="/docs/"] { display: none; }
  .nav-links a, .nav-links button { padding: 0 10px; font-size: 13px; }
  .auth-panel { padding: 22px 18px; }
  .profile-head { flex-direction: column; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
