/* ==========================================================================
   Liréa Books — Tactile UI & Mechanical Button System
   Inspired by Dan Hollick (dqnamo.com/kitchen)
   ========================================================================== */

:root {
  --tactile-depth: 6px;
  --tactile-radius: 0.75rem;
  --ease-tactile: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Base Tactile Button Container */
.btn-tactile {
  position: relative !important;
  display: inline-grid !important;
  width: max-content;
  flex-shrink: 0;
  cursor: pointer !important;
  user-select: none;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  padding-bottom: var(--tactile-depth) !important;
  font-family: inherit;
  line-height: 1;
  text-decoration: none !important;
  outline: none;
  vertical-align: middle;
  transition: opacity 0.15s ease;
  box-shadow: none !important;
}

.btn-tactile:focus-visible {
  border-radius: var(--tactile-radius);
  outline: 2px solid #c5a059;
  outline-offset: 3px;
}

.btn-tactile:disabled,
.btn-tactile[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.5;
}

/* Mechanical Base Chassis (Sits underneath, gives extruded 3D depth) */
.btn-tactile .tactile-base {
  position: absolute !important;
  inset-inline: 0 !important;
  top: var(--tactile-depth) !important;
  bottom: 0 !important;
  border-radius: var(--tactile-radius) !important;
  background-color: var(--tactile-base) !important;
  box-shadow: inset 0 -1px 0 var(--tactile-base-shadow), 0 4px 10px rgba(0, 0, 0, 0.25) !important;
  pointer-events: none;
}

/* Mechanical Keycap Face (The moving surface) */
.btn-tactile .tactile-face {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: var(--tactile-radius) !important;
  background-color: var(--tactile-face) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--tactile-content) !important;
  box-shadow: inset 0 1px 0 var(--tactile-face-highlight) !important;
  transition: transform 150ms var(--ease-tactile);
  will-change: transform;
}

/* Subtle pre-press give on hover */
@media (hover: hover) and (pointer: fine) {
  .btn-tactile:hover .tactile-face {
    transform: translateY(1px);
  }
}

/* Full mechanical compression travel on click/active */
.btn-tactile:active .tactile-face {
  transform: translateY(var(--tactile-depth));
  transition-duration: 60ms;
}

/* Motion reduction */
@media (prefers-reduced-motion: reduce) {
  .btn-tactile .tactile-face {
    transition: none !important;
    transform: none !important;
  }
}

/* --- Sizes --- */
.btn-tactile.tactile-sm {
  --tactile-depth: 4px;
  --tactile-radius: 0.5rem;
}
.btn-tactile.tactile-sm .tactile-face {
  height: 2rem !important;
  padding-inline: 0.75rem !important;
  gap: 0.375rem;
  font-size: 0.75rem !important;
}

.btn-tactile.tactile-md {
  --tactile-depth: 5px;
  --tactile-radius: 0.625rem;
}
.btn-tactile.tactile-md .tactile-face {
  height: 2.5rem !important;
  padding-inline: 1.125rem !important;
  gap: 0.5rem;
  font-size: 0.875rem !important;
}

.btn-tactile.tactile-lg {
  --tactile-depth: 6px;
  --tactile-radius: 0.75rem;
}
.btn-tactile.tactile-lg .tactile-face {
  height: 3.1rem !important;
  padding-inline: 1.5rem !important;
  gap: 0.625rem;
  font-size: 1rem !important;
}

/* --- Brand Color Themes --- */

/* 1. Sovereign Gold (Primary Buy / Founder) */
.btn-tactile-gold {
  --tactile-face: #c5a059;
  --tactile-face-highlight: #ecd197;
  --tactile-content: #0a0e17;
  --tactile-base: #876729;
  --tactile-base-shadow: #523c14;
}

/* 2. Midnight Obsidian (Sleek Dark Theme) */
.btn-tactile-obsidian {
  --tactile-face: #1e293b;
  --tactile-face-highlight: #334155;
  --tactile-content: #f8fafc;
  --tactile-base: #0f172a;
  --tactile-base-shadow: #020617;
}

/* 3. Liréa Crimson Wax Seal */
.btn-tactile-crimson {
  --tactile-face: #991b1b;
  --tactile-face-highlight: #dc2626;
  --tactile-content: #ffffff;
  --tactile-base: #7f1d1d;
  --tactile-base-shadow: #450a0a;
}

/* 4. Thermal Charcoal (dqnamo Original) */
.btn-tactile-charcoal {
  --tactile-face: #4a4a46;
  --tactile-face-highlight: #64645e;
  --tactile-content: #eeeeec;
  --tactile-base: #292926;
  --tactile-base-shadow: #141412;
}

/* 5. Paper Linen / Parchment */
.btn-tactile-parchment {
  --tactile-face: #fbf9f4;
  --tactile-face-highlight: #ffffff;
  --tactile-content: #1e293b;
  --tactile-base: #d8ceb8;
  --tactile-base-shadow: #b3a68d;
}
