/* SumLock concept — chalkboard arithmetic meets OLED lock screen. */

:root {
  --slate: #243530;        /* chalkboard green — page */
  --slate-deep: #1a2823;   /* darker band */
  --slate-line: #3a4f47;   /* hairlines on slate */
  --chalk: #edf4ef;        /* chalk white */
  --chalk-dim: #9db4aa;    /* dusted chalk */
  --yellow: #f5d76b;       /* yellow chalk accent */
  --oled: #0a0d0c;         /* inside the phone */
  --oled-line: #1e2622;
  --mint: #7fe0b2;         /* success */
  --red: #f08c7d;          /* error / duress */
  --disp: "Sora", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --hand: "Caveat", cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--slate);
  color: var(--chalk);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--yellow); color: var(--slate-deep); }

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

:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
  border-radius: 4px;
}

b, strong { color: var(--chalk); }
code {
  font-family: var(--mono);
  background: var(--slate-deep);
  padding: .1em .4em;
  border-radius: 6px;
  font-size: .92em;
}
.dim { color: var(--chalk-dim); font-weight: 400; }

/* ---------- hero ---------- */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 24px 48px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: start;
}

.eyebrow {
  font-family: var(--hand);
  font-size: 1.5rem;
  color: var(--yellow);
  transform: rotate(-1.2deg);
  margin-bottom: 8px;
}

h1 {
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.chalked {
  position: relative;
  white-space: nowrap;
}
.chalked::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -0.08em;
  height: 0.22em;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 12" preserveAspectRatio="none"><path d="M2 8 Q 20 3 40 7 T 80 6 T 118 7" fill="none" stroke="%23f5d76b" stroke-width="4" stroke-linecap="round"/></svg>') no-repeat center / 100% 100%;
}

.lede {
  font-size: 1.13rem;
  color: var(--chalk-dim);
  max-width: 34em;
  margin-bottom: 18px;
}
.lede strong { color: var(--yellow); font-weight: 500; }

.annot {
  font-family: var(--hand);
  font-size: 1.35rem;
  color: var(--yellow);
  opacity: .92;
  transform: rotate(-0.6deg);
  margin-bottom: 28px;
}
.annot b { color: inherit; font-size: 1.1em; }
.annot.center { text-align: center; margin-top: 28px; margin-bottom: 0; }

.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  font-family: var(--disp);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 999px;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-solid { background: var(--yellow); color: var(--slate-deep); }
.btn-line { border: 1.5px solid var(--slate-line); color: var(--chalk); }
.btn-line:hover { border-color: var(--chalk-dim); }

/* ---------- phone ---------- */
.hero-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.phone {
  position: relative;
  width: 292px;
  height: 604px;
  background: #060808;
  border: 3px solid #2c3833;
  border-radius: 44px;
  padding: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.phone-side-btn {
  position: absolute;
  right: -7px;
  top: 130px;
  width: 5px;
  height: 64px;
  border: none;
  border-radius: 3px;
  background: #2c3833;
  cursor: pointer;
}
.phone-side-btn:hover { background: var(--yellow); }

.phone-notch {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 22px;
  background: #060808;
  border-radius: 12px;
  z-index: 2;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--oled);
  border-radius: 32px;
  overflow: hidden;
}

.scr {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 54px 18px 22px;
}

.lock-clock {
  font-family: var(--mono);
  font-size: 1.5rem;
  color: var(--chalk-dim);
  letter-spacing: .06em;
}
.lock-clock.small { font-size: 1rem; }

.lock-challenge {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 2.6rem;
  margin: 26px 0 4px;
  display: flex;
  gap: .35em;
  align-items: baseline;
  color: var(--chalk);
}
.ch-op { color: var(--yellow); }
.ch-b { color: var(--chalk-dim); }

.lock-hint {
  font-size: .8rem;
  color: var(--chalk-dim);
  margin-bottom: 14px;
  text-align: center;
}

.dots {
  font-size: .9rem;
  letter-spacing: .4em;
  color: var(--yellow);
  min-height: 1.4em;
  margin-bottom: 8px;
}

.grid {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: auto;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.cell {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--chalk);
  background: #131917;
  border: 1px solid var(--oled-line);
  border-radius: 14px;
  padding: 13px 0;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.cell:hover { background: #1b2420; border-color: #35443d; }
.cell:active { background: #24312b; }
.key-fn { color: var(--chalk-dim); }
.key-ok { color: var(--slate-deep); background: var(--yellow); border-color: var(--yellow); }
.key-ok:hover { background: #f8e18d; border-color: #f8e18d; }

/* unlocked / private / lockout */
.scr-home, .scr-private { justify-content: flex-start; gap: 10px; }
.home-title {
  font-family: var(--disp);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--mint);
  margin-top: 18px;
}
.scr-private .home-title { color: var(--yellow); }

.home-apps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
  padding: 18px 8px;
}
.app {
  aspect-ratio: 1;
  border-radius: 14px;
  background: linear-gradient(135deg, #1d2723, #141a17);
  border: 1px solid var(--oled-line);
}

.vault {
  list-style: none;
  width: 100%;
  margin-top: 10px;
}
.vault li {
  font-family: var(--mono);
  font-size: .9rem;
  color: var(--chalk);
  padding: 13px 14px;
  border: 1px solid var(--oled-line);
  border-radius: 12px;
  margin-bottom: 9px;
  background: #10140f;
}

.ghost-btn {
  margin-top: auto;
  font-family: var(--disp);
  font-size: .85rem;
  font-weight: 600;
  color: var(--chalk-dim);
  background: none;
  border: 1.5px solid var(--oled-line);
  border-radius: 999px;
  padding: 9px 20px;
  cursor: pointer;
}
.ghost-btn:hover { color: var(--chalk); border-color: #35443d; }

.scr-lockout { justify-content: center; gap: 12px; }
.lockout-num {
  font-family: var(--mono);
  font-size: 4rem;
  font-weight: 600;
  color: var(--red);
}

/* shake on wrong answer */
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
.phone.shake { animation: shake .45s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .phone.shake { animation: none; }
  .btn:hover { transform: none; }
}

/* ---------- event banner ---------- */
.event-banner {
  max-width: 320px;
  font-size: .88rem;
  line-height: 1.45;
  border-radius: 12px;
  padding: 0 14px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .3s ease, opacity .3s ease, padding .3s ease;
}
.event-banner.show { max-height: 200px; opacity: 1; padding: 12px 14px; }
.event-banner.duress { background: rgba(240, 140, 125, .12); border: 1px solid rgba(240, 140, 125, .4); color: var(--red); }
.event-banner.private { background: rgba(127, 224, 178, .1); border: 1px solid rgba(127, 224, 178, .35); color: var(--mint); }
.event-banner em { font-style: normal; opacity: .75; }

/* ---------- observer notebook ---------- */
.notebook {
  width: 320px;
  border: 1.5px dashed var(--slate-line);
  border-radius: 14px;
  padding: 16px 18px;
}
.nb-title {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--yellow);
  transform: rotate(-0.8deg);
}
.nb-sub { font-size: .82rem; color: var(--chalk-dim); margin-bottom: 10px; }
.notebook ul { list-style: none; min-height: 3.2em; }
.notebook li {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--chalk);
  padding: 3px 0;
}
.nb-n { color: var(--chalk-dim); margin-right: 6px; }
.nb-note {
  font-family: var(--hand);
  font-size: 1.15rem;
  color: var(--chalk-dim);
  margin-top: 10px;
  transform: rotate(-0.5deg);
}

/* ---------- bands / sections ---------- */
.band {
  padding: 72px 24px;
}
.band > * { max-width: 980px; margin-left: auto; margin-right: auto; }
.band-alt { background: var(--slate-deep); }

.sec-title {
  font-family: var(--disp);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.sec-sub { color: var(--chalk-dim); margin-bottom: 34px; max-width: 40em; }

/* steps */
.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 26px;
}
.steps li {
  display: flex;
  gap: 16px;
  align-items: baseline;
  color: var(--chalk-dim);
  max-width: 44em;
}
.steps strong { color: var(--chalk); }
.step-n {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  color: var(--yellow);
  border: 1.5px solid var(--slate-line);
  border-radius: 999px;
  padding: 3px 11px;
  flex-shrink: 0;
}

/* worked example */
.worked { margin-top: 44px; }
.worked-label {
  font-family: var(--hand);
  font-size: 1.35rem;
  color: var(--yellow);
  margin-bottom: 12px;
  transform: rotate(-0.8deg);
}
.worked-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  align-items: baseline;
}
.eq {
  font-family: var(--mono);
  font-size: 1.5rem;
  color: var(--chalk-dim);
}
.eq b { color: var(--yellow); }
.eq-total {
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--chalk);
}

/* ---------- playground ---------- */
.playground-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 32px;
  align-items: start;
}

.levels { display: flex; flex-direction: column; gap: 14px; }

.level-card {
  text-align: left;
  background: none;
  border: 1.5px solid var(--slate-line);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  color: var(--chalk);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color .15s ease;
}
.level-card:hover { border-color: var(--chalk-dim); }
.level-card.active { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
.lv-n { font-family: var(--mono); font-size: .75rem; color: var(--yellow); letter-spacing: .08em; text-transform: uppercase; }
.lv-name { font-family: var(--disp); font-weight: 600; font-size: 1.1rem; }
.lv-desc { font-size: .88rem; color: var(--chalk-dim); }

.settings {
  border: 1.5px solid var(--slate-line);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.set-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: end; }
.settings label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .82rem;
  color: var(--chalk-dim);
}
.settings input[type="number"], .settings select {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--chalk);
  background: var(--slate-deep);
  border: 1px solid var(--slate-line);
  border-radius: 9px;
  padding: 8px 10px;
  width: 108px;
}
.band-alt .settings input[type="number"], .band-alt .settings select { background: var(--slate); }
.settings .ops { border: none; display: flex; gap: 16px; }
.settings .ops legend { font-size: .82rem; color: var(--chalk-dim); margin-bottom: 8px; }
.settings .ops label, .settings .toggles label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--chalk);
  cursor: pointer;
}
.settings .toggles label { font-family: var(--body); font-size: .88rem; }
.settings input[type="checkbox"] { accent-color: var(--yellow); width: 16px; height: 16px; }
#op-mul-label.disabled { opacity: .38; }
#settingsMsg .err { color: var(--red); font-size: .85rem; }
#settingsMsg .warn { color: var(--yellow); font-size: .85rem; }

/* ---------- mode cards ---------- */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.modes-grid.two { grid-template-columns: repeat(2, 1fr); max-width: 800px; }

.mode-card {
  border: 1.5px solid var(--slate-line);
  border-radius: 14px;
  padding: 22px;
}
.mode-card h3 {
  font-family: var(--disp);
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 10px;
}
.mode-card p { font-size: .92rem; color: var(--chalk-dim); }
.mode-card.duress { border-color: rgba(240, 140, 125, .45); }
.mode-card.duress h3 { color: var(--red); }
.mode-card.private { border-color: rgba(127, 224, 178, .4); }
.mode-card.private h3 { color: var(--mint); }

/* ---------- security table ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--slate-line);
  font-size: .92rem;
  vertical-align: top;
}
th {
  font-family: var(--disp);
  font-weight: 600;
  font-size: .85rem;
  color: var(--chalk-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
}
td:first-child { color: var(--chalk); font-weight: 500; }
.good { color: var(--mint); }
.bad { color: var(--red); }
.mid { color: var(--yellow); }

/* ---------- footer ---------- */
.foot {
  padding: 40px 24px 56px;
  text-align: center;
  font-size: .88rem;
  color: var(--chalk-dim);
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; }
  .hero-demo { order: 2; }
  .playground-grid { grid-template-columns: 1fr; }
  .modes-grid { grid-template-columns: 1fr; }
  .modes-grid.two { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .phone { width: 262px; height: 548px; }
  .notebook { width: 100%; }
}
