@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Figtree:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

/* OPIc Practice Library - editorial guides. Standalone, no JS. */
:root {
  --g-bg: hsl(42 45% 95%);
  --g-paper: hsl(44 60% 98%);
  --g-ink: hsl(252 30% 18%);
  --g-ink-soft: hsl(252 10% 36%);
  --g-primary: hsl(252 42% 30%);
  --g-primary-ink: hsl(44 60% 97%);
  --g-accent: hsl(40 92% 62%);
  --g-accent-soft: hsl(40 90% 88%);
  --g-teal: hsl(168 35% 32%);
  --g-line: hsl(38 25% 82%);
  --g-rule: hsl(252 40% 60% / .13);
  --g-serif: 'Fraunces', Georgia, serif;
  --g-sans: 'Figtree', system-ui, sans-serif;
  --g-mono: 'JetBrains Mono', ui-monospace, monospace;
  --g-radius: .75rem;
  --g-measure: 40rem;
  --g-pad: clamp(1rem, 4vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body.guide-site {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--g-bg);
  color: var(--g-ink);
  font-family: var(--g-sans);
  font-size: clamp(1rem, .95rem + .25vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
body.guide-site::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.guide-site a { color: var(--g-primary); text-decoration-thickness: 1px; text-underline-offset: .2em; }
.guide-site a:hover { text-decoration-color: var(--g-accent); text-decoration-thickness: 3px; }
.guide-site :focus-visible {
  outline: 3px solid var(--g-primary);
  outline-offset: 3px;
  border-radius: 4px;
  box-shadow: 0 0 0 6px hsl(40 92% 62% / .55);
}

/* Skip link */
.guide-skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--g-primary); color: var(--g-primary-ink) !important;
  padding: .6rem 1rem; border-radius: var(--g-radius); font-weight: 600; text-decoration: none;
}
.guide-skip:focus, .guide-skip:focus-visible { top: 1rem; }

/* Header */
.guide-header { border-bottom: 1px solid var(--g-line); background: hsl(42 40% 93% / .9); }
.guide-header-inner {
  max-width: 64rem; margin: 0 auto; padding: .9rem var(--g-pad);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
}
.guide-brand {
  font-family: var(--g-serif); font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em;
  color: var(--g-ink) !important; text-decoration: none;
}
.guide-brand:hover { text-decoration: none; }
.guide-header nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; }
.guide-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; }
.guide-language { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.guide-header nav a {
  display: inline-block; padding: .35rem 0; font-size: .95rem; font-weight: 500;
  color: var(--g-ink-soft); text-decoration: none;
}
.guide-header nav a:hover, .guide-header nav a[aria-current] { color: var(--g-primary); text-decoration: underline; text-decoration-color: var(--g-accent); text-decoration-thickness: 3px; }

/* Main */
.guide-main {
  flex: 1; width: 100%; max-width: 64rem; margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--g-pad) clamp(3rem, 8vw, 5rem);
}
.guide-main > *, .guide-article > * { max-width: var(--g-measure); }

.guide-kicker {
  display: inline-block; margin: 0 0 1rem;
  font-family: var(--g-mono); font-size: .75rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--g-teal);
  border-bottom: 2px solid var(--g-accent); padding-bottom: .15rem;
}

.guide-site h1 {
  font-family: var(--g-serif); font-weight: 700;
  font-size: clamp(2rem, 1.3rem + 3.6vw, 3.6rem); line-height: 1.06; letter-spacing: -.025em;
  margin: 0 0 1rem; max-width: 22ch; text-wrap: balance;
}
.guide-deck {
  font-family: var(--g-serif); font-weight: 400; font-style: italic;
  font-size: clamp(1.1rem, 1rem + .6vw, 1.35rem); line-height: 1.5;
  color: var(--g-ink-soft); margin: 0 0 2.5rem;
}

/* Index list */
.guide-index { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--g-ink); max-width: 48rem; counter-reset: g; }
.guide-index > li {
  counter-increment: g; position: relative;
  padding: 1.4rem 0 1.4rem 3.25rem; border-bottom: 1px solid var(--g-line);
}
.guide-index > li::before {
  content: counter(g, decimal-leading-zero);
  position: absolute; left: 0; top: 1.55rem;
  font-family: var(--g-mono); font-size: .8rem; color: var(--g-ink-soft);
}
.guide-index a {
  font-family: var(--g-serif); font-weight: 600;
  font-size: clamp(1.2rem, 1.05rem + .7vw, 1.55rem); line-height: 1.25;
  color: var(--g-ink); text-decoration: none;
}
.guide-index a:hover { color: var(--g-primary); text-decoration: underline; text-decoration-color: var(--g-accent); text-decoration-thickness: 3px; }
.guide-index p { margin: .4rem 0 0; color: var(--g-ink-soft); font-size: .98rem; }

/* Article */
.guide-article h2 {
  font-family: var(--g-serif); font-weight: 600;
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.9rem); line-height: 1.2; letter-spacing: -.015em;
  margin: 2.75rem 0 .75rem; text-wrap: balance;
}
.guide-article h3 { font-family: var(--g-serif); font-weight: 600; font-size: 1.2rem; margin: 2rem 0 .5rem; }
.guide-article p { margin: 0 0 1.15rem; }
.guide-article ul, .guide-article ol { margin: 0 0 1.4rem; padding-left: 1.4rem; }
.guide-article li { margin: .35rem 0; padding-left: .25rem; }
.guide-article li::marker { color: var(--g-teal); font-weight: 700; }
.guide-article ol li::marker { font-family: var(--g-mono); font-size: .85em; }
.guide-article strong { font-weight: 700; }
.guide-article code { font-family: var(--g-mono); font-size: .88em; background: var(--g-accent-soft); padding: .05em .3em; border-radius: 4px; }

/* Sample answer: ruled notebook page */
.guide-sample {
  margin: 1.75rem 0; padding: .9rem 1.25rem .9rem 1.5rem;
  background-color: var(--g-paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(2rem - 1px), var(--g-rule) calc(2rem - 1px), var(--g-rule) 2rem);
  line-height: 2rem;
  border: 1px solid var(--g-line); border-left: 4px solid var(--g-primary);
  border-radius: 0 var(--g-radius) var(--g-radius) 0;
  font-family: var(--g-serif); font-size: 1.05rem;
}
.guide-sample p { margin: 0 0 0; }
.guide-sample p + p { margin-top: 2rem; }
.guide-sample cite, .guide-template cite { display: block; font-family: var(--g-mono); font-style: normal; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--g-ink-soft); }

/* Template: fill-in-the-blank card */
.guide-template {
  margin: 1.75rem 0; padding: 1.1rem 1.25rem;
  background: var(--g-accent-soft);
  border: 1px dashed hsl(40 60% 50%);
  border-radius: var(--g-radius);
  font-family: var(--g-mono); font-size: .92rem; line-height: 1.75;
}
.guide-template p { margin: 0 0 .6rem; }
.guide-template p:last-child { margin: 0; }
.guide-template mark, .guide-template em {
  font-style: normal; font-weight: 600; color: var(--g-ink);
  background: linear-gradient(to top, hsl(40 92% 62% / .75) 42%, transparent 42%); padding: 0 .15em;
}

/* Related */
.guide-related {
  margin-top: 3rem; padding-top: 1.25rem; border-top: 2px solid var(--g-ink);
}
.guide-related h2 { margin-top: 0; font-size: 1.15rem; font-family: var(--g-mono); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.guide-related ul { list-style: none; padding: 0; margin: 0; }
.guide-related li { padding: .6rem 0; border-bottom: 1px solid var(--g-line); margin: 0; }
.guide-related a { font-family: var(--g-serif); font-weight: 600; font-size: 1.08rem; }

/* CTA */
.guide-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.9rem; padding: .7rem 1.4rem; margin: 1rem 0;
  background: var(--g-primary); color: var(--g-primary-ink) !important;
  border: 1px solid hsl(252 42% 22%); border-radius: 999px;
  font-family: var(--g-sans); font-weight: 600; font-size: 1rem; line-height: 1.2;
  text-decoration: none !important; box-shadow: 0 3px 0 hsl(40 92% 55%);
  transition: transform .15s ease, box-shadow .15s ease;
}
.guide-button:hover { transform: translateY(-1px); box-shadow: 0 5px 0 hsl(40 92% 55%); }
.guide-button:active { transform: translateY(2px); box-shadow: 0 1px 0 hsl(40 92% 55%); }

/* Footer */
.guide-footer { border-top: 1px solid var(--g-line); background: hsl(42 40% 93%); color: var(--g-ink-soft); font-size: .9rem; }
.guide-footer-inner {
  max-width: 64rem; margin: 0 auto; padding: 1.5rem var(--g-pad);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center;
}
.guide-footer p { margin: 0; }
.guide-footer a { color: var(--g-ink-soft); }

/* Small screens */
@media (max-width: 480px) {
  .guide-index > li { padding-left: 2.4rem; }
  .guide-sample { padding-left: 1rem; padding-right: .9rem; font-size: 1rem; }
  .guide-template { font-size: .85rem; padding: .9rem 1rem; }
  .guide-button { width: 100%; }
  .guide-header nav a { font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .guide-button { transition: none; }
  .guide-button:hover, .guide-button:active { transform: none; }
}

@media print {
  body.guide-site::before, .guide-header nav, .guide-skip, .guide-button { display: none; }
  body.guide-site { background: none; }
}
