:root {
  color-scheme: light;

  /* Claude / Anthropic palette */
  --cloud: #f0eee6;        /* page background — warm ivory */
  --paper: #faf9f5;        /* card surface */
  --ink: #1a1915;          /* near-black, warm */
  --ink-soft: #6f6d64;     /* muted warm gray */
  --ink-faint: #9b9890;
  --clay: #cc785c;         /* signature accent — book cloth */
  --clay-strong: #b1573b;  /* accent for text / hover */
  --rule: #e3dfd3;         /* hairline */
  --rule-soft: #ece9df;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

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

* {
  box-sizing: border-box;
}

html {
  background: var(--cloud);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  margin: 0;
  line-height: 1.55;
  font-feature-settings: "kern", "liga", "calt";
}

a {
  color: inherit;
}

img {
  display: block;
}

/* ---------- Nav ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1160px, calc(100% - 56px));
  margin: 0 auto;
  padding: 22px 0 0;
}

.wordmark {
  display: inline-flex;
  width: 124px;
  line-height: 0;
  text-decoration: none;
}

.wordmark img {
  width: 100%;
  height: auto;
}

/* ---------- Page + hero ---------- */

.page {
  width: min(1160px, calc(100% - 56px));
  margin: 0 auto;
  padding: clamp(28px, 5vh, 56px) 0 56px;
}

.hero {
  max-width: 720px;
  margin: 0 0 clamp(30px, 5vh, 52px);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 8vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.lede {
  max-width: 540px;
  margin: 22px 0 0;
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  color: var(--ink-soft);
}

/* ---------- Layer rows + spine ---------- */

.layers {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vh, 34px);
}

/* the spine threading the three numbered stages, dissolving into "product" */
.layers::before {
  content: "";
  position: absolute;
  top: 26px;
  bottom: 0;
  left: 21px;
  width: 1px;
  background: linear-gradient(
    var(--clay) 0%,
    var(--rule) 7%,
    var(--rule) 64%,
    transparent 100%
  );
}

.layer {
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
}

.layer-label {
  display: flex;
  gap: 16px;
  padding-top: 4px;
}

.layer-num {
  position: relative;
  z-index: 1;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--clay);
  border-radius: 50%;
  background: var(--cloud);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--clay-strong);
}

.layer-name {
  margin: 6px 0 4px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.layer-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  max-width: 22ch;
}

/* ---------- Cards ---------- */

.layer-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(26, 25, 21, 0.04);
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease,
    transform 200ms ease;
}

.card:hover {
  border-color: var(--clay);
  box-shadow: 0 14px 30px rgba(26, 25, 21, 0.1);
  transform: translateY(-4px);
}

.card-thumb {
  position: relative;
  height: 82px;
  overflow: hidden;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--rule-soft);
}

.card-thumb iframe {
  --preview-scale: 0.24;
  position: absolute;
  inset: 0;
  width: calc(100% / var(--preview-scale));
  height: calc(100% / var(--preview-scale));
  border: 0;
  pointer-events: none;
  transform: scale(var(--preview-scale));
  transform-origin: 0 0;
}

/* The Form Builder is a wide app — zoom out a touch more than the default,
   but keep the responsive width/height so the preview always fills the card
   (a fixed pixel size left an empty strip and a blank crop on mobile). */
.preview-builder iframe {
  --preview-scale: 0.2;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px 15px;
}

.card-kicker {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay-strong);
}

.card-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ---------- Focus + motion ---------- */

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

.card:focus-visible {
  outline-offset: 2px;
}

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

/* ---------- Responsive ---------- */

@media (max-width: 920px) {
  .layers::before {
    display: none;
  }

  .layer {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

@media (max-width: 560px) {
  .nav,
  .page {
    width: calc(100% - 36px);
  }

  .layer-cards {
    grid-template-columns: 1fr;
  }
}
