/* ==========================================================================
   GhostFellow — one-on-one thesis mentoring
   The page is a draft on a desk: white paper, blue-pen notes from Casper,
   yellow and green highlighter. Casper's words are always handwritten.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  --desk: #eef2f6;
  --paper: #ffffff;
  --ink: #1b2230;
  --ink-soft: #4a5567;
  --line: #d8dfe8;
  --pen: #2446b5;
  --pen-strong: #1a3690;
  --on-pen: #ffffff;
  --hl-yellow: #ffe870;
  --hl-green: #bdf0cc;
  --red-pen: #c0392b;
  --good: #1f7a45;
  --shadow-sheet: 0 1px 2px rgba(27, 34, 48, 0.06), 0 14px 32px -18px rgba(27, 34, 48, 0.28);

  --casper-body: #ffffff;
  --casper-line: #1b2230;
  --casper-limb: #1b2230;
  --casper-blush: #f7a8b8;
  --casper-sweat: #a8d8ff;
  --casper-heart: #e5566f;
  --casper-glow: none;

  --font-body: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Kalam', 'Segoe Print', 'Comic Sans MS', cursive;
  --font-draft: 'Times New Roman', Times, serif;

  --radius: 8px;
  --measure: 40rem;

  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10.5l4 4 8-9' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 5.5l9 9M14.5 5.5l-9 9' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

:root.dark {
  color-scheme: dark;

  --desk: #141922;
  --paper: #1c232e;
  --ink: #e6eaf0;
  --ink-soft: #a5b0c0;
  --line: #313b4b;
  --pen: #92aaff;
  --pen-strong: #b8c8ff;
  --on-pen: #0f1420;
  --hl-yellow: #5e5316;
  --hl-green: #1d4d31;
  --red-pen: #ff8f84;
  --good: #6fd39a;
  --shadow-sheet: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 32px -18px rgba(0, 0, 0, 0.7);

  /* In the dark, Casper glows */
  --casper-body: #eef2fb;
  --casper-line: #141922;
  --casper-limb: #eef2fb;
  --casper-blush: #f59bb0;
  --casper-sweat: #8cc8ff;
  --casper-heart: #ff7088;
  --casper-glow: drop-shadow(0 0 10px rgba(190, 205, 255, 0.3));
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  overflow-x: clip;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

svg {
  display: block;
}

a {
  color: var(--pen);
  text-underline-offset: 3px;
}

ul, ol {
  padding: 0;
}

h1, h2 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h3 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

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

.container {
  width: 100%;
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.nowrap {
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--pen);
  color: var(--on-pen);
  border-radius: var(--radius);
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

/* --------------------------------------------------------------------------
   3. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.35rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background-color: var(--pen);
  color: var(--on-pen);
}

.btn-primary:hover {
  background-color: var(--pen-strong);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: progress;
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--ink-soft);
}

.btn-small {
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--ink-soft);
}

.icon-btn svg {
  width: 1.2rem;
  height: 1.2rem;
}

/* --------------------------------------------------------------------------
   4. Notice bar & header
   -------------------------------------------------------------------------- */
.notice-bar {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.notice-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
}

.notice-inner a {
  font-weight: 600;
}

.notice-dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--good);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  min-height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-right: auto;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
}

.brand svg {
  width: 2.1rem;
  height: 2.1rem;
  color: var(--pen);
}

.site-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.site-nav a {
  color: var(--ink-soft);
  font-size: 0.98rem;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.menu-toggle {
  display: none;
}

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */
.hero {
  background-color: var(--desk);
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(3rem, 7vw, 5rem);
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 3.9vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
}

.hero h1 span {
  display: block;
  text-wrap: balance;
}

.hero-lead {
  max-width: 40rem;
  margin-bottom: 1.75rem;
  font-size: clamp(1.05rem, 1.4vw, 1.15rem);
  color: var(--ink-soft);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.hero-fine {
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.tool-chips li {
  padding: 0.25rem 0.7rem;
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--ink);
}

/* The desk: a few things from a real thesis week, scattered at slight angles.
   Each item straightens up when you hover it. */
.desk {
  position: relative;
  height: 27.5rem;
}

.desk-item {
  position: absolute;
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sheet);
  rotate: var(--r, 0deg);
  transition: rotate 0.3s ease, translate 0.3s ease, box-shadow 0.3s ease;
}

.desk-item:hover {
  z-index: 5;
  rotate: 0deg;
  translate: 0 -4px;
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.win-dots {
  display: flex;
  gap: 0.25rem;
}

.win-dots i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background-color: var(--line);
}

.win-title {
  font-weight: 600;
  color: var(--ink);
}

.win-app {
  margin-left: auto;
}

/* LaTeX in an Overleaf-style window */
.desk-tex {
  --r: -3deg;
  --i: 0;
  top: 0.75rem;
  left: 0;
  width: 64%;
}

.tex {
  margin: 0;
  padding: 0.8rem 0.9rem 0.9rem;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, 'SF Mono', monospace;
  font-size: 0.74rem;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
}

.tex-cmd {
  color: var(--pen);
  font-weight: 600;
}

.tex-note {
  color: var(--good);
}

/* Reference manager list */
.desk-refs {
  --r: 2deg;
  --i: 3;
  z-index: 2;
  bottom: 1.75rem;
  right: 0;
  width: 55%;
}

.refs {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem 0.8rem;
  list-style: none;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.refs li {
  display: grid;
  grid-template-columns: 0.55rem minmax(0, 1fr);
  column-gap: 0.45rem;
}

.refs b {
  color: var(--ink);
  font-weight: 600;
}

.refs b,
.refs span {
  grid-column: 2;
}

.tag {
  grid-row: span 2;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.25rem;
  border-radius: 2px;
}

.tag-yellow { background-color: var(--hl-yellow); }
.tag-green { background-color: var(--hl-green); }
.tag-blue { background-color: var(--pen); }

/* A results figure */
.desk-chart {
  --r: -2deg;
  --i: 2;
  bottom: 0.25rem;
  left: 2%;
  width: 47%;
  margin: 0;
  padding: 0.75rem 0.8rem 0.65rem;
}

.desk-chart svg {
  width: 100%;
  height: auto;
}

.desk-chart .axis {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.2;
}

.desk-chart .grid {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.desk-chart .bar {
  fill: var(--pen);
}

.desk-chart .bar:nth-of-type(2) { opacity: 0.8; }
.desk-chart .bar:nth-of-type(3) { opacity: 0.62; }
.desk-chart .bar:nth-of-type(4) { opacity: 0.45; }

.desk-chart .whisker {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
}

.desk-chart text {
  font-family: var(--font-body);
  font-size: 9px;
  fill: var(--ink-soft);
  text-anchor: middle;
}

.desk-chart figcaption {
  margin-top: 0.35rem;
  font-family: var(--font-draft);
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.3;
  color: var(--ink-soft);
}

/* Sticky note, taped down */
.desk-note {
  --r: 5deg;
  --i: 1;
  top: 0;
  right: 0;
  width: 31%;
  padding: 1.4rem 1rem 1.1rem;
  background-color: var(--hl-yellow);
  border: 0;
  border-radius: 2px;
  font-family: var(--font-hand);
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--ink);
}

.desk-note::before {
  content: '';
  position: absolute;
  top: -0.55rem;
  left: 50%;
  width: 3.5rem;
  height: 1.1rem;
  margin-left: -1.75rem;
  background-color: color-mix(in srgb, var(--paper) 65%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  rotate: 3deg;
}

/* Deadline */
.desk-due {
  --r: -2deg;
  --i: 4;
  z-index: 3;
  top: 12.9rem;
  left: 5%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.desk-due svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: var(--red-pen);
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* One gentle entrance: the desk items settle in one after another */
@media (prefers-reduced-motion: no-preference) {
  .desk-item {
    animation: desk-settle 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
    animation-delay: calc(var(--i) * 90ms + 150ms);
  }
}

@keyframes desk-settle {
  from {
    opacity: 0;
    translate: 0 14px;
  }
}

/* The annotated draft */
.demo {
  margin-top: clamp(5rem, 7vw, 5.5rem);
}

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 42rem) minmax(15rem, 18rem);
  gap: 2.5rem;
  align-items: start;
}

.sheet {
  position: relative;
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-sheet);
}

.sheet-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.sheet-bar svg {
  width: 1rem;
  height: 1rem;
  color: var(--pen);
}

.sheet-body {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 5vw, 3rem) clamp(1.75rem, 4vw, 2.75rem);
  font-family: var(--font-draft);
  color: var(--ink);
}

.sheet-heading {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.sheet-text {
  font-size: 1.15rem;
  line-height: 2.15;
}

.sheet-text mark {
  color: inherit;
  background-color: transparent;
  background-image: linear-gradient(var(--hl-yellow), var(--hl-yellow));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 0.08em 0.04em;
}

.sheet-text mark.keep {
  background-image: linear-gradient(var(--hl-green), var(--hl-green));
}

.ref {
  margin-left: 0.1em;
  font-family: var(--font-hand);
  font-size: 0.8em;
  font-weight: 700;
  line-height: 0;
  color: var(--pen);
}

.edit {
  position: relative;
  white-space: nowrap;
}

.edit del {
  text-decoration: line-through 2px var(--pen);
}

.edit ins {
  position: absolute;
  left: 0.15em;
  bottom: 1em;
  font-family: var(--font-hand);
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1;
  color: var(--pen);
  text-decoration: none;
  transform: rotate(-3deg);
}

.notes {
  display: grid;
  gap: 1.5rem;
  padding-top: 3.5rem;
  list-style: none;
}

.notes.is-aligned {
  display: block;
  position: relative;
  padding-top: 0;
}

.notes.is-aligned .note {
  position: absolute;
  left: 0;
  right: 0;
}

.note {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.6rem;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--pen);
}

.note-num {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: 0.05rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}

.demo-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  max-width: 42rem;
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.swatch {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.15em;
  border-radius: 2px;
  vertical-align: -0.1em;
  background-color: var(--hl-yellow);
  border: 1px solid var(--line);
}

.swatch.keep {
  background-color: var(--hl-green);
}

.replay {
  display: none;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  color: var(--pen);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Animated states only apply when JS is running; without it, all notes show */
.js .replay {
  display: inline;
}

.js .sheet-text mark {
  background-size: 0% 100%;
  transition: background-size 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.js .sheet-text mark.is-on {
  background-size: 100% 100%;
}

.js .ref,
.js .edit ins {
  opacity: 0;
  transition: opacity 0.4s ease 0.5s;
}

.js .ref.is-on,
.js .edit.is-on ins {
  opacity: 1;
}

.js .edit del {
  text-decoration: none;
  background: linear-gradient(var(--pen), var(--pen)) no-repeat 0 58% / 0% 2px;
  transition: background-size 0.6s ease;
}

.js .edit.is-on del {
  background-size: 100% 2px;
}

.js .note {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.45s ease 0.35s, transform 0.45s ease 0.35s;
}

.js .note.is-on {
  opacity: 1;
  transform: none;
}

.no-anim,
.no-anim * {
  transition: none !important;
}

/* --------------------------------------------------------------------------
   6. Sections
   -------------------------------------------------------------------------- */
.section {
  padding: clamp(4rem, 9vw, 6.5rem) 0;
}

.band {
  background-color: var(--desk);
}

.section-head {
  max-width: var(--measure);
  margin-bottom: clamp(2.25rem, 5vw, 3.25rem);
}

.section-head h2 {
  margin-bottom: 0.9rem;
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  letter-spacing: -0.025em;
}

.section-head p {
  color: var(--ink-soft);
}

.section-head p + p {
  margin-top: 1rem;
}

.section-head .section-lead {
  font-size: 1.2rem;
  color: var(--ink);
}

/* A heading with Casper sitting beside it */
.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 1rem;
  margin-bottom: 0.9rem;
}

.section-head .title-row h2 {
  margin-bottom: 0;
}

/* Tick and cross lists */
.check-list,
.cross-list {
  display: grid;
  gap: 0.75rem;
  list-style: none;
}

.check-list li,
.cross-list li {
  position: relative;
  padding-left: 1.9rem;
}

.check-list li::before,
.cross-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2rem;
  width: 1.2rem;
  height: 1.2rem;
  background-color: var(--good);
  -webkit-mask: var(--icon-check) center / contain no-repeat;
  mask: var(--icon-check) center / contain no-repeat;
}

.cross-list li::before {
  background-color: var(--red-pen);
  -webkit-mask-image: var(--icon-cross);
  mask-image: var(--icon-cross);
}

/* Is this allowed? */
.dos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 58rem;
}

.dos-col {
  position: relative;
  padding: 1.75rem 1.75rem 2rem;
  background-color: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
}

.dos-col h3 {
  margin-bottom: 1.1rem;
  font-size: 1.2rem;
}

.dos-col--never {
  padding-bottom: 8rem;
}

/* What we help with */
.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.75rem, 5vw, 3.75rem) clamp(2rem, 5vw, 4.5rem);
}

.help-item {
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
}

.help-quote {
  margin-bottom: 0.9rem;
  font-size: clamp(1.3rem, 2.2vw, 1.5rem);
  line-height: 1.3;
}

.help-name {
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: var(--pen);
}

.help-summary {
  color: var(--ink-soft);
}

.help-list {
  display: grid;
  gap: 0.35rem;
  margin: 1rem 0 1.25rem;
  padding-left: 1.2rem;
}

.help-list li::marker {
  color: var(--pen);
}

.help-for {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* How it works: a timeline, so the dots and rail carry the sequence */
.steps {
  --when: 7.5rem;
  --rail: calc(var(--when) + 1.25rem);
  max-width: 54rem;
  list-style: none;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: var(--when) minmax(0, 1fr);
  column-gap: 2.5rem;
  padding-bottom: 2.75rem;
}

.step:last-child {
  padding-bottom: 0;
}

.step::before {
  content: '';
  position: absolute;
  z-index: 1;
  left: calc(var(--rail) - 7px);
  top: 0.35rem;
  width: 14px;
  height: 14px;
  border: 2.5px solid var(--pen);
  border-radius: 50%;
  background-color: var(--desk);
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: calc(var(--rail) - 1px);
  top: 1.1rem;
  bottom: -0.35rem;
  width: 2px;
  background-color: color-mix(in srgb, var(--pen) 30%, var(--line));
}

.step-when {
  font-weight: 600;
  color: var(--pen);
}

.step h3 {
  margin-bottom: 0.4rem;
  font-size: 1.3rem;
}

.step p {
  max-width: 38rem;
  color: var(--ink-soft);
}

.step .step-when {
  color: var(--pen);
}

.step .step-out {
  margin-top: 0.75rem;
  font-size: 0.98rem;
  color: var(--ink);
}

/* The last stop on the timeline is filled in: you made it */
.step-finish::before {
  background-color: var(--pen);
}

.finish {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Prices */
.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding-top: 2.25rem;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.75rem;
  background-color: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
}

.plan-main {
  border: 2px solid var(--pen);
}

.plan h3 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.price-amount {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.price-unit {
  color: var(--ink-soft);
}

.plan-summary {
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
}

.plan-list {
  margin-bottom: 2rem;
  font-size: 0.98rem;
}

.plan .btn {
  margin-top: auto;
}

.plan-note {
  position: absolute;
  bottom: calc(100% - 0.4rem);
  right: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.2rem;
  font-family: var(--font-hand);
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--pen);
  transform: rotate(-2deg);
}

.plan-note svg {
  width: 2.2rem;
  height: 2.2rem;
  margin-top: 0.4rem;
}

.fine-note {
  max-width: 44rem;
  margin-top: 2rem;
  color: var(--ink-soft);
}

.fine-note strong {
  color: var(--ink);
}

/* What students say */
.stories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3rem);
}

.story {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.story p {
  font-size: 1.1rem;
  line-height: 1.55;
}

.story footer {
  margin-top: auto;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.story strong {
  display: block;
  color: var(--ink);
}

/* FAQ */
.faq-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.faq-casper {
  margin-top: 2.5rem;
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item h3 {
  font-size: inherit;
  letter-spacing: normal;
}

.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.25rem 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.faq-q:hover {
  color: var(--pen);
}

.faq-icon {
  position: relative;
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
  background-color: var(--pen);
  transition: transform 0.25s ease;
}

.faq-icon::after {
  transform: rotate(90deg);
}

.faq-item.is-open .faq-icon::after {
  transform: rotate(0deg);
}

.faq-a p {
  max-width: 40rem;
  padding-bottom: 1.35rem;
  color: var(--ink-soft);
}

.faq-a strong {
  color: var(--ink);
}

.js .faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.js .faq-a > div {
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0.3s;
}

.js .faq-item.is-open .faq-a {
  grid-template-rows: 1fr;
}

.js .faq-item.is-open .faq-a > div {
  visibility: visible;
}

/* Book a call */
.book-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.tip-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  max-width: 30rem;
}

.casper-tip {
  padding-top: 1.5rem;
  font-family: var(--font-hand);
  color: var(--pen);
}

.casper-tip p {
  font-size: 1.2rem;
  line-height: 1.4;
  transition: opacity 0.3s ease;
}

.casper-tip footer {
  margin-top: 0.4rem;
  font-size: 1rem;
  font-weight: 700;
}

.form-card {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sheet);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  align-content: start;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.95rem;
  font-weight: 600;
}

.optional {
  font-weight: 400;
  color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background-color: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
}

.field input,
.field select {
  height: 3rem;
  padding-top: 0;
  padding-bottom: 0;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--ink-soft);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--pen);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.8;
}

.field textarea {
  resize: vertical;
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-error {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--red-pen);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--ink);
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.5rem;
}

.form-foot p {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.form-done {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.form-done:focus {
  outline: none;
}

.form-done h3 {
  margin-bottom: 0.3rem;
  font-size: 1.3rem;
}

.form-done p {
  color: var(--ink-soft);
}

.form-done-icon {
  position: relative;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--pen);
}

.form-done-icon::after {
  content: '';
  position: absolute;
  inset: 0.6rem;
  background-color: var(--on-pen);
  -webkit-mask: var(--icon-check) center / contain no-repeat;
  mask: var(--icon-check) center / contain no-repeat;
}

/* --------------------------------------------------------------------------
   7. Casper
   One small, pressable ghost per section, each with its own mood.
   script.js clones the SVG from #casper-template and sets data-eyes,
   data-mouth, data-brows, data-blush and has-* classes to change his face.
   -------------------------------------------------------------------------- */
.casper {
  position: relative;
  display: inline-block;
  flex: none;
  width: 84px;
  vertical-align: bottom;
}

.casper--small {
  width: 64px;
}

.casper--large {
  width: 136px;
}

.casper-btn {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 14px;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.c-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: var(--casper-glow);
  transition: transform 0.3s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.casper-btn:hover .c-svg {
  transform: translateY(-3px);
}

.c-svg * {
  transform-box: view-box;
}

/* Drawing */
.c-body,
.c-cap-board {
  fill: var(--casper-body);
  stroke: var(--casper-line);
  stroke-width: 2;
  stroke-linejoin: round;
}

.c-arm,
.c-arms-hips path,
.c-glasses,
.c-sleep-eyes,
.c-happy-eyes,
.c-brows,
.c-mouth,
.c-cap-tassel {
  fill: none;
  stroke: var(--casper-line);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.c-pupils circle,
.m-o,
.m-open {
  fill: var(--casper-line);
}

/* Arms and tassel sit outside his body, so in the dark they're drawn light */
.c-arm,
.c-arms-hips path,
.c-cap-tassel {
  stroke: var(--casper-limb);
}

.c-cap-bead {
  fill: var(--casper-limb);
}

.c-pupils {
  transition: transform 0.15s ease-out;
}

.c-pupils circle {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.08s ease;
}

.c-cheeks ellipse {
  fill: var(--casper-blush);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.c-pen {
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.8;
  stroke-linecap: round;
}

.c-sweat {
  fill: var(--casper-sweat);
  stroke: var(--casper-line);
  stroke-width: 1;
}

.c-think,
.c-zzz text {
  font-family: var(--font-hand);
  font-weight: 700;
  fill: var(--pen);
}

.c-think {
  font-size: 17px;
}

.c-zzz text {
  font-size: 10px;
}

.c-zzz text:nth-child(2) {
  font-size: 12px;
}

.c-zzz text:nth-child(3) {
  font-size: 15px;
}

.c-heart {
  fill: var(--casper-heart);
}

.c-sparkles path {
  fill: var(--pen);
  transform-box: fill-box;
  transform-origin: center;
}

/* Parts that only show for some moods */
.c-arms-hips,
.c-pen,
.c-sleep-eyes,
.c-happy-eyes,
.c-brows,
.m-flat,
.m-wavy,
.m-o,
.m-open,
.c-sweat,
.c-think,
.c-zzz,
.c-heart,
.c-sparkles {
  display: none;
}

.casper[data-eyes] .c-eyes,
.casper[data-mouth] .m-smile {
  display: none;
}

.casper[data-eyes="sleep"] .c-sleep-eyes,
.casper[data-eyes="happy"] .c-happy-eyes,
.casper[data-mouth="flat"] .m-flat,
.casper[data-mouth="wavy"] .m-wavy,
.casper[data-mouth="o"] .m-o,
.casper[data-mouth="open"] .m-open,
.casper[data-brows="worried"] .brows-worried,
.casper[data-brows="firm"] .brows-firm,
.casper.has-pen .c-pen,
.casper.has-sweat .c-sweat,
.casper.has-q .c-think-q,
.casper.has-x .c-think-x,
.casper.has-zzz .c-zzz,
.casper.has-hips .c-arms-hips,
.casper.is-hearting .c-heart,
.casper.is-sparkling .c-sparkles {
  display: inline;
}

.casper.has-hips .c-arms {
  display: none;
}

.casper[data-blush] .c-cheeks ellipse {
  opacity: 1;
}

.casper.is-blink .c-pupils circle {
  transform: scaleY(0.1);
}

.casper.cap-tilt .c-cap {
  transform: rotate(-14deg) translate(-2px, 3px);
  transform-origin: 40px 19px;
}

/* Reactions */
.casper.is-hop .c-float {
  animation: casper-hop 0.45s ease-out;
}

.casper.is-shake .c-float {
  transform-origin: 40px 72px;
  animation: casper-shake 0.6s ease-in-out;
}

.casper.is-tilt .c-float {
  transform-origin: 40px 72px;
  animation: casper-tilt 0.9s ease-in-out;
}

.casper.is-toss .c-cap {
  transform-origin: 40px 19px;
  animation: casper-toss 1s cubic-bezier(0.3, 0.7, 0.4, 1);
}

.casper.is-wave .c-arm-r {
  transform-origin: 59px 56px;
  animation: casper-wave 0.9s ease-in-out;
}

.casper.is-hearting .c-heart {
  transform-origin: 68px 26px;
  animation: casper-heart 1.4s ease-out forwards;
}

.casper.is-sparkling .c-sparkles path {
  animation: casper-sparkle 1.1s ease-out forwards;
}

.casper.is-sparkling .c-sparkles path:nth-child(2) {
  animation-delay: 0.12s;
}

.casper.is-sparkling .c-sparkles path:nth-child(3) {
  animation-delay: 0.24s;
}

.casper.has-zzz .c-zzz text {
  animation: casper-zzz 3s ease-in-out infinite;
}

.casper.has-zzz .c-zzz text:nth-child(2) {
  animation-delay: 0.6s;
}

.casper.has-zzz .c-zzz text:nth-child(3) {
  animation-delay: 1.2s;
}

@keyframes casper-hop {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-7px); }
  70% { transform: translateY(1px); }
}

@keyframes casper-shake {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(-7deg); }
  40%, 80% { transform: rotate(7deg); }
}

@keyframes casper-tilt {
  0%, 100% { transform: rotate(0); }
  30%, 70% { transform: rotate(-10deg); }
}

@keyframes casper-toss {
  0% { transform: translateY(0) rotate(0); }
  45% { transform: translateY(-30px) rotate(200deg); }
  100% { transform: translateY(0) rotate(360deg); }
}

@keyframes casper-wave {
  0%, 100% { transform: rotate(0); }
  25%, 75% { transform: rotate(-40deg); }
  50% { transform: rotate(-10deg); }
}

@keyframes casper-heart {
  0% { opacity: 0; transform: translateY(4px) scale(0.6); }
  25% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-16px) scale(1); }
}

@keyframes casper-sparkle {
  0% { opacity: 0; transform: scale(0.3); }
  35% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(0.8); }
}

@keyframes casper-zzz {
  0% { opacity: 0; transform: translate(0, 3px); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translate(3px, -5px); }
}

/* Speech bubble: sits above Casper and grows to the left by default */
.casper-bubble {
  position: absolute;
  z-index: 5;
  bottom: calc(100% + 8px);
  right: -4px;
  width: max-content;
  max-width: 13rem;
  padding: 0.35rem 0.8rem 0.4rem;
  background-color: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  font-family: var(--font-hand);
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--ink);
  opacity: 0;
  translate: var(--nudge, 0px) 0;
  transform: translateY(4px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

/* The tail keeps pointing at Casper even when the bubble is nudged */
.casper-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 22px;
  translate: calc(var(--nudge, 0px) * -1) 0;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  background-color: var(--paper);
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
}

.casper.is-talking .casper-bubble {
  opacity: 1;
  transform: none;
}

.casper--bubble-start .casper-bubble {
  right: auto;
  left: -4px;
  transform-origin: bottom left;
}

.casper--bubble-start .casper-bubble::after {
  right: auto;
  left: 22px;
}

/* Hero: peeking over the top edge of the draft */
.casper--peek {
  position: absolute;
  bottom: 100%;
  right: 1.75rem;
}

.casper--peek .casper-btn {
  height: 82px;
  overflow: hidden;
  border-radius: 0;
}

/* Only his cap and eyes show over the paper; he rises when you come close */
.casper--peek .c-svg {
  transform: translateY(26px);
}

.casper--peek .casper-btn:hover .c-svg,
.casper--peek.is-talking .c-svg {
  transform: translateY(11px);
}

.casper--peek .casper-bubble {
  bottom: auto;
  top: 6px;
  right: calc(100% + 10px);
  transform-origin: right center;
}

.casper--peek .casper-bubble::after {
  top: calc(50% - 5px);
  right: -6px;
  translate: none;
  margin-top: 0;
  border: 0;
  border-top: 1.5px solid var(--ink);
  border-right: 1.5px solid var(--ink);
}

/* "What we never do": standing in the corner of the box */
.casper--corner {
  position: absolute;
  right: 1.25rem;
  bottom: 1rem;
}

/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 3.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-about p + p {
  margin-top: 0.75rem;
}

.footer-brand-row {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
}

.footer-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.footer-honor {
  max-width: 24rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--line);
}

.footer-col h2 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  letter-spacing: normal;
  color: var(--ink);
}

.footer-col ul {
  display: grid;
  gap: 0.5rem;
  list-style: none;
}

.footer-col a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .hero-top {
    grid-template-columns: minmax(0, 1fr);
  }

  .desk {
    width: 100%;
    max-width: 32rem;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0.5rem clamp(1rem, 4vw, 2rem) 1.25rem;
    background-color: var(--paper);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav a {
    display: block;
    padding: 0.75rem 0;
    font-size: 1.05rem;
    color: var(--ink);
  }
}

@media (max-width: 860px) {
  .demo-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .notes {
    padding-top: 0;
    gap: 1rem;
  }

  .help-grid,
  .stories,
  .faq-layout,
  .book-layout,
  .dos {
    grid-template-columns: minmax(0, 1fr);
  }

  .plans {
    grid-template-columns: minmax(0, 1fr);
    max-width: 30rem;
    gap: 3rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-about {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  /* On phones the draft below does the showing; the desk would only push it down */
  .desk {
    display: none;
  }

  .step {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 2rem;
  }

  .step::before {
    left: 0;
    top: 0.3rem;
  }

  .step:not(:last-child)::after {
    left: 6px;
  }

  .step-when {
    margin-bottom: 0.2rem;
  }
}

@media (max-width: 520px) {
  .header-cta {
    display: none;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .casper-art {
    width: 5.5rem;
    height: 5.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  /* Casper still changes his face, he just doesn't move */
  .casper * {
    animation: none !important;
  }
}
