/* ==========================================================================
   AI for Everyone — community
   Design idea: a working professional's ledger. Everything the member does
   is entered as minutes taken back, ruled and totalled like an account book.
   Navy ink on cool paper, brass for the totals, teal for anything live.
   ========================================================================== */

:root {
  --ink:        #0F1D33;
  --ink-2:      #1C3355;
  --wash:       #E7ECF2;
  --paper:      #FFFFFF;
  --rule:       #C9D3DF;
  --muted:      #5C6B80;
  --brass:      #B0800F;
  --brass-soft: #F2E4C2;
  --teal:       #0E7C6B;
  --teal-soft:  #D6EDE8;
  --rust:       #A63A2E;

  --display: 'Bricolage Grotesque', 'Trebuchet MS', sans-serif;
  --body:    'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

  --shell: 1140px;
  --gap:   clamp(1rem, 3vw, 2rem);
  --r:     4px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--ink); text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--brass); }

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

.shell { width: min(100% - 2.5rem, var(--shell)); margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }

/* --- Type scale ---------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.35rem, 6vw, 4.1rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p { margin: 0 0 1rem; max-width: 62ch; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.lede { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.mono  { font-family: var(--mono); font-variant-numeric: tabular-nums; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--body);
  font-size: 0.98rem;
  font-weight: 600;
  padding: 0.8rem 1.4rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--ink-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }

.btn--brass { background: var(--brass); border-color: var(--brass); }
.btn--brass:hover { background: #976D0C; border-color: #976D0C; }

.btn--block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* --- Masthead ------------------------------------------------------------ */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 40;
}
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.wordmark span { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; color: var(--brass); text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 1.35rem; }
.nav a { font-size: 0.93rem; text-decoration: none; color: var(--ink-2); }
.nav a:hover, .nav a[aria-current='page'] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--brass); }
.nav__toggle { display: none; }

@media (max-width: 860px) {
  .nav { display: none; }
  .nav--open { display: flex; position: absolute; inset: 100% 0 auto; flex-direction: column;
    align-items: flex-start; gap: 0; background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 0.5rem 1.25rem 1.25rem; }
  .nav--open a { padding: 0.7rem 0; width: 100%; border-bottom: 1px solid var(--rule); }
  .nav__toggle { display: inline-flex; }
}

/* --- Hero ---------------------------------------------------------------- */

.hero {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: clamp(2.5rem, 7vw, 5rem) 0 0;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: end;
}
.hero h1 em { font-style: normal; color: var(--brass); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 1rem; }
.hero__note { font-size: 0.85rem; color: var(--muted); }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; align-items: start; }
}

/* --- The ledger: the signature element ----------------------------------- */

.ledger {
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--brass-soft);
}
.ledger__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ledger__rows { list-style: none; margin: 0; padding: 0; }
.ledger__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.62rem 1rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.92rem;
}
.ledger__row:nth-child(even) { background: #FAFBFD; }
.ledger__row span:last-child { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--teal); white-space: nowrap; }
.ledger__row--pending span:last-child { color: var(--muted); }
.ledger__total {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding: 0.9rem 1rem 1.1rem;
  background: var(--brass-soft);
  border-top: 2px solid var(--ink);
}
.ledger__total b { font-family: var(--body); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.ledger__figure {
  font-family: var(--mono);
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* --- Generic surfaces ---------------------------------------------------- */

.section { padding: clamp(2.75rem, 7vw, 5rem) 0; }
.section--paper { background: var(--paper); border-block: 1px solid var(--rule); }
.section__head { max-width: 46rem; margin-bottom: 2.25rem; }

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 1.4rem;
}
.card--flat { box-shadow: none; }
.card h3 { margin-bottom: 0.35rem; }

.grid { display: grid; gap: 1.15rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr)); }

/* --- Day tiles ----------------------------------------------------------- */

.day {
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  gap: 1.1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule);
  border-radius: var(--r);
  padding: 1.15rem 1.25rem;
}
.day--done { border-left-color: var(--teal); background: #FBFDFC; }
.day--next { border-left-color: var(--brass); box-shadow: 4px 4px 0 var(--brass-soft); }
.day__no {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-right: 1px solid var(--rule);
  padding-right: 0.9rem;
}
.day__no strong { display: block; font-size: 1.5rem; letter-spacing: -0.02em; color: var(--ink); }
.day h3 { font-size: 1.08rem; }
.day p { font-size: 0.94rem; margin-bottom: 0.75rem; }
.day__deliverable {
  font-size: 0.85rem;
  background: var(--wash);
  border-left: 2px solid var(--brass);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.9rem;
}

/* --- Prompt cards -------------------------------------------------------- */

.prompt { display: flex; flex-direction: column; gap: 0.6rem; }
.prompt__scenario { font-size: 0.9rem; color: var(--muted); }
.prompt__text {
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.55;
  background: #F6F8FB;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 0.85rem;
  white-space: pre-wrap;
  max-height: 12rem;
  overflow: auto;
}
.prompt__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: auto; }

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.22rem 0.5rem;
  border-radius: 2px;
  background: var(--teal-soft);
  color: #0A5C50;
}
.tag--locked { background: var(--brass-soft); color: #7A5806; }

.locked .prompt__text { filter: blur(4px); user-select: none; }

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

.field { display: block; margin-bottom: 1rem; }
.field > span {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  padding: 0.72rem 0.85rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: none; }
.field small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.3rem; }
.field--inline { display: flex; gap: 0.6rem; align-items: flex-start; }
.field--inline input[type='checkbox'] { width: auto; margin-top: 0.3rem; }

.notice { border-left: 3px solid var(--teal); background: var(--teal-soft); padding: 0.8rem 1rem; border-radius: var(--r); font-size: 0.92rem; margin-bottom: 1.25rem; }
.notice--error { border-left-color: var(--rust); background: #FBE9E7; }

.form-shell { max-width: 27rem; margin: 0 auto; }

/* --- Dashboard ----------------------------------------------------------- */

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.stat { background: var(--paper); padding: 1rem 1.1rem; }
.stat b { display: block; font-family: var(--mono); font-size: 1.55rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat span { font-size: 0.76rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); font-family: var(--mono); }

.streak-dots { display: flex; gap: 5px; margin-top: 0.6rem; }
.streak-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); }
.streak-dots i.on { background: var(--teal); }

.rank-table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); }
.rank-table th, .rank-table td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--rule); font-size: 0.92rem; }
.rank-table th { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.rank-table td:last-child, .rank-table th:last-child { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.rank-table tr[data-you] { background: var(--brass-soft); font-weight: 600; }

.invite-code {
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  background: var(--wash);
  border: 1px dashed var(--ink);
  padding: 0.6rem 0.9rem;
  border-radius: var(--r);
  display: inline-block;
}

/* --- Footer -------------------------------------------------------------- */

.footer { background: var(--ink); color: #C3CEDD; padding: 3rem 0 2rem; font-size: 0.9rem; }
.footer a { color: #fff; text-decoration-color: rgba(255,255,255,0.35); }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer h4 { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: #7D91AC; margin-bottom: 0.75rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li + li { margin-top: 0.4rem; }
.footer__base { border-top: 1px solid #26385A; padding-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* --- Utilities ----------------------------------------------------------- */

.flow > * + * { margin-top: 1.5rem; }
.center { text-align: center; }
.hide { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: #fff;
  padding: 0.8rem 1.3rem;
  border-radius: var(--r);
  font-size: 0.93rem;
  z-index: 90;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.show { transform: translateX(-50%) translateY(0); }

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