/* caretgrammar.com — theme "Fresh Ink". One stylesheet, no framework,
   no third-party requests. See THEME.md for the palette. */

@import url('/assets/fonts/fonts.css');

:root {
  --ink: #0b0d12;
  --paper: #fbfaf9;
  --surface: #ffffff;
  --wash: #f3f1ee;
  --slate: #5b6472;
  --line: rgba(11, 13, 18, 0.10);
  --iris: #5b4bff;
  --iris-deep: #3d2fd6;
  --mint: #00c68f;

  --spelling: #e5484d;
  --grammar: #2f6fd0;
  --punctuation: #8b5cf6;
  --clarity: #0f9b8e;

  --display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 13, 18, 0.06), 0 4px 14px rgba(11, 13, 18, 0.06);
  --shadow: 0 2px 6px rgba(11, 13, 18, 0.06), 0 18px 46px rgba(11, 13, 18, 0.12);
  --shadow-iris: 0 10px 30px rgba(91, 75, 255, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eceef3;
    --paper: #0b0d12;
    --surface: #151a23;
    --wash: #11151d;
    --slate: #9aa3b2;
    --line: rgba(255, 255, 255, 0.12);
    --iris: #8e82ff;
    --iris-deep: #6e60f0;
    --mint: #2be0ac;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 18px 46px rgba(0, 0, 0, 0.55);
    --shadow-iris: 0 10px 30px rgba(91, 75, 255, 0.45);
  }
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 40px); margin-inline: auto; }

a { color: var(--iris); text-underline-offset: 3px; }
a:hover { color: var(--iris-deep); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.5rem, 6.4vw, 4rem); }
h2 { font-size: clamp(1.65rem, 3.6vw, 2.35rem); }
h3 { font-family: var(--body); font-size: 1.05rem; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: 0.45em; }
.lede { font-size: 1.2rem; color: var(--slate); }
.small { font-size: 0.92rem; color: var(--slate); }

::selection { background: color-mix(in srgb, var(--iris) 26%, transparent); }

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

header.site {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.5) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
header.site.scrolled { border-bottom-color: var(--line); box-shadow: 0 1px 20px rgba(11, 13, 18, 0.05); }
header.site .wrap { display: flex; align-items: center; gap: 16px; height: 66px; }

.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 1.06rem;
  letter-spacing: -0.02em; color: var(--ink); text-decoration: none;
}
.brand svg { border-radius: 9px; transition: transform 400ms var(--ease); }
.brand:hover { color: var(--ink); }
.brand:hover svg { transform: rotate(-8deg) scale(1.06); }

nav.site { margin-left: auto; display: flex; gap: 6px; align-items: center; }
nav.site a.link {
  color: var(--slate); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 8px 12px; border-radius: 9px; transition: color 160ms, background 160ms;
}
nav.site a.link:hover { color: var(--ink); background: var(--wash); }
nav.site .button { margin-left: 6px; }
@media (max-width: 760px) { .hide-sm { display: none !important; } }
@media (max-width: 420px) { nav.site .button { padding: 9px 13px; font-size: 0.9rem; } }

/* ------------------------------------------------------------- the button */

.button {
  --lift: -1px;
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, var(--iris), var(--iris-deep));
  color: #fff; text-decoration: none;
  font-family: var(--body); font-weight: 600; font-size: 1rem;
  padding: 13px 22px; border: 0; border-radius: 12px; cursor: pointer;
  box-shadow: var(--shadow-iris);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), filter 180ms;
}
.button:hover { color: #fff; transform: translateY(var(--lift)); filter: brightness(1.06); }
.button:active { transform: translateY(0); }
.button::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-120%);
}
.button:hover::after { animation: sheen 700ms var(--ease); }
@keyframes sheen { to { transform: translateX(120%); } }
.button .size { opacity: 0.8; font-weight: 400; font-size: 0.9rem; }
.button.small { padding: 9px 15px; font-size: 0.93rem; border-radius: 10px; }
.button.ghost {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.button.ghost:hover { color: var(--ink); background: var(--wash); }
.button.ghost::after { display: none; }

/* --------------------------------------------------------------- the hero */

.hero { position: relative; padding: 74px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: -200px 0 0; z-index: -1;
  background:
    radial-gradient(46rem 26rem at 12% -6%, color-mix(in srgb, var(--iris) 20%, transparent), transparent 60%),
    radial-gradient(38rem 22rem at 92% 8%, color-mix(in srgb, var(--mint) 17%, transparent), transparent 62%);
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-2%, 1.5%, 0) scale(1.06); }
}
.hero .wrap { display: grid; gap: 42px; align-items: center; }
@media (min-width: 940px) {
  .hero { padding: 96px 0 64px; }
  .hero .wrap { grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 56px; }
}

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 100px; padding: 6px 14px 6px 8px;
  font-size: 0.88rem; font-weight: 500; color: var(--slate);
  box-shadow: var(--shadow-sm); margin-bottom: 22px;
}
.pill .tick {
  width: 18px; height: 18px; border-radius: 50%; background: var(--mint);
  color: #04231a; font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
}

h1 .mark {
  position: relative; white-space: nowrap;
}
h1 .mark::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.04em; height: 0.09em;
  background: var(--spelling); border-radius: 4px;
  transform-origin: left center; transform: scaleX(0);
  animation: draw 900ms var(--ease) 600ms forwards;
}
@keyframes draw { to { transform: scaleX(1); } }

.hero .lede { max-width: 44ch; font-size: 1.26rem; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 30px 0 16px; }

/* rise-in on load, staggered by the markup order */
.rise { opacity: 0; transform: translateY(14px); animation: rise 700ms var(--ease) forwards; }
.rise:nth-child(1) { animation-delay: 60ms; }
.rise:nth-child(2) { animation-delay: 140ms; }
.rise:nth-child(3) { animation-delay: 220ms; }
.rise:nth-child(4) { animation-delay: 300ms; }
.rise:nth-child(5) { animation-delay: 380ms; }
@keyframes rise { to { opacity: 1; transform: none; } }

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

section { padding: 58px 0; position: relative; }
section.wash { background: var(--wash); }
section.wash::before, section.wash::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--line);
}
section.wash::before { top: 0; }
section.wash::after { bottom: 0; }
.section-head { max-width: 58ch; margin-bottom: 30px; }
.eyebrow {
  font-family: var(--body); font-size: 0.82rem; font-weight: 650;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--iris);
  margin: 0 0 10px;
}

/* revealed by app.js as they scroll into view; visible without JavaScript */
.js .reveal { opacity: 0; transform: translateY(20px); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}
.js .reveal.d1.in { transition-delay: 80ms; }
.js .reveal.d2.in { transition-delay: 160ms; }
.js .reveal.d3.in { transition-delay: 240ms; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(236px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease), border-color 260ms;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--iris) 30%, var(--line)); }
.card p:last-child { margin-bottom: 0; }
.card .eg { font-family: var(--mono); font-size: 0.85rem; color: var(--slate); display: block; margin-top: 10px; line-height: 1.9; }
.card .eg b { color: var(--ink); font-weight: 600; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 9px; vertical-align: 1px; }
.dot.red { background: var(--spelling); }
.dot.blue { background: var(--grammar); }
.dot.purple { background: var(--punctuation); }
.dot.teal { background: var(--clarity); }

figure { margin: 0 0 22px; }
.shot {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); background: var(--surface);
}
figcaption { margin-top: 12px; font-size: 0.92rem; color: var(--slate); }

ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
ol.steps li {
  counter-increment: step; position: relative;
  padding: 0 0 26px 54px; border-left: 2px solid var(--line); margin-left: 16px;
}
ol.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
ol.steps li::before {
  content: counter(step);
  position: absolute; left: -17px; top: -3px;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--iris), var(--iris-deep));
  color: #fff; font-family: var(--display); font-size: 0.9rem; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(91, 75, 255, 0.32);
}
ol.steps b { font-weight: 650; }

kbd {
  font: 600 0.85em var(--mono);
  background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: 2px 7px; box-shadow: var(--shadow-sm);
}
code { font: 0.9em var(--mono); background: var(--wash); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }

.note {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--spelling);
  padding: 16px 20px; border-radius: 4px 14px 14px 4px; margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.note p:last-child { margin-bottom: 0; }
.note.good { border-left-color: var(--mint); }

details { border-bottom: 1px solid var(--line); padding: 16px 2px; }
details summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: 12px;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: ""; width: 16px; height: 16px; flex: 0 0 auto;
  background: var(--iris); mask: no-repeat center/16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3v10M3 8h10' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  transition: transform 260ms var(--ease);
}
details[open] summary::before { transform: rotate(135deg); }
details p { margin: 12px 0 4px 28px; color: var(--slate); }
details p:last-child { margin-bottom: 0; }

table.plain { width: 100%; border-collapse: collapse; margin: 6px 0 14px; }
table.plain td { padding: 10px 12px 10px 0; vertical-align: top; border-top: 1px solid var(--line); }
table.plain tr:first-child td { border-top: 0; }
table.plain td:last-child { color: var(--slate); }

/* ------------------------------------------------------------- the demo */

.demo {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px 20px; position: relative;
}
.demo .bar { display: flex; gap: 6px; margin-bottom: 14px; }
.demo .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.demo .label { font-size: 0.78rem; font-weight: 600; color: var(--slate); letter-spacing: 0.04em;
               text-transform: uppercase; margin-bottom: 8px; }
.demo .box {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 15px;
  min-height: 108px; font-size: 1.02rem; line-height: 1.75; background: var(--paper);
}
.demo .box .caret-blink {
  display: inline-block; width: 2px; height: 1.05em; vertical-align: -0.18em;
  background: var(--ink); margin-left: 1px; animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.demo w {
  position: relative; display: inline-block;
  transition: color 260ms var(--ease);
}
.demo w::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  border-radius: 2px; background: currentColor; opacity: 0;
  transform: scaleX(0); transform-origin: left center;
  transition: transform 360ms var(--ease), opacity 200ms;
}
.demo w.flag::after { opacity: 1; transform: scaleX(1); }
.demo w.spelling::after { background: var(--spelling); }
.demo w.grammar::after { background: var(--grammar); }
.demo w.fixed { color: var(--mint); }
.demo w.active { background: color-mix(in srgb, var(--grammar) 14%, transparent); border-radius: 3px; }

.demo .card-pop {
  position: absolute; z-index: 3; width: 232px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 12px 13px 10px;
  opacity: 0; transform: translateY(-6px) scale(0.97); pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}
.demo .card-pop.show { opacity: 1; transform: none; }
.demo .card-pop .chip {
  display: inline-block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #fff; background: var(--grammar);
  padding: 3px 7px; border-radius: 5px; margin-bottom: 8px;
}
.demo .card-pop .msg { font-size: 0.86rem; line-height: 1.45; margin: 0 0 10px; }
.demo .card-pop .fix {
  display: inline-block; background: var(--grammar); color: #fff;
  font-size: 0.86rem; font-weight: 650; padding: 6px 12px; border-radius: 8px;
}
.demo .badge-count {
  position: absolute; right: 26px; bottom: 30px;
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--spelling) 45%, var(--line));
  color: var(--spelling); font-size: 0.76rem; font-weight: 700;
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
  opacity: 0; transform: scale(0.6); transition: opacity 240ms, transform 300ms var(--ease);
}
.demo .badge-count.show { opacity: 1; transform: none; }

/* --------------------------------------------------------------- the form */

form.report { margin-top: 28px; }
.field { margin-bottom: 20px; }
.field > label { display: block; font-weight: 620; margin-bottom: 8px; }
.field .help { font-size: 0.88rem; color: var(--slate); margin: 0 0 9px; }
input[type=text], input[type=email], textarea, select {
  font: inherit; width: 100%; padding: 12px 14px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 11px;
  transition: border-color 160ms, box-shadow 160ms;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--iris);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--iris) 18%, transparent);
}
.button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--iris) 55%, transparent); outline-offset: 2px;
}
textarea { min-height: 148px; resize: vertical; }
.choices { display: grid; gap: 9px; }
.choice {
  display: flex; gap: 11px; align-items: flex-start; font-weight: 400;
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px;
  background: var(--surface); cursor: pointer;
  transition: border-color 160ms, background 160ms, transform 160ms var(--ease);
}
.choice:hover { border-color: color-mix(in srgb, var(--iris) 40%, var(--line)); transform: translateX(2px); }
.choice:has(input:checked) {
  border-color: var(--iris);
  background: color-mix(in srgb, var(--iris) 7%, var(--surface));
}
.choice input { margin: 4px 0 0; accent-color: var(--iris); }
.hp { position: absolute; left: -9999px; }

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

footer.site {
  border-top: 1px solid var(--line); margin-top: 20px; padding: 34px 0 54px;
  color: var(--slate); font-size: 0.93rem;
}
footer.site .row { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
footer.site a { color: var(--slate); text-decoration: none; }
footer.site a:hover { color: var(--ink); }
footer.site .spacer { margin-left: auto; }

/* ------------------------------------------------------- motion, opted out */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .rise { opacity: 1; transform: none; }
  .js .reveal { opacity: 1; transform: none; }
  h1 .mark::after { transform: scaleX(1); }
}
