:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #565656;
  --accent: #c97b5a;
  --accent-dark: #a35a3d;
  --bg: #f4efe8;
  --panel: #ffffff;
  --shadow: 0 20px 40px rgba(21, 21, 21, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: linear-gradient(160deg, #fff7ee 0%, #f4efe8 48%, #efe8df 100%);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(201, 123, 90, 0.12), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(203, 159, 121, 0.16), transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: grid;
  gap: 32px;
}

.hero {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  align-items: end;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.hero h1 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  margin: 0;
}

.brand-title {
  font-family: "Courgette", "Brush Script MT", "Apple Chancery", "Segoe Script",
    cursive;
  font-size: clamp(3rem, 6vw, 4.6rem);
  letter-spacing: 0.02em;
  text-transform: none;
  color: #3f2b24;
}

.hero-copy {
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.9fr);
  gap: 24px;
}

.pad-wrap {
  background: var(--panel);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.pad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

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

.pad-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

.pulse {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(201, 123, 90, 0.8);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(201, 123, 90, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(201, 123, 90, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(201, 123, 90, 0);
  }
}

.pad {
  position: relative;
  border-radius: 18px;
  border: 1px solid #f0e5db;
  background: #fffdf9;
  min-height: 280px;
  overflow: hidden;
}

#signaturePad {
  width: 100%;
  height: 320px;
  display: block;
  touch-action: none;
}

.pad-hint {
  position: absolute;
  bottom: 16px;
  right: 18px;
  font-size: 0.8rem;
  color: #a58a7a;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.controls {
  display: grid;
  gap: 16px;
}

.control-card {
  background: var(--panel);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.control-card h2 {
  font-size: 1rem;
  margin: 0;
}

.control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.control input[type="color"] {
  border: none;
  width: 44px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.control input[type="range"] {
  width: 130px;
}

.button-row {
  display: flex;
  gap: 12px;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-icon {
  width: 18px;
  height: 18px;
}

button:active {
  transform: translateY(1px) scale(0.98);
}

.tiny {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.primary {
  background: linear-gradient(135deg, #d88f6c, #c97b5a);
  color: #fff;
  box-shadow: 0 10px 20px rgba(201, 123, 90, 0.25);
  border: none;
}

.primary:hover {
  background: linear-gradient(135deg, #c97b5a, #b96c4b);
}

.ghost {
  background: #f4ebe1;
  color: #483a34;
}

.ghost.accent {
  background: #f8e4d7;
  color: #5a3a2c;
  border: 1px solid rgba(201, 123, 90, 0.25);
  box-shadow: 0 8px 16px rgba(201, 123, 90, 0.15);
}

.ghost.accent:hover {
  background: #f3d7c4;
}

.orientation {
  font-weight: 600;
  font-size: 0.95rem;
  color: #5b4033;
}

.helper {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

.footer {
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(63, 43, 36, 0.12);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: center;
}

.footer a {
  color: #7a4a3a;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  #signaturePad {
    height: 260px;
  }
}

@media (max-width: 600px) {
  .page {
    padding: 32px 18px 64px;
  }

  .button-row {
    flex-direction: column;
  }
}
