/* The Summer AI Challenge — one stylesheet, no framework. */

:root {
  --bg:        #12101f;
  --bg-2:      #191630;
  --card:      #1e1a38;
  --card-2:    #262048;
  --line:      #342c5c;
  --ink:       #ece9ff;
  --ink-dim:   #a49ec9;
  --ink-faint: #736c9c;

  --accent:      #8b7cff;
  --accent-soft: #2a2350;
  --good:        #45d6a4;
  --warn:        #ffcc66;

  --radius:  16px;
  --radius-s: 10px;
  --shadow: 0 10px 34px rgba(0,0,0,.34);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
}

html[data-accent="indigo"] { --accent: #7c8cff; --accent-soft: #232a5c; }
html[data-accent="coral"]  { --accent: #ff8b7a; --accent-soft: #4a2a2c; }
html[data-accent="teal"]   { --accent: #3fd0c9; --accent-soft: #143f44; }
html[data-accent="amber"]  { --accent: #ffc35c; --accent-soft: #4a3a18; }

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #f6f4ff;
    --bg-2:      #ffffff;
    --card:      #ffffff;
    --card-2:    #f2efff;
    --line:      #e0daf5;
    --ink:       #221d3d;
    --ink-dim:   #5f5885;
    --ink-faint: #918ab0;
    --accent-soft: #ece8ff;
    --shadow: 0 8px 26px rgba(60,40,120,.10);
  }
  html[data-accent="coral"] { --accent-soft: #ffe9e5; }
  html[data-accent="teal"]  { --accent-soft: #dcf7f5; }
  html[data-accent="amber"] { --accent-soft: #fff2d9; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1100px 520px at 12% -8%, var(--accent-soft), transparent 60%),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }

/* ------------------------------------------------------------------ topbar */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px clamp(14px, 4vw, 34px);
  background: color-mix(in srgb, var(--bg-2) 86%, transparent);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none;
  font-size: 1.02rem;
}
.brand-mark { font-size: 1.35rem; }

.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 600;
  white-space: nowrap;
}
.nav a:hover { background: var(--card-2); color: var(--ink); }
.nav a.on    { background: var(--accent); color: #14102c; }

.whoami { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .92rem; }
.whoami-name { color: var(--ink-dim); }
.avatar {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.05rem;
}
.signout {
  text-decoration: none; color: var(--ink-faint);
  font-size: 1.1rem; padding: 2px 6px; border-radius: 8px;
}
.signout:hover { background: var(--card-2); color: var(--ink); }

/* -------------------------------------------------------------- structure */

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 38px) clamp(14px, 4vw, 22px) 70px;
}
.wrap.wide { max-width: 1180px; }

.foot {
  text-align: center;
  color: var(--ink-faint);
  font-size: .86rem;
  padding: 0 20px 44px;
}

h1 { font-size: clamp(1.6rem, 4.4vw, 2.3rem); line-height: 1.15; letter-spacing: -.025em; margin: 0 0 6px; }
h2 { font-size: 1.22rem; letter-spacing: -.015em; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }

.lede { color: var(--ink-dim); font-size: 1.02rem; margin: 0 0 26px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .72rem;
  font-weight: 800;
  color: var(--accent);
  margin: 0 0 6px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 3.4vw, 26px);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }

.card-head {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.card-head h2 { margin: 0; }
.card-head .spacer { margin-left: auto; }

/* ------------------------------------------------------------------ pills */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill.done { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good); border-color: transparent; }
.pill.todo { background: transparent; }

/* ------------------------------------------------------------------ login */

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-card h1 { font-size: 1.5rem; }
.login-emoji { font-size: 2.8rem; display: block; margin-bottom: 8px; }
.who-row { display: flex; gap: 10px; justify-content: center; margin: 20px 0 6px; flex-wrap: wrap; }
.who {
  border: 1px solid var(--line);
  background: var(--card-2);
  border-radius: 14px;
  padding: 12px 8px;
  width: 92px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  text-align: center;
  transition: transform .12s ease, border-color .12s ease;
}
.who:hover { transform: translateY(-2px); border-color: var(--accent); }
.who .who-emoji { font-size: 1.7rem; display: block; }
.who .who-name { font-weight: 700; font-size: .85rem; }

/* ------------------------------------------------------------------ forms */

label.field { display: block; margin-bottom: 14px; text-align: left; }
label.field > span {
  display: block;
  font-weight: 700;
  font-size: .84rem;
  margin-bottom: 5px;
  color: var(--ink-dim);
}

input[type=text], input[type=password], input[type=date], input[type=url], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  font: inherit;
  font-size: .97rem;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: #16112e;
  font: inherit;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.wide  { width: 100%; justify-content: center; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn.small { padding: 7px 14px; font-size: .85rem; }

.hint { color: var(--ink-faint); font-size: .84rem; margin: 8px 0 0; }
.err {
  background: color-mix(in srgb, #ff6b6b 18%, transparent);
  border: 1px solid #ff6b6b;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--radius-s);
  margin-bottom: 16px;
  font-size: .9rem;
}

.flash {
  background: color-mix(in srgb, var(--good) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--good) 55%, transparent);
  padding: 11px 16px;
  border-radius: var(--radius-s);
  margin-bottom: 20px;
  font-weight: 600;
  font-size: .93rem;
  transition: opacity .5s ease;
}
.flash.gone { opacity: 0; }

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

.day-hero {
  display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap; margin-bottom: 26px;
}
.day-badge {
  flex: 0 0 auto;
  width: 78px; height: 78px;
  border-radius: 20px;
  background: var(--accent);
  color: #15102e;
  display: grid; place-items: center;
  line-height: 1;
  box-shadow: var(--shadow);
}
.day-badge b { font-size: 1.9rem; display: block; font-weight: 900; }
.day-badge span { font-size: .62rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; }

/* -------------------------------------------------------------- the reading */

.reading {
  font-family: var(--serif);
  font-size: 1.09rem;
  line-height: 1.78;
}
.reading p { margin: 0 0 1.05em; }
.reading h3 {
  font-family: var(--font);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--accent);
  margin: 1.9em 0 .6em;
}
.reading strong { color: var(--ink); }
.reading em { color: var(--ink-dim); }

.pullquote {
  margin: 1.6em 0;
  padding: 14px 20px;
  border-left: 4px solid var(--accent);
  background: var(--card-2);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-style: italic;
  color: var(--ink-dim);
}

.deeper {
  margin-top: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-s);
  padding: 16px 18px;
  background: var(--card-2);
}
.deeper .eyebrow { color: var(--warn); }
.deeper .reading { font-size: 1.02rem; }

.sources { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.sources li a {
  display: block;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--bg-2);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: .93rem;
}
.sources li a:hover { border-color: var(--accent); }
.sources small { display: block; color: var(--ink-faint); font-weight: 500; font-size: .82rem; }

.qlist { counter-reset: q; display: grid; gap: 16px; }
.qlist .q { counter-increment: q; }
.qlist .q > span.qtext {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: .96rem;
}
.qlist .q > span.qtext::before {
  content: counter(q);
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .76rem;
  font-weight: 800;
  vertical-align: 1px;
}

/* ------------------------------------------------------------------- grid */

.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}
.day-tile {
  display: block;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  position: relative;
  min-height: 108px;
  transition: transform .12s ease, border-color .12s ease;
}
.day-tile:hover { transform: translateY(-3px); border-color: var(--accent); }
.day-tile .n { font-size: .7rem; font-weight: 800; letter-spacing: .1em; color: var(--ink-faint); text-transform: uppercase; }
.day-tile .t { font-weight: 700; font-size: .95rem; line-height: 1.3; margin-top: 4px; }
.day-tile .when { position: absolute; bottom: 12px; left: 14px; font-size: .74rem; color: var(--ink-faint); }
.day-tile .stamp { position: absolute; top: 12px; right: 12px; font-size: 1.05rem; }
.day-tile.locked { opacity: .48; pointer-events: none; }
.day-tile.today  { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.day-tile.done   { border-color: color-mix(in srgb, var(--good) 55%, transparent); }

.week-band {
  display: flex; align-items: baseline; gap: 10px;
  margin: 30px 0 12px;
}
.week-band h2 { margin: 0; }
.week-band .sub { color: var(--ink-faint); font-size: .84rem; }

/* ------------------------------------------------------------------- wall */

.post {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-head .name { font-weight: 800; }
.post-head .meta { color: var(--ink-faint); font-size: .8rem; margin-left: auto; }
.post-body { margin: 0 0 12px; white-space: pre-wrap; }
.post-q {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 13px;
  color: var(--ink);
  font-weight: 600;
  margin: 0 0 12px;
  white-space: pre-wrap;
}
.post-check {
  background: var(--card-2);
  border-radius: var(--radius-s);
  padding: 11px 14px;
  font-size: .89rem;
  margin-bottom: 12px;
}
.post-check b { color: var(--accent); }

.reply-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.reply { display: flex; gap: 9px; align-items: flex-start; font-size: .91rem; }
.reply .who-em { flex: 0 0 auto; }
.reply .rname { font-weight: 700; margin-right: 5px; }
.reply-form { display: flex; gap: 8px; margin-top: 10px; }
.reply-form input { flex: 1; }

.react-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.react {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 999px;
  padding: 4px 11px;
  cursor: pointer;
  font: inherit;
  font-size: .9rem;
  color: var(--ink);
}
.react:hover { border-color: var(--accent); }
.react.mine { background: var(--accent-soft); border-color: var(--accent); }

/* ------------------------------------------------------------------- misc */

.ring { position: relative; width: 64px; height: 64px; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); width: 64px; height: 64px; }
.ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); transition: stroke-dashoffset .6s ease; }
.ring-label {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 800;
}

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat {
  flex: 1 1 130px;
  background: var(--card-2);
  border-radius: var(--radius-s);
  padding: 13px 15px;
}
.stat b { display: block; font-size: 1.5rem; line-height: 1.1; }
.stat span { color: var(--ink-dim); font-size: .8rem; font-weight: 600; }

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.table th { color: var(--ink-faint); font-size: .76rem; text-transform: uppercase; letter-spacing: .09em; }
.table td.num { text-align: center; }

.empty {
  text-align: center;
  color: var(--ink-faint);
  padding: 34px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) {
  .split { grid-template-columns: 1fr; }
  .nav a { padding: 6px 10px; font-size: .86rem; }
  .whoami-name { display: none; }
}

.lane-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.lane {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 15px;
  background: var(--card-2);
}
.lane h3 { margin-bottom: 5px; }
.lane p { margin: 0; font-size: .89rem; color: var(--ink-dim); }
.lane.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.checkline {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--card-2);
  margin-bottom: 10px;
  font-weight: 600;
}
.checkline input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; }
.checkline.on { border-color: color-mix(in srgb, var(--good) 55%, transparent); }

.prose p { margin: 0 0 .9em; }
.prose ul { margin: 0 0 1em; padding-left: 20px; }
.prose li { margin-bottom: .4em; }
.prose > :last-child { margin-bottom: 0; }

.mission-body { font-size: 1.02rem; }
.stretch {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-s);
  background: var(--accent-soft);
  border: 1px solid var(--line);
}
.stretch .eyebrow { margin-bottom: 4px; }
.stretch p { margin: 0; font-size: .95rem; }

@media print {
  .topbar, .foot, .btn, form { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
