:root {
  --bg: #f4eddc;
  --panel: rgba(255, 251, 242, 0.82);
  --text: #1d1712;
  --muted: #6d604f;
  --line: rgba(29, 23, 18, 0.1);
  --ink: #2d2016;
  --red: #e76b4d;
  --yellow: #f0cc65;
  --blue: #6b93ff;
}

html {
  min-height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(240, 204, 101, 0.2), transparent 22rem),
    radial-gradient(circle at 84% 16%, rgba(107, 147, 255, 0.16), transparent 20rem),
    linear-gradient(180deg, #fbf6ee 0%, var(--bg) 100%);
  overflow-x: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

.page {
  width: min(1220px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.hero,
.card,
.panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(70, 44, 19, 0.1);
}

.hero {
  min-height: 82vh;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 1rem;
  align-items: center;
}

.eyebrow,
.card span {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
.card strong {
  margin: 0;
  font-family: "Syne", sans-serif;
  line-height: 0.94;
}

h1 {
  max-width: 8.5ch;
  font-size: clamp(3.3rem, 6vw, 5.7rem);
  letter-spacing: -0.04em;
}

h2 {
  max-width: 11ch;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  letter-spacing: -0.03em;
}

.lede,
.panel p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 1rem;
}

.lede {
  max-width: 38rem;
  margin-top: 1.2rem;
}

.cards,
.gallery {
  display: grid;
  gap: 1rem;
}

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

.card,
.panel {
  padding: 1.25rem;
}

.card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card strong {
  font-size: 1.7rem;
  line-height: 1.05;
}

.accent {
  background: linear-gradient(135deg, rgba(231, 107, 77, 0.16), rgba(255, 251, 242, 0.92));
}

.gallery {
  margin-top: 1rem;
  grid-template-columns: 1fr 1fr;
}

.paint-ui {
  position: fixed;
  inset: auto 1rem 1rem auto;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.paint-toggle {
  display: none;
  pointer-events: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 251, 242, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.8rem 1rem;
}

.paint-toggle.is-browse {
  background: rgba(29, 23, 18, 0.92);
  color: #f8f2e6;
}

.pencil {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9;
  width: 90px;
  height: 18px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #f3d86b 0%, #f3d86b 70%, #ef8b72 70%, #ef8b72 84%, #cbbda2 84%, #cbbda2 94%, #272119 94%);
  transform: rotate(-26deg);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  will-change: transform;
}

.paint-hint {
  margin: 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 251, 242, 0.88);
  color: var(--muted);
}

#paint-layer {
  position: absolute;
  inset: 0 0 auto;
  z-index: 7;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  touch-action: none;
  -webkit-touch-callout: none;
}

body.is-browse-mode #paint-layer {
  pointer-events: none;
}

@media (max-width: 960px) {
  .hero,
  .cards,
  .gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100vw - 1rem, 1220px);
  }

  .hero,
  .card,
  .panel {
    border-radius: 24px;
  }

  .hero {
    min-height: auto;
    padding: 1.1rem;
  }

  h1 {
    font-size: clamp(2.6rem, 11vw, 4.2rem);
  }

  h2 {
    font-size: clamp(1.9rem, 8vw, 2.7rem);
  }

  .paint-ui {
    right: 0.5rem;
    left: 0.5rem;
    bottom: 0.5rem;
    justify-content: space-between;
  }

  .paint-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .pencil {
    width: 72px;
    height: 16px;
  }

  .paint-hint {
    max-width: 210px;
    font-size: 0.85rem;
    padding: 0.7rem 0.85rem;
  }
}
