:root {
  --bg-canvas: #f3f0fa;
  --bg-surface: #e4ddf4;
  --bg-surface-card: #f9f7fc;
  --bg-surface-hover: #dbd2ee;
  --text-primary: #334155;
  --text-muted: #596579;
  --accent-navy: #1e2a5a;
  --accent-navy-hover: #151e40;
  --accent-crimson: #9e2a2b;
  --accent-amber: #d97706;
  --border-subtle: #d3c7ea;
  --border-strong: #b9a7db;
  --radius-pill: 9999px;
  --radius-card: 20px;
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 10px 24px -4px rgba(30, 42, 90, 0.08);
  --shadow-hover: 0 16px 32px -6px rgba(30, 42, 90, 0.16);
  --font-serif: "Charter", "Bitstream Charter", "Sitka Text", "Cambria", Georgia, serif;
}

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

body {
  font-family: var(--font-serif);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
  hyphens: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Pill Nav */
.header-wrapper {
  padding: 1.25rem 1rem 0.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.floating-header {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-elevation);
}

.brand-anchor {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--accent-navy);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-navy);
  color: #f3f0fa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: bold;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-desktop a {
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s var(--ease-kinetic);
}

.nav-desktop a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--accent-navy);
  transition: width 0.3s var(--ease-kinetic);
}

.nav-desktop a:hover::after,
.nav-desktop a.active::after {
  width: 100%;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--accent-navy);
}

.menu-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  color: var(--accent-navy);
  font-size: 1.3rem;
  line-height: 1;
}

.nav-mobile-dropdown {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  margin-top: 0.75rem;
  padding: 1rem;
  box-shadow: var(--shadow-elevation);
}

.nav-mobile-dropdown.open {
  display: block;
}

.nav-mobile-dropdown ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nav-mobile-dropdown a {
  text-decoration: none;
  color: var(--accent-navy);
  font-weight: 600;
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: #f9f7fc;
}

/* Layout Utilities */
main {
  flex: 1 0 auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.prose-cap {
  max-width: 70ch;
  margin: 0 auto;
}

.small-caps {
  font-variant: all-small-caps;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent-navy);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-navy);
  color: #f3f0fa;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-navy);
  color: #f3f0fa;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-elevation);
  transition: transform 0.2s var(--ease-kinetic), background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background: var(--accent-navy-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Hero Section */
.hero-block {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2rem 0 3.5rem;
}

.hero-content h1 {
  font-size: clamp(2rem, 3.5vw, 2.9rem);
  line-height: 1.15;
  color: var(--accent-navy);
  margin-bottom: 1rem;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.floating-rule-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  box-shadow: var(--shadow-elevation);
  position: relative;
}

.floating-rule-card h3 {
  color: var(--accent-navy);
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
}

.floating-rule-card ol {
  padding-left: 1.25rem;
  color: var(--text-primary);
}

.floating-rule-card li {
  margin-bottom: 0.65rem;
}

.hero-image-wrap {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-elevation);
  background: var(--bg-surface);
}

.hero-image-wrap img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
}

/* Timeline Vertical Spine */
.timeline-stream {
  position: relative;
  max-width: 860px;
  margin: 3rem auto 0;
  padding-left: 2.5rem;
}

.timeline-stream::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 20px;
  left: 11px;
  width: 2px;
  background: var(--border-strong);
}

.timeline-node {
  position: relative;
  margin-bottom: 3.5rem;
}

.timeline-marker {
  position: absolute;
  left: -2.5rem;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-navy);
  color: #fff;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 0 0 4px var(--bg-canvas);
}

.timeline-card {
  background: var(--bg-surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: var(--shadow-elevation);
  transition: transform 0.25s var(--ease-kinetic), box-shadow 0.25s var(--ease-kinetic);
}

.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.timeline-card h2 {
  font-size: 1.55rem;
  color: var(--accent-navy);
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
}

.symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.symbol-item {
  background: var(--bg-surface);
  border-radius: 14px;
  padding: 1.25rem;
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.symbol-glyph-box {
  font-size: 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  color: var(--accent-navy);
}

.symbol-item h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--accent-navy);
}

.symbol-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Interactive Decoder Tool */
.decoder-panel {
  background: #fdfcff;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-card);
  padding: 2rem;
  margin: 3rem 0;
}

.decoder-tag-simulation {
  background: #fff;
  border: 1px solid #d3c7ea;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 650px;
  margin: 1.5rem auto 0;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.03);
}

.tag-selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.tag-choice-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--accent-navy);
  transition: all 0.2s ease;
}

.tag-choice-btn:hover,
.tag-choice-btn.active {
  background: var(--accent-navy);
  color: #fff;
  border-color: var(--accent-navy);
}

.decoder-output {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
  margin-top: 1rem;
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

/* General Content & Card Grids */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.75rem;
  margin: 2.5rem 0;
}

.content-card {
  background: var(--bg-surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  box-shadow: var(--shadow-elevation);
  display: flex;
  flex-direction: column;
}

.content-card h3 {
  font-size: 1.3rem;
  color: var(--accent-navy);
  margin-bottom: 0.75rem;
}

.content-card p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.image-card-visual {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  background-color: var(--bg-surface);
}

.data-table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: #fff;
}

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

table.textile-table th,
table.textile-table td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
}

table.textile-table th {
  background: var(--bg-surface);
  color: var(--accent-navy);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 2rem 0;
}

.faq-item {
  background: var(--bg-surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.75rem;
}

.faq-item h3 {
  color: var(--accent-navy);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.faq-item p {
  color: var(--text-primary);
}

/* Contact Module */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 2rem;
}

.contact-card, .contact-form-panel {
  background: var(--bg-surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: var(--shadow-elevation);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--accent-navy);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
}

.form-control:focus {
  outline: 2px solid var(--accent-navy);
  border-color: transparent;
}

/* Curved Seam Footer */
.footer-seam {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 1rem 2.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.footer-top h4 {
  color: var(--accent-navy);
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.footer-top ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-top a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-top a:hover {
  color: var(--accent-navy);
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-domain {
  font-weight: bold;
  color: var(--accent-navy);
  text-decoration: none;
}

/* Responsive Rules */
@media (max-width: 768px) {
  .nav-desktop {
    display: none;
  }
  .menu-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .hero-block {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .hero-image-wrap img {
    height: 250px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .timeline-stream {
    padding-left: 2rem;
  }
  .timeline-marker {
    left: -2rem;
  }
}

@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
