/* ==========================================================================
   ENSEMBLE DESIGN SYSTEM
   Directly ported from Theme.swift & Masthead.swift
   Editorial Couturier's Paper Board Aesthetic
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  /* Ground & Surfaces */
  --color-screen: #F4F0E7;       /* Warm plaster paper ground */
  --color-card: #FBF8F1;         /* Raised oyster card / panel */
  --color-card-sunken: #EFE9DD;  /* Slightly sunken neutral for garments */
  --color-chip: #ECE5D8;         /* Neutral chalk chip */

  /* Inks & Text */
  --color-ink: #24201B;          /* Primary text: sepia near-black */
  --color-soft: #6E6455;         /* Secondary text: pencil taupe (AA verified) */
  --color-line: #E4DDCD;         /* Hairline rules and dividers */

  /* Brand Sapphire Accent */
  --color-accent: #2A55A8;       /* Deep sapphire accent */
  --color-accent-soft: #DDE4F3;  /* Soft sapphire wash for chips/pills */
  --color-accent-deep: #1B3A78;  /* Deep accent navy for high emphasis */
  --color-accent-hover: #22468F;

  /* Editorial Status & Intent */
  --color-positive: #53663C;     /* Worn, packed, complete: deep olive */
  --color-positive-soft: #E3E7D6;/* Pale olive wash */
  --color-caution: #9A5518;      /* Weather note, attention: burnt amber */
  --color-caution-soft: #F0E3D2; /* Pale amber wash */

  /* Typography Families */
  --font-editorial: Didot, "Didot LT STD", "Playfair Display", "Cormorant Garamond", "Bodoni MT", Georgia, serif;
  --font-serif-subtle: "Cormorant Garamond", Didot, Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", Menlo, Monaco, Consolas, monospace;

  /* Type Scale */
  --text-hero: clamp(2.75rem, 5.5vw, 4.5rem);
  --text-title-xl: clamp(2rem, 3.5vw, 2.75rem);
  --text-title: clamp(1.4rem, 2.2vw, 1.85rem);
  --text-title-s: 1.25rem;
  --text-body-lg: 1.15rem;
  --text-body: 1rem;
  --text-subheadline: 0.9375rem;
  --text-footnote: 0.8125rem;
  --text-caption: 0.75rem;
  --text-caption-sm: 0.6875rem;

  /* Spacing Rhythm (from Theme.Space) */
  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 12px;
  --space-l: 16px;
  --space-xl: 24px;
  --space-section: 36px;
  --space-block: 64px;
  --space-block-lg: 100px;

  /* Content Widths */
  --content-max-width: 1160px;
  --content-reading-width: 680px;

  /* Corner Radii (from Theme.Radius) */
  --radius-thumb: 10px;
  --radius-control: 12px;
  --radius-tile: 14px;
  --radius-card: 18px;
  --radius-pill: 9999px;

  /* Subtle Editorial Shadows & Paper Depth */
  --shadow-subtle: 0 1px 3px rgba(36, 32, 27, 0.04), 0 1px 2px rgba(36, 32, 27, 0.02);
  --shadow-card: 0 4px 16px -2px rgba(36, 32, 27, 0.05), 0 2px 6px -1px rgba(36, 32, 27, 0.03);
  --shadow-floating: 0 20px 40px -10px rgba(36, 32, 27, 0.09), 0 8px 16px -4px rgba(36, 32, 27, 0.04);
  --shadow-device: 0 30px 60px -12px rgba(36, 32, 27, 0.18), 0 12px 24px -6px rgba(36, 32, 27, 0.1);

  /* Transitions */
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Foundations */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--color-screen);
  color: var(--color-ink);
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-screen);
  color: var(--color-ink);
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Didot Drop-Cap Ensemble Mark */
.ensemble-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: var(--color-screen);
  font-family: var(--font-editorial);
  font-weight: 700;
  border-radius: calc(var(--mark-size, 32px) * 0.16);
  width: var(--mark-size, 32px);
  height: var(--mark-size, 32px);
  font-size: calc(var(--mark-size, 32px) * 0.74);
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(42, 85, 168, 0.25);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.ensemble-mark span {
  transform: translateY(-2%);
}

.ensemble-mark:hover {
  background-color: var(--color-accent-deep);
}

/* Paper Card Container */
.paper-card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-line);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.paper-card:hover {
  border-color: rgba(42, 85, 168, 0.22);
}

/* Editorial Pills and Chips */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-footnote);
  font-weight: 500;
  letter-spacing: 0.01em;
  background: var(--color-chip);
  color: var(--color-soft);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.pill.accent {
  background: var(--color-accent-soft);
  color: var(--color-accent-deep);
  font-weight: 600;
}

.pill.positive {
  background: var(--color-positive-soft);
  color: var(--color-positive);
  font-weight: 600;
}

.pill.caution {
  background: var(--color-caution-soft);
  color: var(--color-caution);
  font-weight: 600;
}

/* Primary Button with Paper Couture Feel */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  padding: 12px 24px;
  background-color: var(--color-accent);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: var(--text-subheadline);
  font-weight: 600;
  border-radius: var(--radius-control);
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(42, 85, 168, 0.25);
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--color-accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(27, 58, 120, 0.32);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  padding: 12px 22px;
  background-color: var(--color-card);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--text-subheadline);
  font-weight: 500;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-subtle);
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: #FFFFFF;
  border-color: var(--color-soft);
  transform: translateY(-1px);
}

/* Eyebrow Label */
.eyebrow {
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
  display: inline-block;
}

/* Masthead Rule */
.masthead-rule {
  width: 100%;
  height: 1px;
  background-color: var(--color-ink);
  margin: var(--space-m) 0;
}

.soft-rule {
  width: 100%;
  height: 1px;
  background-color: var(--color-line);
  margin: var(--space-m) 0;
}
