/*
  JB & K Design, concept v1: every style for this page.
  Colors, fonts and sizes live in the design tokens (:root) near the top.
  Sections, in order: fonts; design tokens; base; buttons; header; hero and the red pen; measured on your device; what changes; what stays yours; how it works; who's behind it; contact; footer; small screens; motion.
  Mazius Display is by Collletttivo (collletttivo.it), OFL; they ask for credit, so it lives here and in fonts/.
*/

/* ---------- fonts (files are in fonts/) ---------- */
@font-face { font-family: "Mazius Display"; src: url(fonts/mazius-display.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Mazius Display"; src: url(fonts/mazius-display-extraitalic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans.woff2) format("woff2"); font-weight: 100 700; font-style: normal; font-display: swap; }

/* ---------- design tokens: colors, fonts and sizes. Change these first; the rest of the file uses them ---------- */
:root {
  --paper: #FFFFFF;
  --sheet: #F3F3F0;      /* alternate sections */
  --ink: #141414;
  --pencil: #585C62;     /* secondary text */
  --pen: #C8102E;        /* the red pen: marks, links, the main button */
  --pen-lit: #FF7A85;    /* red on dark sections */
  --pen-wash: #FBE3E6;   /* faint red behind struck-out text */
  --hi: #FFE66B;         /* highlighter, used sparingly */
  --rule: #DADBD6;
  --display: "Mazius Display", Georgia, "Times New Roman", serif;
  --text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1180px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--text); }
svg { max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.04; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h3 { font-size: 1.5rem; line-height: 1.15; }
em { font-style: italic; }
p { margin: 0 0 1rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
.concept { margin: 0; font-size: .8125rem; color: var(--pencil); background: var(--sheet); text-align: center; padding: .45rem var(--gutter); }
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section--sheet { background: var(--sheet); }
.intro { max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.intro p { color: var(--pencil); font-size: 1.125rem; margin-top: 1rem; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .7rem 1.3rem; border-radius: 999px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font: 600 1rem/1.1 var(--text); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--sheet); }
.btn--pen { background: var(--pen); border-color: var(--pen); color: #fff; }
.btn--pen:hover { background: #A50D26; border-color: #A50D26; }

/* ---------- header ---------- */
.top { border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: .9rem; padding-bottom: .9rem; }
.mark { display: inline-flex; align-items: baseline; gap: .45rem; text-decoration: none; }
.mark__name { font: 400 2.1rem/1 var(--display); letter-spacing: -0.02em; }
.mark__name i { font-style: italic; color: var(--pen); margin: 0 .03em; }
.mark__sub { font-size: .875rem; font-weight: 600; color: var(--pencil); }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav ul { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav a:not(.btn) { text-decoration: none; font-weight: 500; font-size: .9375rem; }
.nav a:not(.btn):hover { text-decoration: underline; color: var(--pen); }

/* ---------- hero and the red pen ---------- */
.hero .wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding-top: clamp(2.5rem, 6vw, 5rem); padding-bottom: clamp(2rem, 5vw, 4rem); }
.hero h1 { font-size: clamp(3rem, 6.4vw, 5.2rem); line-height: .98; letter-spacing: -0.025em; }
.hero h1 em { color: var(--pen); }
.hero__lead { font-size: 1.1875rem; max-width: 31em; margin: 1.6rem 0 2rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.markup { margin: 0; }
.markup svg { display: block; width: 100%; height: auto; }
.markup .frame { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.markup .bar { fill: var(--sheet); }
.markup .dot { fill: #D5D6D2; }
.markup .block { fill: #E6E7E3; }
.markup .soft { fill: none; stroke: #B9BCC2; stroke-width: 4; }
.markup .old { font: 400 12px Georgia, "Times New Roman", serif; fill: var(--pencil); }
.markup .old--big { font-size: 17px; letter-spacing: .04em; }
.markup .old--ink { fill: var(--ink); font-size: 12.5px; }
.markup .old--link { fill: #2F4FA8; text-decoration: underline; }
.markup .addr { font: 400 11px var(--text); fill: var(--pencil); }
.markup .pen { fill: none; stroke: var(--pen); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.markup .note { font: italic 400 18px var(--display); fill: var(--pen); }

/* ---------- measured on your device ---------- */
.meter { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--sheet); }
.meter .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) repeat(4, minmax(0, 1fr)); gap: 1rem 2rem; align-items: end; padding-top: 1.4rem; padding-bottom: 1.4rem; }
.meter__head { font-size: .9375rem; color: var(--pencil); margin: 0; }
.meter__head strong { display: block; color: var(--ink); font: 400 1.5rem/1.1 var(--display); margin-bottom: .2rem; }
.meter dl { display: contents; }
.meter dl > div { border-left: 2px solid var(--pen); padding-left: .8rem; }
.meter dt { font-size: .8125rem; color: var(--pencil); }
.meter dd { margin: .1rem 0 0; font-size: 1.6rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* ---------- what changes ---------- */
.fixes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; }
.fixes li { display: grid; gap: .35rem; padding: 1.3rem 0; border-top: 1px solid var(--rule); }
.fixes .was { color: var(--pencil); text-decoration: line-through; text-decoration-color: var(--pen); text-decoration-thickness: 2px; }
.fixes .now { font: 400 1.45rem/1.2 var(--display); }

/* ---------- what stays yours ---------- */
.yours { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.yours h3 { margin-bottom: .6rem; }
.yours p { color: var(--pencil); margin: 0; }
.yours > div { border-top: 3px solid var(--ink); padding-top: 1rem; }

/* ---------- how it works ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; counter-reset: step; }
.steps li { position: relative; padding-top: 3.2rem; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 0; width: 2.4rem; height: 2.4rem; border: 2px solid var(--pen); border-radius: 50%; display: grid; place-items: center; font: italic 400 1.3rem/1 var(--display); color: var(--pen); }
.steps li::after { content: ""; position: absolute; top: 1.2rem; left: 3rem; right: -1.6rem; border-top: 2px dashed var(--rule); }
.steps li:last-child::after { display: none; }
.steps h3 { margin-bottom: .5rem; }
.steps p { color: var(--pencil); margin: 0; }

/* ---------- who's behind it ---------- */
.about { background: var(--ink); color: #fff; }
.about .wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.about h2 em { color: var(--pen-lit); }
.about p { color: #D8D9DC; font-size: 1.125rem; }
.about ul { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .8rem; }
.about li { border-left: 2px solid var(--pen-lit); padding-left: .9rem; color: #fff; }

/* ---------- contact ---------- */
.contact { text-align: center; }
.contact h2 { max-width: 14em; margin: 0 auto; }
.contact p { color: var(--pencil); font-size: 1.125rem; max-width: 34rem; margin: 1.2rem auto 2rem; }
.email { display: inline-block; font: 400 clamp(1.7rem, 5vw, 3.2rem)/1.1 var(--display); color: var(--pen); text-decoration: none; border-bottom: 3px solid var(--pen); padding-bottom: .15rem; overflow-wrap: anywhere; }
.email:hover { background: var(--pen-wash); }
.contact small { display: block; margin-top: 1.6rem; color: var(--pencil); font-size: .9375rem; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule); padding: 2rem 0 2.5rem; font-size: .875rem; color: var(--pencil); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.foot p { margin: 0; }
.foot a { color: var(--ink); }

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .nav ul { display: none; }
  .meter .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meter__head { grid-column: 1 / -1; }
  .yours, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li:nth-child(2)::after { display: none; }
  .about .wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .mark__name { font-size: 1.8rem; }
  .mark__sub { display: none; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .fixes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .yours, .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li::after { display: none; }
  .hero__cta .btn { flex: 1 1 100%; }
}

/* ---------- motion: the pen marks draw themselves in once ---------- */
/* each mark's turn comes from data-i in the page (no inline styles, so the security policy can block them) */
.markup [data-i="0"] { --i: 0; } .markup [data-i="1"] { --i: 1; } .markup [data-i="2"] { --i: 2; } .markup [data-i="3"] { --i: 3; } .markup [data-i="4"] { --i: 4; }
@media (prefers-reduced-motion: no-preference) {
  .markup .pen { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .5s cubic-bezier(.4, .1, .3, 1) forwards; animation-delay: calc(.5s + var(--i) * .38s); }
  .markup .note { opacity: 0; animation: show .3s ease-out forwards; animation-delay: calc(.85s + var(--i) * .38s); }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes show { to { opacity: 1; } }
