/* ==========================================================================
   The Prompt Lessons — AI for Everyone
   25 techniques, each shown four ways.

   The content is 1920s success-literature framing ("The Council of Invisible
   Counselors") pointed at modern AI tools. The design answers that with a
   correspondence-course structure — numbered lessons in a standing rail —
   but in cool ink and electric violet rather than the obvious sepia.

   The repeating unit of the whole site is one idea: a weak prompt beside a
   strong one. Everything else stays quiet so that pair can carry the page.
   ========================================================================== */

:root {
  --ink:      #11162B;
  --ink-2:    #2B3350;
  --slate:    #5A6478;
  --mist:     #D7DCE5;
  --mist-2:   #E8ECF1;
  --paper:    #F2F4F7;
  --white:    #FFFFFF;
  --violet:   #5B3DF5;
  --violet-d: #4327D6;
  --violet-w: #EEEBFE;

  /* Platform identity. These are wayfinding, not decoration — the accent
     tells you which tab you are reading without looking up. */
  --chatgpt:    #0E8A6B;
  --chatgpt-w:  #E3F3EE;
  --claude:     #C2571B;
  --claude-w:   #FBEDE3;
  --gemini:     #2B6BE4;
  --gemini-w:   #E6EEFC;
  --perplexity: #0E7F8C;
  --perplexity-w:#E2F1F3;

  --display: 'Fraunces', Georgia, serif;
  --body:    'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --rail: 20rem;
  --r:    10px;
  --r-sm: 6px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }

/* Fraunces is variable: SOFT rounds the terminals, WONK lets it lean odd.
   A little of both keeps the display voice from reading as a stock serif. */
.display {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1, 'opsz' 40;
  font-weight: 600;
  letter-spacing: -0.02em;
}

a { color: var(--violet); }
a:hover { color: var(--violet-d); }

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

button { font: inherit; cursor: pointer; }

.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;
}

/* ---------------------------------------------------------------- shell -- */

.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

/* ----------------------------------------------------------------- rail -- */

.rail {
  background: var(--ink);
  color: #C9D0E0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.rail__head { padding: 1.5rem 1.4rem 1rem; border-bottom: 1px solid #262E4A; }

.brand {
  display: block;
  color: #fff;
  text-decoration: none;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1, 'opsz' 28;
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.brand span { display: block; font-family: var(--body); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.08em; color: #7F8AA8; margin-top: 0.4rem; }

.rail__search { padding: 0.9rem 1.4rem; border-bottom: 1px solid #262E4A; }
.rail__search input {
  width: 100%;
  background: #1C233C;
  border: 1px solid #2E3756;
  color: #fff;
  font-family: var(--body);
  font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--r-sm);
}
.rail__search input::placeholder { color: #6D789A; }
.rail__search input:focus { border-color: var(--violet); outline: none; }

.rail__list { flex: 1; overflow-y: auto; padding: 0.6rem 0 2rem; scrollbar-width: thin; }
.rail__list::-webkit-scrollbar { width: 8px; }
.rail__list::-webkit-scrollbar-thumb { background: #2E3756; border-radius: 4px; }

.lesson {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.7rem;
  align-items: baseline;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-left: 3px solid transparent;
  padding: 0.6rem 1.4rem 0.6rem 1.1rem;
  color: #AEB8CE;
  font-size: 0.88rem;
  line-height: 1.35;
}
.lesson:hover { background: #1A2138; color: #fff; }
.lesson__no {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #6D789A;
  font-variant-numeric: tabular-nums;
}
.lesson { text-decoration: none; }
.lesson[aria-current='page'] { background: #1C233C; color: #fff; border-left-color: var(--violet); }
.lesson[aria-current='page'] .lesson__no { color: #9B8BFA; }
.lesson.is-hidden { display: none; }

.rail__empty { padding: 1rem 1.4rem; font-size: 0.85rem; color: #6D789A; }

/* ------------------------------------------------------------------ main -- */

.main { min-width: 0; }
.wrap { max-width: 56rem; margin: 0 auto; padding: 0 2rem 6rem; }

/* ------------------------------------------------------------------ hero -- */
/* The one orchestrated moment on the site: the weak prompt gives way to the
   strong one, once, on load. It is the whole argument of the book in a gesture. */

.hero { background: var(--white); border-bottom: 1px solid var(--mist); }
.hero__inner { max-width: 56rem; margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) 2rem clamp(2.5rem, 5vw, 4rem); }

.hero h1 {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1, 'opsz' 100;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 16ch;
  margin-bottom: 1.2rem;
}

.hero__lede { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--ink-2); max-width: 54ch; line-height: 1.5; }

.hero__meta { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--mist); }
.hero__stat b { display: block; font-family: var(--mono); font-size: 1.5rem; font-weight: 500; letter-spacing: -0.03em; }
.hero__stat span { font-size: 0.82rem; color: var(--slate); }

/* the demo pair */
.demo { margin-top: 2.5rem; display: grid; gap: 0.9rem; }
@media (min-width: 46rem) { .demo { grid-template-columns: 1fr 1.45fr; align-items: start; } }

.demo__card { border-radius: var(--r); padding: 1.1rem 1.2rem; }
.demo__card h2 { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; margin-bottom: 0.6rem; }
.demo__card p { margin: 0; font-family: var(--mono); font-size: 0.82rem; line-height: 1.55; }

.demo__weak { background: var(--mist-2); border: 1px solid var(--mist); }
.demo__weak h2 { color: var(--slate); }
.demo__weak p { color: var(--ink-2); }

.demo__strong { background: var(--ink); color: #fff; border: 1px solid var(--ink); position: relative; }
.demo__strong h2 { color: #9B8BFA; }
.demo__strong p { color: #DCE1EC; }

.demo__strong { animation: rise 0.6s cubic-bezier(0.2, 0.75, 0.25, 1) 0.25s backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------- chapter --- */

.chapter { padding-top: 2.75rem; }

.chapter__eyebrow { font-family: var(--mono); font-size: 0.76rem; color: var(--slate); margin-bottom: 0.5rem; }

.chapter h2 {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1, 'opsz' 72;
  font-size: clamp(1.9rem, 4.2vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.chapter__principle { font-size: 1.1rem; line-height: 1.55; color: var(--ink-2); max-width: 58ch; }

.chapter__when {
  margin-top: 1.1rem;
  padding: 0.85rem 1.1rem;
  background: var(--violet-w);
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  max-width: 58ch;
}
.chapter__when b {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--violet-d);
  margin-bottom: 0.25rem;
}

/* -------------------------------------------------------------- index ---- */

.index { padding-top: 3rem; }
.index__head { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.025em; margin-bottom: 0.5rem; }
.index__sub { color: var(--slate); max-width: 52ch; margin: 0 0 2rem; }

.index__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px;
  background: var(--mist); border: 1px solid var(--mist); border-radius: var(--r); overflow: hidden; }
@media (min-width: 42rem) { .index__grid { grid-template-columns: 1fr 1fr; } }

.index__grid a {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.2rem 0.8rem;
  background: var(--white);
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: var(--ink);
  height: 100%;
  align-content: start;
}
.index__grid a:hover { background: var(--violet-w); }
.index__no { font-family: var(--mono); font-size: 0.76rem; color: var(--violet); grid-row: span 2; }
.index__grid b { font-weight: 600; font-size: 0.98rem; line-height: 1.3; }
.index__gist { font-size: 0.86rem; color: var(--slate); line-height: 1.45; grid-column: 2; }

/* --------------------------------------------------------------- tabs ---- */

.tabs { display: flex; gap: 0.4rem; margin: 2.25rem 0 0; flex-wrap: wrap; }

.tab {
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: var(--r-sm);
  padding: 0.55rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--slate);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.14s, color 0.14s;
}
.tab i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.55; }
.tab:hover { color: var(--ink); border-color: var(--slate); }
.tab { text-decoration: none; }
.tab[aria-current='page'] { color: var(--pf); border-color: var(--pf); background: var(--pf-w); }
.tab[aria-current='page'] i { opacity: 1; }

/* -------------------------------------------------------------- panel ---- */

.panel { border-top: 2px solid var(--pf); margin-top: -1px; padding-top: 1.75rem; }

.approach { font-size: 1.02rem; line-height: 1.6; max-width: 60ch; }

.caveat {
  margin-top: 1.1rem;
  border-left: 3px solid var(--pf);
  background: var(--pf-w);
  padding: 0.85rem 1.1rem;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 0.93rem;
  line-height: 1.55;
  max-width: 60ch;
}
.caveat b { display: block; font-size: 0.74rem; letter-spacing: 0.06em; color: var(--pf); margin-bottom: 0.3rem; }

.tips { margin: 1.6rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.tips li {
  display: grid; grid-template-columns: 1.2rem 1fr; gap: 0.6rem;
  font-size: 0.94rem; line-height: 1.5; color: var(--ink-2);
}
.tips li::before { content: '→'; color: var(--pf); font-weight: 600; }

/* ------------------------------------------------------------- prompts --- */

.prompts { margin-top: 2.5rem; display: grid; gap: 1.6rem; }

.pair { background: var(--white); border: 1px solid var(--mist); border-radius: var(--r); overflow: hidden; }

.pair__head {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--mist);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--slate);
  background: #FAFBFC;
}

.pair__weak { padding: 1rem 1.2rem; border-bottom: 1px dashed var(--mist); }
.pair__weak h2, .pair__strong h2 {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  margin: 0 0 0.5rem; color: var(--slate);
}
.pair__weak p {
  margin: 0; font-family: var(--mono); font-size: 0.84rem; line-height: 1.55;
  color: var(--slate); text-decoration: line-through; text-decoration-color: var(--mist);
}

.pair__strong { padding: 1rem 1.2rem 1.2rem; }
.pair__strong h2 { color: var(--pf); }
.pair__strong pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  background: #FAFBFD;
  border: 1px solid var(--mist-2);
  border-radius: var(--r-sm);
  padding: 0.9rem 1rem;
  max-height: 26rem;
  overflow: auto;
}

.pair__foot { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.8rem; flex-wrap: wrap; }

.copy {
  background: var(--pf);
  color: #fff;
  border: 0;
  border-radius: var(--r-sm);
  padding: 0.5rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
}
.copy:hover { filter: brightness(0.92); }
.copy.is-done { background: var(--ink); }

.open {
  border: 1px solid var(--mist);
  background: var(--white);
  color: var(--ink-2);
  border-radius: var(--r-sm);
  padding: 0.5rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}
.open:hover { border-color: var(--pf); color: var(--pf); }

.pair__len { font-family: var(--mono); font-size: 0.76rem; color: var(--slate); margin-left: auto; }

/* ----------------------------------------------------------------- nav --- */

.chapnav { display: flex; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--mist); }
.chapnav a {
  flex: 1; text-decoration: none; color: var(--ink);
  border: 1px solid var(--mist); border-radius: var(--r);
  padding: 0.9rem 1.1rem; background: var(--white);
}
.chapnav a:hover { border-color: var(--violet); }
.chapnav span { display: block; font-size: 0.74rem; color: var(--slate); margin-bottom: 0.2rem; }
.chapnav b { font-weight: 600; font-size: 0.95rem; line-height: 1.3; display: block; }
.chapnav .next { text-align: right; }

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

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(150%);
  background: var(--ink); color: #fff; padding: 0.7rem 1.2rem; border-radius: var(--r-sm);
  font-size: 0.9rem; z-index: 60; transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.is-up { transform: translateX(-50%) translateY(0); }

.railtoggle { display: none; }

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

@media (max-width: 62rem) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; inset: 0 auto 0 0; width: min(85vw, var(--rail));
    transform: translateX(-100%); transition: transform 0.25s ease; z-index: 50;
  }
  .rail.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(17, 22, 43, 0.45); }
  .railtoggle {
    display: inline-flex; align-items: center; gap: 0.5rem;
    position: sticky; top: 0; z-index: 40;
    width: 100%; background: var(--white); border: 0; border-bottom: 1px solid var(--mist);
    padding: 0.8rem 1.25rem; font-size: 0.92rem; font-weight: 600; color: var(--ink);
  }
  .wrap, .hero__inner { padding-left: 1.25rem; padding-right: 1.25rem; }
  .chapnav { flex-direction: column; }
  .chapnav .next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .demo__strong { opacity: 1; transform: none; }
}

@media print {
  .rail, .tabs, .copy, .open, .chapnav, .railtoggle { display: none; }
  .shell { grid-template-columns: 1fr; }
  .pair__strong pre { max-height: none; }
}


/* ------------------------------------------------- server-rendered extras -- */

.chapter__h { font-family: var(--display); font-variation-settings: 'SOFT' 40, 'WONK' 1, 'opsz' 72;
  font-size: clamp(1.9rem, 4.2vw, 2.7rem); line-height: 1.05; letter-spacing: -0.03em;
  margin-bottom: 1rem; font-weight: 600; }

.rail__foot { border-top: 1px solid #262E4A; padding: 0.85rem 1.4rem 1rem;
  display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; }
.rail__foot a { color: #7F8AA8; font-size: 0.8rem; text-decoration: none; }
.rail__foot a:hover { color: #fff; }
.rail__foot a.is-on { color: #9B8BFA; }

.btn { display: inline-block; background: var(--violet); color: #fff; text-decoration: none;
  padding: 0.6rem 1.1rem; border-radius: var(--r-sm); font-weight: 600; font-size: 0.95rem; }
.btn:hover { background: var(--violet-d); color: #fff; }

.sitefoot { background: var(--ink); color: #9AA5BD; margin-top: 4rem; }
.sitefoot__in { max-width: 56rem; margin: 0 auto; padding: 2.5rem 2rem 3rem; }
.sitefoot p { margin: 0 0 0.9rem; font-size: 0.92rem; }
.sitefoot strong { color: #fff; }
.sitefoot__links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; }
.sitefoot__links a { color: #C9D0E0; font-size: 0.9rem; }
.sitefoot__note { font-size: 0.84rem; color: #6D789A; max-width: 60ch; }

/* The rail is a plain list when JavaScript is off, and the toggle is hidden. */
.no-js .railtoggle { display: none; }
