:root {
  --paper: #f4efe4;
  --panel: rgba(255, 251, 244, 0.86);
  --panel-strong: #fffdf8;
  --ink: #1f221d;
  --muted: #5f655b;
  --accent: #0f7a63;
  --accent-strong: #134f42;
  --border: rgba(70, 64, 51, 0.14);
  --shadow: 0 28px 80px rgba(35, 31, 24, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  overscroll-behavior: none;
  background:
    radial-gradient(circle at top left, rgba(15, 122, 99, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(176, 96, 62, 0.14), transparent 30%),
    linear-gradient(180deg, #fbf7ef 0%, var(--paper) 100%);
}

.app-shell {
  width: min(1540px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 2.4vw + 0.9rem, 3.4rem);
  line-height: 0.96;
}

.lede {
  margin: 0;
  max-width: 64ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-actions button {
  appearance: none;
  border: 1px solid rgba(19, 79, 66, 0.2);
  background: linear-gradient(180deg, #fffef9 0%, #ebe0cb 100%);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(19, 79, 66, 0.1);
  transition: transform 120ms ease, border-color 120ms ease;
}

.hero-actions button:hover {
  border-color: rgba(19, 79, 66, 0.32);
  transform: translateY(-1px);
}

.canvas-card {
  backdrop-filter: blur(14px);
}

.canvas-card {
  overflow: auto;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

#board-canvas {
  display: block;
  width: min(100%, 1400px);
  height: auto;
  margin: 0 auto;
  touch-action: none;
  cursor: grab;
  border-radius: 22px;
  background: #ffffff;
}

#board-canvas.is-grabbing {
  cursor: grabbing;
}

@media (min-width: 921px) {
  html,
  body {
    height: 100%;
  }

  body {
    overflow: hidden;
  }

  .app-shell {
    min-height: 100dvh;
    padding: 16px 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
  }

  .hero {
    margin-bottom: 0;
  }

  .canvas-card {
    min-height: 0;
    padding: 12px;
    overflow: hidden;
    display: grid;
    place-items: center;
  }

  #board-canvas {
    width: auto;
    max-width: 100%;
    max-height: var(--desktop-canvas-max-height, calc(100dvh - 220px));
  }
}

@media (min-width: 921px) and (max-height: 920px) {
  .app-shell {
    padding-top: 10px;
    padding-bottom: 14px;
    gap: 8px;
  }

  .eyebrow {
    margin-bottom: 6px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 2.1vw + 0.8rem, 2.8rem);
  }

  .hero-actions button {
    padding: 10px 16px;
  }

  .canvas-card {
    padding: 10px;
  }
}

@media (max-width: 920px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-shell {
    width: min(100% - 20px, 1540px);
    padding-top: 18px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions button {
    width: 100%;
  }

  .canvas-card {
    padding: 10px;
    border-radius: 20px;
  }

  #board-canvas {
    border-radius: 16px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 12px, 1540px);
    padding-top: 12px;
  }

  .canvas-card {
    padding: 6px;
  }
}
