/* ==========================================================================
   AGAIN COFFEE DESIGN SYSTEM — COMPONENTS
   Buttons, cards, badges, tags, glassmorphism, modals, and drawers
   ========================================================================== */

button, input, optgroup, select, textarea { font-family: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: 100%; font-weight: inherit; line-height: inherit; letter-spacing: inherit; color: inherit; margin: 0px; padding: 0px; }

button, select { text-transform: none; }

button, input:where([type="button"]), input:where([type="reset"]), input:where([type="submit"]) { appearance: button; background-color: transparent; background-image: none; }

::-webkit-inner-spin-button, ::-webkit-outer-spin-button { height: auto; }

::-webkit-file-upload-button { appearance: button; font: inherit; }

textarea { resize: vertical; }

input::placeholder, textarea::placeholder { opacity: 1; color: var(--grey-500); }

[role="button"], button { cursor: pointer; }

.select-none { user-select: none; }

.selection\:bg-primary ::selection { background-color: var(--white); color: var(--black); }

.selection\:text-white ::selection { color: var(--white); }

.selection\:bg-primary::selection { background-color: var(--white); color: var(--black); }

.selection\:text-white::selection { color: var(--white); }

.group\/btn:hover .group-hover\/btn\:translate-x-1 { --tw-translate-x: 0.25rem; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }

.coffee-card { transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s, border-color 0.4s; transform-style: preserve-3d; perspective: 1000px; }

.coffee-card-visual { perspective: 800px; transform-style: preserve-3d; cursor: pointer; }

.coffee-card-img { transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.35s; transform-style: preserve-3d; will-change: transform; filter: grayscale(1); }

.coffee-card:hover .coffee-card-img { filter: grayscale(1) drop-shadow(rgba(0, 0, 0, 0.75) 0px 24px 44px); }

/* STEP 5: GLASS PANELS & CARDS (Why Choose Us + Micron Spectrum) */
.glass-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 32px;
  box-shadow: rgba(0, 0, 0, 0.5) 0px 24px 60px, inset 0px 1px 0px rgba(255, 255, 255, 0.20);
  overflow: hidden;
}

.glass-card {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  box-shadow: rgba(0, 0, 0, 0.45) 0px 10px 40px, inset 0px 1px 0px rgba(255, 255, 255, 0.20);
  overflow: hidden;
  transition: transform 0.4s, border-color 0.4s, box-shadow 0.4s, background 0.4s;
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 0px;
  left: 0px;
  width: 140px;
  height: 140px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.02) 50%, transparent 100%);
  border-top-left-radius: 24px;
  pointer-events: none;
  z-index: 1;
}

.glass-card::after {
  content: "";
  position: absolute;
  inset: 0px;
  border-radius: 24px;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.04);
  pointer-events: none;
  transition: box-shadow 0.4s;
  z-index: 1;
}

.glass-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.40);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: rgba(0, 0, 0, 0.6) 0px 20px 50px, inset 0px 1px 0px rgba(255, 255, 255, 0.35);
}

.glass-card:hover::after {
  box-shadow: inset 0 0 25px rgba(255, 255, 255, 0.08);
}

.glass-card.is-active {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--white) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  box-shadow: rgba(0, 0, 0, 0.6) 0px 20px 50px, 0 0 30px rgba(255, 255, 255, 0.15), inset 0px 1px 0px rgba(255, 255, 255, 0.40) !important;
}

.glass-backdrop-layer {
  position: absolute;
  inset: 0px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.glass-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.65;
  pointer-events: none;
  animation: 16s ease-in-out 0s infinite alternate none running driftBlob;
}

.glass-blob-orange {
  width: min(440px, 45vw);
  height: min(440px, 45vw);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 60%, transparent 80%);
}

.glass-blob-warm {
  width: min(390px, 40vw);
  height: min(390px, 40vw);
  background: radial-gradient(circle, rgba(200, 200, 204, 0.14) 0%, rgba(100, 100, 105, 0.03) 60%, transparent 80%);
  animation-duration: 20s;
  animation-direction: alternate-reverse;
}

@keyframes driftBlob { 
  0% { transform: translate(0px, 0px) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
  100% { transform: translate(-30px, 25px) scale(0.94); }
}

/* Floating coffee beans: grayscale(1) */
.floating-bean {
  position: absolute;
  pointer-events: none;
  filter: grayscale(1) drop-shadow(rgba(0, 0, 0, 0.85) 0px 10px 20px);
  opacity: 0.75;
  animation: 12s ease-in-out 0s infinite alternate none running driftBean;
  z-index: 0;
}

@keyframes driftBean { 
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(8deg); }
  100% { transform: translateY(14px) rotate(-6deg); }
}

.glass-cup-wrap {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(rgba(0, 0, 0, 0.65) 0px 20px 40px) drop-shadow(rgba(255, 255, 255, 0.10) 0px 0px 30px);
  animation: 7s ease-in-out 0s infinite normal none running floatCup;
  z-index: 2;
}

@keyframes floatCup { 
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(1.5deg); }
}

.steam-line {
  animation: 3.6s cubic-bezier(0.4, 0, 0.2, 1) 0s infinite normal none running steamRise;
}

@keyframes steamRise { 
  0% { transform: translateY(0px); opacity: 0; }
  25% { opacity: 0.7; }
  75% { opacity: 0.25; }
  100% { transform: translateY(-38px); opacity: 0; }
}

.glass-reveal {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-reveal.is-in {
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0px);
}

.ember-glow-btn {
  box-shadow: rgba(255, 255, 255, 0.12) 0px 0px 24px -4px;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ember-glow-btn:hover {
  box-shadow: rgba(255, 255, 255, 0.25) 0px 0px 36px 0px;
  transform: translateY(-1px);
}

.method-tab {
  transition: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.method-tab[aria-pressed="true"] {
  box-shadow: rgba(0, 0, 0, 0.2) 0px 4px 16px;
  background: var(--black) !important;
  color: var(--white) !important;
  border-color: var(--black) !important;
}

.particle-box {
  display: none; /* Semantic accessibility fallback */
}

/* ==========================================================================
   AGAIN COFFEE — PRECISION GRIND ATELIER & OPTICAL PARTICLE CHAMBER
   ========================================================================== */

/* Quick-select Grind Level Pills */
.grind-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 1px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.grind-pills-row::-webkit-scrollbar {
  display: none;
}

.grind-pill-btn {
  flex: 1 1 0%;
  min-width: 62px;
  padding: 6px 8px;
  border-radius: 9999px;
  background: #FFFFFF;
  border: 1px solid var(--line-light);
  font-family: var(--font-label-mono, 'Space Grotesk', sans-serif);
  font-size: 10px;
  font-weight: 600;
  color: #555555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

.grind-pill-btn:hover {
  background: #EFEFEA;
  color: #0A0A0A;
  border-color: rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.grind-pill-btn.is-active {
  background: #0A0A0A !important;
  color: #FFFFFF !important;
  border-color: #0A0A0A !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

/* Precision Grind Range Slider */
.grind-slider-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.grind-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: #E0E0DC;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  z-index: 2;
}

.grind-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0A0A0A;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s;
}

.grind-slider::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}

.grind-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.08);
}

.grind-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0A0A0A;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: grab;
}

/* Optical Particle Inspection Viewport */
.grind-chamber {
  position: relative;
  background: #0E0C0B;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 2px 16px rgba(0, 0, 0, 0.8), 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: border-color 0.3s;
}

.grind-chamber:hover {
  border-color: rgba(0, 0, 0, 0.35);
}

.grind-chamber-canvas {
  width: 100%;
  height: 144px;
  display: block;
  cursor: crosshair;
}

/* Concentric Optical Reticle Overlay */
.chamber-reticle {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(circle at center, transparent 38px, rgba(255, 255, 255, 0.05) 39px, transparent 40px),
    radial-gradient(circle at center, transparent 78px, rgba(255, 255, 255, 0.05) 79px, transparent 80px),
    radial-gradient(circle at center, transparent 118px, rgba(255, 255, 255, 0.04) 119px, transparent 120px);
}

.chamber-crosshairs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.chamber-crosshairs::before,
.chamber-crosshairs::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.09);
}

.chamber-crosshairs::before {
  top: 50%;
  left: 20%;
  right: 20%;
  height: 1px;
}

.chamber-crosshairs::after {
  left: 50%;
  top: 15%;
  bottom: 15%;
  width: 1px;
}

/* Macro Mode Optical Lens Ring */
.macro-lens-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.08), inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.grind-chamber.is-macro .macro-lens-ring {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: pulseLens 3s infinite alternate ease-in-out;
}

@keyframes pulseLens {
  0% { transform: translate(-50%, -50%) scale(0.98); border-color: rgba(255, 255, 255, 0.25); }
  100% { transform: translate(-50%, -50%) scale(1.03); border-color: rgba(255, 255, 255, 0.55); }
}

/* Micron Scale Bar Indicator */
.chamber-scale-tag {
  position: absolute;
  bottom: 8px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-label-mono, 'Space Grotesk', sans-serif);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.08em;
  pointer-events: none;
  z-index: 3;
}

.chamber-scale-line {
  display: inline-block;
  width: 32px;
  height: 2px;
  background: rgba(255, 255, 255, 0.45);
  position: relative;
}

.chamber-scale-line::before,
.chamber-scale-line::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 1px;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.chamber-scale-line::before { left: 0; }
.chamber-scale-line::after { right: 0; }

/* Control buttons in chamber header */
.chamber-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-family: var(--font-label-mono, 'Space Grotesk', sans-serif);
  font-size: 10px;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.chamber-ctrl-btn:hover {
  background: #0A0A0A;
  color: #FFFFFF;
  border-color: #0A0A0A;
}

.chamber-ctrl-btn.is-active {
  background: #0A0A0A;
  color: #FFFFFF;
  border-color: #0A0A0A;
}

/* Texture Benchmark Card Callout */
.texture-callout-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid var(--line-light);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

/* Telemetry Pills */
.telemetry-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 10px;
  font-family: var(--font-label-mono, 'Space Grotesk', sans-serif);
}

/* Sift / Agitate particle animation */
@keyframes chamberJitter {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, 2px); }
  80% { transform: translate(1px, -1px); }
  100% { transform: translate(0, 0); }
}

.grind-chamber.is-agitating {
  animation: chamberJitter 0.38s ease-in-out;
}

.spectrum-bar-wrap {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: visible; /* allows marker to overflow height */
}

.spectrum-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #FFFFFF 0%, #C9C9CC 35%, #8A8A8E 70%, #3A3B3F 100%);
  box-shadow: rgba(255, 255, 255, 0.3) 0px 0px 15px;
}

/* Spectrum Marker Pin on the Micron Bar */
.spectrum-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #000000;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: left 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 5;
}

/* ==========================================================================
   STEP 6: DECORATIVE FINTECH ELEMENTS
   Halftone dots, Donut rings, Topographic lines
   ========================================================================== */

/* Halftone dot pattern in the top-right corner of dark cards */
.halftone-corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.32;
  border-top-right-radius: inherit;
  overflow: hidden;
}

/* Donut ring shapes (torus) partly cropped at section edges */
.donut-ring {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
}

.donut-ring-dark {
  border: 42px solid var(--black);
}

.donut-ring-light {
  border: 42px solid rgba(255, 255, 255, 0.14);
}

.donut-ring-glass {
  border: 36px solid rgba(255, 255, 255, 0.22);
}

/* Topographic line background layer */
.topo-bg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
