/* ═══════════════════════════════════════════════════════════════════════
   Rostormic
   Direction: a CAD viewport. The page is a drawing sheet, the wordmark is
   the part, and the type is the annotation. One accent, used the way a CAD
   program highlights a selected entity.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Fonts (self-hosted: Google Fonts is unreliable in mainland China, ──
      which is where a large share of this page's readers sit) */

@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-latin-var.woff2') format('woff2');
  font-weight: 400 700;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

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

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

/* ── Tokens ─────────────────────────────────────────────────────────── */

:root {
  --vp-900: #191e23;
  --vp-850: #1d242a;
  --vp-800: #232a31;
  --line: #333c45;
  --line-soft: #272f36;
  --ink: #eaeef1;
  --ink-2: #a2acb6;
  --ink-3: #6c7681;
  --signal: #f0c23c;

  --font-sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --page: min(1180px, 100% - 3rem);
  --step: clamp(3.25rem, 6.5vw, 5.25rem);
}

/* ── Reset ──────────────────────────────────────────────────────────── */

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

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

body,
h1,
h2,
p,
ul,
ol,
li,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

/* ── Base ───────────────────────────────────────────────────────────── */

body {
  background-color: var(--vp-900);
  /* Drawing-sheet grid. Deliberately near-invisible: atmosphere, not decor. */
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-stretch: 100%;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
}

::selection {
  background: var(--signal);
  color: var(--vp-900);
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--signal);
  color: var(--vp-900);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  z-index: 10;
}

.skip:focus {
  left: 0;
}

/* ── Utilities ──────────────────────────────────────────────────────── */

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.4;
}

.eyebrow {
  color: var(--signal);
  margin-bottom: 2rem;
}

/* ── Top bar ────────────────────────────────────────────────────────── */

.topbar {
  border-bottom: 1px solid var(--line-soft);
}

.topbar__inner {
  width: var(--page);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.15rem;
}

.topbar__mark {
  font-stretch: 115%;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.topbar__link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.topbar__link:hover {
  color: var(--signal);
  border-bottom-color: var(--signal);
}

/* ── Hero: the signature. The wordmark is dimensioned like a part. ──── */

.hero {
  width: var(--page);
  margin-inline: auto;
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3.25rem);
}

.hero__inner {
  max-width: 62rem;
}

/* The plate closes the dimension into a measured bracket: the two rules are
   the dimension lines, these hairlines are the extension lines. */
.plate {
  position: relative;
  /* Shrink to the wordmark so the extension lines land on the part's
     extremes, as they would on a real drawing. */
  width: fit-content;
  max-width: 100%;
}

.plate::before,
.plate::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-soft);
}

.plate::before {
  left: 0;
}

.plate::after {
  right: 0;
}

.dim {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  /* Lift above .plate::after, which would otherwise paint over the ticks. */
  position: relative;
  z-index: 1;
}

.dim__rule {
  flex: 1;
  height: 1px;
  background: var(--line);
  position: relative;
  transform-origin: center;
}

/* Tick terminators at the outer ends only, as on a real dimension line. */
.dim__rule:first-child::before,
.dim__rule:last-child::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 1px;
  height: 10px;
  background: var(--signal);
  transform: translateY(-50%);
}

.dim__rule:first-child::before {
  left: 0;
}

.dim__rule:last-child::after {
  right: 0;
}

.dim__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.dim--bottom {
  margin-top: clamp(0.5rem, 1.5vw, 1rem);
}

.wordmark {
  font-stretch: 123%;
  font-weight: 700;
  font-size: clamp(3rem, 13vw, 9.5rem);
  line-height: 0.95;
  letter-spacing: -0.022em;
  margin-block: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 2.5vw, 1.75rem);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.25rem;
  color: var(--ink-3);
  margin-top: 1.25rem;
}

.lede {
  font-size: clamp(1.1rem, 2.3vw, 1.45rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 34ch;
  margin-top: clamp(2rem, 5vw, 3.25rem);
}

.cta {
  display: inline-flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: clamp(2rem, 4.5vw, 3rem);
  text-decoration: none;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  transition: border-color 0.25s;
}

.cta__label {
  color: var(--ink-3);
  transition: color 0.25s;
}

.cta__value {
  font-stretch: 108%;
  font-weight: 600;
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  color: var(--ink);
  transition: color 0.25s;
}

.cta:hover {
  border-top-color: var(--signal);
}

.cta:hover .cta__label,
.cta:hover .cta__value {
  color: var(--signal);
}

/* ── Sections ───────────────────────────────────────────────────────── */

.section {
  padding-block: var(--step);
}

.section__inner {
  width: var(--page);
  margin-inline: auto;
}

.section--ruled {
  border-top: 1px solid var(--line-soft);
}

.section__lede {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-2);
  max-width: 44ch;
  margin-bottom: 2.5rem;
}

.grid {
  display: grid;
  gap: 1px;
  background: var(--line-soft);
  border-block: 1px solid var(--line-soft);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

/* ── Capability cards ───────────────────────────────────────────────── */

.card {
  background: var(--vp-900);
  padding: 2.25rem 1.75rem 2.75rem;
  transition: background-color 0.3s;
}

.card:hover {
  background: var(--vp-850);
}

.card__title {
  font-stretch: 110%;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.005em;
  margin-bottom: 0.85rem;
}

.card__body {
  color: var(--ink-2);
  font-size: 0.94rem;
  line-height: 1.6;
}

/* ── Process steps ──────────────────────────────────────────────────── */

.steps {
  display: grid;
  gap: 0;
}

.step {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.5rem;
  padding-block: 1.9rem;
  border-top: 1px solid var(--line-soft);
}

.step:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.step__no {
  color: var(--signal);
  padding-top: 0.35rem;
}

.step__title {
  font-stretch: 110%;
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.step__text p {
  color: var(--ink-2);
  font-size: 0.96rem;
  max-width: 52ch;
}

/* ── Spec lists (written for the manufacturer) ──────────────────────── */

.spec {
  background: var(--vp-900);
  padding: 2.25rem 1.75rem 2.5rem;
}

.spec__title {
  color: var(--signal);
  margin-bottom: 1.5rem;
}

.spec__list li {
  color: var(--ink-2);
  font-size: 0.96rem;
  padding-block: 0.6rem;
  padding-left: 1.5rem;
  position: relative;
  border-top: 1px solid var(--line-soft);
}

.spec__list li:first-child {
  border-top: 0;
}

.spec__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.35em;
  width: 8px;
  height: 1px;
  background: var(--line);
}

.note {
  margin-top: 2.5rem;
  font-size: 1rem;
  color: var(--ink);
  border-left: 2px solid var(--signal);
  padding-left: 1.1rem;
}

/* ── Contact ────────────────────────────────────────────────────────── */

.section--contact {
  border-top: 1px solid var(--line-soft);
}

.contact__email {
  display: inline-block;
  font-stretch: 114%;
  font-weight: 700;
  font-size: clamp(1.5rem, 6vw, 3.4rem);
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-decoration: none;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.15em;
  transition: color 0.25s, border-color 0.25s;
  overflow-wrap: anywhere;
}

.contact__email:hover {
  color: var(--signal);
  border-bottom-color: var(--signal);
}

.contact__note {
  margin-top: 1.5rem;
  color: var(--ink-3);
  font-size: 0.96rem;
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--line-soft);
}

.footer__inner {
  width: var(--page);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.6rem;
  color: var(--ink-3);
}

/* ── Motion ─────────────────────────────────────────────────────────── */

/* One orchestrated page-load sequence, in the hero only. `backwards` keeps
   the hidden state during the delay without hiding anything if animation
   never runs. */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes draw {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

.dim--top .dim__rule,
.dim--bottom .dim__rule {
  animation: draw 0.75s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

[data-seq='1'] .dim__rule {
  animation-delay: 0.1s;
}

[data-seq='3'] .dim__rule {
  animation-delay: 0.35s;
}

[data-seq='1'] .dim__label,
[data-seq='2'],
[data-seq='4'],
[data-seq='5'],
[data-seq='6'] {
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

[data-seq='1'] .dim__label {
  animation-delay: 0.5s;
}

[data-seq='2'] {
  animation-delay: 0.22s;
}

[data-seq='4'] {
  animation-delay: 0.55s;
}

[data-seq='5'] {
  animation-delay: 0.65s;
}

[data-seq='6'] {
  animation-delay: 0.75s;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  :root {
    --page: min(1180px, 100% - 2.25rem);
  }

  .grid--4,
  .grid--2 {
    grid-template-columns: 1fr;
  }

  /* Lift the label onto its own line so the two rules close into a single
     dimension line, keeping both tick terminators. */
  .dim--top {
    flex-wrap: wrap;
    gap: 0;
  }

  .dim__label {
    order: -1;
    width: 100%;
    white-space: normal;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    margin-bottom: 0.7rem;
  }

  .step {
    grid-template-columns: 3rem 1fr;
    gap: 1rem;
  }

  .card,
  .spec {
    padding-inline: 1.35rem;
  }

  .footer__inner,
  .topbar__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ── Reduced motion ─────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}
