/*
  PenRace — coming-soon site. Shared by / and /contact/.

  Colours are the product's own (frontend/src/styles/tokens.ts).

  How text stays readable over a vivid background: every block of text sits on a `.protect` pad —
  a soft, unseen darkening behind it — so the lattice can run bright everywhere else. Measured
  against the brightest pixel the field can paint, small text inside a pad never drops below
  5.7:1. The accent red is only used as text at display size, where 3:1 is the bar.
*/
:root {
  --bg: #000000;
  --panel: #0a0a0a;
  --line: #1f1f1f;
  --line-2: #2e2e2e;
  --fg: #ffffff;
  --fg-2: #d4d4d4;
  --fg-3: #c0c0c0;
  --fg-4: #adadad;
  --accent: #ee3443;
  --accent-fill: #dd1223;      /* the red that carries white text at AA */
  --accent-fill-hi: #e61324;
  --ok: #3fb950;
  --sans: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ the field */
#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
/* Only ever darkens, and only at the very edges, so the lattice reads across the whole page. */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 95% 85% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ------------------------------------------------------------------ text protection
   An invisible pad of darkness behind a block of text. Inside the block it is a flat 55%, so
   every glyph is covered; outside, the box-shadow feathers it out over ~50px, so it reads as the
   lattice fading near the words rather than as a box. */
.protect { position: relative; isolation: isolate; }
.protect::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 52px 34px rgba(0, 0, 0, 0.55);
}

/* ------------------------------------------------------------------ layout */
.wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px var(--gutter) 24px;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.top a { display: block; }
.logo { width: clamp(150px, 20vw, 210px); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.78);
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-2);
  white-space: nowrap;
}
.dot {
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(238, 52, 67, 0.55);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(238, 52, 67, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(238, 52, 67, 0); }
  100% { box-shadow: 0 0 0 0 rgba(238, 52, 67, 0); }
}

/* ------------------------------------------------------------------ hero */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(30px, 6vh, 88px) 0 clamp(26px, 4.5vh, 60px);
}
.copy { width: fit-content; max-width: 100%; }
.eyebrow {
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.display {
  margin-top: 22px;
  font-weight: 900;
  font-size: clamp(36px, 9vw, 112px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.display .accent { color: var(--accent); }
.sub {
  margin-top: 26px;
  max-width: 36em;
  font-size: clamp(16px, 1.45vw, 19px);
  line-height: 1.62;
  color: var(--fg-2);
}
.tuned {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.tuned::before { content: ""; width: 18px; height: 1px; background: var(--accent); }

/* ------------------------------------------------------------------ buttons */
.actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 26px;
  border: 1px solid transparent;
  font: 700 13px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent-fill);
  color: #fff;
  /* The cut corner from the product's own buttons. */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.btn-primary:hover { background: var(--accent-fill-hi); }
/* clip-path would cut an outline off, so focus inverts the button instead. */
.btn-primary:focus-visible { outline: none; background: #fff; color: #000; }
.btn-ghost {
  background: rgba(0, 0, 0, 0.6);
  border-color: var(--line-2);
  color: var(--fg);
}
.btn-ghost:hover { border-color: var(--accent); }
.btn-ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn .arrow { transition: transform 0.15s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ------------------------------------------------------------------ features */
.features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 28px;
  list-style: none;
}
.feature {
  padding: 20px 0 6px;
  border-top: 1px solid var(--line);
}
.num {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.2em;
  color: var(--fg-4);
}
.num::before { content: ""; width: 6px; height: 6px; background: var(--accent); }
.ftitle {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.fcap {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-3);
}

/* ------------------------------------------------------------------ contact page */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 860px;
  margin-top: 36px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 26px 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--line-2); }
.card-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.card-label::before { content: ""; width: 6px; height: 6px; background: var(--accent); }
.card-title {
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.card-desc { font-size: 14px; line-height: 1.55; color: var(--fg-3); }
.card .actions { margin-top: auto; padding-top: 10px; }
.card .btn { height: 46px; padding: 0 18px; font-size: 12px; }
.copied { min-height: 1.4em; font: 400 12px var(--mono); letter-spacing: 0.06em; color: var(--ok); }
.follow { margin-top: 34px; }
.follow-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; list-style: none; }
.follow-list a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.6);
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg-2);
  transition: border-color 0.15s, color 0.15s;
}
.follow-list a:hover { border-color: var(--accent); color: var(--fg); }
.follow-list a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ------------------------------------------------------------------ footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.social { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; }
.foot a, .copy-note {
  font: 400 12px var(--mono);
  letter-spacing: 0.08em;
  color: var(--fg-4);
  text-decoration: none;
}
.foot a:hover, .foot a:focus-visible { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.foot a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }

/* ------------------------------------------------------------------ entrance */
.rise { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.rise:nth-child(2) { animation-delay: 0.06s; }
.rise:nth-child(3) { animation-delay: 0.12s; }
.rise:nth-child(4) { animation-delay: 0.18s; }
.rise:nth-child(5) { animation-delay: 0.24s; }
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 980px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .wrap { padding-top: 18px; }
  .badge { padding: 8px 10px; letter-spacing: 0.16em; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .actions .btn { flex: 1 1 100%; }
  .foot { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .dot, .rise { animation: none; }
  .btn, .btn .arrow, .card, .follow-list a { transition: none; }
}
