/* ============================================================
   Charging Pixels — site styles
   Built on the ThoughtStream foundations (flat, warm-neutral,
   hairline borders, 0 radius, generous space).
   ============================================================ */

:root {
  --accent: #C21A07;          /* brand red — deepened for AA text contrast */
  --accent-press: #9E1505;
  /* Logo "charge" ramp — used decoratively only (mark + ramp), never as text */
  --charge-1: #FE0000;
  --charge-2: #FF4F00;
  --charge-3: #FFA100;
  --charge-4: #FFE900;
  --font-headline: var(--font-display);  /* serif */
  --font-logo: "JetBrains Mono", ui-monospace, "Source Code Pro", monospace;
  --maxw: 1120px;
  --gut: clamp(24px, 6vw, 80px);
  --reveal-dur: 600ms;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--body-lh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; }

/* Skip link for keyboard users */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--text-1); color: var(--bg);
  padding: 12px 20px; z-index: 100; font-weight: 600;
}
.skip:focus { left: 16px; top: 16px; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

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

/* ---- Headlines ---- */
.display {
  font-family: var(--font-headline);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--text-1);
  text-wrap: balance;
  margin: 0;
}
[data-headline="sans"] .display { letter-spacing: -0.035em; }

.headline {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.overline {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.overline .num { color: var(--accent); font-variant-numeric: tabular-nums; }

.lede {
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.65;
  color: var(--text-2);
  max-width: 56ch;
  margin: 0;
  text-wrap: pretty;
}

/* ============================================================
   Top bar — slim, quiet, static (no sticky chrome)
   ============================================================ */
.topbar {
  border-bottom: 1px solid var(--border-subtle);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.mark {
  display: block;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  image-rendering: pixelated; /* keep the pixel edges crisp */
}
.logo-type {
  display: grid;
  font-family: var(--font-logo);
  font-weight: 800;
  font-size: 17px;
  line-height: 1.0;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text-1);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 38px);
}
.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 0;
  transition: color .15s ease;
}
.nav a:hover { color: var(--text-1); }
.nav a.contact { color: var(--text-1); }
.nav a.contact:hover { color: var(--accent); }
@media (max-width: 640px) {
  .nav a:not(.contact) { display: none; }
}

/* ============================================================
   Hero — editorial (left aligned)
   ============================================================ */
.hero { padding-block: clamp(72px, 13vw, 160px); }
.hero .display { font-size: clamp(52px, 11vw, 132px); }
.hero-inner { display: grid; gap: clamp(28px, 4vw, 44px); }
.hero-eyebrow { color: var(--text-2); }
.hero-eyebrow b { color: var(--text-1); font-weight: 600; }

/* Charge ramp — small brand signature echoing the logo's stepped corner */
.charge-ramp {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 32px;
  width: fit-content;
}
.charge-ramp i { display: block; width: 9px; }
.charge-ramp i:nth-child(1) { height: 34%; background: var(--charge-1); }
.charge-ramp i:nth-child(2) { height: 55%; background: var(--charge-2); }
.charge-ramp i:nth-child(3) { height: 78%; background: var(--charge-3); }
.charge-ramp i:nth-child(4) { height: 100%; background: var(--charge-4); }
[data-hero="centered"] .charge-ramp { margin-inline: auto; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--text-1);
  transition: color .16s ease, border-color .16s ease, gap .16s ease;
  width: fit-content;
  white-space: nowrap;
}
.cta .arrow { transition: transform .2s ease; color: var(--accent); }
.cta:hover { color: var(--accent); border-color: var(--accent); gap: 14px; }
.cta:hover .arrow { transform: translateX(2px); }

/* default = editorial (left aligned) */
[data-hero="editorial"] .display { max-width: 9ch; }
.hero .lede { max-width: 48ch; }

/* centered */
[data-hero="centered"] .hero-inner {
  justify-items: center;
  text-align: center;
}
[data-hero="centered"] .display { max-width: 13ch; }
[data-hero="centered"] .hero .lede { margin-inline: auto; text-align: center; }
[data-hero="centered"] .hero-eyebrow { text-align: center; white-space: nowrap; }
[data-hero="centered"] .hero-side { justify-items: center; }

/* split — headline left, supporting column right, separated by a hairline */
@media (min-width: 860px) {
  [data-hero="split"] .hero-inner {
    max-width: none;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: end;
    column-gap: clamp(40px, 6vw, 96px);
    row-gap: 28px;
  }
  [data-hero="split"] .hero-eyebrow { grid-column: 1 / -1; }
  [data-hero="split"] .hero .display { grid-column: 1; }
  [data-hero="split"] .hero-side {
    grid-column: 2;
    padding-left: clamp(28px, 4vw, 56px);
    border-left: 1px solid var(--border-medium);
    display: grid;
    gap: 28px;
    padding-bottom: 8px;
  }
}
.hero-side { display: grid; gap: clamp(22px, 2.6vw, 32px); align-content: start; }

/* ============================================================
   Generic section
   ============================================================ */
section { scroll-margin-top: 24px; }
.section { padding-block: clamp(64px, 9vw, 120px); }
.section + .section,
.band + .section,
.section + .band { border-top: 1px solid var(--border-subtle); }

.section-head { display: grid; gap: 18px; margin-bottom: clamp(40px, 5vw, 64px); max-width: 60ch; }

/* ---- Approach: three points ---- */
.points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
}
.point { display: grid; gap: 14px; align-content: start; }
.point .pt-no {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.point h3 { font-family: var(--font-headline); font-weight: 700; font-size: 24px; letter-spacing: -0.015em; margin: 0; line-height: 1.2; }
.point p { margin: 0; color: var(--text-2); font-size: 16px; line-height: 1.65; text-wrap: pretty; }
@media (max-width: 760px) { .points { grid-template-columns: 1fr; gap: 36px; } }

/* ---- Track record: stat blocks on a quiet band ---- */
.band { background: var(--surface); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 48px);
}
.stat { display: grid; gap: 12px; align-content: start; padding-top: 28px; border-top: 2px solid var(--text-1); }
.stat .figure {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-1);
}
.stat .figure .arr { color: var(--accent); font-weight: 400; }
.stat p { margin: 0; color: var(--text-2); font-size: 16px; line-height: 1.6; max-width: 30ch; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; gap: 0; } .stat { padding-block: 28px; } .stat + .stat { border-top: 1px solid var(--border-medium); } .stat:first-child { border-top: 2px solid var(--text-1); } }

/* ---- Domains: tags ---- */
.tags { display: flex; flex-wrap: wrap; gap: 12px; }
.tag {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-1);
  border: 1px solid var(--border-medium);
  padding: 11px 18px;
  background: var(--bg);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Services: editorial rows ---- */
.services { display: grid; }
.svc {
  display: grid;
  grid-template-columns: 56px minmax(220px, 0.9fr) 1.1fr;
  gap: clamp(16px, 3vw, 48px);
  align-items: baseline;
  padding-block: clamp(24px, 3vw, 34px);
  border-top: 1px solid var(--border-subtle);
}
.services .svc:last-child { border-bottom: 1px solid var(--border-subtle); }
.svc .svc-no { font-size: 13px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.svc h3 { font-family: var(--font-headline); font-weight: 700; font-size: clamp(21px, 2vw, 26px); letter-spacing: -0.015em; margin: 0; line-height: 1.2; }
.svc p { margin: 0; color: var(--text-2); font-size: 16.5px; line-height: 1.6; text-wrap: pretty; }
@media (max-width: 760px) {
  .svc { grid-template-columns: 1fr; gap: 10px; padding-block: 26px; }
  .svc .svc-no { color: var(--text-3); }
}

/* ---- Contact ---- */
.contact-inner { display: grid; gap: clamp(24px, 3vw, 36px); }
.email-link {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 54px);
  letter-spacing: -0.025em;
  color: var(--text-1);
  text-decoration: none;
  line-height: 1.05;
  width: fit-content;
  max-width: 100%;
  border-bottom: 2px solid transparent;
  transition: color .16s ease, border-color .16s ease;
  overflow-wrap: anywhere;
}
.email-link:hover { color: var(--accent); border-color: var(--accent); }
.contact-note { color: var(--text-2); font-size: clamp(18px, 1.5vw, 21px); line-height: 1.6; max-width: 46ch; }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--border-subtle); padding-block: 44px; }
.footer .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px 32px; }
.footer .f-mark { display: inline-flex; align-items: center; gap: 10px; }
.footer .f-mark .mark { width: 30px; height: 30px; }
.footer .f-mark .logo-type { font-size: 12px; letter-spacing: 0.02em; }
.footer .f-mark .pixels { color: var(--accent); }
.footer a { color: var(--text-2); text-decoration: none; font-size: 14px; transition: color .15s ease; }
.footer a:hover { color: var(--text-1); }
.footer .copy { color: var(--text-3); font-size: 13px; }

/* ============================================================
   Products: homepage strip and the /projects page
   ============================================================ */
.app-icon { display: block; width: 48px; height: 48px; border-radius: 22%; flex-shrink: 0; }

/* ---- Homepage strip: one row per product ---- */
.products { display: grid; }
.product-row {
  display: grid;
  grid-template-columns: 48px 236px 1fr auto;
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
  padding-block: clamp(20px, 2.6vw, 28px);
  border-top: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: background .15s ease;
}
.products .product-row:last-child { border-bottom: 1px solid var(--border-subtle); }
.product-row h3 { font-family: var(--font-headline); font-weight: 700; font-size: clamp(21px, 2vw, 26px); letter-spacing: -0.015em; margin: 0; line-height: 1.2; }
.product-row p { margin: 0; color: var(--text-2); font-size: 16.5px; line-height: 1.6; text-wrap: pretty; }
.product-row .go { font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: color .15s ease; }
.product-row .go .arrow { color: var(--accent); }
.product-row:hover h3, .product-row:hover .go { color: var(--accent); }
.products-more { margin-top: clamp(28px, 3vw, 40px); }
@media (max-width: 760px) {
  .product-row { grid-template-columns: 48px 1fr; row-gap: 6px; align-items: start; }
  .product-row .app-icon { grid-row: span 3; }
  .product-row p, .product-row .go { grid-column: 2; }
}

/* ---- /projects: hero ---- */
.page-hero { padding-block: clamp(64px, 10vw, 128px) clamp(48px, 7vw, 88px); }
.page-hero .display { font-size: clamp(44px, 8vw, 96px); max-width: 12ch; }
.page-hero .hero-inner { display: grid; gap: clamp(24px, 3.4vw, 36px); }

/* ---- /projects: one large card per product ---- */
.project {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(56px, 8vw, 104px);
  border-top: 1px solid var(--border-subtle);
}
.project:nth-of-type(even) { grid-template-columns: 0.9fr 1.1fr; }
.project:nth-of-type(even) .project-visual { order: 2; }
.projects-list + .section, .clients + .section { border-top: 1px solid var(--border-subtle); }
.nav a[aria-current="page"] { color: var(--text-1); }
.project-visual {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-visual img { display: block; }
.project-visual.shot { aspect-ratio: auto; }
.project-visual.shot img { width: 100%; height: auto; }
.project-visual.phones { gap: 4%; padding: 6% 6% 0; align-items: flex-start; background: #F1EBDB; }
.project-visual.phones img { width: 30%; height: auto; }
.project-body { display: grid; gap: 22px; align-content: start; }
.project-name { display: flex; align-items: center; gap: 14px; }
.project-name .app-icon { width: 44px; height: 44px; }
.project-name h2 { font-family: var(--font-body); font-size: 15px; font-weight: 600; letter-spacing: 0.02em; margin: 0; color: var(--text-1); }
.project-pitch { font-family: var(--font-headline); font-weight: 700; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.12; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.project-desc { margin: 0; color: var(--text-2); font-size: 17px; line-height: 1.7; text-wrap: pretty; }
.proof { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.proof li { display: grid; gap: 6px; align-content: start; padding-top: 14px; border-top: 2px solid var(--text-1); }
.proof b { font-family: var(--font-headline); font-weight: 700; font-size: clamp(20px, 1.9vw, 24px); line-height: 1.1; letter-spacing: -0.015em; }
.proof span { color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.project-meta { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); }
.project-meta .sep { color: var(--accent); padding-inline: 6px; }
/* Ember: no screenshots yet, so its icon and its two modes */
.project-visual.mark-panel { flex-direction: column; gap: 24px; }
.project-visual.mark-panel img { width: 28%; height: auto; border-radius: 22%; box-shadow: 0 18px 40px rgba(28, 25, 23, 0.18); }
.mark-panel-modes { margin: 0; display: flex; gap: 10px; }
.mark-panel-modes span { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-1); border: 1px solid var(--border-medium); background: var(--bg); padding: 6px 12px; }

/* ---- /projects: built for clients ---- */
.clients { border-top: 1px solid var(--border-subtle); }
.clients .section-head .lede { max-width: 60ch; }
.client-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 4vw, 56px); }
.client { display: grid; gap: 16px; align-content: start; }
.client-shot { display: block; border: 1px solid var(--border-subtle); overflow: hidden; }
.client-shot img { display: block; width: 100%; height: auto; transition: transform .4s ease; }
.client-shot:hover img { transform: scale(1.015); }
.client h3 { font-family: var(--font-headline); font-weight: 700; font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -0.015em; margin: 6px 0 0; }
.client-pitch { margin: 0; color: var(--text-2); font-size: 17px; line-height: 1.6; }
.client-built { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.client-built li::marker { color: var(--accent); }
@media (max-width: 760px) { .client-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .client-shot img { transition: none; } }

@media (max-width: 900px) {
  .project, .project:nth-of-type(even) { grid-template-columns: 1fr; }
  .project:nth-of-type(even) .project-visual { order: 0; }
}
@media (max-width: 520px) {
  .proof { grid-template-columns: 1fr; gap: 14px; }
}

/* ============================================================
   Quiet scroll reveal
   Hidden state is gated behind html.js so the page is fully
   visible if JavaScript never runs (progressive enhancement).
   ============================================================ */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--reveal-dur) cubic-bezier(.2,.6,.2,1),
              transform var(--reveal-dur) cubic-bezier(.2,.6,.2,1);
  transition-delay: var(--reveal-delay, 0ms);
}
html.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Motion off, or no-JS, or reduced-motion: show everything, no animation */
html:not(.js) [data-reveal],
[data-motion="static"] [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}
