/* EVDataBot — Workshop Notebook
 * Cream paper, ink black, marker red. Graph-paper background. Mixed
 * typewriter mono + handwriting. Single column, intentionally hand-built.
 *
 * Class names preserved so legal pages re-skin automatically.
 */

@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&family=Special+Elite&display=swap");

:root {
  --paper:        #f5eedd;
  --paper-deep:   #ede4cc;
  --ink:          #1a1410;
  --ink-soft:     #4a3f33;
  --muted:        #8a7a64;
  --pencil:       #b8a888;
  --rule:         rgba(26, 20, 16, 0.18);
  --rule-soft:    rgba(26, 20, 16, 0.10);
  --marker:       #c4321f;
  --marker-soft:  #de5740;
  --highlight:    rgba(255, 222, 89, 0.45);
  --tape:         rgba(255, 245, 200, 0.85);
  --tape-edge:    rgba(180, 160, 100, 0.4);

  --max-col:      640px;
  --max-wide:     820px;

  --type:  "Special Elite", "Courier New", ui-monospace, monospace;
  --hand:  "Caveat", "Bradley Hand", cursive;
  --serif: "Charter", "Georgia", "Iowan Old Style", "Iowan", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--type);
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Graph-paper background — fixed so it doesn't scroll */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    /* major grid every 96px */
    linear-gradient(to right, rgba(26, 20, 16, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(26, 20, 16, 0.05) 1px, transparent 1px),
    /* minor grid every 24px */
    linear-gradient(to right, rgba(26, 20, 16, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(26, 20, 16, 0.025) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  background-position: 0 0, 0 0, 0 0, 0 0;
}

/* Faint paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(800px 600px at 10% 0%, rgba(196, 50, 31, 0.05), transparent 60%),
    radial-gradient(800px 600px at 100% 100%, rgba(26, 20, 16, 0.04), transparent 60%);
}

main, header, footer { position: relative; z-index: 2; }

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--marker); }

/* ---------- Shell ---------- */

.site-shell {
  width: min(calc(100% - 36px), var(--max-wide));
  margin: 0 auto;
}

/* ---------- Header strip ---------- */

.site-header {
  position: relative;
  z-index: 30;
  border-bottom: 1px dashed var(--rule);
  background: transparent;
}

.nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 14px;
  font-family: var(--type);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
  font-weight: 400;
  text-decoration: none;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.brand:hover { color: var(--marker); }

.brand-mark {
  display: inline-block;
  width: auto;
  height: auto;
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--marker);
  background: none;
  border: 0;
  box-shadow: none;
  letter-spacing: -0.04em;
  transform: rotate(-6deg);
  padding: 0;
}

.brand-mark::before { content: "~ "; }
.brand-mark::after  { content: " ~"; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-family: var(--type);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 1px solid var(--rule);
}

.nav-links a:hover {
  color: var(--marker);
  border-bottom-color: var(--marker);
}

/* Page indicator (top right of header) */
.page-stamp {
  font-family: var(--type);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--type);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.2;
}

h1 { font-size: clamp(1.9rem, 4.2vw, 2.6rem); }
h2 { font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.06em; }
h3 { font-size: 1.05rem; }

p { margin: 0; color: var(--ink-soft); }

p + p, p + ul, p + ol, ul + p, ol + p { margin-top: 14px; }

/* Underline rule under section headings */
.rule {
  border: 0;
  border-bottom: 1px dashed var(--rule);
  margin: 8px 0 18px;
}

/* ---------- Main column ---------- */

main { padding: 32px 0 64px; }

.page {
  width: min(calc(100% - 36px), var(--max-col));
  margin: 0 auto;
}

.page.wide { width: min(calc(100% - 36px), var(--max-wide)); }

.section { padding: 38px 0 6px; }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}

.section-title::before {
  content: "§";
  font-family: var(--type);
  font-size: 0.95rem;
  color: var(--marker);
}

/* ---------- Lead paragraph ---------- */

.lead {
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.65;
  color: var(--ink);
}

.lead + .lead { margin-top: 14px; }

.signature {
  display: inline-block;
  font-family: var(--hand);
  font-size: 2rem;
  color: var(--marker);
  line-height: 1;
  margin-top: 18px;
  transform: rotate(-3deg);
  letter-spacing: -0.01em;
}

.byline {
  font-family: var(--type);
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

/* ---------- Bulleted / annotated lists ---------- */

ul, ol { padding-left: 22px; color: var(--ink-soft); }

.bullet-list,
.check-list,
.legal-list,
.numbered-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}

.bullet-list li,
.check-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
}

.bullet-list li::before,
.check-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--marker);
  font-weight: 700;
}

.numbered-list {
  counter-reset: item;
}

.numbered-list li {
  position: relative;
  padding-left: 36px;
  margin-bottom: 14px;
  counter-increment: item;
}

.numbered-list li::before {
  content: "(" counter(item, lower-alpha) ")";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--type);
  color: var(--marker);
}

/* Annotated rows: list item + handwritten margin note */
.annotated {
  position: relative;
  margin: 18px 0;
  padding: 0;
}

.annotated .note {
  position: absolute;
  right: -8px;
  top: -8px;
  transform: rotate(-4deg);
  font-family: var(--hand);
  font-size: 1.25rem;
  color: var(--marker);
  max-width: 180px;
  line-height: 1.1;
  pointer-events: none;
}

.annotated .note::before {
  content: "↘ ";
}

/* ---------- Inline marker / highlight / dash ---------- */

mark {
  background: linear-gradient(180deg, transparent 55%, var(--highlight) 55%);
  color: var(--ink);
  padding: 0 2px;
}

.hand {
  font-family: var(--hand);
  font-size: 1.4em;
  color: var(--marker);
  line-height: 1;
}

.dim { color: var(--muted); }

code, .mono { font-family: var(--type); }

/* ---------- Masking-tape photo mounts ---------- */

.photo {
  position: relative;
  margin: 32px auto;
  max-width: 100%;
  padding: 14px 14px 18px;
  background: #fbf6e6;
  border: 1px solid var(--rule-soft);
  box-shadow:
    0 1px 0 var(--rule-soft),
    0 12px 24px rgba(26, 20, 16, 0.08);
  transform: rotate(-1.1deg);
}

.photo.right { transform: rotate(1.4deg); margin-left: auto; }
.photo.left  { transform: rotate(-1.6deg); margin-right: auto; }

/* Masking tape strips (two on top) */
.photo::before,
.photo::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 78px;
  height: 20px;
  background: var(--tape);
  border: 1px dashed var(--tape-edge);
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(26, 20, 16, 0.08);
}

.photo::before { left: 14px; transform: rotate(-5deg); }
.photo::after  { right: 14px; transform: rotate(4deg); }

.photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1px;
  filter: contrast(1.02) saturate(0.92);
}

.photo .caption {
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--marker);
  line-height: 1;
  margin-top: 12px;
  text-align: center;
  transform: rotate(-0.8deg);
}

/* Photo placeholder: when image missing, show a hand-labeled rectangle */
.photo .placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(to right, rgba(26, 20, 16, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(26, 20, 16, 0.06) 1px, transparent 1px),
    #f1e9d2;
  background-size: 24px 24px;
  display: grid;
  place-items: center;
  padding: 20px;
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--pencil);
  text-align: center;
  line-height: 1.2;
}

.photo .placeholder::before { content: "[ "; }
.photo .placeholder::after  { content: " ]"; }

/* ---------- Screenshot mounts (same vibe, different aspect) ---------- */

.screen {
  position: relative;
  margin: 18px auto;
  padding: 10px 10px 14px;
  background: #fbf6e6;
  border: 1px solid var(--rule-soft);
  box-shadow: 0 8px 18px rgba(26, 20, 16, 0.08);
  transform: rotate(-0.6deg);
  max-width: 280px;
}

.screen.right { transform: rotate(0.9deg); }

.screen::before,
.screen::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 60px;
  height: 16px;
  background: var(--tape);
  border: 1px dashed var(--tape-edge);
  border-radius: 2px;
}

.screen::before { left: 10px; transform: rotate(-5deg); }
.screen::after  { right: 10px; transform: rotate(4deg); }

.screen img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.screen .placeholder {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  background:
    linear-gradient(to right, rgba(26, 20, 16, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(26, 20, 16, 0.06) 1px, transparent 1px),
    #f1e9d2;
  background-size: 18px 18px;
  display: grid;
  place-items: center;
  padding: 14px;
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--pencil);
  text-align: center;
}

.screen .caption {
  font-family: var(--hand);
  font-size: 1.15rem;
  color: var(--marker);
  text-align: center;
  margin-top: 8px;
}

.screens-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 22px auto;
}

.screens-row .screen { max-width: 100%; margin: 0; }

/* ---------- Buttons (App Store badge style line) ---------- */

.button, .button-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-family: var(--type);
  font-size: 0.92rem;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 160ms ease, color 160ms ease;
  position: relative;
}

.button:hover {
  background: var(--ink);
  color: var(--paper);
}

.button-secondary {
  border-style: dashed;
  border-color: var(--muted);
  color: var(--ink-soft);
}

.button-secondary:hover {
  color: var(--marker);
  border-color: var(--marker);
}

.button .arrow { font-family: var(--hand); font-size: 1.3rem; color: var(--marker); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
  align-items: center;
}

/* ---------- Pull quote / margin note block ---------- */

.pull {
  margin: 28px 0;
  padding: 18px 22px;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink);
  border-left: 3px solid var(--marker);
  background: rgba(255, 245, 200, 0.4);
}

.pull cite {
  display: block;
  margin-top: 8px;
  font-family: var(--hand);
  font-size: 1.2rem;
  font-style: normal;
  color: var(--marker);
}

/* ---------- Spec list (datasheet rows) ---------- */

.spec {
  width: 100%;
  margin-top: 14px;
  font-family: var(--type);
  font-size: 0.92rem;
}

.spec .row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px dotted var(--rule);
}

.spec .row:last-child { border-bottom: 0; }

.spec .k { color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.78rem; padding-top: 2px; }
.spec .v { color: var(--ink); }

/* ---------- Footnotes ---------- */

.footnotes {
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px dashed var(--rule);
  font-family: var(--type);
  font-size: 0.82rem;
  color: var(--muted);
}

.footnotes ol { padding-left: 22px; }
.footnotes li { margin-bottom: 6px; }

/* ---------- Generic "panel" / "card" classes (so legal/guide re-skin) ---------- */

.panel,
.feature-card,
.step-card,
.info-card,
.faq-card,
.legal-card,
.page-hero {
  padding: 22px 24px;
  border: 1px dashed var(--rule);
  background: rgba(255, 250, 235, 0.55);
  margin-bottom: 18px;
}

.page-hero {
  border-style: solid;
  border-color: var(--ink);
  border-width: 1px;
  background: rgba(255, 250, 235, 0.7);
}

.feature-card h3,
.step-card h3,
.info-card h3,
.faq-card h3,
.legal-card h2 {
  margin-bottom: 8px;
}

.feature-icon,
.step-number {
  display: inline-block;
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--marker);
  margin-bottom: 4px;
  transform: rotate(-4deg);
}

.feature-icon::before { content: "» "; }

.eyebrow {
  display: inline-block;
  font-family: var(--type);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}

.meta {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--type);
  font-size: 0.82rem;
  color: var(--muted);
}

.legal-card code {
  font-family: var(--type);
  background: rgba(196, 50, 31, 0.08);
  padding: 1px 4px;
  color: var(--marker);
}

.card-grid,
.wide-grid,
.privacy-row,
.section-head,
.screen-grid,
.price-panel,
.story-panel {
  /* Notebook is single-column; flatten any grid classes from legacy pages. */
  display: block;
}

.card-grid > *,
.wide-grid > *,
.privacy-row > *,
.screen-grid > * {
  margin-bottom: 16px;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 28px 0 48px;
  border-top: 1px dashed var(--rule);
  margin-top: 64px;
}

.footer-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 0;
  font-family: var(--type);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.footer-card p { color: var(--muted); font-size: 0.85rem; }

.footer-card .nav-links { justify-content: center; }

.footer-card .stamp {
  display: inline-block;
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--marker);
  transform: rotate(-3deg);
  margin-top: 6px;
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
  .site-shell, .page { width: calc(100% - 24px); }
  .nav { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-stamp { display: none; }
  .screens-row { grid-template-columns: 1fr; }
  h1 { font-size: 1.7rem; }
  .lead { font-size: 1.05rem; }
  .photo { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .signature, .photo, .photo.right, .photo.left, .screen, .screen.right, .brand-mark { transform: none; }
}

/* ---------- Hand-drawn arrow SVG helper class ---------- */

.with-arrow {
  position: relative;
}

.with-arrow .arrow-svg {
  position: absolute;
  pointer-events: none;
  color: var(--marker);
}
