/* ==========================================================================
   CHRONO-MINIMALISM & BENTO GRID DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Fonts */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Easing curves (Custom Spring Physics) */
  --transition-spring: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --transform-hover: translateY(-4px);

  /* Light Theme (Warm Alabaster Base) */
  --bg-color: #FAF9F6;
  --card-bg: #F4F3ED;
  --card-bg-hover: #FAF9F6;
  --text-primary: #121314;
  --text-muted: #666560;
  --border-color: #D6D3C9;
  --border-hover-color: #121314;
  
  --accent-color: #8C7C65;
  --accent-contrast: #FAF9F6;
  --btn-hover-bg: #121314;
  --btn-hover-text: #FAF9F6;
  
  --shadow-color: rgba(18, 19, 20, 0.08);
  --shadow-hover-color: rgba(18, 19, 20, 0.16);
  --shadow-normal: 0 8px 24px var(--shadow-color);
  --shadow-hover: 0 24px 48px var(--shadow-hover-color), 0 0 0 1px var(--border-hover-color);
  
  --stone-preview-bg: #E8E7E0;
  --stone-grain-opacity: 0.15;
  --carve-color: rgba(18, 19, 20, 0.85);
  --carve-highlight: rgba(255, 255, 255, 0.5);
  
  --scroll-track: #FAF9F6;
  --scroll-thumb: #D6D3C9;
}

[data-theme="dark"] {
  /* Dark Theme (Premium Graphite Charcoal & Warm Slate) */
  --bg-color: #0b0c0d;
  --card-bg: #121316;
  --card-bg-hover: #0b0c0d;
  --text-primary: #FAF9F6;
  --text-muted: #8a8982;
  --border-color: #1c1d22;
  --border-hover-color: #FAF9F6;
  
  --accent-color: #D3C3AD;
  --accent-contrast: #0b0c0d;
  --btn-hover-bg: #FAF9F6;
  --btn-hover-text: #0b0c0d;
  
  --shadow-color: rgba(0, 0, 0, 0.55);
  --shadow-hover-color: rgba(0, 0, 0, 0.85);
  --shadow-normal: 0 8px 32px var(--shadow-color);
  --shadow-hover: 0 24px 64px var(--shadow-hover-color), 0 0 0 1px var(--border-hover-color);
  
  --stone-preview-bg: #1c1d22;
  --stone-grain-opacity: 0.25;
  --carve-color: rgba(0, 0, 0, 0.95);
  --carve-highlight: rgba(255, 255, 255, 0.08);
  
  --scroll-track: #0b0c0d;
  --scroll-thumb: #1c1d22;
}

/* ==========================================================================
   RESET & FOUNDATIONS
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--scroll-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border: 2px solid var(--scroll-track);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

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

.serif-title {
  font-family: var(--font-serif);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.serif-card-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.95rem;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.serif-card-title em,
.serif-title em {
  font-style: italic;
  font-family: var(--font-serif);
}

.mono-label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-color);
}

.card-tag {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 1.25rem;
  display: block;
}

.body-text {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 400;
}

.body-text.compact {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.text-muted {
  color: var(--text-muted);
}

/* ==========================================================================
   HEADER / HEADER NAVIGATION
   ========================================================================== */

.site-header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-color);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition-spring);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-text-large {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.logo-subtext {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.system-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

#system-time-stamp {
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
  border-right: 1px solid var(--border-color);
  padding-right: 1.5rem;
  display: none; /* Hidden on small screens, shown in media query */
}

/* Custom Buttons (Chrono-Minimalist, solid, sharp, micro-interactions) */
.control-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-spring);
  border-radius: 0; /* Strict angular shapes */
}

.control-btn:hover {
  border-color: var(--border-hover-color);
  background-color: var(--btn-hover-bg);
  color: var(--btn-hover-text);
}

.control-btn svg {
  transition: transform 0.4s ease;
}

.control-btn:hover svg {
  transform: rotate(15deg);
}

.control-btn.accent-outline {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.control-btn.accent-outline:hover {
  background-color: var(--accent-color);
  color: var(--accent-contrast);
}

[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

/* ==========================================================================
   BENTO GRID LAYOUT
   ========================================================================== */

.bento-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  flex: 1;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

/* Card Foundations (Solid Matte Surfaces) */
/* Card Foundations (Solid Matte Surfaces with Entrance Animations) */
.bento-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-normal);
  
  /* Hidden state for animation */
  opacity: 0;
  transform: translateY(30px);
  
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.bento-card.revealed:hover {
  transform: var(--transform-hover);
  box-shadow: var(--shadow-hover);
  background-color: var(--card-bg-hover);
  border-color: var(--border-hover-color);
}

/* Bento Grid Spacing - Desktops (col-span & row-span) */
@media (min-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-flow: dense;
  }
  
  .col-span-1 { grid-column: span 1; }
  .col-span-2 { grid-column: span 2; }
  .col-span-3 { grid-column: span 3; }
  .col-span-4 { grid-column: span 4; }
  
  .row-span-1 { grid-row: span 1; }
  .row-span-2 { grid-row: span 2; }
  .row-span-3 { grid-row: span 3; }
}

/* ==========================================================================
   MODULE 1: HERO & HERITAGE
   ========================================================================== */

.hero-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.main-heading {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4.5vw, 4.2rem);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 2rem;
}

.main-heading em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent-color);
}

.hero-divider {
  height: 1px;
  background-color: var(--border-color);
  width: 100%;
  margin: 1rem 0 2rem 0;
  opacity: 0.8;
}

.hero-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .hero-content-grid {
    grid-template-columns: 1fr 1.8fr;
    gap: 3.5rem;
  }
}

.hero-subheading-serif {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.3;
  color: var(--accent-color);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero-body-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-body-col .body-text {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* High contrast Text links with Sharp hover interactions */
.text-link {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid var(--text-primary);
  padding-bottom: 0.25rem;
  transition: var(--transition-spring);
}

.text-link:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  padding-left: 0.25rem;
}

.text-link svg {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-link:hover svg {
  transform: translateX(4px);
}

.text-link.secondary {
  color: var(--text-muted);
  border-color: var(--border-color);
}

.text-link.secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

/* ==========================================================================
   MODULE 2: CHRONO TIMEPIECE
   ========================================================================== */

.timepiece-card {
  justify-content: space-between;
}

.timepiece-display {
  display: flex;
  align-items: baseline;
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 0;
  margin-bottom: 1.5rem;
}

.mono-display {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 2.4rem;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.mono-ms {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--accent-color);
  font-variant-numeric: tabular-nums;
  width: 3.5ch;
  margin-left: 0.2rem;
}

.coordinates-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.coord-item {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.coord-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.coord-val {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.mono-val {
  font-variant-numeric: tabular-nums;
  color: var(--accent-color);
  font-weight: 600;
}

/* ==========================================================================
   MODULE 3: PREMIUM MATERIALS CARD
   ========================================================================== */

.material-selectors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.material-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-spring);
  text-align: center;
}

.material-btn:hover {
  border-color: var(--border-hover-color);
}

.material-btn.active {
  background: var(--text-primary);
  color: var(--bg-color);
  border-color: var(--text-primary);
}

.material-details-display {
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  padding: 2rem;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  transition: var(--transition-spring);
}

@media (min-width: 768px) {
  .material-details-display {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 3rem;
  }
}

.material-info-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.material-detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.material-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.4rem;
}

.material-swatch {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-hover-color);
  display: inline-block;
}

.material-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.material-origin {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.material-texture-preview {
  border: 1px solid var(--border-color);
  background-color: #050505;
  width: 100%;
  max-width: 175px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

@media (min-width: 768px) {
  .material-texture-preview {
    align-self: center;
    justify-self: end;
  }
}

.texture-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 6s cubic-bezier(0.16, 1, 0.3, 1);
}

.material-texture-preview:hover .texture-img {
  transform: scale(1.08);
}

/* ==========================================================================
   MODULE 4: MEMORIAL CUSTOM CONFIGURATOR
   ========================================================================== */

.configurator-workspace {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
}

.stone-preview-tablet {
  height: 150px;
  background-color: var(--stone-preview-bg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition-spring);
}

.stone-grain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(var(--carve-highlight) 1px, transparent 1px),
    radial-gradient(var(--carve-color) 1px, transparent 1px);
  background-size: 8px 8px, 12px 12px;
  background-position: 0 0, 4px 4px;
  opacity: var(--stone-grain-opacity);
  pointer-events: none;
}

/* Engraving Effect: Pure CSS deep carving simulation without transparency */
.inscription-overlay {
  font-size: 2.2rem;
  text-align: center;
  width: 90%;
  word-wrap: break-word;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  z-index: 2;
  transition: var(--transition-spring);
  user-select: none;
  font-variant-numeric: tabular-nums;
  
  /* Engraving shadows: dark cut offset and white light reflection rim */
  color: var(--carve-color);
  text-shadow: 
    -1px -1px 1px rgba(0, 0, 0, 0.4), 
     1px  1px 1px var(--carve-highlight);
}

.stone-preview-tablet[data-stone="alabaster"] {
  background-color: #FAF9F6;
}

.stone-preview-tablet[data-stone="alabaster"] .inscription-overlay {
  color: #3C3A35;
  text-shadow: -1px -1px 0px rgba(0, 0, 0, 0.15), 1px 1px 0px rgba(255, 255, 255, 0.8);
}

.stone-preview-tablet[data-stone="charcoal"] {
  background-color: #1A1B1D;
}

.stone-preview-tablet[data-stone="charcoal"] .inscription-overlay {
  color: #0A0A0A;
  text-shadow: -1px -1px 0px rgba(0, 0, 0, 0.5), 1px 1px 0px rgba(255, 255, 255, 0.08);
}

.configurator-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-group.row-group {
  flex-direction: row;
  gap: 1rem;
}

.control-sub {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.text-input {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-spring);
  border-radius: 0;
}

.text-input:focus {
  border-color: var(--border-hover-color);
  background: var(--card-bg-hover);
}

.select-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238C7C65' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
  padding-right: 2.2rem;
}

.toggle-button-group {
  display: flex;
  border: 1px solid var(--border-color);
}

.toggle-group-btn {
  flex: 1;
  background: var(--bg-color);
  border: none;
  color: var(--text-primary);
  padding: 0.65rem 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-spring);
}

.toggle-group-btn:not(:last-child) {
  border-right: 1px solid var(--border-color);
}

.toggle-group-btn:hover {
  background-color: var(--card-bg);
}

.toggle-group-btn.active {
  background-color: var(--text-primary);
  color: var(--bg-color);
}

/* Range slider styling */
.range-slider {
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border-color);
  outline: none;
  margin: 0.5rem 0;
}

.range-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--text-primary);
  cursor: pointer;
  border: 1px solid var(--border-hover-color);
  transition: var(--transition-spring);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--accent-color);
}

/* ==========================================================================
   MODULE 5: WORKSHOP TIMELINE
   ========================================================================= */

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.timeline-event {
  display: flex;
  gap: 1.5rem;
  position: relative;
  padding-bottom: 0.25rem;
}

.timeline-event:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 2.25rem;
  top: 1.5rem;
  bottom: -1rem;
  width: 1px;
  background: var(--border-color);
}

.timeline-year {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--text-primary);
  color: var(--bg-color);
  padding: 0.3rem 0.5rem;
  height: max-content;
  min-width: 4.5ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.timeline-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
}

.timeline-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==========================================================================
   MODULE 7: FINISHED WORKS GALLERY
   ========================================================================== */

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.gallery-header .serif-card-title {
  margin-bottom: 0;
}

.gallery-nav-buttons {
  display: flex;
  gap: 0.5rem;
}

.icon-nav-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-spring);
}

.icon-nav-btn:hover {
  border-color: var(--border-hover-color);
  background-color: var(--text-primary);
  color: var(--bg-color);
}

.gallery-slider-viewport {
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  overflow: hidden;
}

.gallery-slide {
  display: flex;
  flex-direction: column;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.gallery-slide.active {
  opacity: 1;
}

.gallery-media-placeholder {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0e0f10;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.gallery-media-placeholder img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-slide:hover .gallery-media-placeholder img {
  transform: scale(1.08);
}

.gallery-slide-info {
  padding: 1.25rem;
}

.serif-slide-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

/* Responsive SVG sketches styling inside gallery */
.gallery-sketch-svg {
  width: 100%;
  height: 100%;
  max-height: 180px;
  padding: 1rem;
}

.gallery-sketch-svg path, 
.gallery-sketch-svg rect, 
.gallery-sketch-svg polygon {
  stroke: var(--text-primary);
  fill: none;
  stroke-width: 1.5;
  transition: var(--transition-spring);
}

.gallery-sketch-svg .fill-shade {
  fill: var(--border-color);
}

/* ==========================================================================
   MODULE 6: INQUIRY FORM CARD
   ========================================================================== */

.solid-state-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.textarea-input {
  resize: vertical;
}

/* Solid state button with sharp interaction */
.solid-btn {
  background: var(--text-primary);
  color: var(--bg-color);
  border: 1px solid var(--text-primary);
  padding: 0.9rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: var(--transition-spring);
  border-radius: 0;
}

.solid-btn:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--accent-contrast);
}

.solid-btn .btn-arrow {
  transition: transform 0.4s ease;
}

.solid-btn:hover .btn-arrow {
  transform: translateX(4px);
}

.solid-btn.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.form-status-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--accent-color);
  background-color: var(--card-bg);
  color: var(--text-primary);
  padding: 1rem;
  font-size: 0.85rem;
  margin-top: 1rem;
  font-weight: 500;
}

.form-status-alert.hidden {
  display: none;
}

/* ==========================================================================
   ADMIN PORTAL OVERLAY & CONTAINER
   ========================================================================== */

.admin-portal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  z-index: 1000;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.admin-portal.hidden {
  display: none !important;
}

.admin-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .admin-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.admin-brand {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mono-tag {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border-color);
  width: max-content;
}

.mono-tag.accent {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.admin-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
}

.admin-actions {
  display: flex;
  gap: 1rem;
}

.warning-action {
  border-color: #A34E36;
  color: #A34E36;
}

.warning-action:hover {
  background-color: #A34E36;
  color: #FAF9F6;
  border-color: #A34E36;
}

/* Admin Tabs Setup */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.admin-tab-btn {
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-spring);
}

.admin-tab-btn:hover {
  color: var(--text-primary);
}

.admin-tab-btn.active {
  color: var(--text-primary);
  border-color: var(--border-color);
  background: var(--card-bg);
  position: relative;
}

.admin-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--bg-color); /* Overlaps border border */
}

/* Admin Section Panel Mechanics */
.admin-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-section {
  display: none;
  flex-direction: column;
  gap: 2rem;
  height: 100%;
}

.admin-section.active {
  display: flex;
}

/* Metrics Grid */
.analytics-metrics-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .analytics-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .analytics-metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metric-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.metric-trend {
  font-size: 0.75rem;
  font-weight: 600;
}

.metric-trend.upward { color: var(--accent-color); }
.metric-trend.downward { color: #A34E36; }

/* SVG Analytics Chart and Live Activities layout */
.analytics-charts-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .analytics-charts-container {
    grid-template-columns: 2fr 1fr;
  }
}

.chart-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
}

.chart-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.svg-chart-wrapper {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 1rem;
}

.svg-chart-wrapper text {
  font-size: 8px;
}

/* Live Feed Simulation styles */
.live-activity-list-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  max-height: 300px;
  display: flex;
  flex-direction: column;
}

.activity-feed {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.feed-item {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--accent-color);
  padding-left: 0.75rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

.feed-item-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.feed-time {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.feed-details {
  color: var(--text-muted);
}

/* Content Manager layouts */
.content-manager-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .content-manager-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.manager-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.manager-section-title {
  margin-bottom: 0;
}

.editor-sublist {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  padding: 0.75rem;
}

.editor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.editor-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.editor-item-title {
  font-weight: 600;
  font-size: 0.85rem;
}

.editor-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.delete-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: #A34E36;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-spring);
}

.delete-btn:hover {
  background: #A34E36;
  color: #FAF9F6;
  border-color: #A34E36;
}

.editor-mini-form {
  border-top: 1px dashed var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mini-form-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-color);
}

.width-30 { width: 30%; }
.width-70 { width: 70%; }

/* Inbox Inquiries styles */
.inbox-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  flex: 1;
}

@media (min-width: 768px) {
  .inbox-layout {
    grid-template-columns: 1fr 2fr;
  }
}

.inbox-sidebar {
  border-right: none;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  max-height: 400px;
}

@media (min-width: 768px) {
  .inbox-sidebar {
    border-right: 1px solid var(--border-color);
    border-bottom: none;
    padding-bottom: 0;
    padding-right: 1.5rem;
    max-height: calc(100vh - 250px);
  }
}

.mono-tag-heading {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  flex: 1;
}

.inbox-item-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: var(--transition-spring);
  border-radius: 0;
}

.inbox-item-btn:hover {
  border-color: var(--border-hover-color);
}

.inbox-item-btn.active {
  background: var(--bg-color);
  border-color: var(--accent-color);
  box-shadow: inset 3px 0 0 var(--accent-color);
}

.inbox-item-sender {
  font-weight: 600;
  font-size: 0.85rem;
}

.inbox-item-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.inbox-item-snippet {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-reader {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.reader-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  gap: 1rem;
}

.reader-inquiry-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.4s ease-in-out;
}

.reader-meta-group {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reader-sender-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.8rem;
  line-height: 1.1;
}

.reader-metadata-line {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.reader-metadata-line strong {
  color: var(--text-primary);
}

.reader-message-body {
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-line;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 3rem 2rem 1.5rem 2rem;
  margin-top: auto;
  transition: var(--transition-spring);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .footer-container {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-logo {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: block;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-data {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-meta {
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ==========================================================================
   MODULE 2 & 8: CUSTOM CREATIONS & WORKSHOP VIDEO CARDS
   ========================================================================== */

/* Creations Card styling */
.creations-card {
  justify-content: space-between;
  display: flex;
  flex-direction: column;
}

.creations-viewport {
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  position: relative;
  overflow: hidden;
  height: 150px;
  margin-bottom: 0.75rem;
}

.creations-slide {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.creations-media {
  height: 115px;
  position: relative;
  background-color: var(--bg-color);
  overflow: hidden;
}

.creations-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), transform 6s cubic-bezier(0.16, 1, 0.3, 1);
}

.creations-media img.active {
  opacity: 1;
  transform: scale(1);
}

.creations-slide-info {
  padding: 0.25rem 0.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--card-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
}

.creations-nav-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Video Card styling */
.video-card {
  padding: 0 !important; /* Zero padding to make video fill card */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-height: 250px;
  position: relative;
}

.video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.video-container video {
  position: absolute;
  top: -20%;
  left: 0;
  width: 100%;
  height: 120%;
  object-fit: cover;
  transition: transform 6s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-card:hover video {
  transform: scale(1.05);
}

.video-overlay-tint {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(10,11,13,0.1) 0%, rgba(10,11,13,0.1) 50%, rgba(10,11,13,0.7) 100%);
  z-index: 2;
  pointer-events: none;
  transition: background-color 0.5s ease;
}

.video-card:hover .video-overlay-tint {
  background: linear-gradient(180deg, rgba(10,11,13,0.3) 0%, rgba(10,11,13,0.1) 50%, rgba(10,11,13,0.85) 100%);
}

.video-overlay-text {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  pointer-events: none;
}

.video-caption {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: #FAF9F6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Media Query Adaptations */
@media (min-width: 768px) {
  #system-time-stamp {
    display: inline;
  }
}

/* ==========================================================================
   MODULE: ELEGANT MONUMENTS CARD
   ========================================================================== */

.elegant-monuments-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.elegant-image-viewport {
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.elegant-image-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), transform 6s cubic-bezier(0.16, 1, 0.3, 1);
}

.elegant-image-viewport img.active {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   MODULE: RESOURCES DRAWER & DOCUMENT READER
   ========================================================================== */

.resources-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  z-index: 990;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
  transform: translateX(0);
  opacity: 1;
}

.resources-drawer.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.drawer-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}

.drawer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.drawer-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 2.2rem;
  line-height: 1;
}

.drawer-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  flex: 1;
}

@media (min-width: 768px) {
  .drawer-content-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.drawer-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.serif-section-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.document-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  margin-top: 0.5rem;
}

.doc-link-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-spring);
  text-align: left;
}

.doc-link-item:hover {
  border-color: var(--border-hover-color);
  background-color: var(--card-bg-hover);
  transform: translateY(-2px);
}

.doc-link-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text-primary);
}

.doc-link-meta {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Document Reader Modal Overlay */
.doc-reader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.4s ease;
  overflow: hidden;
}

.doc-reader-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.doc-reader-wrapper {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  padding: 3rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .doc-reader-wrapper {
    padding: 5rem 2rem;
  }
}

.doc-reader-container {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 1100px;
  padding: 4.5rem 2.5rem 2.5rem 2.5rem;
  position: relative;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
  animation: modalEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.close-modal-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-spring);
}

.close-modal-btn:hover {
  background-color: var(--text-primary);
  color: var(--bg-color);
  border-color: var(--text-primary);
}

/* 2-Column Responsive Layout */
.doc-reader-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1rem;
}

@media (min-width: 992px) {
  .doc-reader-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 3.5rem;
  }
}

/* Column 1: Sticky Sidebar */
.doc-reader-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.doc-reader-sidebar h1 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 300;
  line-height: 1.1;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

@media (min-width: 992px) {
  .doc-reader-sidebar {
    position: sticky;
    top: 4rem;
    align-self: start;
    max-height: calc(100vh - 14rem);
    overflow-y: auto;
    padding-right: 1rem;
  }
}

/* Table of Contents (Anchors) */
.doc-reader-toc {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 0;
  margin: 0.5rem 0;
}

.toc-link {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-spring);
  line-height: 1.4;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
}

.toc-link:hover, .toc-link.active {
  color: var(--text-primary);
  border-left-color: var(--accent-color);
  padding-left: 1rem;
}

/* Micro Reading-Progress Indicator */
.reading-progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reading-progress-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.reading-progress-track {
  height: 3px;
  background-color: var(--border-color);
  width: 100%;
  position: relative;
}

.reading-progress-bar {
  height: 100%;
  background-color: var(--accent-color);
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Column 2: Scrollable Content */
.doc-reader-content {
  display: flex;
  flex-direction: column;
}

.doc-reader-body {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.25rem);
  line-height: 1.7;
  color: var(--text-primary);
  opacity: 0.95;
}

.doc-reader-body p {
  margin-bottom: 1.25rem;
  text-wrap: pretty;
}

/* Bento-style Card Sections */
.doc-section-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 2.25rem;
  margin-bottom: 2rem;
  transition: var(--transition-spring);
}

.doc-section-card:hover {
  border-color: var(--border-hover-color);
}

.doc-section-card h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 400;
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.5rem;
}

.doc-section-card h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.doc-section-card p:last-child {
  margin-bottom: 0;
}

.doc-section-card ul, .doc-section-card ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.doc-section-card li {
  margin-bottom: 0.5rem;
  list-style-type: square;
}

/* Content Images Styling */
.doc-reader-body p img:only-of-type {
  max-width: 100%;
  max-height: 500px;
  height: auto;
  object-fit: contain;
  margin: 1.5rem auto;
  display: block;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.doc-reader-body p img:only-of-type:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.doc-reader-body p:has(img + img) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.doc-reader-body p:has(img + img) img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.doc-reader-body p:has(img + img) img:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.doc-reader-body blockquote {
  border-left: 3px solid var(--accent-color);
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1.5rem;
  font-style: italic;
  color: var(--text-muted);
}

.doc-magazine-image {
  width: 100%;
  margin: 1.5rem 0;
  display: block;
}

.doc-magazine-image img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.doc-magazine-image img:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
  .doc-section-card:nth-of-type(even) .doc-magazine-image {
    float: right;
    width: 42%;
    margin: 0.5rem 0 1.5rem 2.5rem;
  }
  
  .doc-section-card:nth-of-type(odd) .doc-magazine-image {
    float: left;
    width: 42%;
    margin: 0.5rem 2.5rem 1.5rem 0;
  }
  
  .doc-section-card::after {
    content: "";
    display: table;
    clear: both;
  }
}

/* Accessibility: Prefers-reduced-motion overrides */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-delay: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
    transform: none !important;
    scroll-snap-type: none !important;
  }
  html, body, .bento-container, .bento-grid {
    scroll-snap-type: none !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile Optimization & Responsive Bento Grid (under 768px) */
@media (max-width: 767px) {
  /* 1. RESPONSIVE BREAKDOWN & STACKING */
  html, body {
    width: 100%;
    overflow-x: hidden;
  }
  
  /* Unpin the desktop document reader sidebar and stack vertically */
  .doc-reader-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
  }
  
  .doc-reader-sidebar {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
  }
  
  /* Smoothly stack the grid layout vertically into a single column */
  .bento-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
  }
  
  .bento-card {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100% !important;
  }

  .video-card {
    min-height: auto !important;
    aspect-ratio: 1.7 / 1 !important;
  }

  .video-container video {
    top: -10% !important;
    height: 110% !important;
  }
  
  /* 2. MOBILE INTERFACE & TOUCH TARGETS */
  .bento-container {
    touch-action: pan-y !important;
    padding: 1.5rem 1rem !important;
  }
  
  /* Strict minimum tap target size of 48x48 CSS pixels & defensive spacing */
  .bento-card .text-link {
    min-height: 48px !important;
    min-width: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 0.75rem 1.25rem !important;
  }
  
  .hero-actions {
    gap: 1rem !important;
  }
  
  .bento-card .icon-nav-btn {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
  }
  
  .creations-nav-buttons, 
  .gallery-nav-buttons {
    gap: 0.75rem !important;
  }
  
  .bento-card .material-btn {
    min-height: 48px !important;
    min-width: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.75rem 1rem !important;
  }
  
  .material-selectors {
    gap: 0.75rem !important;
  }
  
  /* Form elements: strictly 48px target height & 16px input fonts to prevent iOS zoom */
  .bento-card .text-input,
  .bento-card .select-input {
    min-height: 48px !important;
    font-size: 1rem !important;
    box-sizing: border-box !important;
  }
  
  .bento-card .textarea-input {
    min-height: 96px !important;
    font-size: 1rem !important;
    box-sizing: border-box !important;
  }
  
  .bento-card .solid-btn {
    min-height: 48px !important;
    min-width: 48px !important;
    padding: 0.9rem 1.5rem !important;
    box-sizing: border-box !important;
  }
  
  .solid-state-form {
    gap: 1.25rem !important;
  }
  
  .form-row {
    gap: 1.25rem !important;
  }
  
  .form-field {
    gap: 0.5rem !important;
  }
  
  /* Header adjustments for mobile touch safety */
  .system-controls {
    gap: 0.5rem !important;
  }
  
  .site-header .control-btn {
    width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 0 !important;
  }
  
  .site-header .control-btn .btn-text {
    display: none !important;
  }
  
  /* 3. BOUNCE-SNAP TEXT PROTECTION */
  html, body {
    scroll-snap-type: y proximity !important;
    scroll-padding-top: 1rem !important;
  }
  
  .bento-card {
    scroll-snap-align: start !important;
    scroll-snap-stop: normal !important;
  }
}

/* Floating Site Version Tag (Bottom Right) */
.site-version-tag {
  position: fixed;
  bottom: 0.75rem;
  right: 1rem;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  opacity: 0.5;
  z-index: 10000;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.site-version-tag:hover {
  opacity: 1;
}




