/* Semax Source — Ceramica Wabi-Sabi aesthetic
   Dark kiln-fired clay ground (#262019), kintsugi gold accents (#C9962E)
   Spectral (serif) + Public Sans (sans) */

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --primary: #C9962E;
  --primary-50: #F6ECD3;
  --primary-900: #5C4310;
  --secondary: #7C8A45;
  --accent: #C28B72;
  --neutral-50: #F3EFE9;
  --neutral-200: #CFC8BC;
  --neutral-500: #8B8680;
  --neutral-900: #1A150F;
  --bg: #262019;
  --surface: #322A20;
  --surface-raised: #3C3024;
  --text: #F1EADD;
  --text-muted: #B4A892;
  --success: #7C8A45;
  --warning: #C9962E;
  --danger: #C0584A;
  --border: rgba(201, 150, 46, 0.18);
  --border-muted: rgba(209, 196, 184, 0.12);
  --max-width: 70rem;
  --container-px: clamp(1rem, 3vw, 2.25rem);
  --font-heading: 'Spectral', Georgia, 'Times New Roman', serif;
  --font-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius-btn: 2px 10px 2px 10px;
  --radius-card: 4px 14px 4px 14px;
  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.32);
  --transition: 180ms ease-out;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body, 1.0625rem);
  line-height: 1.7;
  min-height: 100vh;
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(201, 150, 46, 0.4);
  text-underline-offset: 3px;
  transition: color var(--transition), text-decoration-color var(--transition);
}

a:hover, a:focus-visible {
  color: var(--primary-50);
  text-decoration-color: var(--primary);
}

ul, ol {
  list-style: none;
}

/* ============================================================
   TYPOGRAPHY SCALE
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.14;
  font-weight: 800;
  color: var(--text);
}

h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: -0.01em;
  font-weight: 600;
}

h3 {
  font-size: 1.4rem;
  font-weight: 600;
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
}

p {
  margin-bottom: 1.1em;
  max-width: 70ch;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 700;
  color: var(--text);
}

em {
  font-style: italic;
}

small {
  font-size: 0.875rem;
  color: var(--text-muted);
}

sup {
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
}

sup a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  padding: 0 1px;
}

sup a:hover {
  color: var(--primary-50);
}

/* ============================================================
   KINTSUGI SEAM DIVIDER
   ============================================================ */
.kintsugi-rule {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--primary) 20%,
    rgba(201, 150, 46, 0.7) 50%,
    var(--primary) 80%,
    transparent 100%
  );
  margin: 2.5rem 0;
}

/* ============================================================
   LAYOUT / CONTAINER
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

.container--narrow {
  max-width: 52rem;
}

/* Asymmetric content offset — content column 7/12, gutter 4/12 on large */
.content-offset {
  padding-left: 0;
}

@media (min-width: 1024px) {
  .content-offset {
    padding-left: 6%;
    padding-right: 2%;
  }
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(38, 32, 25, 0.93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.75rem;
}

.site-brand {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.site-brand:hover {
  color: var(--primary);
  text-decoration: none;
}

/* Gold hairline underline beneath header */
.site-header::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary) 30%, var(--primary) 70%, transparent);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0.6;
}

/* ============================================================
   PRIMARY NAVIGATION
   ============================================================ */
.site-nav {
  display: none;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  transition: color var(--transition);
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 1.75rem;
  height: 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 1px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem var(--container-px) 1.5rem;
}

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

.mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav a {
  display: block;
  padding: 0.6rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border-muted);
  transition: color var(--transition);
}

.mobile-nav a:hover {
  color: var(--primary);
  text-decoration: none;
}

@media (min-width: 768px) {
  .site-nav {
    display: block;
  }

  .nav-toggle {
    display: none;
  }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

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

  .hero {
    padding: 5rem 0 4rem;
  }
}

@media (min-width: 1024px) {
  .hero-inner {
    grid-template-columns: 7fr 5fr;
    gap: 4rem;
  }
}

.hero-content {
  max-width: 52ch;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin-bottom: 1rem;
}

.hero h1 {
  margin-bottom: 1.25rem;
  font-style: italic;
  font-weight: 600;
}

.hero .subheadline {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 54ch;
  margin-bottom: 2rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Hero figure — organic mask */
.hero-figure {
  position: relative;
}

.hero-figure img {
  width: 100%;
  border-radius: 6px 24px 6px 18px;
  object-fit: cover;
  aspect-ratio: 4/3;
}

@media (min-width: 768px) {
  .hero-figure img {
    aspect-ratio: auto;
    max-height: 420px;
  }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  border-radius: var(--radius-btn);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  line-height: 1;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--primary);
  color: var(--neutral-900);
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(201, 150, 46, 0.25);
}

.btn-primary:hover {
  background: var(--primary-50);
  color: var(--neutral-900);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(201, 150, 46, 0.35);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(201, 150, 46, 0.1);
  color: var(--primary-50);
  border-color: var(--primary-50);
  transform: translateY(-1px);
  text-decoration: none;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
main {
  padding-bottom: 4rem;
}

/* Page hero / breadcrumb area for inner pages */
.page-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.page-hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.page-hero .page-desc {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 60ch;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb-sep {
  opacity: 0.5;
  font-size: 0.75rem;
}

/* ============================================================
   SECTION STYLES
   ============================================================ */
.content-section {
  padding: 2.5rem 0;
}

.content-section + .content-section {
  border-top: 1px solid var(--border-muted);
}

.content-section h2 {
  margin-bottom: 1.25rem;
  color: var(--text);
  font-style: italic;
}

.content-section h2::before {
  content: '';
  display: block;
  height: 2px;
  width: 2.5rem;
  background: var(--primary);
  margin-bottom: 0.6rem;
}

.content-section h3 {
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
}

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

.content-section p:has(strong),
.content-section p strong {
  color: var(--text);
}

/* Section with image */
.section-with-image {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .section-with-image {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 3rem;
  }
}

.section-image {
  border-radius: 4px 16px 4px 12px;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 3/2;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.6rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

/* Crackle-glaze top edge detail */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 30%, rgba(201,150,46,0.4) 60%, transparent 100%);
}

.card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
}

.card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
}

.card-grid {
  display: grid;
  gap: 1.25rem;
}

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

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

/* Summary cards on index */
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.4rem;
  box-shadow: var(--shadow-card);
  position: relative;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 30%, rgba(201,150,46,0.4) 60%, transparent 100%);
}

.summary-card .card-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-decoration: none;
  display: block;
  transition: color var(--transition);
}

.summary-card .card-heading:hover {
  color: var(--primary-50);
  text-decoration: none;
}

.summary-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  max-width: none;
}

/* ============================================================
   CALLOUT (left gold rule)
   ============================================================ */
.callout {
  background: var(--surface-raised);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  font-style: italic;
  color: var(--text);
  font-size: 1.05rem;
}

.callout-caveat {
  background: rgba(194, 139, 114, 0.08);
  border-left-color: var(--accent);
}

/* ============================================================
   FAQ ACCORDION
   ============================================================ */
.faq-group {
  margin-bottom: 2.5rem;
}

.faq-group-heading {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border-muted);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 1.1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  transition: color var(--transition);
}

.faq-question:hover {
  color: var(--primary);
}

.faq-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  position: relative;
  color: var(--primary);
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background: currentColor;
  transition: transform var(--transition), opacity var(--transition);
}

.faq-icon::before {
  width: 100%;
  height: 1px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.faq-icon::after {
  width: 1px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.faq-question[aria-expanded="true"] .faq-icon::after {
  transform: translateX(-50%) rotate(90deg);
  opacity: 0;
}

.faq-answer {
  overflow: hidden;
  max-height: 0;
  transition: max-height 240ms ease-out;
}

.faq-answer.is-open {
  max-height: 600px;
}

.faq-answer-inner {
  padding: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.9625rem;
  line-height: 1.7;
}

/* ============================================================
   REFERENCES LIST
   ============================================================ */
.references-list {
  list-style: none;
  counter-reset: ref;
}

.references-list li {
  counter-increment: ref;
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.references-list li::before {
  content: counter(ref);
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  min-width: 1.75rem;
  text-align: right;
  padding-top: 0.05em;
}

.references-list a {
  color: var(--primary);
}

/* ============================================================
   CONTACT FORM
   ============================================================ */
.contact-form {
  display: grid;
  gap: 1.25rem;
  max-width: 42rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input,
.form-textarea,
.form-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px 8px 2px 8px;
  padding: 0.7rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 150, 46, 0.15);
}

.form-textarea {
  min-height: 9rem;
  resize: vertical;
}

.form-disclaimer {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 2rem;
  position: relative;
}

/* Kintsugi seam across the top of footer */
.site-footer::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--primary) 15%,
    rgba(201, 150, 46, 0.5) 50%,
    var(--primary) 85%,
    transparent 100%
  );
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.footer-disclaimer {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 2.5rem;
  max-width: 60ch;
  line-height: 1.6;
}

.footer-columns {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

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

.footer-col-heading {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-nav a {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid var(--border-muted);
  padding-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ============================================================
   UTILITY
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

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

.text-gold {
  color: var(--primary);
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* ============================================================
   404 PAGE
   ============================================================ */
.not-found {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem var(--container-px);
}

.not-found h1 {
  font-size: clamp(4rem, 10vw, 8rem);
  color: var(--primary);
  line-height: 1;
  margin-bottom: 1rem;
  font-style: italic;
  opacity: 0.7;
}

.not-found p {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: none;
}

/* ============================================================
   TIPPY THEME OVERRIDE
   ============================================================ */
.tippy-box[data-theme~='semax'] {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1.55;
  max-width: 320px;
}

.tippy-box[data-theme~='semax'] .tippy-arrow {
  color: var(--surface-raised);
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .faq-answer {
    transition: none;
  }
}

/* ============================================================
   CONTACT LISTS
   ============================================================ */
.contact-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.contact-list li {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.65;
}

.contact-list--no {
  margin-bottom: 1.5rem;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header,
  .nav-toggle,
  .mobile-nav,
  .site-footer { display: none; }
  body { background: white; color: black; }
  a { color: inherit; text-decoration: underline; }
}
