@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-canvas: #FAF8F5;
  --bg-subtle: #F3EFE9;
  --surface-card: #FFFFFF;
  --surface-card-hover: #FCFBF9;
  --surface-tray: #EFE9DF;
  --surface-tray-recessed: #E4DCD0;
  
  --birch-blonde: #F6F1E8;
  --birch-warmth: #E8DECE;
  --wood-grain-tint: #4A3320;
  --wood-scorched: #4A3221;
  --wood-kerf: rgba(74, 50, 33, 0.22);
  
  --terracotta: #D45D48;
  --terracotta-hover: #C14F3C;
  --terracotta-subtle: rgba(212, 93, 72, 0.1);
  --brass-gold: #C89B48;
  --brass-gold-subtle: rgba(200, 155, 72, 0.12);
  --sage-green: #5E8069;
  --sage-green-subtle: rgba(94, 128, 105, 0.12);
  
  --midnight: #1A1817;
  --text-primary: #1C1917;
  --text-secondary: #6B645C;
  --text-tertiary: #9E968D;
  
  --border-hairline: rgba(28, 25, 23, 0.08);
  --border-subtle: rgba(28, 25, 23, 0.05);
  --border-card: rgba(28, 25, 23, 0.07);
  
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-card: 0 4px 20px -2px rgba(28, 25, 23, 0.06), 0 1px 3px rgba(28, 25, 23, 0.03);
  --shadow-hover: 0 16px 40px -8px rgba(28, 25, 23, 0.1), 0 3px 8px rgba(28, 25, 23, 0.04);
  --shadow-piece-resting: 0 2px 5px rgba(28, 25, 23, 0.14), 0 1px 2px rgba(28, 25, 23, 0.08);
  --shadow-piece-lifted: 0 18px 36px -6px rgba(28, 25, 23, 0.24), 0 8px 16px -4px rgba(28, 25, 23, 0.12);
  --shadow-tray: inset 0 3px 10px rgba(45, 30, 18, 0.11), inset 0 1px 3px rgba(45, 30, 18, 0.08);
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg-canvas);
  overflow-x: hidden;
  line-height: 1.55;
}

/* Wood Grain Subtle Ambient Canvas */
.canvas-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  z-index: 999;
}

/* Typography Utilities */
.font-serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* Nav */
.header-glass {
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-hairline);
  transition: all 0.3s ease;
}

/* Buttons & Spring Micro-interactions (Kinetics) */
.spring-button {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background-color 0.2s ease;
}
.spring-button:hover {
  transform: translateY(-1.5px) scale(1.015);
}
.spring-button:active {
  transform: translateY(1px) scale(0.97);
}

.spring-card {
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.35s ease, border-color 0.25s ease;
}
.spring-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(28, 25, 23, 0.12);
}

/* Wooden Tray Surface & Recessed Cutout */
.tray-recessed {
  background: var(--surface-tray);
  box-shadow: var(--shadow-tray);
  border: 1px solid rgba(74, 50, 33, 0.08);
}

.wood-cardstock-edge {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8) inset, 0 3px 8px rgba(45, 30, 18, 0.12);
}

/* Decorative Linen Stitch Line */
.linen-stitch {
  background-image: repeating-linear-gradient(
    90deg,
    var(--terracotta) 0,
    var(--terracotta) 6px,
    transparent 6px,
    transparent 12px
  );
  height: 2px;
  opacity: 0.45;
}

/* Device Frame Simulation */
.ipad-frame {
  background: #111010;
  padding: 14px;
  border-radius: 36px;
  box-shadow: 
    0 32px 80px -16px rgba(45, 30, 18, 0.22),
    0 12px 30px -8px rgba(45, 30, 18, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 0 0 2px rgba(0, 0, 0, 0.8);
}
@media (min-width: 768px) {
  .ipad-frame {
    padding: 18px;
    border-radius: 44px;
  }
}

/* Portrait iPad Pro Frame */
.ipad-frame-portrait {
  background: #111010;
  padding: 12px;
  border-radius: 40px;
  box-shadow: 
    0 36px 90px -18px rgba(45, 30, 18, 0.24),
    0 14px 32px -8px rgba(45, 30, 18, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.14) inset,
    0 0 0 2px rgba(0, 0, 0, 0.85);
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
}
@media (min-width: 640px) {
  .ipad-frame-portrait {
    padding: 15px;
    border-radius: 50px;
  }
}
.ipad-frame-portrait:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 44px 100px -20px rgba(45, 30, 18, 0.28),
    0 18px 40px -10px rgba(45, 30, 18, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset,
    0 0 0 2px rgba(0, 0, 0, 0.9);
}



/* Status Indicator Dot */
.pulsing-indicator {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: currentColor;
  border-radius: 50%;
}
.pulsing-indicator::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-ring 2.2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  60%, 100% { transform: scale(2.4); opacity: 0; }
}

/* FAQ Accordion Transitions */
.faq-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease;
  opacity: 0;
  visibility: hidden;
}
.faq-content.open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
}
.faq-content > div {
  overflow: hidden;
}
.faq-chevron {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.faq-trigger[aria-expanded="true"] .faq-chevron {
  transform: rotate(180deg);
}

/* Custom Scrollbar for Tray */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(74, 50, 33, 0.15);
  border-radius: 999px;
}
