/* ================================================================
   CANON DESIGN SYSTEM - Ported from canon-craft
   Electric heartbreak aesthetics: Red + Teal on Deep Black
   ================================================================ */

/* =========================
   CSS CUSTOM PROPERTIES (HSL)
   ========================= */

:root {
  /* Core Colors - HSL format for opacity control */
  --background: 0 0% 3%;           /* Deep void black #070707 */
  --foreground: 48 25% 92%;        /* Warm cream white #F0E8C9 */
  --ink: 0 0% 3%;                  /* Deep black for sections */
  --bone: 48 25% 92%;              /* Bone white/cream */
  
  /* Brand Colors - Electric */
  --primary: 0 85% 52%;            /* Electric Red #E32636 */
  --primary-foreground: 0 0% 100%; /* White on red */
  --accent: 158 65% 45%;           /* Teal-Green #2AA87E */
  --accent-foreground: 0 0% 100%;  /* White on teal */
  
  /* Surface Colors */
  --card: 42 35% 92%;              /* Warm cream surface */
  --card-foreground: 0 0% 8%;      /* Dark text on cream */
  --muted: 0 0% 12%;               /* Muted dark gray */
  --muted-foreground: 48 15% 55%;  /* Muted text */
  
  /* Borders & Dividers */
  --border: 0 0% 16%;              /* Border color */
  --input: 0 0% 16%;               /* Input borders */
  --ring: 0 85% 52%;               /* Focus ring (primary) */
  
  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'Space Mono', monospace;
  
  /* Spacing */
  --reading-width: 68ch;
  --section-spacing: 10rem;
}

/* =========================
   BASE RESETS
   ========================= */

* {
  border-color: hsl(var(--border));
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography base */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
}

::selection {
  background: hsl(var(--primary) / 0.3);
  color: hsl(var(--foreground));
}

/* =========================
   TYPOGRAPHY SCALE
   ========================= */

/* Display - Massive headlines */
.text-display-xl {
  font-family: var(--font-display);
  font-size: clamp(3.75rem, 8vw, 5.5rem);
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-feature-settings: 'liga' 1;
}

.text-display {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 4.5rem);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* Headlines */
.text-headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  font-weight: 500;
}

/* Subheads */
.text-subhead {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.4;
  font-weight: 400;
}

/* Body text */
.text-body-large {
  font-size: 1.25rem;
  line-height: 1.6;
}

.text-body {
  font-size: 1rem;
  line-height: 1.6;
}

/* Caption - mono uppercase */
.text-caption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 400;
}

.text-mono {
  font-family: var(--font-mono);
}

/* Number displays */
.number-display {
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 9rem);
  line-height: 1;
  font-weight: 500;
  -webkit-text-stroke: 1px hsl(var(--foreground) / 0.3);
  color: transparent;
}

/* Font display utility */
.font-display {
  font-family: var(--font-display);
}

/* =========================
   COLOR UTILITIES
   ========================= */

/* Backgrounds */
.bg-ink { background-color: hsl(var(--ink)); }
.bg-bone { background-color: hsl(var(--bone)); }
.bg-background { background-color: hsl(var(--background)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-accent { background-color: hsl(var(--accent)); }

/* Background with opacity */
.bg-primary\/5 { background-color: hsl(var(--primary) / 0.05); }
.bg-primary\/10 { background-color: hsl(var(--primary) / 0.1); }
.bg-primary\/20 { background-color: hsl(var(--primary) / 0.2); }
.bg-accent\/5 { background-color: hsl(var(--accent) / 0.05); }
.bg-accent\/10 { background-color: hsl(var(--accent) / 0.1); }
.bg-accent\/20 { background-color: hsl(var(--accent) / 0.2); }
.bg-ink\/20 { background-color: hsl(var(--ink) / 0.2); }
.bg-ink\/30 { background-color: hsl(var(--ink) / 0.3); }
.bg-ink\/50 { background-color: hsl(var(--ink) / 0.5); }
.bg-ink\/70 { background-color: hsl(var(--ink) / 0.7); }

/* Text colors */
.text-ink { color: hsl(var(--ink)); }
.text-bone { color: hsl(var(--bone)); }
.text-foreground { color: hsl(var(--foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-accent { color: hsl(var(--accent)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }

/* Text with opacity */
.text-foreground\/80 { color: hsl(var(--foreground) / 0.8); }
.text-foreground\/70 { color: hsl(var(--foreground) / 0.7); }
.text-foreground\/60 { color: hsl(var(--foreground) / 0.6); }
.text-bone\/80 { color: hsl(var(--bone) / 0.8); }
.text-bone\/70 { color: hsl(var(--bone) / 0.7); }
.text-bone\/60 { color: hsl(var(--bone) / 0.6); }

/* Borders */
.border-border { border-color: hsl(var(--border)); }
.border-border\/30 { border-color: hsl(var(--border) / 0.3); }
.border-border\/50 { border-color: hsl(var(--border) / 0.5); }
.border-primary { border-color: hsl(var(--primary)); }
.border-primary\/20 { border-color: hsl(var(--primary) / 0.2); }
.border-primary\/30 { border-color: hsl(var(--primary) / 0.3); }
.border-primary\/50 { border-color: hsl(var(--primary) / 0.5); }
.border-accent { border-color: hsl(var(--accent)); }
.border-accent\/20 { border-color: hsl(var(--accent) / 0.2); }
.border-accent\/30 { border-color: hsl(var(--accent) / 0.3); }
.border-accent\/50 { border-color: hsl(var(--accent) / 0.5); }
.border-bone\/20 { border-color: hsl(var(--bone) / 0.2); }
.border-bone\/30 { border-color: hsl(var(--bone) / 0.3); }

/* =========================
   GRADIENT & GLOW EFFECTS
   ========================= */

/* Electric gradient text */
.text-gradient-electric {
  background: linear-gradient(135deg, hsl(var(--accent)) 0%, hsl(var(--primary)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Text glows */
.text-glow-red {
  text-shadow: 
    0 0 40px hsl(var(--primary) / 0.4),
    0 0 80px hsl(var(--primary) / 0.2);
}

.text-glow-green {
  text-shadow: 
    0 0 30px hsl(var(--accent) / 0.4),
    0 0 60px hsl(var(--accent) / 0.2);
}

/* Box glows */
.glow-red {
  box-shadow: 
    0 0 80px hsl(var(--primary) / 0.15),
    0 0 120px hsl(var(--primary) / 0.1);
}

.glow-green {
  box-shadow: 
    0 0 60px hsl(var(--accent) / 0.15),
    0 0 100px hsl(var(--accent) / 0.08);
}

/* =========================
   SECTION BACKGROUNDS
   ========================= */

.section-ink {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  padding: 5rem 0;
}

.section-cream {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  padding: 5rem 0;
}

/* Noise overlay */
.noise-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.4;
  z-index: 1;
}

/* =========================
   BUTTON STYLES (Canon Craft)
   ========================= */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background-color: hsl(var(--primary));
  background-image: none;
  color: hsl(var(--primary-foreground));
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0;
  border-radius: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.btn-primary:hover {
  box-shadow: 0 0 40px hsl(var(--primary) / 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background-color: transparent;
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid hsl(var(--foreground) / 0.4);
  border-radius: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.btn-outline:hover {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.btn-accent:hover {
  box-shadow: 0 0 40px hsl(var(--accent) / 0.4);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  background-color: transparent;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-ghost:hover {
  color: hsl(var(--primary));
}

/* =========================
   ANIMATIONS
   ========================= */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.8;
  }
}

/* Animation classes */
.animate-fade-up {
  animation: fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.animate-fade-in {
  animation: fade-in 1s ease-out forwards;
  opacity: 0;
}

.animate-slide-in {
  animation: slide-in 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.animate-pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* Animation delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-700 { animation-delay: 0.7s; }

/* =========================
   PROSE & READING STYLES
   ========================= */

.prose-editorial {
  max-width: var(--reading-width);
  line-height: 1.85;
}

.prose-editorial p {
  margin-bottom: 1.5rem;
}

.prose-editorial blockquote {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  border-left: 2px solid hsl(var(--primary));
  padding-left: 1.5rem;
  margin: 2rem 0;
}

.reading-column {
  max-width: var(--reading-width);
  line-height: 1.6;
}

/* =========================
   LAYOUT & UTILITIES
   ========================= */

/* Noise overlay texture */
.noise-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZmlsdGVyIGlkPSJhIiB4PSIwIiB5PSIwIj48ZmVUdXJidWxlbmNlIGJhc2VGcmVxdWVuY3k9Ii43NSIgc3RpdGNoVGlsZXM9InN0aXRjaCIgdHlwZT0iZnJhY3RhbE5vaXNlIi8+PGZlQ29sb3JNYXRyaXggdHlwZT0ic2F0dXJhdGUiIHZhbHVlcz0iMCIvPjwvZmlsdGVyPjxwYXRoIGQ9Ik0wIDBoMzAwdjMwMEgweiIgZmlsdGVyPSJ1cmwoI2EpIiBvcGFjaXR5PSIuMDUiLz48L3N2Zz4=');
  pointer-events: none;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (min-width: 768px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Link underline effect */
.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: hsl(var(--primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.link-underline:hover::after {
  transform: scaleX(1);
}

/* Dividers */
.divider-subtle {
  border-top: 1px solid hsl(var(--border) / 0.4);
}

.hr-electric {
  border: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    hsl(var(--primary)),
    transparent
  );
  opacity: 0.6;
}

/* =========================
   RESPONSIVE ADJUSTMENTS
   ========================= */

@media (max-width: 1024px) {
  /* Adjust spacing on tablets */
  .section-ink,
  .section-cream {
    padding: 4rem 0;
  }
}

@media (max-width: 768px) {
  /* Hide large decorative numbers on mobile */
  .number-display,
  .absolute.-top-16.-right-8.number-display {
    display: none !important;
  }
  
  /* Hero section adjustments */
  .min-h-screen.flex.items-center {
    min-height: auto;
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  
  /* Hide scroll indicator on mobile to avoid overlap */
  .absolute.bottom-8.left-1\/2 {
    display: none;
  }
  
  /* Typography adjustments - maintain detail */
  .text-display-xl {
    font-size: 2.75rem;
    line-height: 1.05;
    letter-spacing: -0.02em;
  }
  
  .text-display {
    font-size: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
  }
  
  .text-headline {
    font-size: 1.75rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
  }
  
  .text-body-large {
    font-size: 1rem;
    line-height: 1.7;
  }
  
  .number-display {
    font-size: 4rem;
  }
  
  /* Maintain text glow on mobile */
  .text-glow-red {
    text-shadow: 
      0 0 30px hsl(var(--primary) / 0.5),
      0 0 60px hsl(var(--primary) / 0.3);
  }
  
  /* Container adjustments */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Section spacing */
  .section-ink,
  .section-cream {
    padding: 3rem 0;
  }
  
  /* Button adjustments for flex containers - maintain styling */
  .flex.flex-col.sm\:flex-row {
    gap: 0.75rem;
  }
  
  .flex.flex-col.sm\:flex-row .btn-primary,
  .flex.flex-col.sm\:flex-row .btn-outline {
    width: 100%;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
  }
  
  /* Ensure proper z-index layering */
  .relative.z-10 {
    z-index: 10;
  }
  
  /* Canon section cards - maintain detail and design */
  .md\:space-y-0.md\:grid.md\:grid-cols-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .md\:space-y-0.md\:grid.md\:grid-cols-3 > a {
    margin-left: 0 !important;
    margin-top: 0 !important;
  }
  
  .md\:space-y-0.md\:grid.md\:grid-cols-3 > a > div {
    border-left-width: 1px !important;
    padding: 2rem 1.5rem !important;
  }
  
  /* Maintain large background numbers on mobile */
  .md\:space-y-0.md\:grid.md\:grid-cols-3 .font-display.text-8xl,
  .md\:space-y-0.md\:grid.md\:grid-cols-3 .font-display.text-9xl {
    font-size: 6rem !important;
    opacity: 0.1;
  }
  
  /* Maintain hover underline bars on mobile */
  .md\:space-y-0.md\:grid.md\:grid-cols-3 .absolute.bottom-0 {
    display: block;
  }
  
  /* Featured book adjustments - fix overlap */
  .grid.lg\:grid-cols-2 {
    gap: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
  }
  
  .aspect-\[3\/4\] {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }
  
  /* Fix "COMING March 2026" badge positioning on mobile */
  .aspect-\[3\/4\] + .absolute {
    position: static !important;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    margin-left: auto;
    margin-right: auto;
    max-width: fit-content;
  }
  
  /* Ensure proper layering in featured section */
  .section-cream .grid.lg\:grid-cols-2 > div:first-child {
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .section-cream .grid.lg\:grid-cols-2 > div:last-child {
    position: relative;
    z-index: 2;
  }
  
  /* Stats grid */
  .grid.grid-cols-2.md\:grid-cols-4 {
    gap: 0;
  }
  
  .grid.grid-cols-2.md\:grid-cols-4 > div {
    padding: 1.5rem 0.75rem;
  }
  
  /* Review cards */
  .grid.md\:grid-cols-2.lg\:grid-cols-3 {
    gap: 1.25rem;
  }
  
  /* Writing section timeline dots */
  .group.relative.block.pl-8 {
    padding-left: 2rem;
  }
  
  .group.relative.block.pl-8 .absolute.left-6 {
    left: 0.5rem;
  }
  
  /* Shop grid */
  .grid.md\:grid-cols-3.gap-8 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* Maintain typography detail on all text elements */
  .font-display {
    font-feature-settings: 'liga' 1, 'kern' 1;
  }
  
  /* Reduce gradient backgrounds intensity on mobile */
  .absolute.inset-0 {
    opacity: 0.7;
  }
  
  .absolute.top-1\/4,
  .absolute.bottom-1\/4 {
    display: block;
    width: 200px !important;
    height: 200px !important;
  }
  
  /* Improve mobile hero readability */
  .min-h-screen .container {
    max-width: 100%;
  }
  
  /* Better mobile button stack spacing */
  .flex.flex-col.gap-4 {
    gap: 1rem;
  }
  
  /* Improve mobile headline grouping */
  h1.mt-8.mb-10 {
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
  
  /* Better prose spacing on mobile */
  .prose-editorial {
    max-width: 100%;
  }
  
  .prose-editorial p {
    margin-bottom: 1rem;
  }
  
  /* Fix canon cards to maintain elegance but be readable */
  .md\:space-y-0.md\:grid.md\:grid-cols-3 .font-display.text-8xl,
  .md\:space-y-0.md\:grid.md\:grid-cols-3 .font-display.text-9xl {
    font-size: 5rem !important;
    opacity: 0.08 !important;
    line-height: 1 !important;
  }
}

/* Focus visible styles */
:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 4px;
}
