/* attack.tech: typographic one-pager. No framework, no build step. */

/* Fonts (SIL Open Font License 1.1, see assets/fonts/OFL-*.txt) */
@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #0b0b0c;
  --fg: #f2efe8;
  --body: #bdb9b0;
  --muted: #8f8b83;
  --rule: rgba(242, 239, 232, 0.14);
  --rule-strong: rgba(242, 239, 232, 0.3);
  --accent: #ff3d24;
  --on-accent: #0b0b0c;

  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Grid. The letter column sits left of the content, all sizes follow the viewport. */
  --vh: 1vh;
  --page-x: clamp(1rem, 3.3vw, 3rem);
  --page-r: var(--page-x);
  --lane-fs: clamp(2.25rem, min(calc((100 * var(--vh) - 12rem) / 5.3), 9.2vw), 9.5rem);
  --rail-gap: clamp(0.75rem, 1.8vw, 2rem);
  --lane-w: calc(var(--rail-gap) + var(--lane-fs));
  --lane-gap: clamp(1.5rem, 4.5vw, 4.5rem);
  --content-x: calc(var(--page-x) + var(--lane-w) + var(--lane-gap));
  --content-w: calc(100vw - var(--content-x) - var(--page-r));
  --gutter: clamp(1rem, 2.4vw, 2.25rem);

  /* Type scale */
  --h1: clamp(3rem, calc(var(--content-w) / 7.35), 14rem);
  --h2: clamp(2.25rem, 6.1vw, 6.25rem);
  --lead: clamp(1.1875rem, 1.75vw, 1.625rem);
  --space-section: clamp(7rem, 24vh, 15rem);
}

@supports (height: 1svh) {
  :root { --vh: 1svh; }
}

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

html {
  background: var(--bg);
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Texture: fine scanlines and grain, CSS only, behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(242, 239, 232, 0.022) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}

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

a {
  color: inherit;
}

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

h1, h2, h3 {
  text-wrap: balance;
}

/* ------------------------------------------------------------------ labels */
.label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.label__index {
  color: var(--accent);
}

.label__mark {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
}

/* ------------------------------------------------------------------ button */
.button {
  display: inline-flex;
  align-items: center;
  gap: 1.1em;
  padding: 1.15em 1.45em 1.1em;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.18s ease;
}

.button__arrow {
  font-size: 1.15em;
}

.button:hover {
  background: var(--fg);
}

.button:focus-visible {
  outline-color: var(--fg);
}

/* ----------------------------------------------------------- letter column */
.lane {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: var(--page-x);
  width: var(--lane-w);
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  font-family: var(--sans);
  font-size: var(--lane-fs);
  line-height: 1;
}

.lane__stack {
  /* cap height of Archivo = 0.686 em; the letters are stacked on that box */
  --cap: 0.686em;
  --pitch: 0.886em;
  position: relative;
  height: calc(5 * var(--pitch) + var(--cap));
}

.lane__slot {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--cap);
}

.lane__slot:nth-child(2) { top: 0; }
.lane__slot:nth-child(3) { top: calc(1 * var(--pitch)); }
.lane__slot:nth-child(4) { top: calc(2 * var(--pitch)); }
.lane__slot:nth-child(5) { top: calc(3 * var(--pitch)); }
.lane__slot:nth-child(6) { top: calc(4 * var(--pitch)); }
.lane__slot:nth-child(7) { top: calc(5 * var(--pitch)); }

.lane__ghost,
.lane__glyph {
  position: absolute;
  top: 0;
  left: var(--rail-gap);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.686; /* line box == cap height: caps fill the slot exactly */
  white-space: nowrap;
}

.lane__ghost {
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 239, 232, 0.2);
}

/* Hide the outline under a docked letter so its stroke cannot rim the solid glyph. */
.lane__slot.is-docked .lane__ghost {
  visibility: hidden;
}

.lane__glyph {
  z-index: 2;
  color: var(--accent);
  opacity: 0;
  transform-origin: 0 0;
}

.has-motion .lane__glyph {
  will-change: transform;
}

.lane__slot.is-docked .lane__glyph {
  animation: dock 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes dock {
  0% { color: var(--fg); }
  100% { color: var(--accent); }
}

/* The path: a rail through one node per letter, filled as letters arrive. */
.lane__rail {
  position: absolute;
  left: 0;
  top: calc(var(--cap) / 2);
  width: 2px;
  height: calc(5 * var(--pitch));
  background: repeating-linear-gradient(to bottom, var(--rule-strong) 0 2px, transparent 2px 6px);
}

.lane__rail-fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: 50% 0;
}

.lane__node {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 1px;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border: 1px solid var(--rule-strong);
  background: var(--bg);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.lane__node.is-on {
  border-color: var(--accent);
  background: var(--accent);
}

.lane__meta {
  margin: 1.75rem 0 0 var(--rail-gap);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
}

.lane__status {
  display: none;
  margin-left: 0.9em;
}

@media (min-width: 1100px) {
  .lane__status { display: inline; }
}

.lane.is-complete .lane__status {
  color: var(--accent);
}

/* Static column: no JavaScript, or reduced motion. The word is shown assembled. */
@media (scripting: none), (prefers-reduced-motion: reduce) {
  .lane__glyph {
    opacity: 1 !important;
    transform: none !important;
  }
  .lane__ghost {
    visibility: hidden;
  }
  .lane__node {
    border-color: var(--accent);
    background: var(--accent);
  }
  .lane__rail-fill {
    transform: none !important;
  }
  .lane__status {
    color: var(--accent);
  }
}

/* -------------------------------------------------------------------- hero */
.hero {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(1rem, 3vh, 1.75rem) var(--page-r) clamp(1rem, 3vh, 1.75rem) var(--content-x);
}

.hero__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.hero__main {
  margin: auto 0;
  padding: clamp(3rem, 9vh, 6rem) 0 clamp(2.5rem, 7vh, 5rem);
}

.hero__title {
  margin: 0 0 0 -0.035em;
  font-size: var(--h1);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.84;
  letter-spacing: -0.045em;
}

.hero__dot {
  color: var(--accent);
}

.hero__line {
  max-width: 24ch;
  margin: clamp(1.75rem, 4.5vh, 3rem) 0 0;
  font-size: clamp(1.5rem, 3vw, 2.75rem);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.hero__sub {
  max-width: 50ch;
  margin: 1.5rem 0 0;
  font-size: clamp(1rem, 1.25vw, 1.1875rem);
  color: var(--body);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
  margin-top: clamp(2rem, 5vh, 3rem);
}

.hero__cue {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__services {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0;
  margin: 0;
  padding: 1rem 0 0;
  list-style: none;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--body);
}

.hero__services li:not(:last-child)::after {
  content: "/";
  content: "/" / "";
  margin: 0 0.9em;
  color: var(--muted);
}

/* ---------------------------------------------------------------- chapters */
.chapter,
.engagements,
.contact {
  padding: var(--space-section) var(--page-r) 0 var(--content-x);
}

.chapter__label {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.chapter__title,
.section-title {
  position: relative;
  margin: clamp(1.75rem, 4.5vh, 3rem) 0 0;
  font-size: var(--h2);
  font-weight: 800;
  font-stretch: 100%;
  line-height: 0.92;
  letter-spacing: -0.035em;
}

/* Tie: a short rule from the heading towards the letter column. */
.chapter__title::before {
  content: "";
  position: absolute;
  top: 0.44em;
  left: calc(-1 * var(--lane-gap) + 0.5rem);
  width: calc(var(--lane-gap) - 1.25rem);
  height: 2px;
  background: var(--accent);
  transition: background-color 0.3s ease;
}

.chapter__title.is-lifted::before {
  background: var(--rule-strong);
}

.initial {
  color: var(--accent);
}

/* After its letter has left for the column, the heading keeps an outline of it. */
.is-lifted .initial {
  color: var(--fg);
}

@supports (-webkit-text-stroke: 1px) {
  .is-lifted .initial {
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(242, 239, 232, 0.7);
  }
}

.chapter__body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  margin-top: clamp(2.25rem, 6vh, 4rem);
}

.lead {
  grid-column: 5 / span 7;
  max-width: 34ch;
  margin: 0;
  font-size: var(--lead);
  line-height: 1.38;
  letter-spacing: -0.005em;
  color: var(--fg);
}

.points {
  grid-column: 5 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem var(--gutter);
  margin: clamp(2.5rem, 6vh, 4rem) 0 0;
  padding: 0;
  list-style: none;
}

.points li {
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--body);
}

.points__key {
  display: block;
  margin-bottom: 0.65rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
}

/* ------------------------------------------------------------- engagements */
.engagement-list {
  margin: clamp(2.5rem, 6vh, 4rem) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: engagement;
  border-top: 1px solid var(--rule);
}

.engagement {
  counter-increment: engagement;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: baseline;
  padding: 1.4rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.engagement::before {
  content: counter(engagement, decimal-leading-zero);
  content: counter(engagement, decimal-leading-zero) / "";
  grid-column: 1 / span 1;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.engagement__name {
  grid-column: 2 / span 5;
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.875rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.engagement p {
  grid-column: 7 / -1;
  max-width: 46ch;
  margin: 0;
  color: var(--body);
}

/* ----------------------------------------------------------------- contact */
.contact {
  padding-bottom: clamp(6rem, 20vh, 13rem);
}

.contact__title {
  font-size: clamp(2.5rem, 7.4vw, 7.5rem);
}

.contact__lead {
  max-width: 34ch;
  margin-top: clamp(1.75rem, 4vh, 2.5rem);
}

.contact__pending {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin: clamp(2rem, 5vh, 3rem) 0 0;
  padding: 0.95rem 1.15rem;
  border: 1px solid var(--rule-strong);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.contact__pending::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--accent);
  animation: blink 1.1s steps(1, end) infinite;
}

@keyframes blink {
  50% { opacity: 0.2; }
}

/* Style for the e-mail link that replaces the CONTACT_EMAIL marker (see README). */
.contact__email {
  display: inline-block;
  margin-top: clamp(2rem, 5vh, 3rem);
  font-size: clamp(1.5rem, 3.6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

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

/* ------------------------------------------------------------------ footer */
.footer {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 0.75rem;
  margin: 0 var(--page-r) 0 var(--content-x);
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.footer p {
  margin: 0;
}

.footer__copy {
  grid-column: 1 / span 3;
}

.footer__note {
  grid-column: 4 / span 6;
  max-width: 62ch;
}

.footer__note strong {
  font-weight: 600;
  color: var(--fg);
}

.footer__top {
  grid-column: 10 / -1;
  justify-self: end;
  color: var(--fg);
  text-decoration: none;
}

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

/* ------------------------------------------------------------- breakpoints */
@media (max-width: 1100px) {
  .lead {
    grid-column: 1 / span 10;
  }
  .points {
    grid-column: 1 / -1;
  }
  .engagement__name {
    grid-column: 2 / span 11;
  }
  .engagement p {
    grid-column: 2 / -1;
    margin-top: 0.5rem;
  }
  .footer__copy { grid-column: 1 / span 4; }
  .footer__note { grid-column: 5 / -1; }
  .footer__top { grid-column: 5 / -1; justify-self: start; }
}

@media (max-width: 640px) {
  :root {
    --page-x: 0.625rem;
    --page-r: 1rem;
    --lane-fs: clamp(1.75rem, 8.4vw, 2.5rem);
    --rail-gap: 0.625rem;
    --lane-gap: 0.875rem;
    --gutter: 1rem;
    --h1: calc(var(--content-w) / 4.15);
    --space-section: clamp(5rem, 16vh, 8rem);
  }

  body {
    font-size: 1rem;
  }

  .hero__word {
    display: block;
  }

  .hero__title {
    line-height: 0.88;
  }

  .hero__bar {
    flex-direction: column;
  }

  .chapter__title::before {
    display: none;
  }

  .is-lifted .initial {
    -webkit-text-stroke-width: 1px;
  }

  .lead {
    grid-column: 1 / -1;
  }

  .points {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .engagement {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    column-gap: 0.75rem;
  }

  .engagement::before {
    grid-column: 1;
  }

  .engagement__name,
  .engagement p {
    grid-column: 2;
  }

  .footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer__copy,
  .footer__note,
  .footer__top {
    grid-column: 1;
    justify-self: start;
  }

  .lane__node {
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
  }

  .lane__meta {
    margin-top: 1rem;
  }

}

/* ----------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
