/* Tally account: the app's dark room and one light, for a single column of cards. */

@font-face {
  font-family: 'Tally Display';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url(/fonts/display.woff2) format('woff2-variations');
}
@font-face {
  font-family: 'Tally UI';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/ui.woff2) format('woff2-variations');
}

:root {
  --ink: #110d14;
  --ink-deep: #0b080d;
  --surface: #1b1520;
  --raised: #251d2b;
  --raised-hi: #34293b;
  --text: #f4eee8;
  --muted: #a89ca9;
  --faint: #6f6373;
  --accent: #ff5a47;
  --accent-2: #ffb14a;
  --on-accent: #1a0906;
  --ok: #5fd4a0;
  --line: color-mix(in srgb, var(--text) 9%, transparent);
  --line-strong: color-mix(in srgb, var(--text) 16%, transparent);
  --wash: color-mix(in srgb, var(--text) 6%, transparent);
  --font-display: 'Tally Display', 'Segoe UI', system-ui, sans-serif;
  --font-ui: 'Tally UI', 'Segoe UI', system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--accent-2);
  text-underline-offset: 3px;
}

.glow {
  position: fixed;
  inset: -30vh -20vw auto;
  height: 70vh;
  background: radial-gradient(closest-side, rgb(255 90 71 / 0.16), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Header ------------------------------------------------------------------------------------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.wordmark-dot {
  display: inline-block;
  width: 0.24em;
  height: 0.24em;
  margin-left: 0.06em;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.brand-sub {
  color: var(--muted);
  font-size: 0.95rem;
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
}

.who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.who-name {
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}

/* Layout ------------------------------------------------------------------------------------- */

.main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 32px;
  color: var(--faint);
  font-size: 0.8125rem;
  border-top: 1px solid var(--line);
}

.foot a {
  color: var(--muted);
}

.center {
  text-align: center;
}

.quiet {
  color: var(--muted);
}

/* Signed out --------------------------------------------------------------------------------- */

.hero {
  padding: 8vh 0 4vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 85%;
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  text-wrap: balance;
}

.lede {
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 34em;
  margin: 0 0 28px;
  text-wrap: pretty;
}

.gsi {
  min-height: 44px;
}

/* Cards -------------------------------------------------------------------------------------- */

.card {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-quiet {
  background: transparent;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0;
}

.card p {
  margin: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.plan {
  position: relative;
  overflow: hidden;
}

.plan::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.plan[data-tone='off']::before {
  background: var(--faint);
}

.plan-title.plan-title {
  font-size: 1.6rem;
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.plan-option {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 12px;
  background: var(--wash);
  border: 1px solid var(--line);
}

.plan-option strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.plan-option span {
  color: var(--muted);
  font-size: 0.8125rem;
}

.warn {
  color: var(--accent-2);
}

.fine,
.help {
  color: var(--muted);
  font-size: 0.875rem;
}

.error {
  color: #ff8a7a;
  font-size: 0.9rem;
}

.error:empty {
  display: none;
}

/* Lists -------------------------------------------------------------------------------------- */

.list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.item:first-child {
  border-top: 0;
}

.item-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.item-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.item-sub {
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.item-actions {
  display: flex;
  gap: 4px;
  flex: none;
}

.inline-edit {
  display: flex;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

.inline-edit .input {
  flex: 1 1 180px;
}

/* Forms -------------------------------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.add-form,
.link-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

.input {
  font: inherit;
  color: var(--text);
  background: var(--ink-deep);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 11px 14px;
  min-height: 46px;
  width: 100%;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(255 90 71 / 0.25);
}

.code-input {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  flex: 1 1 200px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.confirm-q {
  font-size: 1.125rem;
}

.done {
  font-size: 1.125rem;
  color: var(--ok);
}

/* Buttons ------------------------------------------------------------------------------------ */

.btn {
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text);
  background: var(--raised);
  transition: background-color 160ms var(--ease), transform 160ms var(--ease), opacity 160ms;
}

.btn:hover {
  background: var(--raised-hi);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff6d5c, #ffbe66);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  align-self: flex-start;
}

.btn-quiet {
  background: transparent;
  color: var(--muted);
}

.btn-quiet:hover {
  background: var(--wash);
  color: var(--text);
}

.btn-small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.875rem;
}

.btn-danger {
  color: #ff8a7a;
}

/* Toast -------------------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 520px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--raised-hi);
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.45);
  animation: toast-in 260ms var(--ease);
  transition: opacity 400ms, transform 400ms var(--ease);
}

.toast-bad {
  border-color: rgb(255 90 71 / 0.5);
}

.toast-out {
  opacity: 0;
  transform: translate(-50%, 8px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
}

@media (max-width: 480px) {
  .card {
    padding: 18px;
  }
  .plans {
    grid-template-columns: 1fr;
  }
  .plan-option {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }
  .brand-sub {
    display: none;
  }
  .item {
    flex-wrap: wrap;
  }
}

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