/*
 * CS Permit — landing page styles.
 *
 * Same construction as the Rig Check site, different subject. The palette is
 * lifted straight off the CS Permit app icon so the page reads as continuous
 * with the app: slate ground, the permit sheet's near-white as paper, and the
 * icon's orange used only where the app itself uses it — for the check that
 * says a thing is done.
 *
 * Two colours are semantic and never decorative: red is an atmospheric breach
 * and green is a permit that is open and clear, exactly as on the tablet.
 *
 * Typography: system sans at weight 900 for display, monospace for anything
 * that reads as data — eyebrows, spec chips, step numbers, the footer.
 * Tabular numerals wherever digits line up, because most of this app is digits
 * in columns.
 */

/* --- Design tokens --------------------------------------------------- */
:root {
  --ground: #1A202B;      /* slate — the icon's background, lightened a step */
  --ground-2: #12161D;    /* the icon's darker end, for panels */
  --paper: #F5F7FA;       /* the permit sheet itself */
  --muted: #9AA3AF;       /* the icon's checklist rules */
  --rule: #2A3240;        /* section dividers */
  --accent: #FF7A00;      /* the check — used as sparingly here as there */
  --breach: #E63946;      /* red: an atmospheric reading outside the limits */
  --clear: #4FBE79;       /* green: open and clear */

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* --- Base ------------------------------------------------------------ */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--ground);
  color: var(--paper);
  font-family: var(--font-ui);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga";
}
body {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(255,122,0,0.05) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 100%, rgba(150,175,210,0.05) 0%, transparent 40%),
    var(--ground);
  min-height: 100vh;
}
img { max-width: 100%; }

/* --- Layout ---------------------------------------------------------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 32px; }

/* --- Typography ------------------------------------------------------ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--muted);
}

h1, h2, h3 {
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-wrap: balance;
  margin: 0;
  color: var(--paper);
}
h1 { font-size: clamp(2.75rem, 7.5vw, 5.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); letter-spacing: -0.015em; line-height: 1.1; }
h3 { font-size: 1.2rem; letter-spacing: -0.005em; }
p  { margin: 0; font-size: 1.02rem; color: rgba(245,247,250,0.86); }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(255,122,0,0.35); }
a:hover { border-bottom-color: var(--accent); }

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

/* --- Hero ------------------------------------------------------------ */
.hero {
  padding: 96px 0 120px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
/* Faint grid, masked to a soft ellipse — the permit form is a grid too. */
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-text .eyebrow { margin-bottom: 28px; }
.hero-text h1       { margin-bottom: 24px; }
.hero-text p        { max-width: 42ch; font-size: 1.18rem; margin-bottom: 40px; color: rgba(245,247,250,0.9); }

.app-icon {
  width: 208px; height: 208px;
  border-radius: 46px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06);
  overflow: hidden;
}
.app-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* --- CTAs ------------------------------------------------------------ */
.cta-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 28px;
  background: var(--paper);
  color: var(--ground);
  font-weight: 700;
  font-size: 0.98rem;
  border-radius: 999px;
  letter-spacing: -0.005em;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border-bottom: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(0,0,0,0.4); border-bottom: none; }
.btn-arrow { transition: transform 0.2s; }
.btn:hover .btn-arrow { transform: translateX(3px); }
.btn-secondary {
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(245,247,250,0.4);
  padding-bottom: 2px;
}
.btn-secondary:hover { border-bottom-color: var(--paper); }

/* --- Status strip ---------------------------------------------------- */
.status-strip {
  margin-top: 88px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
}
.status-strip strong {
  display: block;
  color: var(--paper);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  margin-top: 4px;
}
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--clear); margin-right: 8px; vertical-align: middle; }

/* --- Section shell --------------------------------------------------- */
section { padding: 96px 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: none; }
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  margin-bottom: 64px;
  align-items: start;
}
.section-head .eyebrow { margin-bottom: 20px; display: block; }
.section-head p { color: rgba(245,247,250,0.75); max-width: 58ch; }

/* --- Page cards (what the app is) ------------------------------------ */
.pages { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.page-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.18));
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.page-card h3 { margin-bottom: 2px; }
.page-card p  { font-size: 0.95rem; color: rgba(245,247,250,0.72); }
.page-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- Gates ----------------------------------------------------------- */
/* Numbered, because they are numbered in the code and in the crew's head. */
.gates { display: grid; gap: 0; margin-top: 8px; }
.gate {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.gate:last-child { border-bottom: 1px solid var(--rule); }
.gate-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.gate h3 { font-size: 1.05rem; margin-bottom: 6px; }
.gate p  { font-size: 0.98rem; color: rgba(245,247,250,0.75); }

/* --- Focus grid (this beta) ------------------------------------------ */
.focus { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 40px; margin-top: 32px; }
.focus-item { padding: 24px 0; border-top: 2px solid var(--accent); }
.focus-item:nth-child(2) { border-top-color: var(--muted); }
.focus-item:nth-child(3) { border-top-color: var(--breach); }
.focus-item:nth-child(4) { border-top-color: var(--clear); }
.focus-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.focus-item p  { font-size: 0.94rem; color: rgba(245,247,250,0.7); }

/* --- Steps ----------------------------------------------------------- */
.steps { display: grid; gap: 4px; margin-top: 40px; }
.step {
  display: grid;
  grid-template-columns: 60px 1fr;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  gap: 24px;
  align-items: start;
}
.step:last-child { border-bottom: 1px solid var(--rule); }
.step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p  { font-size: 0.98rem; color: rgba(245,247,250,0.75); }
.step code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: rgba(255,122,0,0.08);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255,122,0,0.18);
}

/* --- Footer ---------------------------------------------------------- */
footer {
  padding: 48px 0 64px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; align-items: center; }
footer .brand { color: var(--paper); }

/* --- Responsive ------------------------------------------------------ */
@media (max-width: 780px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-inner .app-icon { order: -1; width: 168px; height: 168px; border-radius: 38px; }
  .hero { padding: 64px 0 80px; }
  .status-strip { grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 56px; }
  .section-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 40px; }
  .pages, .focus { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
  .step, .gate { grid-template-columns: 44px 1fr; gap: 16px; }
  footer .wrap { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 20px; }
  h1 { font-size: 3rem; }
  .hero-text p { font-size: 1.08rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
