/* 
  Design System: Restrained Art Deco / Editorial
  Palette: Plum & Stone (light)
  Typography: Big Caslon / Tahoma
  Motion: Slide-in from left
*/

:root {
  --bg-canvas: #F5F1F2;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #F9F7F8;
  --text-primary: #25161D;
  --text-muted: #6E5E66;
  --accent-primary: #6D2147;
  --accent-secondary: #C78F5B;
  --border-subtle: #DDD2D6;

  --font-display: "Big Caslon", "Hoefler Text", Georgia, serif;
  --font-body: Tahoma, Geneva, sans-serif;

  --radius-card: 16px;
  --space-unit: 8px;

  --ease-kinetic: cubic-bezier(0.22, 0.61, 0.36, 1);
  --duration: 400ms;
}

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

html {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  line-height: 1.6;
  font-size: 16px;
  scroll-behavior: smooth;
  /* Faint dot grid, 5% opacity */
  background-image: radial-gradient(var(--text-muted) 1px, transparent 1px);
  background-size: 24px 24px;
}

body {
  margin: 0;
  padding: 0;
  overflow-wrap: anywhere;
  hyphens: auto;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin-top: 0;
  margin-bottom: calc(var(--space-unit) * 2);
  color: var(--text-primary);
}

h1 { font-size: 2.488rem; }
h2 { font-size: 2.074rem; }
h3 { font-size: 1.728rem; }
h4 { font-size: 1.44rem; }
h5 { font-size: 1.2rem; }

/* Uppercase tracked small heading (Dice #10) */
.heading-tracked {
  font-family: var(--font-body);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-unit);
  display: block;
}

p {
  margin-top: 0;
  margin-bottom: calc(var(--space-unit) * 3);
  color: var(--text-primary);
}

/* Links & Buttons */
a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: all var(--duration) var(--ease-kinetic);
}

a.text-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a.text-link:hover, a.text-link:focus-visible {
  text-decoration-thickness: 3px;
  color: var(--text-primary);
}

a:focus-visible, button:focus-visible, details:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 4px;
}

/* Solid pill button (Dice #9) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 3);
  background-color: var(--accent-primary);
  color: #FFFFFF;
  border: none;
  border-radius: 9999px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--duration) var(--ease-kinetic), transform var(--duration) var(--ease-kinetic);
}

.btn:hover, .btn:focus-visible {
  background-color: var(--text-primary);
  color: #FFFFFF;
  transform: translateY(-2px);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 calc(var(--space-unit) * 3);
}

.content-longform {
  max-width: 68ch;
  margin: 0 auto;
}

/* Header & Top Bar */
.top-bar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: calc(var(--space-unit)) calc(var(--space-unit) * 3);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: right;
}

.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: static;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--space-unit) * 2) 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-unit);
  font-family: var(--font-display);
  font-size: 1.44rem;
  color: var(--text-primary);
  text-decoration: none;
}

.brand svg {
  fill: var(--accent-primary);
  width: 32px;
  height: 32px;
}

.main-nav {
  display: flex;
  gap: calc(var(--space-unit) * 3);
}

.main-nav a {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
}

.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--space-unit);
}

.mobile-nav-panel {
  display: none;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: calc(var(--space-unit) * 2) calc(var(--space-unit) * 3);
}

.mobile-nav-panel.is-open {
  display: block;
}

.mobile-nav-panel a {
  display: block;
  padding: calc(var(--space-unit) * 1.5) 0;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-nav-panel a:last-child {
  border-bottom: none;
}

/* Hero Section (Offset image overlapping text block) */
.hero {
  padding: calc(var(--space-unit) * 8) 0;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--space-unit) * 6);
  align-items: center;
}

.hero-text {
  position: relative;
  z-index: 2;
  background-color: var(--bg-surface);
  padding: calc(var(--space-unit) * 4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  margin-right: calc(var(--space-unit) * -8);
}

.hero-image-wrapper {
  position: relative;
  z-index: 1;
}

.hero-image-wrapper img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-card);
  display: block;
}

/* Flat offset color block behind image (Dice #14) */
.img-offset {
  position: relative;
}
.img-offset::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 16px;
  right: -16px;
  bottom: -16px;
  background-color: var(--accent-secondary);
  border-radius: var(--radius-card);
  z-index: -1;
}

/* Secondary Card: Caption Plate */
.caption-plate {
  margin-bottom: calc(var(--space-unit) * 6);
}
.caption-plate img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-card);
  display: block;
  border: 1px solid var(--border-subtle);
}
.caption-plate figcaption {
  margin-top: calc(var(--space-unit) * 1.5);
  font-size: 0.875rem;
  color: var(--text-muted);
  border-left: 2px solid var(--accent-secondary);
  padding-left: calc(var(--space-unit) * 2);
}

/* Editorial Index / Layout */
.editorial-index {
  padding: calc(var(--space-unit) * 8) 0;
  border-top: 1px solid var(--border-subtle);
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: calc(var(--space-unit) * 4);
}

.index-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: calc(var(--space-unit) * 3);
  transition: background-color var(--duration) var(--ease-kinetic);
}
.index-item:hover {
  background-color: var(--bg-surface-hover);
}

.index-number {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent-secondary);
  display: block;
  margin-bottom: var(--space-unit);
}

/* Primary Card: Accordion */
.accordion-group {
  margin: calc(var(--space-unit) * 4) 0;
}
.accordion-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  margin-bottom: calc(var(--space-unit) * 2);
  overflow: hidden;
}
.accordion-item summary {
  padding: calc(var(--space-unit) * 2.5);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accordion-item summary::-webkit-details-marker {
  display: none;
}
.accordion-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--accent-primary);
}
.accordion-item[open] summary::after {
  content: "−";
}
.accordion-content {
  padding: 0 calc(var(--space-unit) * 2.5) calc(var(--space-unit) * 2.5);
  border-top: 1px solid var(--border-subtle);
  margin-top: calc(var(--space-unit) * -1);
  padding-top: calc(var(--space-unit) * 2);
}

/* Sections */
section {
  padding: calc(var(--space-unit) * 6) 0;
}
.divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: calc(var(--space-unit) * 4) 0;
  border: none;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: calc(var(--space-unit) * 4);
}
table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
th, td {
  padding: calc(var(--space-unit) * 2);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
th {
  background-color: var(--bg-canvas);
  font-family: var(--font-display);
  font-weight: 600;
}

/* Forms (Contact) */
.form-group {
  margin-bottom: calc(var(--space-unit) * 3);
}
label {
  display: block;
  margin-bottom: var(--space-unit);
  font-weight: 600;
}
input, textarea {
  width: 100%;
  padding: calc(var(--space-unit) * 1.5);
  border: 1px solid var(--border-subtle);
  border-radius: calc(var(--radius-card) / 2);
  font-family: var(--font-body);
  font-size: 1rem;
  background-color: var(--bg-surface);
  color: var(--text-primary);
}
.form-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-unit);
}

/* Footer (Minimal one-line) */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: calc(var(--space-unit) * 4) 0;
  margin-top: calc(var(--space-unit) * 8);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: calc(var(--space-unit) * 2);
}
.footer-links {
  display: flex;
  gap: calc(var(--space-unit) * 3);
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.footer-links a:hover {
  color: var(--accent-primary);
}
.footer-copy {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Motion (Slide-in from left) */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity var(--duration) var(--ease-kinetic), transform var(--duration) var(--ease-kinetic);
  }
  .reveal.reveal-visible {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .hero-text {
    margin-right: 0;
    margin-bottom: calc(var(--space-unit) * -4);
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-image-wrapper {
    order: -1;
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .footer-links {
    justify-content: center;
  }
}