/* Scaffold Robotics — site styles */

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

:root {
  --bg: #ffffff;
  --ink: #111110;
  --ink-mid: #6b6862;
  --ink-dim: #a3a099;
  --line: rgba(17, 17, 16, 0.14);
  --mono: "Space Mono", ui-monospace, Menlo, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  overflow-x: hidden;
}

.sans {
  font-family: var(--sans);
}

/* ---------- page frame + rails ---------- */

.frame {
  position: fixed;
  inset: 10px;
  border: 1px solid var(--line);
  pointer-events: none;
  z-index: 60;
}

.rail {
  position: fixed;
  left: 16px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  z-index: 55;
}

.rail a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.rail a:hover {
  color: var(--ink);
}

.rail-top {
  top: 96px;
}

.rail-bottom {
  bottom: 26px;
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 26px;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: var(--ink);
  border-radius: 6px;
  flex: none;
}

.brand .mark svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: var(--bg);
}

.topnav {
  justify-self: center;
  display: flex;
  gap: 26px;
}

.topnav a {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.topnav a:hover,
.topnav a[aria-current="page"] {
  color: var(--ink);
}

.topbar .btn {
  justify-self: end;
}

/* ---------- buttons ---------- */

.btn {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 17px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
  white-space: nowrap;
}

.btn-solid {
  background: var(--ink);
  color: var(--bg);
}

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

.btn-ghost {
  color: var(--ink);
}

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

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  touch-action: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 64px 3vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}

.hero-inner a {
  pointer-events: auto;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 1.6rem;
}

h1 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(2.5rem, 6.5vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.sub {
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
  max-width: 560px;
  margin-bottom: 2.5rem;
}

/* ---------- latest-post card ---------- */

.latest {
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 1.75rem 1.9rem;
  max-width: 620px;
  transition: border-color 0.2s, background 0.2s;
}

.latest:hover {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
}

.latest-line {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 1.4rem;
}

.latest-date {
  display: block;
  color: var(--ink-dim);
  margin-bottom: 0.5rem;
}

.latest-cta {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.2s;
}

.latest:hover .latest-cta {
  gap: 13px;
}

/* ---------- interior pages ---------- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 64px;
}

.page {
  position: relative;
  z-index: 2;
  padding: 9rem 0 5rem;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mid);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: color 0.2s;
}

.back:hover {
  color: var(--ink);
}

.page h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.02;
  max-width: 900px;
  margin-bottom: 1.5rem;
}

.page-sub {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-mid);
  max-width: 620px;
}

.section {
  position: relative;
  z-index: 2;
  padding: 5rem 0;
  border-top: 1px solid var(--line);
}

/* ---------- blog index ---------- */

.post-list {
  display: grid;
  gap: 1.25rem;
  max-width: 760px;
}

.post-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 1.75rem 1.9rem;
  transition: border-color 0.2s, background 0.2s;
}

.post-card:hover {
  border-color: var(--ink);
  background: rgba(17, 17, 16, 0.02);
}

.post-card-date {
  display: block;
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
  margin-bottom: 0.85rem;
}

.post-card-title {
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.post-card-excerpt {
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-mid);
  margin-bottom: 1.4rem;
}

/* ---------- long-form prose ---------- */

.prose {
  max-width: 720px;
  font-size: 15px;
  line-height: 1.78;
  color: var(--ink);
}

.prose h2 {
  font-family: var(--sans);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 3.25rem 0 1.1rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  margin-bottom: 1.35rem;
  color: var(--ink-mid);
}

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

.prose em {
  font-style: italic;
  color: var(--ink);
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
  transition: text-decoration-color 0.2s;
}

.prose a:hover {
  text-decoration-color: var(--ink);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(17, 17, 16, 0.05);
  border: 1px solid var(--line);
  padding: 0.1em 0.4em;
}

/* ---------- demo form ---------- */

.form {
  display: grid;
  gap: 1.5rem;
  max-width: 560px;
  margin-top: 3rem;
}

.field {
  display: grid;
  gap: 0.6rem;
}

.field label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mid);
}

.field input,
.field textarea {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  padding: 12px 14px;
  transition: border-color 0.2s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.field textarea {
  resize: vertical;
  min-height: 130px;
}

.form-note {
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-dim);
  max-width: 560px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* ---------- footer ---------- */

footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding: 2rem 26px;
}

.foot-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.foot-inner .copy {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.foot-links {
  display: flex;
  gap: 1.75rem;
}

.foot-links a {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.foot-links a:hover {
  color: var(--ink);
}

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .rail,
  .topnav {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    padding: 18px 20px;
    gap: 12px;
  }

  .brand {
    font-size: 14px;
    white-space: nowrap;
  }

  .topbar .btn {
    font-size: 11px;
    padding: 9px 12px;
  }

  /* Top-align under the fixed bar and let the hero grow rather than
     centring tall content up into the nav. */
  .hero-inner {
    justify-content: flex-start;
    padding: 104px 28px 4rem;
  }

  .sub {
    font-size: 15px;
  }

  .latest {
    padding: 1.4rem 1.5rem;
  }

  .wrap {
    padding: 0 28px;
  }

  .page {
    padding: 7rem 0 4rem;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .hero-inner {
    padding-top: 72px;
    padding-bottom: 20px;
  }

  .eyebrow {
    margin-bottom: 0.8rem;
    font-size: 11px;
  }

  h1 {
    font-size: clamp(1.5rem, 5vw, 2.4rem);
    line-height: 1;
    margin-bottom: 0.8rem;
  }

  .sub {
    font-size: 12.5px;
    line-height: 1.5;
    margin-bottom: 1rem;
  }

  .latest {
    padding: 0.9rem 1.2rem;
  }

  .latest-line {
    font-size: 12.5px;
    line-height: 1.5;
    margin-bottom: 0.7rem;
  }

  .latest-cta {
    font-size: 11px;
  }
}

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