/* ==========================================================================
   Open SEO Skill — shared stylesheet
   Design concept: a marked-up inspection document.
   Change bars (the vertical rules) mark findings, the way a proof-reader
   marks a revised paragraph. Everything else stays quiet.
   ========================================================================== */

:root {
  --paper:      #F0F1EC;
  --paper-2:    #E7E9E2;
  --ink:        #16181A;
  --slate:      #4E555B;
  --rule:       #D0D3C9;
  --mark:       #B23A2F;   /* proof-reader's red — findings, the one bold note */
  --pass:       #2E6B4F;   /* verified / working */
  --amber:      #8A6110;

  --measure:    64ch;
  --gut:        clamp(1.25rem, 4vw, 2.5rem);
  --band:       clamp(3.5rem, 8vw, 6.5rem);

  --sans: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-synthesis-weight: none;
}

/* ---------- typography ---------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.021em;
  margin: 0 0 .6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.35rem, 5.6vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.35rem); margin-top: 0; }
h3 { font-size: 1.22rem; letter-spacing: -0.012em; }
h4 { font-size: 1rem; letter-spacing: 0; }

p, ul, ol, dl, table { margin: 0 0 1.15em; }
p, li { max-width: var(--measure); }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--mark); }

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

.lede {
  font-size: clamp(1.1rem, 1.9vw, 1.32rem);
  line-height: 1.5;
  color: var(--slate);
  max-width: 54ch;
}

.small { font-size: .925rem; color: var(--slate); }
.tight { margin-bottom: .4em; }

code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--paper-2);
  padding: .12em .34em;
  border-radius: 2px;
}

/* ---------- layout -------------------------------------------------------- */

.wrap {
  max-width: 78rem;
  margin: 0 auto;
  padding-inline: var(--gut);
}

/* Text-led pages sit in a narrower column. The full 78rem measure is for the
   home page, where the prompt box fills the second half. */
.wrap-doc { max-width: 58rem; }

.band { padding-block: var(--band); }
.band + .band { padding-top: 0; }
.hero + .band { padding-top: 0; }

.band-line { border-top: 1px solid var(--rule); }

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: .7rem 1.1rem; z-index: 100;
}
.skip:focus { left: var(--gut); top: .6rem; }

/* ---------- masthead ------------------------------------------------------ */

.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top, 0px);
}

/* Sticky only where the nav fits on one line — on a phone it wraps to two rows
   and eats a third of the screen. */
@media (min-width: 46rem) {
  .masthead { position: sticky; top: 0; z-index: 50; }
}

.masthead-in {
  max-width: 78rem; margin: 0 auto;
  padding: .85rem var(--gut);
  display: flex; align-items: baseline; gap: 1.5rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span { color: var(--mark); }

.masthead nav {
  margin-left: auto;
  display: flex; gap: 1.15rem; flex-wrap: wrap;
  font-family: var(--sans);
  font-size: .925rem;
  font-weight: 500;
}
.masthead nav a { text-decoration: none; color: var(--slate); }
.masthead nav a:hover,
.masthead nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

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

.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2.5rem, 5vw, 4rem); }

.hero-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3.25rem);
  align-items: start;
}
@media (min-width: 62rem) {
  .hero-grid { grid-template-columns: 37fr 63fr; }
}

.hero h1 { margin-bottom: .45em; }

.hero-meta {
  font-family: var(--sans);
  font-size: .875rem;
  color: var(--slate);
  border-top: 1px solid var(--rule);
  padding-top: .8rem;
  margin-top: 1.6rem;
}
.hero-meta strong { color: var(--ink); font-weight: 600; }

/* ---------- the prompt box: the one bold thing ---------------------------- */

.promptbox {
  border: 2.5px solid var(--ink);
  background: #FCFCFA;
  position: relative;
  box-shadow: 9px 9px 0 var(--paper-2);
}

.promptbox-head {
  display: flex; align-items: center; gap: .75rem;
  flex-wrap: wrap;
  border-bottom: 2.5px solid var(--ink);
  padding: .7rem .9rem;
  background: var(--paper);
}

.promptbox-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: -0.01em;
}
.promptbox-sub { font-size: .8rem; color: var(--slate); font-family: var(--sans); }

.promptbox pre {
  margin: 0;
  padding: 1rem 1.1rem 1.6rem;
  max-height: 27rem;
  overflow: auto;
  font-family: var(--mono);
  font-size: .775rem;
  line-height: 1.62;
  white-space: pre-wrap;
  word-break: break-word;
  color: #23272A;
}

.promptbox pre::after {
  content: "";
  display: block;
}

.copybtn {
  margin-left: auto;
  font-family: var(--sans);
  font-weight: 700;
  font-size: .87rem;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  padding: .52rem 1.05rem;
  cursor: pointer;
  border-radius: 2px;
}
.copybtn:hover { background: var(--mark); }
.copybtn[data-done="1"] { background: var(--pass); }

.fade-foot {
  border-top: 1px solid var(--rule);
  padding: .65rem .9rem;
  font-family: var(--sans);
  font-size: .82rem;
  color: var(--slate);
  background: var(--paper);
}

/* ---------- buttons ------------------------------------------------------- */

.btnrow { display: flex; gap: .7rem; flex-wrap: wrap; margin: 1.5rem 0 0; }

.btn {
  font-family: var(--sans);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  padding: .68rem 1.25rem;
  border: 2px solid var(--ink);
  border-radius: 2px;
  display: inline-block;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--mark); border-color: var(--mark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- change bar: the recurring structural device ------------------- */
/* A vertical rule in the margin, the way a revised paragraph is marked up.   */

.note {
  border-left: 3px solid var(--rule);
  padding: .1rem 0 .1rem 1.15rem;
  margin: 1.8rem 0;
}
.note > :last-child { margin-bottom: 0; }
.note-mark   { border-left-color: var(--mark); }
.note-pass   { border-left-color: var(--pass); }
.note-amber  { border-left-color: var(--amber); }

.note h3 { margin-bottom: .35em; }

/* ---------- content columns ----------------------------------------------- */

.cols {
  display: grid;
  gap: clamp(1.6rem, 3vw, 2.8rem);
}
@media (min-width: 48rem)  { .cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem)  { .cols-3 { grid-template-columns: repeat(3, 1fr); } }

.sectionhead {
  display: grid;
  gap: clamp(1rem, 2.5vw, 2.5rem);
  margin-bottom: clamp(1.8rem, 3vw, 2.8rem);
}
@media (min-width: 62rem) {
  .sectionhead { grid-template-columns: 37fr 63fr; align-items: end; }
}

.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.4em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.9em; }
.prose ul, .prose ol { padding-left: 1.15rem; }
.prose li { margin-bottom: .38em; }
.prose li::marker { color: var(--slate); }

/* ---------- steps (genuinely sequential, so numbered) --------------------- */

.steps { list-style: none; padding: 0; counter-reset: s; margin: 0; }
.steps > li {
  counter-increment: s;
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 1.5rem 3.4rem;
  position: relative;
  max-width: none;
}
.steps > li:last-child { border-bottom: 1px solid var(--rule); }
.steps > li::before {
  content: counter(s);
  position: absolute; left: 0; top: 1.5rem;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.55rem;
  line-height: 1;
  color: var(--mark);
}
.steps h3 { margin-bottom: .3em; }
.steps p { margin-bottom: .5em; }
.steps > li > :last-child { margin-bottom: 0; }

/* ---------- tables -------------------------------------------------------- */

.tablewrap { overflow-x: auto; margin-bottom: 1.4em; }

table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td {
  text-align: left;
  padding: .62rem .8rem .62rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-family: var(--sans);
  font-weight: 700;
  font-size: .82rem;
  border-bottom: 2px solid var(--ink);
}
td p { margin: 0; max-width: none; }

/* ---------- sample report ------------------------------------------------- */

.report {
  border: 1px solid var(--rule);
  background: #FCFCFA;
  padding: clamp(1.1rem, 3vw, 2rem);
}
.report pre {
  margin: 0;
  font-family: var(--mono);
  font-size: .76rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  color: #23272A;
}

.verdict {
  display: flex; gap: 1.6rem; flex-wrap: wrap;
  border-block: 1px solid var(--rule);
  padding: 1rem 0;
  margin-bottom: 1.4rem;
}
.verdict div { font-family: var(--sans); }
.verdict b {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.verdict span { font-size: .8rem; color: var(--slate); }
.v-red b { color: var(--mark); }
.v-amber b { color: var(--amber); }
.v-green b { color: var(--pass); }

/* ---------- faq ----------------------------------------------------------- */

.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.05rem 2.2rem 1.05rem 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.05rem;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: .3rem; top: .95rem;
  font-size: 1.35rem; color: var(--mark); line-height: 1;
}
.faq details[open] summary::after { content: "\2013"; }
.faq details > div { padding-bottom: 1.15rem; }
.faq details > div > :last-child { margin-bottom: 0; }

/* ---------- checklist ----------------------------------------------------- */

.checks { list-style: none; padding: 0; }
.checks li {
  padding: .42rem 0 .42rem 1.5rem;
  position: relative;
  border-bottom: 1px solid var(--rule);
  max-width: none;
}
.checks li::before {
  content: "";
  position: absolute; left: 0; top: .95em;
  width: .6rem; height: 1px;
  background: var(--mark);
}

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

.foot {
  border-top: 2.5px solid var(--ink);
  margin-top: var(--band);
  padding-block: 2.6rem 3rem;
  padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
  font-size: .925rem;
}
.foot-grid { display: grid; gap: 1.8rem; }
@media (min-width: 48rem) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h3 { font-size: .82rem; margin-bottom: .7em; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: .34em; }
.foot a { color: var(--slate); }
.foot a:hover { color: var(--mark); }
.foot .small { margin-top: 2rem; margin-bottom: 0; }

/* ---------- utility ------------------------------------------------------- */

.vh {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.updated {
  font-family: var(--sans);
  font-size: .83rem;
  color: var(--slate);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--pass);
  padding: .5rem .8rem;
  display: inline-block;
  margin-bottom: 1.8rem;
}
