/* Lab Helps — clinical, paper-and-ink aesthetic.
   Warm off-white ground, deep teal ink, hairline rules, restrained motion. */

:root {
  --paper:      #F4F1EA;
  --paper-2:    #EAE5DA;
  --card:       #FBF9F5;
  --ink:        #16211F;
  --ink-soft:   #4E5F5A;
  --ink-faint:  #7C8A85;
  --teal:       #0E3B3B;
  --teal-mid:   #17615C;
  --teal-pale:  #C9D9D3;
  --amber:      #A9662F;
  --rule:       rgba(22, 33, 31, 0.13);
  --rule-strong:rgba(22, 33, 31, 0.28);

  --sans: "IBM Plex Sans", ui-sans-serif, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --gutter: clamp(1.25rem, 5vw, 5.5rem);
  --maxw: 78rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.97rem + 0.16vw, 1.075rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Faint paper tooth over everything, fixed so it never repaints on scroll. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 80;
  background: var(--teal);
  color: var(--paper);
  padding: 0.65rem 1rem;
  border-radius: 0 0 4px 0;
}
.skip:focus { left: 0; }

a { color: inherit; }

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.018em;
  margin: 0;
  line-height: 1.08;
}

p { margin: 0; }

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(9px);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--teal);
}
.mark { width: 1.45rem; height: 1.45rem; flex: none; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.5vw, 2rem);
  font-size: 0.9rem;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.site-nav a:hover { color: var(--teal); border-bottom-color: var(--teal); }
.nav-cta {
  color: var(--teal) !important;
  font-weight: 500;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.25rem, 9vw, 7rem) var(--gutter) clamp(3rem, 7vw, 5.5rem);
  position: relative;
}

/* soft field behind the hero, no hard edges */
.hero::before {
  content: "";
  position: absolute;
  inset: -12% -30% 20% 40%;
  background: radial-gradient(60% 55% at 50% 45%, rgba(23, 97, 92, 0.13), transparent 72%);
  pointer-events: none;
  z-index: -1;
}

.hero-copy { min-width: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--rule-strong);
  border-radius: 100px;
  padding: 0.34rem 0.85rem;
  margin-bottom: clamp(1.4rem, 3vw, 2rem);
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(169, 102, 47, 0.18);
}

.hero h1 {
  font-size: clamp(2.6rem, 7.2vw, 5rem);
  letter-spacing: -0.032em;
}
.hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--teal-mid);
}

.lede {
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
  font-size: clamp(1.12rem, 0.95rem + 0.7vw, 1.4rem);
  color: var(--ink);
  max-width: 34ch;
}

.sub {
  margin-top: 1rem;
  color: var(--ink-soft);
  max-width: 48ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.78rem 1.35rem;
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.18s var(--ease), background-color 0.2s var(--ease),
              color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn-primary {
  background: var(--teal);
  color: var(--paper);
  box-shadow: 0 1px 0 rgba(22, 33, 31, 0.3), 0 10px 22px -14px rgba(14, 59, 59, 0.9);
}
.btn-primary:hover { background: var(--teal-mid); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.arrow { width: 1rem; height: 1rem; transition: transform 0.2s var(--ease); }
.btn-primary:hover .arrow { transform: translateX(3px); }

.btn-ghost {
  border: 1px solid var(--rule-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- example panel ---------- */

.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 24px 48px -34px rgba(14, 59, 59, 0.55);
  overflow: hidden;
  transform: translateY(clamp(0px, 1.5vw, 18px));
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(var(--paper-2), var(--card));
}
.panel-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.panel-tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.thread { list-style: none; margin: 0; padding: 0.35rem 0; }

.turn {
  display: grid;
  grid-template-columns: 4.9rem minmax(0, 1fr);
  gap: 0.9rem;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px dashed var(--rule);
  font-size: 0.92rem;
}
.turn:last-child { border-bottom: 0; }
.who {
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.24rem;
}
.turn-user p { color: var(--ink-soft); }
.turn-bot {
  background: rgba(201, 217, 211, 0.24);
  border-left: 2px solid var(--teal-mid);
}
.turn-bot .who { color: var(--teal-mid); }
.turn-meta p {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.panel-foot {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.15rem;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal-mid);
  flex: none;
  animation: pulse 2.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(23, 97, 92, 0.42); }
  50%      { opacity: 0.7; box-shadow: 0 0 0 5px rgba(23, 97, 92, 0); }
}

/* ---------- shared section furniture ---------- */

.section-label {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: clamp(1.5rem, 3.5vw, 2.4rem);
}
.section-label .rule {
  width: clamp(1.5rem, 4vw, 3rem);
  height: 1px;
  background: var(--rule-strong);
  flex: none;
}
.section-label h2 {
  font-size: clamp(0.82rem, 1.4vw, 0.9rem);
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.section-label.light .rule { background: rgba(244, 241, 234, 0.4); }
.section-label.light h2 { color: rgba(244, 241, 234, 0.72); }

/* ---------- steps ---------- */

.steps {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
  border-top: 1px solid var(--rule);
}

.step-list { list-style: none; margin: 0; padding: 0; }
.step-list > li {
  display: grid;
  grid-template-columns: minmax(3.5rem, 8vw) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.5rem, 3.5vw, 2.4rem) 0;
  border-top: 1px solid var(--rule);
}
.step-list > li:first-child { border-top: 0; padding-top: 0; }

/* stagger the copy column so the list reads as a descending flight of steps */
.step-list > li:nth-child(2) > div { margin-left: clamp(0px, 3vw, 2.5rem); }
.step-list > li:nth-child(3) > div { margin-left: clamp(0px, 6vw, 5rem); }

.num {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--amber);
  padding-top: 0.42rem;
}
.step-list h3 {
  font-size: clamp(1.32rem, 2.4vw, 1.8rem);
  margin-bottom: 0.6rem;
}
.step-list p {
  color: var(--ink-soft);
  max-width: 56ch;
}
.step-list em { font-style: italic; color: var(--ink); }

/* ---------- scope ---------- */

.scope {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(1.75rem, 5vw, 4rem);
  align-items: start;
}
.scope-intro p {
  color: var(--ink-soft);
  max-width: 38ch;
}

.scope-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}
.scope-list li {
  background: var(--paper);
  padding: clamp(1.1rem, 2.4vw, 1.5rem);
  transition: background-color 0.22s var(--ease);
}
.scope-list li:hover { background: var(--card); }
.scope-list h3 {
  font-size: 1.06rem;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: 0.35rem;
}
.scope-list p {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.disclaimer {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin-top: clamp(0.5rem, 2vw, 1rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
  color: var(--ink-soft);
  max-width: 82ch;
}
.disclaimer .i { width: 1.05rem; height: 1.05rem; flex: none; margin-top: 0.28rem; color: var(--amber); }

/* ---------- access ---------- */

.access {
  background: var(--teal);
  color: var(--paper);
  margin-top: clamp(1rem, 4vw, 2.5rem);
  position: relative;
  overflow: hidden;
}
.access::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(115deg, rgba(244, 241, 234, 0.05) 0 1px, transparent 1px 26px);
  pointer-events: none;
}
.access-inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
}
.access-lede {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.6vw, 2.35rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  max-width: 26ch;
}
.access-steps {
  list-style: none;
  margin: clamp(2rem, 4vw, 2.75rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: rgba(244, 241, 234, 0.18);
  border-top: 1px solid rgba(244, 241, 234, 0.18);
  border-bottom: 1px solid rgba(244, 241, 234, 0.18);
}
.access-steps li {
  background: var(--teal);
  padding: 1.3rem clamp(1rem, 2vw, 1.5rem);
  font-size: 0.94rem;
  color: rgba(244, 241, 234, 0.86);
}
.access-steps span {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--teal-pale);
  margin-bottom: 0.5rem;
}
.access-note {
  margin-top: 1.6rem;
  font-size: 0.9rem;
  color: rgba(244, 241, 234, 0.62);
  max-width: 54ch;
}

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

.site-foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}
.foot-brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem; }
.foot-tag, .foot-legal { font-size: 0.85rem; color: var(--ink-faint); }

/* ---------- entrance choreography ---------- */

@media (prefers-reduced-motion: no-preference) {
  .eyebrow, .hero h1, .lede, .sub, .actions, .panel {
    animation: rise 0.75s var(--ease) both;
  }
  .eyebrow  { animation-delay: 0.04s; }
  .hero h1  { animation-delay: 0.12s; }
  .lede     { animation-delay: 0.22s; }
  .sub      { animation-delay: 0.30s; }
  .actions  { animation-delay: 0.38s; }
  .panel    { animation-delay: 0.30s; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; }
  }
  /* preserve the panel's resting offset */
  .panel { animation-name: rise-panel; }
  @keyframes rise-panel {
    from { opacity: 0; transform: translateY(calc(clamp(0px, 1.5vw, 18px) + 14px)); }
    to   { opacity: 1; transform: translateY(clamp(0px, 1.5vw, 18px)); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

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

@media (max-width: 62rem) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .panel { transform: none; }
  .scope { grid-template-columns: minmax(0, 1fr); }
  .step-list > li:nth-child(n) > div { margin-left: 0; }
}

@media (max-width: 40rem) {
  .site-nav { gap: 0.9rem; font-size: 0.84rem; }
  .site-nav a:first-child { display: none; }
  .hero h1 { font-size: clamp(2.35rem, 10vw, 3.2rem); }
  .lede { max-width: none; }
  .scope-list { grid-template-columns: minmax(0, 1fr); }
  .turn { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; }
  .who { padding-top: 0; }
  .btn { width: 100%; justify-content: center; }
  .actions { gap: 0.6rem; }
}
