/* ==========================================================================
   Reinstall Work — reinstall.work
   Hand-written static site. No framework, no build step.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('/fonts/plex-sans-var.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/plex-mono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/plex-mono-500.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/plex-mono-600.woff2') format('woff2');
}

/* Phosphor Light, subset to only the glyphs this site uses:
   U+E2EE linkedin-logo, U+E398 paper-plane-tilt, U+E58C monitor-play,
   U+E478 tag, U+E5D4 wrench, U+E628 gauge, U+E712 calendar-check.
   Rebuild: pyftsubset Phosphor-Light.woff2
            --unicodes=U+E2EE,U+E398,U+E478,U+E58C,U+E5D4,U+E628,U+E712
            --flavor=woff2 --output-file=phosphor-light-subset.woff2 */
@font-face {
  font-family: 'Phosphor-Light';
  font-style: normal;
  font-weight: normal;
  font-display: block;
  /* ?v= must be bumped whenever the glyph set changes — /fonts/* is served
     immutable for a year, so a stale cache would drop icons silently. */
  src: url('/fonts/phosphor-light-subset.woff2?v=5') format('woff2');
}

/* Phosphor Fill, subset to U+E2EE linkedin-logo and U+E398 paper-plane-tilt —
   used only for the About section's social icons.
   Rebuild: pyftsubset Phosphor-Fill.woff2 --unicodes=U+E2EE,U+E398
            --flavor=woff2 --output-file=phosphor-fill-subset.woff2 */
@font-face {
  font-family: 'Phosphor-Fill';
  font-style: normal;
  font-weight: normal;
  font-display: block;
  src: url('/fonts/phosphor-fill-subset.woff2?v=1') format('woff2');
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  /* Palette */
  --bg: #f2f0ed;
  --ink: #0a0a0a;
  --accent: #cc2020;
  --neutral: #8a8a8a;
  --dark: #1e1e1e;

  /* Derived surfaces */
  --bg-raised: #f8f7f5;
  --rule: color-mix(in srgb, var(--neutral) 32%, transparent);
  --rule-strong: color-mix(in srgb, var(--neutral) 55%, transparent);
  --muted: #6b6b6b;

  /* Type */
  --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout */
  --measure: 80ch;
  --page: 1120px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --header-h: 4.25rem;

  --radius: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Reset / base --------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  /* Anchor targets clear the sticky header */
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Layout primitives ---------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(4rem, 9vw, 7.5rem);
  border-top: 1px solid var(--rule);
}

.section__head {
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

/* Neutral qualifier under an h2 — quieter than .lede. */
.subhead {
  margin-top: 0.65rem;
  font-size: 1.0625rem;
  color: var(--neutral);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

.eyebrow--muted {
  color: var(--neutral);
}

h2 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem);
}

h3 {
  font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
}

.lede {
  max-width: var(--measure);
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
  color: var(--muted);
  margin-top: 1rem;
}

.prose {
  max-width: var(--measure);
  display: grid;
  gap: 1.15em;
}

/* `:not(.btn)` matters — a .btn placed inside .prose would otherwise inherit
   accent text, which on the solid-accent button is red-on-red. */
.prose a:not(.btn) {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.prose a:not(.btn):hover {
  text-decoration-color: currentColor;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.875rem;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* --- Header --------------------------------------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--rule);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand img {
  height: 1.5rem;
  width: auto;
}

/* --- Nav ------------------------------------------------------------------ */

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 1.9rem);
}

.nav a:not(.btn) {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.35rem;
  position: relative;
  transition: color 0.18s var(--ease);
  white-space: nowrap;
}

.nav a:not(.btn)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s var(--ease);
}

.nav a:not(.btn):hover {
  color: var(--ink);
}

.nav a:not(.btn)[aria-current='true'] {
  color: var(--ink);
}

.nav a:not(.btn)[aria-current='true']::after {
  transform: scaleX(1);
}

/* Shown at every width: a compact button in the desktop bar, and a
   full-width one at the foot of the mobile panel (see the mobile block). */
.nav__cta {
  padding: 0.6rem 1rem;
  margin-left: 0.35rem;
}

/* Mobile nav */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-right: -0.5rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

/* 900px, not 760 — below this the horizontal nav plus the always-visible
   CTA needs ~761px against ~749px available, which wrapped the button label. */
@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }
}

@media (max-width: 899px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1.5rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease),
      visibility 0.2s;
  }

  .nav[data-open='true'] {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  .nav a:not(.btn) {
    padding-block: 0.85rem;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--rule);
  }

  /* The last text link sits directly above the CTA — its divider would read
     as a stray second rule between them. */
  .nav a:not(.btn):has(+ .btn) {
    border-bottom: none;
  }

  /* Full-width CTA at the foot of the panel. */
  .nav__cta {
    justify-content: center;
    margin: 0.75rem 0 0;
    padding-block: 0.85rem;
  }

  .nav a:not(.btn)::after {
    display: none;
  }
}

/* --- Icons ---------------------------------------------------------------- */

/* Minimal replacement for the Phosphor web stylesheet — we only ship two
   glyphs, so there is no reason to carry the full ~87KB of icon classes. */
.ph-light,
.ph-fill {
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  display: inline-block;
  speak: never;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ph-light {
  font-family: 'Phosphor-Light' !important;
}

.ph-fill {
  font-family: 'Phosphor-Fill' !important;
}

/* Codepoints are identical across Phosphor weights — only the family differs. */
.ph-fill.ph-linkedin-logo::before {
  content: '\e2ee';
}

.ph-fill.ph-paper-plane-tilt::before {
  content: '\e398';
}

.ph-light.ph-monitor-play::before {
  content: '\e58c';
}

.ph-light.ph-paper-plane-tilt::before {
  content: '\e398';
}

.ph-light.ph-linkedin-logo::before {
  content: '\e2ee';
}

.ph-light.ph-wrench::before {
  content: '\e5d4';
}

.ph-light.ph-gauge::before {
  content: '\e628';
}

.ph-light.ph-calendar-check::before {
  content: '\e712';
}

.ph-light.ph-tag::before {
  content: '\e478';
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1;
  white-space: nowrap;
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease), transform 0.18s var(--ease);
}

.btn:hover {
  background: color-mix(in srgb, var(--accent) 86%, #000);
  border-color: color-mix(in srgb, var(--accent) 86%, #000);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn--ghost:hover {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn--sm {
  padding: 0.6rem 1rem;
  font-size: 0.8125rem;
}

.btn i {
  font-size: 1.35em;
  line-height: 1;
  flex-shrink: 0;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Closing CTA at the end of a content section — needs more air than the
   in-flow version that sits directly under body copy. */
.btn-row--close {
  margin-top: clamp(2.25rem, 4vw, 3.25rem);
}

.btn-row--center {
  justify-content: center;
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(3rem, 7vw, 5.5rem);
  border-top: 0;
}

/* Capped well below the old 5rem — the headline is a full sentence now and
   would otherwise swallow the fold. */
.hero h1 {
  font-size: clamp(2.125rem, 1.3rem + 3.1vw, 3.5rem);
  letter-spacing: -0.03em;
  max-width: 26ch;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero .lede {
  margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
  max-width: 64ch;
}

.hero__media {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  border-radius: calc(var(--radius) * 2);
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--dark);
  aspect-ratio: 16 / 9;
}

.hero__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Cards (services) ----------------------------------------------------- */

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 620px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) * 1.5);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.card:hover {
  border-color: var(--rule-strong);
  transform: translateY(-2px);
}

.card > i {
  font-size: 1.75rem;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.card p {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Price pill sits on the card's bottom row. `margin-top: auto` pushes it down;
   the grid stretches cards to equal height, so the pills line up across cards.
   Declared after `.card p` so the accent colour actually applies. */
.card p.card__price {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
}

.card__price span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--accent);
  padding: 0.55rem 0.9rem;
  border-radius: 100px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, var(--bg));
}

.card__price i {
  font-size: 1.05rem;
  line-height: 1;
}

/* --- Chips (what I manage) ------------------------------------------------ */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 0.6rem 0.95rem;
  border-radius: 100px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, var(--bg));
  color: var(--accent);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease);
}

.chips li:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.chips__more {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--neutral);
}

/* --- Commitment note (services) ------------------------------------------- */

/* Stacked like .card — icon on its own row above the title. */
.note {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) * 1.5);
  background: transparent;
}

.note > i {
  font-size: 1.75rem;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.note p {
  font-size: 0.9375rem;
  color: var(--muted);
}

.note strong {
  color: var(--ink);
}

/* --- About ---------------------------------------------------------------- */

.about {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
}

@media (min-width: 900px) {
  .about {
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    align-items: start;
  }
}

.about__portrait {
  width: clamp(7rem, 20vw, 12rem);
  border-radius: 50%;
}

/* Tighter measure than the rest of the page — this is the longest single
   block of body copy on the site. */
.about .prose {
  max-width: 62ch;
}

.about__meta {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.about__meta strong {
  color: var(--ink);
  font-weight: 600;
}

.about__links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.about__links a {
  display: inline-flex;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.18s var(--ease);
}

.about__links a:hover {
  opacity: 0.7;
}

.about__links i {
  font-size: 1.35rem;
  line-height: 1;
}

/* --- FAQ ------------------------------------------------------------------ */

.faq {
  max-width: 62rem;
  border-top: 1px solid var(--rule);
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.35rem;
  cursor: pointer;
  list-style: none;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 0.18s var(--ease);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary:hover {
  color: var(--accent);
}

.faq summary::after {
  content: '';
  flex-shrink: 0;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 1.5px solid var(--neutral);
  border-bottom: 1.5px solid var(--neutral);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.25s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.faq details > .prose {
  padding-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* --- Contact / dark band -------------------------------------------------- */

.band {
  background: var(--dark);
  color: var(--bg);
  border-top: 0;
}

.band .lede {
  color: color-mix(in srgb, var(--bg) 70%, transparent);
}

.band h2 {
  max-width: 22ch;
}

.band .btn--ghost {
  color: var(--bg);
  border-color: color-mix(in srgb, var(--bg) 35%, transparent);
}

.band .btn--ghost:hover {
  border-color: var(--bg);
}

/* --- Footer --------------------------------------------------------------- */

.footer {
  background: var(--dark);
  color: color-mix(in srgb, var(--bg) 62%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--bg) 14%, transparent);
  padding-block: 2.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.footer__social {
  display: inline-flex;
  align-items: center;
  /* Optical alignment — the glyphs sit slightly high against the mono baseline. */
  margin-top: 1px;
}

.footer__social i {
  font-size: 1.35rem;
  line-height: 1;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

.footer a:hover {
  color: var(--bg);
}

/* --- Legal pages ---------------------------------------------------------- */

.legal {
  padding-block: clamp(3rem, 7vw, 5rem);
  border-top: 0;
}

.legal .prose {
  max-width: 54rem;
}

.legal h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  margin-bottom: 0.75rem;
}

.legal h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  margin-top: 2.25rem;
}

.legal__updated {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--neutral);
  margin-bottom: 2.5rem;
}

.legal ul {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

/* --- Reveal on scroll ----------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
