/* TESSERACT HEALTH — TESSERACTCUSTOM™
 * Custom typeface spec: ultra-thin geometric grotesque
 * Single weight (300), single style, all-caps native.
 * Built for: Hedi Slimane Dior-era DNA × Bauhaus geometry × Vignelli discipline.
 * Letterspacing is wide by default (-0.02em at display, 0.18em+ at small caps).
 *
 * This file is the FALLBACK / BRIEF. The real font would be commissioned from
 * a type designer. For this mockup we use a free Google Fonts alternative —
 * "Inter Tight" weight 200, all-caps with letter-spacing — which captures
 * the same vertical, cold, architectural feel.
 *
 * To swap in the real custom font later:
 * 1. Replace the @font-face block with the real .woff2 files (drop at /assets/fonts/)
 * 2. The rest of the CSS will continue to work unchanged because it references
 *    the custom property --font-display, not Inter directly.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@200;300;400&family=Söhne&display=swap');

@font-face {
  font-family: 'TesseractCustom';
  src: local('Inter Tight Light'), local('InterTight-Light');
  font-weight: 200 300;
  font-style: normal;
  font-display: swap;
  /* placeholder — real TesseractCustom™ file drops here when commissioned */
}

:root {
  --font-display: 'TesseractCustom', 'Inter Tight', 'Helvetica Neue', sans-serif;
  --font-body: 'Söhne', 'Inter Tight', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* Slimane tracking defaults */
  --track-eyebrow: 0.42em;
  --track-display: 0.18em;
  --track-body: -0.005em;
  --track-caps: 0.18em;

  /* Palette — Slimane Dior-era monochrome + ONE warm accent */
  --paper: #FBF9F1;       /* warm bone */
  --ink: #0a0a0a;          /* near-black */
  --ink-soft: #1a1816;
  --ink-muted: #6e6a64;
  --ink-line: rgba(10,10,10,0.18);
  --accent: #b08d5c;       /* rose-gold (PBI doctrine) */
  --accent-soft: rgba(176, 141, 92, 0.18);
  --warm-bg: #ECECEC;       /* alternate register */
  --warm-text: #262523;

  /* Sizing — monumental */
  --step--1: clamp(0.78rem, 0.74rem + 0.18vw, 0.86rem);
  --step-0: clamp(0.94rem, 0.88rem + 0.3vw, 1.06rem);
  --step-1: clamp(1.18rem, 1.05rem + 0.6vw, 1.45rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  --step-3: clamp(2.4rem, 1.8rem + 3vw, 4.4rem);
  --step-4: clamp(4rem, 2.6rem + 7vw, 9rem);
  --step-5: clamp(6rem, 3rem + 14vw, 14rem);
}

/* Base reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--ink); color: var(--paper); }
body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--step-0);
  line-height: 1.5;
  letter-spacing: var(--track-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

/* Typography */
h1, h2, h3, h4, .display, .eyebrow, .label, .nav a, .button, button, input, textarea, select {
  font-family: var(--font-display);
  font-weight: 200;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
}

.display-xl {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: var(--step-5);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.display-l {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: var(--step-4);
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}
.display-m {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: var(--step-3);
  line-height: 1.02;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.display-s {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: var(--step-2);
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.eyebrow {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step--1);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
}
.label {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step--1);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-muted);
}
.lead {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--step-1);
  line-height: 1.4;
  letter-spacing: -0.005em;
  max-width: 64ch;
}

/* Links & nav */
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.nav {
  display: flex;
  gap: clamp(1rem, 2.5vw, 3rem);
  align-items: center;
}
.nav a, .nav span {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step--1);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
}

/* Layout primitives */
.frame {
  width: min(100%, 1400px);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}
.section {
  padding: clamp(4rem, 9vw, 11rem) 0;
  position: relative;
}
.divider {
  height: 1px;
  background: var(--ink-line);
  margin: 0;
}
.rule-soft {
  height: 1px;
  background: rgba(251,249,241,0.12);
}

/* Hero */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 4vw, 3rem) clamp(2rem, 4vw, 3rem);
  position: relative;
  overflow: hidden;
}
.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.hero-mid {
  align-self: center;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
.hero-mid .display-xl { max-width: 14ch; }
.hero-foot {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
}

/* Editorial columns */
.editorial {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
}
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
@media (max-width: 800px) {
  .col-4, .col-6, .col-8 { grid-column: span 12; }
}

/* Asymmetric block */
.asym {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
@media (max-width: 800px) { .asym { grid-template-columns: 1fr; } }

/* Cards */
.card {
  border: 1px solid rgba(251,249,241,0.14);
  padding: clamp(1.25rem, 2vw, 2rem);
  background: rgba(251,249,241,0.02);
  position: relative;
  transition: border-color 200ms ease, background 200ms ease;
}
.card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.card .eyebrow { display: block; margin-bottom: 0.75rem; }
.card h3 {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: var(--step-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.75rem;
  line-height: 1.05;
}

/* Buttons */
.button, button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: transparent;
  border: 1px solid var(--paper);
  color: var(--paper);
  padding: 1rem 1.75rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step--1);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  cursor: pointer;
  transition: all 200ms ease;
}
.button:hover, button:hover {
  background: var(--paper);
  color: var(--ink);
}
.button--accent { border-color: var(--accent); color: var(--accent); }
.button--accent:hover { background: var(--accent); color: var(--ink); }
.button--ghost { border-color: var(--ink-line); color: var(--paper); }
.button--arrow::after {
  content: '→';
  font-family: var(--font-display);
  font-weight: 200;
  font-size: 1.2em;
}

/* Inputs */
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea, select {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink-line);
  color: var(--paper);
  padding: 0.85rem 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-0);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  width: 100%;
  outline: none;
  transition: border-color 200ms ease;
}
input:focus, textarea:focus, select:focus {
  border-bottom-color: var(--accent);
}
label {
  display: block;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step--1);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

/* Chat */
.chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 70vh;
  padding: clamp(2rem, 4vw, 4rem) clamp(1.25rem, 4vw, 3rem);
  max-width: 760px;
  margin: 0 auto;
  gap: 2rem;
}
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.bubble {
  max-width: 86%;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(251,249,241,0.18);
  font-size: var(--step-0);
}
.bubble.bot { align-self: flex-start; background: rgba(251,249,241,0.04); }
.bubble.user { align-self: flex-end; background: var(--accent-soft); border-color: var(--accent); }
.bubble .eyebrow { display: block; margin-bottom: 0.4rem; }
.bubble .bubble-body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--step-0);
  line-height: 1.5;
  letter-spacing: -0.005em;
  text-transform: none;
}
.chat-input {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}
.chat-input input { flex: 1; }

/* Red-flag banner */
.alert {
  border-left: 2px solid var(--accent);
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  background: rgba(176, 141, 92, 0.08);
  margin: 1rem 0;
}
.alert .label { color: var(--accent); margin-bottom: 0.5rem; }
.alert p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--step-0);
  margin: 0;
  text-transform: none;
  letter-spacing: -0.005em;
}

/* Clinic card */
.clinic-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--ink-line);
  align-items: center;
}
.clinic-card .num {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: var(--step-3);
  color: var(--ink-muted);
  line-height: 1;
}
.clinic-card .meta {
  display: grid;
  gap: 0.4rem;
}
.clinic-card .meta h3 {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: var(--step-2);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.clinic-card .meta .row {
  display: flex;
  gap: 1.5rem;
  font-size: var(--step--1);
  color: var(--ink-muted);
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
}
.clinic-card .distance {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 200;
  font-size: var(--step-2);
  color: var(--accent);
  line-height: 1;
}

/* Consent */
.consent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
}
.consent-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--ink-line);
  align-items: start;
}
.consent-item input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.2rem;
  accent-color: var(--accent);
}
.consent-item .label { display: block; margin-bottom: 0.4rem; }
.consent-item p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--step--1);
  margin: 0;
  text-transform: none;
  letter-spacing: -0.005em;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* Footer */
.footer {
  border-top: 1px solid var(--ink-line);
  padding: clamp(3rem, 6vw, 5rem) 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
}
.footer .col-4, .footer .col-6, .footer .col-12 { grid-column: span 4; }
.footer h4 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step--1);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 1rem;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.footer ul a { font-family: var(--font-body); font-weight: 300; font-size: var(--step--1); text-transform: none; letter-spacing: -0.005em; }

/* Disclaimer ribbon */
.disclaimer-ribbon {
  border-top: 1px solid var(--ink-line);
  border-bottom: 1px solid var(--ink-line);
  padding: 1.25rem 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step--1);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
}

/* Sub-cultural edge: single asymmetric detail per page */
.edge-marker::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  margin-left: 0.75rem;
  vertical-align: middle;
  transform: translateY(-2px);
}

/* Reveal animation (Moving-font doctrine) */
@keyframes drift {
  0%, 100% { letter-spacing: 0.18em; opacity: 1; }
  50% { letter-spacing: 0.22em; opacity: 0.92; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.moving-title {
  animation: drift 6s ease-in-out infinite;
}
.fade-in {
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.fade-in.d1 { animation-delay: 0.1s; }
.fade-in.d2 { animation-delay: 0.2s; }
.fade-in.d3 { animation-delay: 0.4s; }

/* Utility */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2.5rem; }
.mt-5 { margin-top: 4rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2.5rem; }
.flex { display: flex; gap: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--ink-muted); }
.accent { color: var(--accent); }