:root {
  --bg: #f5efe3;
  --bg-deep: #e6dcc8;
  --surface: rgba(255, 251, 243, 0.8);
  --surface-strong: rgba(34, 31, 28, 0.94);
  --text: #211c18;
  --muted: #65584d;
  --accent: #b15b31;
  --line: rgba(33, 28, 24, 0.15);
  --shadow: 0 10px 28px rgba(55, 40, 22, 0.08);
  --image-gap: 20px;
  --tall-width: 275px;
  --tall-height: 400px;
  --wide-width: 320px;
  --top-height: 150px;
  --bottom-height: 230px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(177, 91, 49, 0.22), transparent 28%),
    radial-gradient(circle at 84% 14%, rgba(89, 98, 83, 0.16), transparent 22%),
    linear-gradient(135deg, #f8f3ea 0%, var(--bg) 52%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  line-height: 1.52;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

a {
  color: inherit;
}

code {
  font-family: "Courier New", monospace;
}

.page-shell {
  position: relative;
  overflow: hidden;
}

.page-shell__grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px);
  background-size: 4px 4px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 24px;
}

.hero,
.site-footer {
  position: relative;
}

.hero {
  max-width: 500px;
}

.eyebrow,
.endpoint-card__label {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
}

.eyebrow {
  font-size: 1rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.endpoint-card__label {
  font-size: 0.74rem;
  letter-spacing: 0.18em;
}

.hero h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3.7rem, 6vw, 5.55rem);
  line-height: 0.9;
  font-weight: 600;
  letter-spacing: -0.05em;
  white-space: nowrap;
}

.hero h1 span {
  color: var(--accent);
}

.lede {
  max-width: 500px;
  margin: 20px 0 0;
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: transparent;
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--surface-strong);
  color: #f6efe4;
  box-shadow: 0 18px 40px rgba(33, 28, 24, 0.18);
}

.button-primary:hover {
  background: #181412;
}

.endpoint-card {
  width: fit-content;
  max-width: 100%;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.endpoint-link {
  text-decoration: none;
}

.endpoint-link:hover code {
  color: var(--accent);
}

.endpoint-card code {
  display: block;
  white-space: nowrap;
  overflow-wrap: normal;
  font-size: 0.96rem;
  color: var(--text);
}

.mosaic {
  display: grid;
  grid-template-columns: var(--tall-width) var(--wide-width);
  grid-template-rows: var(--top-height) var(--bottom-height);
  align-items: stretch;
  gap: var(--image-gap);
  width: calc(var(--tall-width) + var(--image-gap) + var(--wide-width));
  height: calc(var(--top-height) + var(--image-gap) + var(--bottom-height));
}

.mosaic-stack {
  display: contents;
}

.frame {
  margin: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(33, 28, 24, 0.38);
  background: rgba(255, 255, 255, 0.34);
  box-shadow: none;
}

.frame-tall {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: var(--tall-width);
  height: calc(var(--top-height) + var(--image-gap) + var(--bottom-height));
}

.frame-top-wide {
  grid-column: 2;
  grid-row: 1;
  width: var(--wide-width);
  height: var(--top-height);
}

.frame-bottom-wide {
  grid-column: 2;
  grid-row: 2;
  width: var(--wide-width);
  height: var(--bottom-height);
}

.site-footer {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

.reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: settle 700ms cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
}

.reveal-delay-1 {
  animation-delay: 60ms;
}

.reveal-delay-2 {
  animation-delay: 180ms;
}

.reveal-delay-3 {
  animation-delay: 300ms;
}

@keyframes settle {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 1101px) {
  body {
    overflow: hidden;
  }

  .layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 500px) auto;
    grid-template-areas:
      "hero mosaic"
      "footer mosaic";
    justify-content: start;
    align-content: center;
    column-gap: 0;
    row-gap: 22px;
  }

  .hero {
    grid-area: hero;
    align-self: center;
  }

  .mosaic {
    grid-area: mosaic;
    justify-self: end;
    align-self: center;
  }

  .site-footer {
    grid-area: footer;
    align-self: end;
  }
}

@media (max-width: 1100px) {
  :root {
    --image-gap: 18px;
    --tall-width: 246px;
    --tall-height: 338px;
    --wide-width: 286px;
    --top-height: 132px;
    --bottom-height: 188px;
  }

  .layout {
    width: min(100% - 40px, 760px);
    padding-top: 38px;
    padding-bottom: 34px;
  }

  .hero {
    max-width: none;
    margin-bottom: 28px;
  }

  .hero h1 {
    font-size: clamp(3.25rem, 8.2vw, 4.95rem);
    white-space: nowrap;
  }

  .lede {
    margin-top: 16px;
    font-size: 1.06rem;
  }

  .endpoint-card {
    margin-top: 20px;
    padding: 16px 18px;
  }

  .endpoint-card code {
    font-size: clamp(0.8rem, 1.65vw, 0.92rem);
  }

  .mosaic {
    margin: 0;
    justify-content: start;
  }

  .site-footer {
    margin-top: 20px;
  }
}

@media (max-width: 640px) {
  :root {
    --image-gap: 14px;
    --tall-width: 178px;
    --tall-height: 246px;
    --wide-width: 198px;
    --top-height: 92px;
    --bottom-height: 140px;
  }

  .layout {
    width: min(100% - 24px, 430px);
    padding-top: 30px;
    padding-bottom: 28px;
  }

  .eyebrow {
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }

  .hero h1 {
    font-size: clamp(2.6rem, 11vw, 3.8rem);
    white-space: nowrap;
    letter-spacing: -0.04em;
  }

  .endpoint-card {
    width: fit-content;
    max-width: 100%;
    margin-top: 18px;
    padding: 14px 16px;
  }

  .endpoint-card code {
    white-space: nowrap;
    overflow-wrap: normal;
    font-size: 0.74rem;
  }

  .mosaic {
    margin: 6px 0 0;
  }

  .site-footer {
    margin-top: 18px;
    font-size: 0.82rem;
  }
}

@media (max-width: 420px) {
  :root {
    --image-gap: 10px;
    --tall-width: 134px;
    --tall-height: 190px;
    --wide-width: 160px;
    --top-height: 72px;
    --bottom-height: 108px;
  }

  .layout {
    width: min(100% - 20px, 320px);
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .eyebrow {
    font-size: 0.74rem;
    letter-spacing: 0.06em;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .lede {
    font-size: 0.94rem;
  }

  .endpoint-card {
    margin-top: 16px;
    padding: 12px 14px;
  }

  .endpoint-card__label {
    margin-bottom: 8px;
  }

  .endpoint-card code {
    font-size: 0.62rem;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .button {
    transition: none;
  }
}
