/* The Fractional CTO — black-and-white system.
   TODO(brand): tweak type scale or spacing to taste. Colour is intentionally excluded. */

:root {
  --fg: #000;
  --ink: #000;
  --nav-ink: #000;
  --bg: #fff;
  --rule: #000;
  --muted: #555;
  --max: 68rem;
  --measure: 36rem;
  --step: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
  --h1: clamp(2.2rem, 1.6rem + 2.8vw, 3.5rem);
  --h2: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
  --h3: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='4.5' y='4.5' width='23' height='23' fill='none' stroke='%23000' stroke-width='3'/%3E%3Crect x='8' y='14' width='10' height='10'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root { --fg: #fff; --ink: #fff; --nav-ink: #fff; --bg: #000; --rule: #fff; --muted: #aaa; }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  /* Body copy sits a step below full black; the hero overrides back to --fg so it pops. */
  color: var(--ink);
  font: var(--step)/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--fg); color: var(--bg); }

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: var(--h1); margin: 0 0 1rem; }
h2 { font-size: var(--h2); margin: 3rem 0 1rem; }
h3 { font-size: var(--h3); margin: 2rem 0 0.5rem; }

p { margin: 0 0 1rem; max-width: var(--measure); }

hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

code, pre, kbd { font-family: var(--mono); font-size: 0.95em; }

table { border-collapse: collapse; width: 100%; margin: 1.5rem 0 2rem; font-size: 0.95rem; }
th, td { border: 1px solid var(--rule); padding: .55rem .75rem; text-align: left; vertical-align: top; }
th { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 400; }

/* --- Layout --- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 48rem; margin: 0 auto; padding: 0 1.5rem; }
main > .narrow, main > article.narrow { padding-top: 3rem; padding-bottom: 1rem; }

/* --- Skip link --- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--fg); color: var(--bg); padding: .5rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 100; }

/* --- Header --- */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: .8rem 0;
  position: sticky; top: 0; background: var(--bg); z-index: 10;
  color: var(--nav-ink);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  column-gap: 1.5rem; row-gap: .4rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--serif);
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

/* The mark: an outlined square with a solid smaller square anchored inside its
   bottom-left corner — the org as hired, and the org the business needs. Same
   grammar as the hero figure (outline is before, solid is after) and the same
   geometry as assets/favicon.svg. Painted as a mask over currentColor so it inverts
   with the colour scheme and never depends on a font shipping the glyph. */
.brand::before { content: ""; display: none; }

@supports (mask-image: url("i.svg")) or (-webkit-mask-image: url("i.svg")) {
  .brand::before {
    display: block;
    flex: none;
    width: 1.1em;
    height: 1.1em;
    background: currentColor;
    -webkit-mask: var(--mark) center / contain no-repeat;
    mask: var(--mark) center / contain no-repeat;
  }
}
.nav { display: flex; gap: 1.15rem; align-items: center; flex-wrap: wrap; font-size: 0.925rem; }
.nav a { text-decoration: none; }
.nav a[aria-current="page"] { text-decoration: underline; }

.lang {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--rule);
  padding: .1rem .5rem;
}
.lang [aria-current="true"] { background: var(--fg); color: var(--bg); text-decoration: none; }
.lang a { text-decoration: none; padding: 0 .25rem; }

/* --- Hero --- */
/* The hero is the one inverted block: ink on paper everywhere else, paper on ink here.
   Re-scoping the custom properties flips the figure, CTA, and links along with the text. */
.hero {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(3rem, 5vw, 4rem);
  --fg: #fff; --bg: #000; --rule: #fff; --muted: #a3a3a3; --ink: #fff; --nav-ink: #fff;
  background: var(--bg);
  color: var(--fg);
  border-bottom: 1px solid var(--rule);
}
@media (prefers-color-scheme: dark) {
  .hero { --fg: #000; --bg: #fff; --rule: #000; --muted: #555; --ink: #000; --nav-ink: #000; }
}
.hero .lede { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); max-width: 34rem; margin-bottom: 0; }
.hero h1 { margin-bottom: 1.25rem; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0 0 1rem;
}
.eyebrow + h2 { margin-top: 0; }

/* --- Buttons / CTAs --- */
.cta {
  display: inline-block;
  padding: .9rem 1.4rem;
  border: 2px solid var(--fg);
  background: var(--fg); color: var(--bg);
  text-decoration: none;
  font-weight: 600;
}
.cta:hover { background: var(--bg); color: var(--fg); }
.cta.ghost { background: var(--bg); color: var(--fg); }
.cta.ghost:hover { background: var(--fg); color: var(--bg); }
.cta-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* --- Sections / grids --- */
section { padding: 4rem 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: 0; }

.grid-2, .grid-3, .grid-4 { display: grid; gap: 2rem; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.card { border: 1px solid var(--rule); padding: 1.5rem; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

/* --- FAQ --- */
details.faq {
  border-top: 1px solid var(--rule);
  padding: 1.25rem 0;
}
details.faq:last-of-type { border-bottom: 1px solid var(--rule); }
details.faq summary {
  cursor: pointer;
  font-family: var(--serif);
  font-size: var(--h3);
  list-style: none;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-family: var(--mono); }
details.faq[open] summary::after { content: "–"; }
details.faq > *:not(summary) { margin-top: 1rem; }

/* --- Blog list --- */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { border-top: 1px solid var(--rule); padding: 1.5rem 0; }
.post-list li:last-child { border-bottom: 1px solid var(--rule); }
.post-list a { text-decoration: none; }
.post-list h3 { margin: 0 0 .25rem; }
.post-list time { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

/* --- Article (blog post) --- */
article.post header { border-bottom: 1px solid var(--rule); padding-bottom: 2rem; margin-bottom: 2rem; }
article.post p, article.post ul, article.post ol, article.post blockquote { max-width: var(--measure); }
article.post ul, article.post ol { padding-left: 1.25rem; }
article.post li { margin: .35rem 0; }
article.post blockquote {
  border-left: 2px solid var(--rule);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-family: var(--serif);
  font-style: italic;
}

/* --- Contact form --- */
form.contact { display: grid; gap: 1rem; max-width: var(--measure); }
form.contact label { display: grid; gap: .35rem; font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; }
form.contact input, form.contact textarea {
  font: inherit;
  padding: .75rem;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--fg);
  border-radius: 0;
}
form.contact textarea { min-height: 8rem; resize: vertical; }
form.contact input:focus, form.contact textarea:focus { outline: 2px solid var(--fg); outline-offset: 2px; }
.honey { position: absolute; left: -9999px; }
.form-status { min-height: 1.5rem; font-family: var(--mono); font-size: 0.85rem; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--rule); padding: 2.5rem 0 3rem; margin-top: 4rem; font-size: 0.9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer .fine { color: var(--muted); }

/* --- Flat marks (inline SVG, monochrome, currentColor) --- */
.icon {
  width: 2rem; height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
  overflow: visible;
}
.card .icon, .step .icon { margin-bottom: 1rem; }
.grid-2 + .fine, .grid-3 + .fine { margin-top: 2rem; }
.card h3, .step h3 { margin-top: 0; }
.icon-inline { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.15em; margin-right: .5rem; stroke-width: 1.5; }

/* --- Hero figure: the shape of an over-hired org, next to the shape it needs --- */
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 3.5rem; }
}
.hero-figure { margin: 0; }

/* --- Audience strip under the hero: who this is for, and the terms of the call.
   A diagonally hatched band, so it reads as neither the hero nor the page: a
   printed divider between them. Hatching stays inside the monochrome system. --- */
section.slim {
  padding: 1.35rem 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0 6px,
    rgba(0, 0, 0, 0.14) 6px 7px
  );
}
@media (prefers-color-scheme: dark) {
  section.slim {
    background: repeating-linear-gradient(
      -45deg,
      transparent 0 6px,
      rgba(255, 255, 255, 0.18) 6px 7px
    );
  }
}
.strip .meta {
  background: var(--bg);
  padding: .3rem .6rem;
  margin: .25rem 0;
}
.strip {
  display: flex; flex-direction: column; align-items: center;
  gap: .4rem; text-align: center;
}
.strip p { margin: 0; max-width: none; }
.strip-lead {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-right: .35rem;
}
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid var(--fg);
  background: var(--bg);
  padding: .3rem .6rem;
  margin: .25rem .35rem .25rem 0;
  white-space: nowrap;
}
.hero-figure svg { width: 100%; max-width: 26rem; }
.hero-figure .shape-before rect { fill: none; stroke: var(--fg); stroke-width: 1.5; }
.hero-figure .shape-after rect { fill: var(--fg); stroke: none; }
.hero-figure .shape-rule, .hero-figure .shape-arrow { stroke: var(--fg); stroke-width: 1.5; fill: none; }
.hero-figure figcaption {
  font-family: var(--mono); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted);
  display: flex; justify-content: space-between; gap: 1rem;
  max-width: 26rem; margin-top: .75rem;
}
@media (max-width: 899px) {
  /* Headline and CTA come first on a phone; the figure follows. */
  .hero-grid { gap: 2rem; }
  .hero-figure svg, .hero-figure figcaption { max-width: 22rem; }
}

/* --- Animated figures --- */
/* One shared timeline, percentage-based, so each figure picks its own cycle:
   blocks pop in staggered (--d per element), hold, dissolve, rebuild. Ghost
   elements (outlined: the trajectory that gets cut) appear and then leave
   mid-cycle. Without animation every figure sits in its finished state, which is
   exactly what prefers-reduced-motion gets. */
@media (prefers-reduced-motion: no-preference) {
  .hero-figure rect, .chart rect {
    animation: block-in var(--cycle, 12s) linear infinite backwards;
    animation-delay: var(--d, 0s);
  }
  .hero-figure .shape-arrow {
    stroke-dasharray: 60;
    animation: draw-in var(--cycle, 12s) linear infinite backwards;
    animation-delay: 1.6s;
  }
  .chart { --cycle: 8s; }
  .chart rect.ghost { animation-name: block-out; }
}
@keyframes block-in {
  0%, 2% { opacity: 0; }
  3%, 94% { opacity: 1; }
  96%, 100% { opacity: 0; }
}
@keyframes block-out {
  0%, 2% { opacity: 0; }
  3%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes draw-in {
  0% { stroke-dashoffset: 60; }
  7%, 94% { stroke-dashoffset: 0; }
  96%, 100% { stroke-dashoffset: 60; }
}

/* --- Card micro-charts: the four problems, each drawn as a small moving figure --- */
.chart {
  width: 100%; max-width: 10rem; height: auto;
  margin-bottom: 1rem;
  overflow: visible;
}
.chart .solid { fill: currentColor; }
.chart .ghost { fill: none; stroke: currentColor; stroke-width: 1.5; }
.chart .axis { fill: none; stroke: currentColor; stroke-width: 1.5; }

/* --- Proof cards: the case numbers, large, directly under the hero --- */
.proof-card .num {
  font-family: var(--serif);
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 .75rem;
}
.proof-card h3 { font-size: var(--h3); }

/* --- Audience paths out of the four-problems intro --- */
.icp-links { line-height: 2.1; }

/* --- Qualification and trust lists --- */
.checklist { list-style: none; padding: 0; margin: 1rem 0; max-width: var(--measure); }
.checklist li { position: relative; padding-left: 1.5rem; margin: .5rem 0; }
.checklist li::before {
  content: "+";
  position: absolute; left: 0;
  font-family: var(--mono);
}
.checklist.no li::before { content: "\2212"; }

/* --- Qualifying line under the hero CTA --- */
.meta {
  font-family: var(--mono); font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted);
  margin: 1.5rem 0 0;
}

/* --- Secondary action: a link, so the primary CTA stays the only button --- */
.link-arrow { text-decoration: none; align-self: center; font-weight: 600; }
.link-arrow::after { content: ""; display: inline-block; width: .8em; height: .8em; margin-left: .5rem;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor;
  transform: rotate(45deg) translate(-0.1em, 0.1em); }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 4px; }
