/* meEdit Editorial: shared component styles. Values come from tokens.css (tokens.json). */

.me-page, .me-page * { box-sizing: border-box; }
.me-page {
  /* Type scale: 4 display steps (Imbue Black) and 4 text steps (Google Sans). Every size on a page comes from here.
     Each step is clearly bigger than the next one down, so levels never blur:
     desktop 112 / 80 / 52 / 32 display and 24 / 18 / 16 / 14 text; phones 56 / 48 / 36 / 28 display and 22 / 17 / 16 / 14 text. */
  --fs-hero: clamp(52px, 7.2vw, 96px);
  --fs-h2: clamp(48px, 5.6vw, 80px);
  --fs-h3: clamp(36px, 3.7vw, 52px);
  --fs-h4: clamp(28px, 2.3vw, 32px);
  --fs-price: clamp(72px, 7vw, 100px);
  --fs-lead: clamp(22px, 18.4px + 0.5vw, 24px);
  --fs-body: 18px;
  --fs-small: 16px;
  --fs-label: 14px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Phones: body steps down to 17px so the 22px lead still stands clearly above it */
@media (max-width: 760px) { .me-page { --fs-body: 17px; } }
.me-page ::selection { background: var(--highlighter); color: var(--on-highlighter); }
.me-page :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* Type helpers */
.me-display { font-family: var(--font-display); font-variation-settings: "opsz" 100; font-weight: 700; letter-spacing: 0; line-height: 0.92; text-wrap: balance; margin: 0; }
/* Lead (dek): a size up from body, tighter leading and a shorter measure, so it reads as the intro, not as another paragraph */
.me-dek { font-size: var(--fs-lead); line-height: 1.4; letter-spacing: -0.006em; max-width: 44ch; text-wrap: balance; margin: 0; }
.me-byline { font-weight: 600; font-size: var(--fs-label); line-height: 1.4; letter-spacing: 0.02em; color: var(--ink-muted); }
.me-caption { font-style: italic; font-size: var(--fs-small); line-height: 1.42; text-align: center; color: var(--ink); text-wrap: balance; max-width: 34ch; margin: 14px auto 0; }
.me-muted { color: var(--ink-muted); }

/* Highlighter swipe: a hand-laid marker stroke behind a word or price */
.me-swipe { position: relative; z-index: 0; white-space: nowrap; padding: 0 0.06em; color: var(--on-highlighter); }
.me-swipe::before {
  content: ""; position: absolute; z-index: -1;
  inset: 0.18em -0.08em 0.02em -0.1em;
  background: var(--highlighter);
  border-radius: 2px 10px 3px 8px;
  transform: rotate(-1.4deg);
}

/* Ink price tag: a black label with highlighter numbers, tilted, with a highlighter offset */
.me-tag { display: inline-block; position: relative; background: var(--ink); color: var(--highlighter); padding: 0.07em 0.18em 0.02em; transform: rotate(-2deg); box-shadow: 0.06em 0.06em 0 var(--highlighter); white-space: nowrap; line-height: 0.95; }

/* Buttons and links */
.me-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px;
  font: 600 var(--fs-small)/1.2 var(--font-text); letter-spacing: 0.01em;
  color: var(--paper); background: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 0;
  text-decoration: none; cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 80ms ease;
}
.me-btn:hover { background: var(--highlighter); color: var(--on-highlighter); border-color: var(--on-highlighter); }
.me-btn:active { transform: translateY(1px); }
.me-btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.me-link {
  color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
  font-weight: 600; transition: box-shadow 160ms ease;
}
.me-link:hover { box-shadow: inset 0 -0.42em 0 var(--highlighter); color: var(--ink); }

/* Illustrations: two masked layers so drawings take the theme's ink and highlighter */
.me-illo { margin: 0; position: relative; }
.me-illo .art { position: relative; width: 100%; aspect-ratio: var(--ar, 1 / 1); }
.me-illo .art > i {
  position: absolute; inset: 0; display: block;
  -webkit-mask: var(--m) center / contain no-repeat;
          mask: var(--m) center / contain no-repeat;
}
.me-illo .art > .fill { background: var(--highlighter); }
.me-illo .art > .ink { background: var(--ink); }

/* Drop cap */
.me-dropcap::first-letter {
  font-family: var(--font-display); font-variation-settings: "opsz" 100; font-weight: 700;
  float: left; font-size: 4.35em; line-height: 0.76; margin: 0.07em 0.09em 0 -0.02em;
  color: var(--ink);
}

/* Pull quote */
.me-pull {
  margin: 0; padding: 22px 0 20px;
  border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  font-family: var(--font-display); font-variation-settings: "opsz" 100; font-weight: 700; font-size: var(--fs-h3); line-height: 1.04; text-wrap: balance;
}

/* Stop disc on the journey thread */
.me-stop {
  width: 64px; height: 64px; border-radius: 999px; flex: none;
  display: grid; place-items: center;
  background: var(--highlighter); color: var(--on-highlighter);
  border: 1.5px solid var(--ink);
  font-family: var(--font-display); font-variation-settings: "opsz" 100; font-weight: 700; font-size: 36px; line-height: 1;
}

/* Journey thread */
.me-thread { position: absolute; inset: 0 auto auto 0; pointer-events: none; overflow: visible; z-index: 1; }
.me-thread path {
  fill: none; stroke: var(--ink); stroke-width: 2.25px; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: var(--len, 0); stroke-dashoffset: var(--len, 0);
  transition: stroke-dashoffset 1.9s cubic-bezier(0.45, 0.05, 0.2, 1);
}
.me-thread path.on { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) {
  .me-thread path { transition: none; stroke-dashoffset: 0; }
}

/* Segmented toggle (Before / After, tweaks) */
.me-seg { display: inline-flex; border: 1.5px solid var(--ink); }
.me-seg button {
  font: 600 var(--fs-small)/1 var(--font-text); color: var(--ink); background: transparent;
  border: 0; padding: 12px 18px; min-height: 44px; cursor: pointer;
}
.me-seg button + button { border-left: 1.5px solid var(--ink); }
.me-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.me-seg button:not([aria-pressed="true"]):hover { background: var(--highlighter); color: var(--on-highlighter); }

/* Form fields */
.me-field { display: grid; gap: 8px; align-content: start; }
.me-field label { font-weight: 600; font-size: var(--fs-small); }
.me-field .hint { font-size: var(--fs-small); color: var(--ink-muted); }
.me-field input, .me-field select, .me-field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: 400 var(--fs-body)/1.4 var(--font-text); color: var(--ink);
  background: var(--paper-raised); border: 1.5px solid var(--ink); border-radius: 0;
}
.me-field textarea { min-height: 132px; resize: vertical; }
.me-field input:focus-visible, .me-field select:focus-visible, .me-field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.me-field .error { font-size: var(--fs-small); font-style: italic; color: var(--ink); display: flex; gap: 8px; align-items: baseline; }
.me-field .error::before { content: ""; width: 10px; height: 10px; background: var(--highlighter); border: 1.5px solid var(--ink); border-radius: 999px; flex: none; transform: translateY(1px); }
.me-field [aria-invalid="true"] { border-width: 2.5px; }

/* Placeholder marker for copy the founder still has to fill */
.me-ph { background: var(--highlighter); color: var(--on-highlighter); padding: 0 0.2em; font-style: normal; }
