/* ============================================================================
   Creative Gym — one stylesheet for the whole site.
   Light, warm, low-glare: this is a tool people stare at for five minutes at a
   time, several times a day, so contrast is tuned for text rather than drama.
   ========================================================================= */

:root {
  --ink: #f5f6fa;
  --ink-2: #eef1f7;
  --panel: #ffffff;
  --panel-2: #f3f5fa;
  --line: #dde2ec;
  --line-soft: #e7eaf2;
  --text: #16191f;
  --muted: #566079;
  --muted-2: #7d8598;
  --ember: #b45309;
  --ember-soft: #fdf0dd;
  --ember-line: #f0d3a8;
  --violet: #5747cc;
  --violet-soft: #ece9fd;
  --mint: #0c7f61;
  --mint-soft: #ddf4ec;
  --rose: #b93a58;
  --rose-soft: #fce8ec;
  --sky: #17629b;
  --warn-bg: #fff6e3;
  --warn-line: #f0dcae;
  --warn-text: #6b4a05;
  --err-bg: #fdecef;
  --err-line: #f2c6cf;
  --err-text: #8c2137;
  --ok-bg: #e4f6ef;
  --ok-line: #b9e5d6;
  --ok-text: #08523f;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 14px 34px -24px rgba(21, 26, 40, 0.45);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(780px 420px at 10% -8%, rgba(180, 83, 9, 0.08), transparent 62%),
    radial-gradient(680px 460px at 94% 2%, rgba(87, 71, 204, 0.08), transparent 60%),
    radial-gradient(900px 560px at 50% 105%, rgba(12, 127, 97, 0.07), transparent 68%);
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; position: relative; z-index: 1; }

a { color: var(--ember); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.02em; font-weight: 650; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.15rem); }
h3 { font-size: 1.16rem; }
p { margin: 0 0 1em; }
small, .small { font-size: 0.86rem; }
.muted { color: var(--muted); }
.tiny { font-size: 0.78rem; color: var(--muted-2); }
code, .mono { font-family: var(--mono); font-size: 0.9em; }

hr { border: 0; border-top: 1px solid var(--line-soft); margin: 34px 0; }

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

header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(245, 246, 250, 0.87);
  border-bottom: 1px solid var(--line);
}

header.site .bar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 62px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 680; letter-spacing: -0.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: conic-gradient(from 210deg, #d97706, #e11d48, #5747cc, #0c7f61, #d97706);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}
.brand span.dim { color: var(--muted-2); font-weight: 500; }

nav.main { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
nav.main a {
  color: var(--muted);
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 520;
}
nav.main a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
nav.main a[aria-current="page"] { color: var(--text); background: var(--panel); box-shadow: var(--shadow); }

.acct-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px 5px 10px; font-size: 0.85rem; color: var(--muted); background: var(--panel);
}
.acct-chip b { color: var(--text); font-weight: 600; }
.acct-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }

/* ------------------------------ ambience bar ------------------------------ */

.ambience {
  position: sticky; top: 62px; z-index: 35;
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.ambience .row { display: flex; align-items: center; gap: 14px; min-height: 46px; flex-wrap: wrap; }
.ambience .tag { font-size: 0.78rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted-2); }
.scape-btns { display: flex; gap: 6px; }
.scape {
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  padding: 5px 11px; border-radius: 999px; font: inherit; font-size: 0.83rem; cursor: pointer;
}
.scape:hover { color: var(--text); border-color: var(--muted-2); }
.scape.on { color: #fff; background: var(--ember); border-color: var(--ember); font-weight: 620; }
.ambience input[type="range"] { width: 116px; accent-color: var(--ember); }
.ambience .lvl { font-size: 0.8rem; color: var(--muted-2); min-width: 62px; }

/* --------------------------------- bits ---------------------------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card h3 { margin-top: 0; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted); background: var(--panel-2);
}
.pill.ember { color: #7c3a03; background: var(--ember-soft); border-color: var(--ember-line); }
.pill.mint { color: #065f47; background: var(--mint-soft); border-color: #b9e5d6; }
.pill.violet { color: #3f31b8; background: var(--violet-soft); border-color: #cfc9f7; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 0.95rem;
  padding: 11px 18px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; background: var(--ember); color: #fff;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.09); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: var(--panel); border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--muted-2); background: var(--panel-2); }
.btn.small { padding: 7px 12px; font-size: 0.86rem; border-radius: 10px; }
.btn.violet { background: var(--violet); color: #fff; }
.btn.mint { background: var(--mint); color: #fff; }
.btn.danger { background: var(--panel); border-color: var(--err-line); color: var(--err-text); }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px;
}
input::placeholder, textarea::placeholder { color: #a8aec0; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(180, 83, 9, 0.32); outline-offset: 1px; border-color: var(--ember-line); }
textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }

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

.hero { padding: 68px 0 26px; }
.hero .kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ember);
  margin-bottom: 18px;
}
.hero .kicker::before { content: ""; width: 26px; height: 1px; background: var(--ember); opacity: 0.7; }
.hero p.lede { font-size: clamp(1.02rem, 1.7vw, 1.22rem); color: #3b4256; max-width: 62ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

section { padding: 54px 0; }
section.tight { padding: 34px 0; }
.section-head { max-width: 68ch; margin-bottom: 30px; }

/* ------------------------------- tables ---------------------------------- */

table.research { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
table.research th, table.research td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.research th { color: var(--muted); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
table.research tr:last-child td { border-bottom: 0; }
table.research td:first-child { font-weight: 600; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

/* ------------------------------- timers ---------------------------------- */

.timer-ring { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.timer-num {
  font-family: var(--mono); font-size: clamp(2.4rem, 7vw, 3.6rem); font-weight: 600;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.timer-num.low { color: var(--ember); }
.progress-line { height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin: 14px 0 20px; border: 1px solid var(--line-soft); }
.progress-line > i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--ember), #e11d48); transition: width 0.35s linear; }

.idea-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.idea-list li {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 0.93rem;
}
.idea-list li button.star { background: none; border: 0; color: var(--muted-2); cursor: pointer; font-size: 1rem; padding: 0; }
.idea-list li button.star.on { color: var(--ember); }
.idea-list li span.body { flex: 1; }
.idea-list li .x { background: none; border: 0; color: var(--muted-2); cursor: pointer; }
.idea-list li .x:hover { color: var(--rose); }

.empty { color: var(--muted-2); font-size: 0.9rem; font-style: italic; }

/* ------------------------------ stat blocks ------------------------------ */

.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat .n { font-family: var(--mono); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.stat .l { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-2); }

.streak-dots { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.streak-dots i { width: 13px; height: 13px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); display: block; }
.streak-dots i.on { background: var(--mint); border-color: var(--mint); }
.streak-dots i.today { outline: 2px solid var(--ember); outline-offset: 1px; }

/* -------------------------------- steps ---------------------------------- */

.steps { counter-reset: step; display: grid; gap: 12px; padding: 0; list-style: none; margin: 0; }
.steps li { position: relative; padding-left: 44px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center; font-family: var(--mono); font-size: 0.82rem;
  background: var(--ember-soft); border: 1px solid var(--ember-line); color: var(--ember);
}

/* ------------------------------- notices --------------------------------- */

.notice { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.92rem; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
.notice.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-text); }
.notice.err { border-color: var(--err-line); background: var(--err-bg); color: var(--err-text); }
.notice.ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-text); }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #1b1f2a; border: 1px solid #2d3341; color: #f6f7fb;
  padding: 11px 18px; border-radius: 999px; font-size: 0.9rem; z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.7);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: #7d2b3d; }

footer.site { border-top: 1px solid var(--line); margin-top: 40px; padding: 34px 0 56px; color: var(--muted-2); font-size: 0.88rem; }
footer.site .cols { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
footer.site a { color: var(--muted); }

.split { display: grid; gap: 22px; grid-template-columns: 1.35fr 1fr; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.kbd { font-family: var(--mono); font-size: 0.8rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.in { opacity: 1; transform: none; }

/* The account gate stands in for the page body until someone signs in. */
#gateCard { max-width: 640px; margin: 36px auto; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 720px) {
  header.site .bar { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  nav.main { margin-left: 0; width: 100%; overflow-x: auto; }
  .ambience { top: 0; position: relative; }
}
