/* Hands-On Excel: ledger paper, ink, and a highlighter. */

:root {
  --paper: #f3eee2;
  --paper-2: #e9e2cf;
  --card: #fbf8f0;
  --ink: #1b2a3a;
  --ink-2: #4b5969;
  --ink-3: #7d8794;
  --rule: rgba(27, 42, 58, 0.09);
  --rule-strong: rgba(27, 42, 58, 0.22);
  --hl: #ffd84a;
  --hl-soft: #fff3bf;
  --green: #2c6a4e;
  --red: #b83a26;
  --amber: #a86a00;
  --blue: #2a58a0;
  --shadow: 6px 6px 0 var(--ink);
  --radius: 10px;
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --body: 'Instrument Sans', 'Avenir Next', 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .15 0 0 0 0 .2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 28px 28px, 28px 28px, 160px 160px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
code, kbd { font-family: var(--mono); font-size: 0.88em; }
code { background: rgba(27, 42, 58, 0.07); padding: 0.08em 0.35em; border-radius: 4px; }
kbd {
  display: inline-block;
  padding: 0.05em 0.4em;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--card);
  line-height: 1.3;
}
.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; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 16px; }

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

.swatch {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  vertical-align: -0.12em;
  background: var(--hl-soft);
  border: 1.5px solid var(--hl);
  border-radius: 3px;
}

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 24px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  display: grid;
  grid-template-columns: 11px 11px;
  gap: 2px;
  padding: 3px;
  background: var(--ink);
  border-radius: 6px;
}
.brand-mark i { width: 11px; height: 11px; background: var(--paper); border-radius: 1px; }
.brand-mark i.on { background: var(--hl); }
.brand-word { font-family: var(--mono); font-size: 15px; letter-spacing: -0.02em; }
.brand-word b { font-weight: 600; margin-left: 2px; }

.top-nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.top-nav a { text-decoration: none; color: var(--ink-2); }
.top-nav a:hover { color: var(--ink); }
.top-nav .nav-cta {
  color: var(--ink);
  font-weight: 600;
  padding: 7px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
}
.top-nav .nav-cta:hover { background: var(--hl); }

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

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 96px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 18px;
  animation: rise 0.7s 0.05s both;
}

h1 {
  font-family: var(--display);
  font-variation-settings: 'opsz' 144;
  font-weight: 760;
  font-size: clamp(3.1rem, 7.4vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0;
  animation: rise 0.8s 0.12s both;
}

h1 em {
  font-style: italic;
  font-weight: 600;
  position: relative;
  white-space: nowrap;
}
.hl {
  background-image: linear-gradient(transparent 58%, var(--hl) 58%, var(--hl) 92%, transparent 92%);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  animation: swipe 0.9s 0.9s cubic-bezier(0.6, 0, 0.2, 1) forwards;
  padding: 0 0.06em;
}

.lede {
  font-size: 1.2rem;
  max-width: 34ch;
  color: var(--ink-2);
  margin: 28px 0 32px;
  animation: rise 0.8s 0.22s both;
}

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; animation: rise 0.8s 0.32s both; }
.hero-note { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes swipe { to { background-size: 100% 100%; } }

/* demo card */

.demo { margin: 0; position: relative; animation: rise 0.9s 0.4s both; }
.demo-card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--ink);
  transform: rotate(-2deg);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 15px;
}
.demo-bar { display: flex; border-bottom: 2px solid var(--ink); }
.demo-name { padding: 10px 14px; border-right: 1px solid var(--rule-strong); font-weight: 600; min-width: 56px; }
.demo-fx { display: flex; align-items: center; gap: 10px; padding: 10px 14px; flex: 1; min-height: 44px; }
.demo-fx i { font-family: var(--display); font-style: italic; color: var(--ink-3); }
.caret { width: 2px; height: 1.1em; background: var(--ink); animation: blink 1s steps(1) infinite; margin-left: -8px; }
@keyframes blink { 50% { opacity: 0; } }

.demo-grid { display: grid; grid-template-columns: 40px 1fr 1fr; }
.demo-grid > span { padding: 9px 12px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-height: 42px; }
.demo-grid .dh, .demo-grid .dr { background: var(--paper-2); color: var(--ink-3); font-size: 12px; text-align: center; padding: 6px 4px; min-height: 0; }
.demo-grid .dr { display: flex; align-items: center; justify-content: center; }
.demo-grid .head { font-weight: 600; }
.demo-grid .num { text-align: right; font-variant-numeric: tabular-nums; transition: background-color 0.3s, box-shadow 0.3s; }
.demo-grid .num.lit { background: rgba(42, 88, 160, 0.09); box-shadow: inset 2px 0 0 var(--blue), inset -2px 0 0 var(--blue); }
.demo-grid .target { background: var(--hl-soft); font-weight: 600; outline: 2px solid var(--ink); outline-offset: -2px; text-align: left; white-space: nowrap; overflow: hidden; }
.demo-grid .target.done { text-align: right; background: var(--hl); animation: pop 0.35s ease-out; }
@keyframes pop { 0% { transform: scale(0.94); } 60% { transform: scale(1.04); } 100% { transform: none; } }

.demo-note {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-2);
  margin: 30px 0 0 24px;
  transform: rotate(-2deg);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 15px/1 var(--body);
  color: var(--ink);
  text-decoration: none;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background-color 0.12s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: none; box-shadow: none; }
.btn kbd { font-size: 11px; background: transparent; border-color: currentColor; opacity: 0.6; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { box-shadow: 3px 3px 0 var(--hl); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); padding-inline: 12px; }
.btn-quiet:hover { color: var(--ink); box-shadow: none; transform: none; text-decoration: underline; text-underline-offset: 4px; }
.btn[disabled] { opacity: 0.6; cursor: wait; }

/* ---------- practice ---------- */

.practice {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 96px;
  scroll-margin-top: 16px;
}
.practice-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; border-bottom: 2px solid var(--ink); padding-bottom: 14px; }
.practice-head h2, .how h2 {
  font-family: var(--display);
  font-variation-settings: 'opsz' 96;
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.9rem);
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0;
}
.practice-head p { margin: 0; color: var(--ink-2); }

.workbench { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; }

/* rail */
.rail-wrap { position: sticky; top: 16px; }
.rail-top { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 10px; }
.progress { color: var(--ink); font-weight: 600; }
.rail { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rail-item {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 1fr 20px;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 12px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}
.rail-item:hover { background: rgba(255, 255, 255, 0.55); border-color: var(--rule-strong); }
.rail-item.is-current { background: var(--card); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.rail-num { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.rail-text { display: grid; line-height: 1.25; }
.rail-title { font-weight: 600; font-size: 15px; }
.rail-skill { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.rail-mark {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--rule-strong);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--paper);
}
.is-solved .rail-mark { background: var(--green); border-color: var(--green); }

/* task */
.task-card { margin-bottom: 18px; }
.task-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.task-num { font-family: var(--display); font-style: italic; font-size: 1.1rem; color: var(--ink-3); margin-right: 4px; }
.chip { font-family: var(--mono); font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--ink); color: var(--paper); }
.chip-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--rule-strong); }
.task-title { font-family: var(--display); font-weight: 700; font-size: 1.9rem; letter-spacing: -0.02em; margin: 0 0 6px; line-height: 1.1; }
.task-prompt { font-size: 1.1rem; margin: 0 0 6px; max-width: 62ch; }
.task-tip { color: var(--ink-2); margin: 0; max-width: 66ch; font-size: 0.97rem; }

/* sheet */
.sheet-frame {
  position: relative;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.fxbar { display: flex; align-items: stretch; border-bottom: 2px solid var(--ink); font-family: var(--mono); }
.namebox { min-width: 64px; padding: 10px 12px; border-right: 1px solid var(--rule-strong); font-weight: 600; font-size: 14px; display: flex; align-items: center; }
.fx-label { display: flex; align-items: center; padding: 0 10px; border-right: 1px solid var(--rule); }
.fx-label i { font-family: var(--display); font-style: italic; color: var(--ink-3); font-size: 16px; }
.fx {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: 500 15px var(--mono);
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  border-top-right-radius: var(--radius);
}
.fx:focus { background: #fffdf5; }
.fx.is-locked { color: var(--ink-3); }

.grid-scroll { overflow-x: auto; border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.grid { outline: none; padding: 0; width: max-content; min-width: 100%; }
.grid:focus-visible { box-shadow: inset 0 0 0 3px var(--blue); }

.sheet { border-collapse: collapse; font-family: var(--mono); font-size: 14px; table-layout: fixed; user-select: none; }
.sheet .col-rownum { width: 44px; }
.sheet th {
  background: var(--paper-2);
  color: var(--ink-3);
  font-weight: 500;
  font-size: 12px;
  height: 28px;
  border: 1px solid var(--rule);
  transition: background-color 0.15s, color 0.15s;
}
.sheet th.is-active { background: #d9d0b8; color: var(--ink); }
.sheet .corner { background: var(--paper-2); }
.sheet td {
  position: relative;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: cell;
  background: #fff;
}
.sheet td .cell-v { display: block; overflow: hidden; text-overflow: ellipsis; }
.sheet td.is-head { font-weight: 600; background: #fbf9f3; }
.sheet td[data-kind='num'] { text-align: right; font-variant-numeric: tabular-nums; }
.sheet td[data-kind='bool'] { text-align: center; }
.sheet td[data-kind='error'] { color: var(--red); font-weight: 600; }
.sheet td[data-kind='editing'] { font-style: italic; color: var(--ink); overflow: visible; }
.sheet td.is-target { background: var(--hl-soft); }
.sheet td.is-input { background: #eef4ff; }
.sheet td.is-target.is-formula { background: #fff8d6; }
.sheet td.is-selected { box-shadow: inset 0 0 0 2px var(--ink); z-index: 1; }
.sheet td.is-selected::before {
  content: '';
  position: absolute;
  right: -1px; bottom: -1px;
  width: 7px; height: 7px;
  background: var(--ink);
  border: 1.5px solid #fff;
}

/* reference highlights while writing a formula */
.sheet td[data-hl] { --hlc: var(--blue); background-image: linear-gradient(color-mix(in srgb, var(--hlc) 12%, transparent), color-mix(in srgb, var(--hlc) 12%, transparent)); }
.sheet td[data-hl='1'] { --hlc: var(--red); }
.sheet td[data-hl='2'] { --hlc: var(--green); }
.sheet td[data-hl='3'] { --hlc: #7d4bb5; }
.sheet td[data-hl='4'] { --hlc: #c27410; }
.sheet td[data-hl]::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 2px solid transparent;
  pointer-events: none;
}
.sheet td[data-edges*='t']::after { border-top-color: var(--hlc); }
.sheet td[data-edges*='b']::after { border-bottom-color: var(--hlc); }
.sheet td[data-edges*='l']::after { border-left-color: var(--hlc); }
.sheet td[data-edges*='r']::after { border-right-color: var(--hlc); }

.sheet td.flash { animation: flash 0.9s ease-out; }
@keyframes flash { 0% { background-color: var(--hl); } 100% { background-color: #fff8d6; } }

/* solved stamp */
.stamp {
  position: absolute;
  right: 18px;
  bottom: -26px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  border: 3px solid var(--green);
  border-radius: 8px;
  padding: 2px 14px;
  background: rgba(251, 248, 240, 0.92);
  transform: rotate(-8deg) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
.stamp.show { animation: stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
@keyframes stamp {
  0% { transform: rotate(-8deg) scale(2.4); opacity: 0; }
  100% { transform: rotate(-8deg) scale(1); opacity: 1; }
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--rule-strong);
  border-left-width: 6px;
  background: var(--card);
  max-width: 70ch;
  animation: rise 0.25s both;
}
.feedback[data-tone='good'] { border-color: var(--green); background: #eef6ef; }
.feedback[data-tone='bad'] { border-color: var(--red); background: #fbefeb; }
.feedback[data-tone='warn'] { border-color: var(--amber); background: #fdf5e2; }
.feedback[data-tone='info'] { border-color: var(--ink); }
.link-btn {
  font-family: var(--body);
  font-size: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--hl);
  border: 0;
  padding: 2px 8px;
  margin-left: 4px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.keys { font-size: 13.5px; color: var(--ink-3); margin: 18px 0 0; }

/* ---------- how ---------- */

.how { max-width: 1200px; margin: 0 auto; padding: 24px 24px 96px; scroll-margin-top: 16px; }
.how h2 { border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 32px; }
.how-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.how-n { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 3.4rem; line-height: 1; color: var(--ink); display: inline-block; background: linear-gradient(transparent 55%, var(--hl) 55%, var(--hl) 88%, transparent 88%); padding: 0 6px; }
.how-list h3 { font-family: var(--display); font-size: 1.4rem; letter-spacing: -0.01em; margin: 14px 0 6px; }
.how-list p { margin: 0; color: var(--ink-2); }

/* ---------- waitlist ---------- */

.waitlist { max-width: 1200px; margin: 0 auto; padding: 0 24px 96px; scroll-margin-top: 16px; }
.waitlist-card {
  background: var(--ink);
  color: var(--paper);
  border-radius: 16px;
  padding: clamp(28px, 5vw, 56px);
  position: relative;
  overflow: hidden;
}
.waitlist-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(243, 238, 226, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(243, 238, 226, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.waitlist-card > * { position: relative; }
.waitlist h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -0.025em; line-height: 1.05; margin: 0 0 12px; max-width: 20ch; }
.waitlist p { max-width: 58ch; color: rgba(243, 238, 226, 0.78); margin: 0; }
.waitlist-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; max-width: 560px; }
.waitlist-form input {
  flex: 1 1 240px;
  min-width: 0;
  font: 500 16px var(--mono);
  padding: 13px 16px;
  border-radius: 999px;
  border: 2px solid var(--paper);
  background: rgba(243, 238, 226, 0.08);
  color: var(--paper);
}
.waitlist-form input::placeholder { color: rgba(243, 238, 226, 0.5); }
.waitlist-form .btn-ink { background: var(--hl); color: var(--ink); border-color: var(--hl); }
.waitlist-form .btn-ink:hover { box-shadow: 3px 3px 0 var(--paper); }
.waitlist-msg { min-height: 1.5em; margin-top: 12px !important; font-weight: 500; }
.waitlist-msg[data-tone='good'] { color: #9fe0b5 !important; }
.waitlist-msg[data-tone='bad'] { color: #ffb4a3 !important; }
.fine { font-size: 13px; margin-top: 6px !important; color: rgba(243, 238, 226, 0.5) !important; }

/* ---------- footer ---------- */

.foot {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--rule-strong);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 24px; padding-bottom: 72px; }
  .demo { max-width: 460px; }
  .workbench { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .rail-wrap { position: static; min-width: 0; }
  .rail { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 8px; scroll-snap-type: x mandatory; }
  .rail li { flex: 0 0 auto; scroll-snap-align: start; }
  .rail-item { width: auto; min-width: 200px; }
  .how-list { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .top { padding: 16px; }
  .top-nav a:not(.nav-cta) { display: none; }
  .hero, .practice, .how { padding-left: 16px; padding-right: 16px; }
  .waitlist { padding-left: 16px; padding-right: 16px; }
  .demo-card { transform: rotate(-1deg); box-shadow: 6px 6px 0 var(--ink); }
  .demo-note { margin-left: 8px; }
  .actions .btn { padding: 11px 14px; }
  .btn kbd { display: none; }
  .foot { padding: 20px 16px; }
}
