/* Unischool — uni.school
 *
 * Palette and type are lifted from the app (lib/core/theme/palette.dart, app_text.dart) so
 * the site and the product read as one thing: the same Bricolage/Jakarta/DM Mono stack, the
 * same warm paper ground, the same blue → purple header gradient.
 */

:root {
  --ink: #16171d;
  --blue: #2e44ff;
  --blue-deep: #1b2cc4;
  --blue-light: #5b6bff;
  --lime: #cbf23a;
  --coral: #ff5a3c;
  --coral-ink: #ce3b1b;
  --purple: #7a5cff;
  --amber: #ffc53d;
  --green: #12b886;

  --page: #f3f1ea;
  --page-alt: #eceae1;
  --card: #ffffff;
  --border: #e2dfd4;

  --fg: var(--ink);
  --fg-2: #4a4c57;
  --fg-3: #7c7e8a;

  --display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --ui: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius: 18px;
  --pill: 999px;
  --wrap: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --page: #0f1017;
    --page-alt: #181a23;
    --card: #181a23;
    --border: #2a2c36;
    --fg: #f4f4f7;
    --fg-2: #b9bac4;
    --fg-3: #8a8c98;
    --blue: #5b6bff;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--fg);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

/* --- type ---------------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 14px;
}

.lead { font-size: 1.1rem; color: var(--fg-2); max-width: 34rem; }

/* --- header -------------------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand .mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2b41f5, #5638cf);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--pill);
  font-family: var(--ui);
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--lime); color: #16171d; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-sm { padding: 10px 16px; font-size: 0.85rem; }
.btn-danger { background: var(--coral); color: #fff; }
.btn-danger:disabled {
  background: var(--page-alt);
  color: var(--fg-3);
  border-color: var(--border);
  cursor: default;
  transform: none;
}

.btn.is-pending {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.btn-store {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 11px 20px;
  text-align: left;
}
.btn-store .small {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
  font-weight: 400;
}
.btn-store .big { font-size: 0.95rem; font-weight: 800; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* --- hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #2b41f5 0%, #3a38e0 45%, #5638cf 100%);
  color: #fff;
  padding: clamp(56px, 10vw, 104px) 0 clamp(64px, 10vw, 112px);
}

.hero::after {
  /* A soft lime bloom, echoing the app's GradientBlob stage. */
  content: '';
  position: absolute;
  right: -10%;
  top: -30%;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(203, 242, 58, 0.28), transparent 62%);
  pointer-events: none;
}

.hero .wrap { position: relative; z-index: 1; }
.hero h1 { color: #fff; }
.hero .accent { color: var(--lime); }
.hero .lead { color: rgba(255, 255, 255, 0.86); margin-top: 20px; }
.hero .eyebrow { color: rgba(255, 255, 255, 0.6); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }

.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-note {
  margin-top: 18px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

/* --- sections ------------------------------------------------------------ */

section { padding: clamp(56px, 8vw, 88px) 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card .glyph {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 14px;
  display: block;
}

.card p { color: var(--fg-2); margin: 8px 0 0; font-size: 0.95rem; }

.rule { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* --- invite (join) page -------------------------------------------------- */

.invite {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2b41f5 0%, #3a38e0 45%, #5638cf 100%);
  color: #fff;
  padding: 40px 24px;
  text-align: center;
}

.invite-card { width: 100%; max-width: 27rem; }

.invite h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); color: #fff; }

.code-plate {
  display: inline-block;
  margin: 22px 0 10px;
  padding: 14px 26px;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  cursor: pointer;
}

.code-plate .label {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.code-plate .value {
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.1rem;
  letter-spacing: 0.08em;
  color: var(--lime);
  line-height: 1.2;
}

.invite .status { color: rgba(255, 255, 255, 0.82); min-height: 1.5rem; margin: 6px 0 0; }
.invite .cta-row { justify-content: center; }
.invite .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.32); }
.invite .hint { margin-top: 26px; font-size: 0.82rem; color: rgba(255, 255, 255, 0.6); }

.copied {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime);
}

/* --- footer -------------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--border);
  padding: 36px 0 48px;
  color: var(--fg-3);
  font-size: 0.87rem;
}

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.site-foot a { color: var(--fg-2); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }

@media (max-width: 560px) {
  .cta-row .btn { width: 100%; }
  .btn-store { align-items: center; text-align: center; }
}

/* --- /delete-account ----------------------------------------------------- */

/* The app's own opening: a coloured sky with drifting clouds and a white sheet
   overlapping it. Coral rather than the usual blue, because this page destroys
   something. Tokens, hard-offset buttons and mono eyebrows all come from the app's
   DESIGN_SYSTEM.md so the page reads as the same product. */

.erase {
  --sky: #ce3b1b;
  --sky-lift: #ff5a3c;
  min-height: 100svh;
  background: var(--page);
  display: flex;
  flex-direction: column;
}

.erase-sky {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: 26px 20px 84px;
  background: linear-gradient(158deg, var(--sky-lift) 0%, #e04726 46%, var(--sky) 100%);
  color: #fff;
}

.erase-sky .brand { color: #fff; position: relative; z-index: 2; }
.erase-sky .brand .mark { background: rgba(255, 255, 255, 0.18); }

.erase-sky h1 {
  position: relative;
  z-index: 2;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.85rem, 6.4vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 26px 0 0;
  max-width: 18ch;
}

.erase-sky .eyebrow {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.82);
  margin: 22px 0 0;
}

/* Four soft clouds drifting across, as on the app's sky headers. */
.cloud {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.16);
  filter: blur(1px);
  animation: drift linear infinite;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud::before { width: 54%; height: 150%; left: 12%; top: -62%; }
.cloud::after { width: 38%; height: 118%; right: 14%; top: -44%; }

.cloud-1 { width: 132px; height: 22px; bottom: 26px; left: -22%; animation-duration: 58s; }
.cloud-2 { width: 92px; height: 16px; bottom: 74px; left: -34%; animation-duration: 76s; opacity: 0.66; }
.cloud-3 { width: 168px; height: 26px; bottom: 6px; left: -52%; animation-duration: 67s; opacity: 0.5; }
.cloud-4 { width: 74px; height: 14px; top: 16px; left: -64%; animation-duration: 92s; opacity: 0.38; }

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(190vw); }
}

/* The sheet the sky slides under. */
.erase-sheet {
  position: relative;
  z-index: 2;
  flex: 1;
  margin-top: -44px;
  border-radius: 30px 30px 0 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: clamp(24px, 6vw, 38px) 20px 56px;
}

.erase-card {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
}

.erase-card h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.35rem, 4.6vw, 1.7rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin: 0;
}

.erase-card .lede {
  color: var(--fg-2);
  font-size: 0.97rem;
  line-height: 1.6;
  margin: 10px 0 0;
}

/* What goes, as the app's More rows: a tinted icon tile and a line of text. */
.erase-list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.erase-list li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: 15px;
  background: var(--page);
  border: 1px solid var(--border);
  color: var(--fg-2);
  font-size: 0.93rem;
  line-height: 1.4;
}

.erase-list .tile {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  background: linear-gradient(158deg, #ffcec2, #ffe4de 52%, #fff5f2);
  border: 1px solid rgba(206, 59, 27, 0.18);
}

.erase-note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin: 22px 0 0;
  padding: 13px 15px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--coral) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--coral) 26%, transparent);
  color: var(--fg-2);
  font-size: 0.88rem;
  line-height: 1.5;
}

.erase-note strong { color: var(--fg); }

.erase-card .cta-row { margin: 26px 0 0; }

/* The app's press: a hard shadow that collapses under the finger. */
.btn-hard {
  box-shadow: 0 5px 0 var(--btn-under), 0 14px 28px -10px var(--btn-glow);
}

.btn-hard:hover { transform: translateY(-1px); }

.btn-hard:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--btn-under), 0 6px 14px -10px var(--btn-glow);
}

.btn-danger {
  --btn-under: #a32c12;
  --btn-glow: rgba(206, 59, 27, 0.45);
  background: var(--coral-ink, #ce3b1b);
}

.btn-danger:disabled {
  --btn-under: transparent;
  --btn-glow: transparent;
  background: var(--page-alt);
  color: var(--fg-3);
  border-color: var(--border);
  cursor: default;
  transform: none;
  box-shadow: none;
}

.state-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  margin: 0 0 16px;
  background: linear-gradient(158deg, #c3d5ff, #dde7ff 52%, #f2f6ff);
  border: 1px solid rgba(46, 68, 255, 0.18);
}

.state-icon.is-done {
  background: linear-gradient(158deg, #c6f0e2, #ddf6ee 52%, #f2fcf8);
  border-color: rgba(11, 122, 86, 0.2);
}

.state-icon.is-stale {
  background: linear-gradient(158deg, #ffe3b4, #fff1dc 52%, #fffaf0);
  border-color: rgba(201, 115, 0, 0.2);
}

/* Three dots, as the app's typing indicator. */
.dots { display: inline-flex; gap: 5px; margin: 14px 0 0; }

.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg-3);
  animation: dot 1.2s ease-in-out infinite;
}

.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* --- the confirmation dialog --------------------------------------------- */

.sheet {
  width: min(28rem, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--card);
  color: var(--fg);
  padding: clamp(22px, 5vw, 28px);
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.2);
}

.sheet::backdrop {
  background: rgba(22, 23, 29, 0.46);
  backdrop-filter: blur(2px);
}

.sheet h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin: 0;
}

.sheet-lede {
  color: var(--fg-2);
  font-size: 0.93rem;
  line-height: 1.55;
  margin: 10px 0 0;
}

.field { display: block; margin: 20px 0 0; }

.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 8px;
}

.field input {
  width: 100%;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 16px;
  border-radius: 15px;
  border: 1.5px solid var(--border);
  background: var(--page);
  color: var(--fg);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--coral);
  background: var(--card);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 14%, transparent);
}

.field-error {
  color: var(--coral-ink, #ce3b1b);
  font-weight: 600;
  font-size: 0.87rem;
  line-height: 1.45;
  margin: 10px 0 0;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin: 22px 0 0;
}

@media (max-width: 420px) {
  .erase-card .cta-row { flex-direction: column-reverse; }
  .erase-card .cta-row .btn { width: 100%; }
  .sheet-actions { flex-direction: column-reverse; }
  .sheet-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cloud, .dots i { animation: none; }
  .btn, .btn-hard { transition: none; }
}
