/* ===========================================================================
   Roost Labs — styles.css
   Refined editorial minimalism. Dark theme. Fraunces + Hanken Grotesk.
   Layout system: one centred page well, single left spine, tonal section tiers.
   =========================================================================== */

/* ----- Design tokens ----- */
:root {
  /* Colour — tonal tiers for depth instead of flat near-black */
  --bg: #0C0D0F;          /* base */
  --surface: #15171B;     /* raised section */
  --surface-2: #1B1E24;   /* cards / form panel */
  --text: #ECECEA;
  --muted: #9296A0;
  --accent: #4F7CFF;
  --accent-bright: #6B91FF;
  --hairline: #24262C;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing scale (8px base) */
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 48px;
  --s-6: 64px;
  --s-7: 96px;
  --s-8: 128px;

  /* Layout */
  --container: 1040px;   /* centred page well */
  --measure: 760px;      /* max text-block width (comfortable measure) */
  --radius: 6px;
  --section-pad: 112px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* Faint grain overlay for depth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-bright);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
  color: var(--text);
}

p {
  margin: 0;
}

header,
main,
footer {
  position: relative;
  z-index: 2;
}

/* ----- Layout primitives ----- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--s-4);
}

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

/* Tonal section separation (replaces scaffolding hairlines) */
.section--surface {
  background: var(--surface);
}

/* A left-aligned content well at a comfortable measure */
.well {
  max-width: var(--measure);
}

.well-wide {
  max-width: 920px;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--s-3);
}

.lede {
  color: var(--muted);
  font-size: 20px;
}

/* ----- Skip link ----- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius);
}

.skip-link:focus {
  left: var(--s-2);
  top: var(--s-2);
  color: #fff;
}

/* ----- Focus visibility ----- */
:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ----- Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(12, 13, 15, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.nav a:not(.btn) {
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}

.nav a:not(.btn):hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  padding: 14px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    transform 0.1s ease;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-bright);
  color: #fff;
}

.btn--primary:active {
  transform: translateY(1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--hairline);
}

.btn--ghost:hover {
  border-color: var(--muted);
  color: var(--text);
}

.btn--lg {
  padding: 17px 28px;
  font-size: 17px;
}

/* ----- Hero ----- */
.hero {
  position: relative;
  padding-block: clamp(88px, 12vw, 148px);
  overflow: hidden;
}

/* Deliberate radial glow, placed behind the headline */
.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  left: -80px;
  width: 760px;
  height: 760px;
  max-width: 110%;
  background: radial-gradient(
    circle at center,
    rgba(79, 124, 255, 0.20) 0%,
    rgba(79, 124, 255, 0.07) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 920px; /* px, not ch — wide enough for clean 2–4 line breaks */
}

.hero h1 {
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-4);
  max-width: 16ch; /* applied to the h1 itself (72px context) → 2–4 lines */
}

.hero__sub {
  max-width: 56ch;
  font-size: 20px;
  color: var(--muted);
  margin: 0 0 var(--s-5);
}

/* ----- Section heading block ----- */
.section__head {
  margin-bottom: var(--s-6);
}

.section-title {
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.14;
  letter-spacing: -0.01em;
  max-width: 20ch; /* h2 context — keeps a tight, deliberate measure */
}

/* ----- Prose ----- */
.prose {
  max-width: var(--measure);
}

.prose > p + p {
  margin-top: var(--s-3);
}

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

.prose .lede {
  color: var(--muted);
}

/* ----- Numbered editorial list (claims / operational areas) ----- */
.numbered {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}

.numbered__item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--s-4);
  padding-block: var(--s-5);
  border-top: 1px solid var(--hairline);
}

.numbered__item:last-child {
  border-bottom: 1px solid var(--hairline);
}

.numbered__num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--accent);
  font-feature-settings: "tnum" 1;
  line-height: 1.25;
}

.numbered__body h3 {
  font-size: 23px;
  line-height: 1.25;
  margin: 0 0 var(--s-2);
}

.numbered__body p {
  color: var(--muted);
  max-width: 58ch;
}

/* ----- Process steps ----- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
  margin-top: var(--s-6);
}

.step {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--s-4);
}

.step__label {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 var(--s-2);
}

.step__label span {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-1);
}

.step p {
  color: var(--muted);
  margin: 0;
}

/* ----- CTA band ----- */
.cta__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  max-width: var(--measure);
}

.cta h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 18ch;
}

.cta__actions {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* ----- Enquiry form (contained, balanced panel) ----- */
.form-panel {
  margin-top: var(--s-6);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: var(--s-5);
  max-width: var(--measure);
}

.form-panel > p {
  color: var(--muted);
  margin: 0 0 var(--s-4);
}

.form {
  display: grid;
  gap: var(--s-3);
}

.field {
  display: grid;
  gap: var(--s-1);
}

.field label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color 0.2s ease;
  width: 100%;
}

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

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

/* Honeypot — visually and programmatically hidden from humans */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__status {
  font-size: 15px;
  min-height: 1.4em;
  margin: 0;
}

.form__status[data-state="success"] {
  color: #6FCF97;
}

.form__status[data-state="error"] {
  color: #FF8A80;
}

/* ----- Footer ----- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  padding-block: var(--s-6);
  color: var(--muted);
  font-size: 15px;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--s-5);
}

.site-footer__brand {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 var(--s-1);
}

.site-footer h4 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s-2);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-1);
}

.site-footer a {
  color: var(--text);
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer__legal {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--hairline);
  font-size: 14px;
}

/* ----- Motion: orchestrated hero load ----- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: reveal-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  .reveal-1 { animation-delay: 0.05s; }
  .reveal-2 { animation-delay: 0.16s; }
  .reveal-3 { animation-delay: 0.27s; }
  .reveal-4 { animation-delay: 0.38s; }
}

@keyframes reveal-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----- Responsive ----- */
@media (max-width: 820px) {
  :root {
    --section-pad: 72px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: var(--s-2);
  }

  .cta__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-4);
  }

  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 17px;
  }

  .container {
    padding-inline: var(--s-3);
  }

  .hero h1 {
    max-width: 100%;
  }

  .hero__sub {
    max-width: 100%;
  }

  .nav {
    gap: var(--s-2);
  }

  .nav a:not(.btn) {
    display: none;
  }

  .numbered__item {
    grid-template-columns: 1fr;
    gap: var(--s-1);
    padding-block: var(--s-4);
  }

  .form-panel {
    padding: var(--s-4);
  }

  .cta__actions .btn {
    flex: 1 1 auto;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }
}
