/* Hands-On Excel: white page, one green, and the spreadsheet in the middle. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f9f7;
  --line: #e4ece7;
  --line-strong: #cddbd3;
  --ink: #0f1f17;
  --ink-2: #46574e;
  --ink-3: #6f8077;
  --green: #0f7a48;
  --green-hover: #0b6239;
  --green-soft: #e8f5ee;
  --green-tint: #f3faf6;
  --green-line: #d3eadc;
  --amber: #9a5b00;
  --amber-soft: #fff6e6;
  --red: #b42318;
  --red-soft: #fff1f0;
  --blue: #2563eb;
  --radius: 12px;
  --sans: 'Schibsted Grotesk', 'Helvetica Neue', Arial, 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;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.15; }
code, kbd { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px; padding: 0.05em 0.35em; }
kbd {
  display: inline-block;
  padding: 0 0.4em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  line-height: 1.4;
}
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.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: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* The colour of the cells the learner fills in, used inline in instructions. */
.swatch {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  vertical-align: -0.12em;
  background: var(--green-tint);
  border: 1.5px solid var(--green);
  border-radius: 3px;
}

.wrap, .top, .hero, .practice, .block, .page-hero, .guide, .foot { max-width: 968px; margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }

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

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-mark { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.brand-mark i { width: 9px; height: 9px; border-radius: 2px; background: var(--line-strong); }
.brand-mark i.on { background: var(--green); }
.top-nav { display: flex; align-items: center; gap: 22px; font-size: 15px; color: var(--ink-2); }
.top-nav a { text-decoration: none; }
.top-nav a:hover { color: var(--ink); }
.top-nav .nav-cta { color: var(--ink); }

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

.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.3;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-green, .btn-ink, .btn-hl { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover, .btn-ink:hover, .btn-hl:hover { background: var(--green-hover); border-color: var(--green-hover); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); padding-inline: 10px; }
.btn-quiet:hover { color: var(--ink); background: var(--bg-soft); border-color: transparent; }
.btn kbd { font-size: 11px; border-color: currentColor; background: transparent; opacity: 0.7; }

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

.hero { padding-top: 56px; padding-bottom: 32px; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 16px; }
.hero h1 em { font-style: normal; color: var(--green); }
.hero .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 54ch; margin: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-3); }
.facts li::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 8px; vertical-align: 2px; }

/* ---------- exercise page hero ---------- */

.page-hero { padding-top: 32px; padding-bottom: 28px; }
.crumbs { font-size: 14px; color: var(--ink-3); margin: 0 0 14px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--green); }
.page-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3rem); letter-spacing: -0.035em; font-weight: 800; line-height: 1.06; margin: 0; }
.page-hero .lede { font-size: 1.1rem; color: var(--ink-2); max-width: 58ch; margin: 14px 0 0; }
.page-meta { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 14px; color: var(--ink-3); margin: 14px 0 0; }
.page-meta span + span::before { content: '·'; margin: 0 10px; color: var(--line-strong); }

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

.practice { scroll-margin-top: 12px; }
.bench {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 31, 23, 0.04), 0 12px 32px -16px rgba(15, 31, 23, 0.14);
  overflow: hidden;
}

/* challenge steps */
.steps { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.rail { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.rail::-webkit-scrollbar { display: none; }
.rail li { flex: none; }
.rail-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.rail-item:hover { color: var(--ink); background: #fff; }
.rail-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink-3);
}
.rail-item.is-solved .rail-mark { background: var(--green); border-color: var(--green); color: #fff; }
.rail-item.is-current { background: #fff; border-color: var(--line-strong); color: var(--ink); font-weight: 600; }
.rail-item.is-current:not(.is-solved) .rail-mark { border-color: var(--ink); color: var(--ink); }
.progress { flex: none; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }

/* task */
.task { padding: 24px 24px 0; }
.task-meta { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 6px; }
.task-title { font-size: 1.6rem; letter-spacing: -0.025em; margin: 0 0 8px; }
.task-prompt { font-size: 1.05rem; margin: 0 0 4px; max-width: 64ch; }
.task-tip { color: var(--ink-2); font-size: 0.95rem; margin: 0; max-width: 64ch; }

/* sheet */
.sheet-frame { position: relative; margin: 20px 24px 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; overflow: hidden; }
.fxbar { display: flex; align-items: stretch; border-bottom: 1px solid var(--line-strong); font-family: var(--mono); }
.namebox { min-width: 60px; padding: 9px 12px; border-right: 1px solid var(--line); 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(--line); }
.fx-label i { color: var(--ink-3); font-size: 14px; }
.fx {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: 500 14.5px var(--mono);
  color: var(--ink);
  padding: 9px 12px;
  outline: none;
}
.fx:focus { background: var(--green-tint); }
.fx.is-locked { color: var(--ink-3); }

.grid-scroll { overflow-x: auto; }
.grid { outline: none; width: max-content; min-width: 100%; }
.grid:focus-visible { box-shadow: inset 0 0 0 2px var(--green); }

.sheet { border-collapse: collapse; font-family: var(--mono); font-size: 14px; table-layout: fixed; user-select: none; }
.sheet .col-rownum { width: 40px; }
.sheet th {
  background: var(--bg-soft);
  color: var(--ink-3);
  font-weight: 500;
  font-size: 12px;
  height: 28px;
  border: 1px solid var(--line);
  transition: background-color 0.15s, color 0.15s;
}
.sheet th.is-active { background: var(--green-soft); color: var(--green); font-weight: 600; }
.sheet td {
  position: relative;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  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; }
.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'] { color: var(--ink); overflow: visible; }
.sheet td.is-target { background: var(--green-tint); box-shadow: inset 0 0 0 1px rgba(15, 122, 72, 0.22); }
.sheet td.is-input { background: #eef4ff; }
.sheet td.is-target.is-formula { background: var(--green-soft); }
.sheet td.is-selected { box-shadow: inset 0 0 0 2px var(--green); z-index: 1; }
.sheet td.is-selected::before {
  content: '';
  position: absolute;
  right: -1px; bottom: -1px;
  width: 7px; height: 7px;
  background: var(--green);
  border: 1.5px solid #fff;
}

/* reference highlights while writing a formula (colours follow Excel's) */
.sheet td[data-hl] { --hlc: var(--blue); background-image: linear-gradient(color-mix(in srgb, var(--hlc) 10%, transparent), color-mix(in srgb, var(--hlc) 10%, transparent)); }
.sheet td[data-hl='1'] { --hlc: #c2410c; }
.sheet td[data-hl='2'] { --hlc: #7c3aed; }
.sheet td[data-hl='3'] { --hlc: #0e7490; }
.sheet td[data-hl='4'] { --hlc: #a16207; }
.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: #bfe3cf; } 100% { background-color: var(--green-soft); } }

/* actions + feedback */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 24px; }
.actions .spacer { flex: 1; }

.feedback {
  margin: 0 24px 20px;
  padding: 14px 16px 14px 46px;
  border-radius: 10px;
  background: var(--bg-soft);
  font-size: 15px;
  position: relative;
  animation: appear 0.2s ease-out both;
}
.feedback::before {
  content: 'i';
  position: absolute;
  left: 14px;
  top: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--ink-3);
}
.feedback[data-tone='good'] { background: var(--green-soft); }
.feedback[data-tone='good']::before { content: '✓'; background: var(--green); }
.feedback[data-tone='bad'] { background: var(--red-soft); }
.feedback[data-tone='bad']::before { content: '!'; background: var(--red); }
.feedback[data-tone='warn'] { background: var(--amber-soft); }
.feedback[data-tone='warn']::before { content: '!'; background: var(--amber); }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.link-btn { font-weight: 600; color: var(--green); text-decoration: none; margin-left: 4px; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
.keys { font-size: 13.5px; color: var(--ink-3); margin: 0; padding: 0 24px 20px; }
.feedback:not([hidden]) + .keys { display: none; }

/* ---------- sections ---------- */

.block { padding-top: 72px; scroll-margin-top: 12px; }
.block > h2 { font-size: 1.5rem; margin: 0 0 20px; }

.how-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 0; padding: 0; list-style: none; }
.how-list li { border-top: 2px solid var(--ink); padding-top: 14px; }
.how-list li:first-child { border-top-color: var(--green); }
.how-list h3 { font-size: 1.05rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.how-list p { margin: 0; color: var(--ink-2); font-size: 0.97rem; }

/* all challenges */
.ch-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ch-list a { display: grid; grid-template-columns: 36px 1fr auto 22px; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.ch-list a:hover { background: var(--bg-soft); }
.ch-list a[aria-current] { background: var(--green-tint); }
.ch-n { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.ch-t { font-weight: 600; }
.ch-t span { display: block; font-weight: 400; font-size: 14px; color: var(--ink-3); }
.ch-lv { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.ch-st { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; color: #fff; }
.ch-st.is-solved { background: var(--green); border-color: var(--green); }

/* pro */
.pro-card { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 28px; border-radius: 16px; background: var(--green-tint); border: 1px solid var(--green-line); }
.pro-tag { display: inline-block; font-family: var(--mono); font-size: 12px; color: var(--green); background: #fff; border: 1px solid var(--green-line); border-radius: 999px; padding: 2px 10px; margin: 0 0 10px; }
.pro-card h2 { font-size: 1.35rem; margin: 0 0 6px; }
.pro-card p { margin: 0; color: var(--ink-2); max-width: 52ch; }
.pro-price { text-align: right; }
.price { display: block; font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.price sup { font-size: 0.5em; vertical-align: 0.7em; margin-right: 1px; }
.price-note { display: block; color: var(--ink-3); font-size: 13px; margin: 4px 0 12px; }
.pro-price .fine { margin: 8px 0 0; }

.pro-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 64px -24px rgba(15, 31, 23, 0.35);
}
.pro-dialog::backdrop { background: rgba(15, 31, 23, 0.35); backdrop-filter: blur(2px); }
.pro-dialog h2 { font-size: 1.5rem; margin: 0 0 8px; }
.pro-dialog p { margin: 0; color: var(--ink-2); }
.dialog-close { position: absolute; top: 10px; right: 10px; margin: 0; }

/* waitlist */
.signup { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; align-items: end; }
.signup h2 { font-size: 1.5rem; margin: 0 0 6px; }
.signup p { margin: 0; color: var(--ink-2); }
.waitlist-form { display: flex; gap: 8px; margin-top: 16px; }
.signup .waitlist-form { margin-top: 0; }
.waitlist-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.waitlist-form input::placeholder { color: var(--ink-3); }
.waitlist-form input:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: transparent; }
.signup-side { min-width: 0; }
.waitlist-msg { min-height: 1.4em; margin: 8px 0 0 !important; font-size: 14px; font-weight: 500; }
.waitlist-msg[data-tone='good'] { color: var(--green) !important; }
.waitlist-msg[data-tone='bad'] { color: var(--red) !important; }
.fine { font-size: 13px; color: var(--ink-3) !important; margin: 4px 0 0 !important; }

/* "How did you find us?" after joining */
.found { margin: 10px 0 4px; }
.found p { font-size: 14px; margin: 0 0 8px !important; color: var(--ink-2); }
.found-options { display: flex; flex-wrap: wrap; gap: 6px; }
.found-opt {
  font: inherit;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line-strong);
}
.found-opt:hover, .found-opt:focus-visible { color: var(--green); border-color: var(--green); background: var(--green-tint); }

/* ---------- guide (exercise pages) ---------- */

.guide { padding-top: 72px; font-size: 1.04rem; }
.guide > * { max-width: 680px; }
.guide .eyebrow { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--green); margin: 0; }
.guide h2 { font-size: 1.45rem; margin: 36px 0 10px; }
.guide .eyebrow + h2 { margin-top: 10px; }
.guide p, .guide li { color: #23332b; }
.guide ul, .guide ol { padding-left: 1.3em; }
.guide li { margin: 6px 0; }
.guide pre { background: var(--bg-soft); border: 1px solid var(--line); border-left: 3px solid var(--green); padding: 12px 16px; border-radius: 8px; overflow-x: auto; }
.guide pre code { background: none; border: 0; padding: 0; font-size: 0.95rem; }
.ref-table { border-collapse: collapse; width: 100%; font-size: 0.95rem; margin: 12px 0; }
.ref-table th, .ref-table td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.ref-table th { background: var(--bg-soft); font-weight: 600; }
.faq dt { font-weight: 600; margin-top: 18px; }
.faq dd { margin: 4px 0 0; color: var(--ink-2); }
.guide-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-weight: 600; }
.guide-nav a { color: var(--green); text-decoration: none; }
.guide-nav a:hover { text-decoration: underline; }

/* ---------- 404 ---------- */

.notfound { padding-bottom: 40px; }
.notfound h1 code { background: none; border: 0; padding: 0; color: var(--red); font-size: 0.9em; }
.notfound-list { list-style: none; padding: 0; margin: 18px 0 28px; display: grid; gap: 8px; max-width: 520px; }
.notfound-list a { display: block; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 10px; text-decoration: none; }
.notfound-list a:hover { border-color: var(--green); background: var(--green-tint); }

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

.foot { margin-top: 80px; border-top: 1px solid var(--line); padding-top: 24px; padding-bottom: 40px; font-size: 13.5px; color: var(--ink-3); display: grid; gap: 8px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--green); }

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

@media (max-width: 720px) {
  .wrap, .top, .hero, .practice, .block, .page-hero, .guide, .foot { padding-left: 16px; padding-right: 16px; }
  .top-nav a:not(.nav-cta) { display: none; }
  .hero { padding-top: 36px; padding-bottom: 24px; }
  .bench { border-radius: 14px; }
  .task { padding: 20px 16px 0; }
  .sheet-frame { margin: 16px 16px 0; }
  .actions { padding: 14px 16px; }
  .actions .spacer { display: none; }
  .btn kbd { display: none; }
  .feedback { margin: 0 16px 16px; }
  .keys { display: none; }
  .rail-item:not(.is-current) .rail-title { display: none; }
  .rail-item:not(.is-current) { padding-right: 6px; }
  .block { padding-top: 56px; }
  .how-list { grid-template-columns: 1fr; gap: 20px; }
  .ch-list a { grid-template-columns: 28px 1fr 22px; }
  .ch-lv { display: none; }
  .pro-card, .signup { grid-template-columns: 1fr; }
  .pro-price { text-align: left; }
  .guide { padding-top: 56px; }
}
