/* Rankpantryrooms.sbs - Clean Crisp White & Modern Tech Stylesheet - Purple Edition */
:root {
  --bg-core: #ffffff;
  --bg-surface: #faf8fd;
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --border-subtle: #ede9fe;
  --border-accent: rgba(124, 58, 237, 0.45);
  --border-glow: rgba(124, 58, 237, 0.2);
  --accent-purple: #7c3aed;
  --accent-purple-hover: #6d28d9;
  --accent-purple-muted: #ede9fe;
  --accent-purple-soft: rgba(124, 58, 237, 0.08);
  /* Aliased for theme transitions */
  --accent-lime: #7c3aed;
  --accent-lime-hover: #6d28d9;
  --accent-lime-muted: #ede9fe;
  --accent-lime-soft: rgba(124, 58, 237, 0.08);
  --text-silver: #475569;
  --text-warm-white: #0f172a;
  --text-dim: #64748b;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --space-4: 4px;
  --space-8: 8px;
  --space-16: 16px;
  --space-24: 24px;
  --space-40: 40px;
  --space-64: 64px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-core);
}

body {
  font-family: var(--font-sans);
  color: var(--text-warm-white);
  background-color: var(--bg-core);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Headings & Word Wrap */
h1, h2, h3, h4, h5, h6, .brand-text, .nav-link {
  overflow-wrap: anywhere;
  color: var(--text-warm-white);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: var(--space-24); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); margin-bottom: var(--space-24); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); margin-bottom: var(--space-16); }
p { margin-bottom: var(--space-16); color: var(--text-silver); }

a {
  color: var(--accent-purple);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-purple-hover);
  text-decoration: underline;
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 3px;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-24);
  padding-right: var(--space-24);
  min-width: 0;
}

.section {
  padding-top: var(--space-64);
  padding-bottom: var(--space-64);
}

/* Header (Non-sticky) */
.site-header {
  position: relative;
  height: 64px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--text-warm-white);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand-wrapper:hover {
  text-decoration: none;
  color: var(--accent-purple);
}

.brand-logo-svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.brand-text {
  overflow-wrap: anywhere;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: var(--space-24);
}

.nav-link {
  color: var(--text-silver);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-purple);
  text-decoration: none;
}

.nav-cta {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.nav-cta:hover {
  opacity: 0.92;
  color: #ffffff;
  text-decoration: none;
}

/* Hamburger Overlay below 768px */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-warm-white);
  padding: 6px 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-overlay {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.08);
  padding: var(--space-24);
  flex-direction: column;
  gap: var(--space-16);
}

.mobile-overlay.is-visible {
  display: flex;
}

/* Card Style: Row layout one after another */
.cards-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  margin-top: var(--space-40);
}

.data-grid-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: grid;
  grid-template-columns: 260px 1fr;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
}

.data-grid-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 10px 26px rgba(124, 58, 237, 0.12);
  transform: translateY(-2px);
}

/* Card Data Header (Left rail in row format) */
.card-data-header {
  background: #faf8fd;
  border-right: 1px solid var(--border-subtle);
  border-bottom: none;
  padding: var(--space-24) var(--space-16);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-16);
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent-purple);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.card-body {
  padding: var(--space-24) var(--space-32, 28px);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: var(--space-16);
  justify-content: center;
}

.card-title {
  font-size: 1.35rem;
  margin: 0;
}

.card-text {
  font-size: 0.9375rem;
  color: var(--text-silver);
  margin: 0;
  flex-grow: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.tag-pill {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: var(--accent-purple-soft);
  color: var(--accent-purple);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(124, 58, 237, 0.2);
  font-weight: 500;
}

.card-action {
  align-self: flex-start;
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: var(--space-64) 0;
  background: radial-gradient(circle at 50% 15%, rgba(124, 58, 237, 0.08) 0%, transparent 65%), #ffffff;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: 6px 14px;
  background: var(--accent-purple-soft);
  border: 1px solid var(--border-accent);
  border-radius: 9999px;
  color: var(--accent-purple);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: var(--space-24);
}

.hero-title {
  max-width: 900px;
}

.hero-subtitle {
  font-size: 1.125rem;
  max-width: 780px;
  color: var(--text-silver);
  margin-bottom: var(--space-40);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover {
  opacity: 0.93;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-warm-white);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.btn-secondary:hover {
  background: #faf8fd;
  border-color: var(--accent-purple);
  color: var(--text-warm-white);
  text-decoration: none;
}

/* Feature/Content Sections */
.info-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-40);
  margin-top: var(--space-40);
}

.prose-block {
  margin-bottom: var(--space-40);
}

.prose-block p {
  font-size: 1.05rem;
  line-height: 1.75;
}

.prose-block ul, .prose-block ol {
  margin-left: var(--space-24);
  margin-bottom: var(--space-24);
  color: var(--text-silver);
}

.prose-block li {
  margin-bottom: var(--space-8);
  line-height: 1.6;
}

/* Technical Data Tables & Code Displays */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: var(--space-24) 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9375rem;
}

.data-table th, .data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  min-width: 120px;
}

.data-table th {
  background: #faf8fd;
  color: var(--text-warm-white);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table tr:last-child td {
  border-bottom: none;
}

pre {
  background: #faf8fd;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-warm-white);
}

/* Contact & Forms */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-40);
  margin-top: var(--space-40);
}

.contact-form {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-40);
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-warm-white);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-warm-white);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-purple);
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-input.is-invalid, .form-textarea.is-invalid {
  border-color: #ef4444;
}

.field-error {
  font-size: 0.75rem;
  color: #dc2626;
  display: none;
}

.field-error.is-visible {
  display: block;
}

.form-success-message {
  display: none;
  background: #faf5ff;
  border: 1px solid #7c3aed;
  color: #5b21b6;
  padding: var(--space-16);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
}

.form-success-message.is-visible {
  display: block;
}

.contact-info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-40);
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.map-placeholder {
  width: 100%;
  height: 240px;
  background: #faf8fd;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Timeline component */
.timeline-list {
  position: relative;
  margin-top: var(--space-40);
  border-left: 2px solid rgba(124, 58, 237, 0.35);
  padding-left: var(--space-24);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-40);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-24) - 5px);
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-purple);
  box-shadow: 0 0 6px rgba(124, 58, 237, 0.6);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-purple);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.timeline-title {
  font-size: 1.15rem;
  margin-bottom: var(--space-8);
}

/* Site Footer */
.site-footer {
  margin-top: auto;
  background: #faf8fd;
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-64) 0 var(--space-40) 0;
  color: var(--text-silver);
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-40);
  margin-bottom: var(--space-40);
}

.footer-col h4 {
  color: var(--text-warm-white);
  font-size: 1rem;
  margin-bottom: var(--space-16);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.footer-links a {
  color: var(--text-silver);
}

.footer-links a:hover {
  color: var(--accent-purple);
}

.footer-bottom {
  padding-top: var(--space-24);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-16) var(--space-24);
  z-index: 9999;
  box-shadow: 0 -4px 24px rgba(124, 58, 237, 0.08);
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

.cookie-text {
  flex: 1 1 300px;
  font-size: 0.875rem;
  color: var(--text-silver);
  margin-bottom: 0;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.cookie-btn {
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.cookie-btn-primary {
  background: var(--accent-purple);
  color: #ffffff;
}

.cookie-btn-primary:hover {
  background: var(--accent-purple-hover);
}

.cookie-btn-secondary {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--text-warm-white);
}

.cookie-btn-secondary:hover {
  background: #e2e8f0;
}

/* Modal Preferences */
.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
}

.cookie-modal-backdrop[hidden] {
  display: none !important;
}

.cookie-modal {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-24);
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(124, 58, 237, 0.15);
}

.cookie-modal h3 {
  margin-bottom: var(--space-16);
}

.preference-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-16);
  margin-bottom: var(--space-16);
  padding-bottom: var(--space-16);
  border-bottom: 1px solid var(--border-subtle);
}

/* Responsive Rules down to 320px */
@media (max-width: 900px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: 50px;
  }
  .primary-nav {
    display: none;
  }
  .mobile-nav-toggle {
    display: flex;
  }
  .data-grid-card {
    grid-template-columns: 1fr;
  }
  .card-data-header {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: var(--space-16);
  }
  .info-panel {
    padding: var(--space-24);
  }
  .contact-form, .contact-info-card {
    padding: var(--space-24);
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: var(--space-16);
    padding-right: var(--space-16);
  }
  .card-data-header {
    grid-template-columns: 1fr;
  }
  .btn-primary, .btn-secondary {
    width: 100%;
  }
  .cookie-actions {
    flex-direction: column;
    width: 100%;
  }
  .cookie-btn {
    width: 100%;
    text-align: center;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}