/* CourzaTT — editorial atlas aesthetic */

:root {
  --paper: #F4EFE3;
  --paper-2: #EDE7D7;
  --card: #FBF8EE;
  --ink: #0E1A17;
  --ink-2: #2A3A35;
  --muted: #6B7771;
  --muted-2: #98A29D;
  --rule: #D9D2BD;
  --rule-strong: #B6AE94;

  /* Accents — emerald primary, amber spark */
  --emerald: #1F5F4A;
  --emerald-2: #144236;
  --amber: #E8A33D;
  --amber-2: #C8852C;
  --rust: #B7472A;

  --radius-sm: 4px;
  --radius: 10px;
  --radius-lg: 18px;

  /* Density (driven by tweaks) */
  --pad-card: 28px;
  --gap-grid: 28px;
  --section-pad: 120px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.025 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.6;
}

#root { position: relative; z-index: 2; }

/* Typography */
.serif {
  font-family: 'Newsreader', 'Source Serif 4', Georgia, serif;
  font-feature-settings: 'liga', 'dlig';
}
.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}
.course-title {
  font-family: 'Space Grotesk', 'DM Sans', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1, h2, h3, h4 { margin: 0; font-family: 'Newsreader', Georgia, serif; font-weight: 500; letter-spacing: -0.015em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* Display sizes — editorial */
.display-1 { font-size: clamp(48px, 7vw, 104px); line-height: 0.96; letter-spacing: -0.025em; font-weight: 400; }
.display-2 { font-size: clamp(40px, 5vw, 72px); line-height: 1.0; letter-spacing: -0.02em; font-weight: 400; }
.display-3 { font-size: clamp(32px, 3.5vw, 48px); line-height: 1.05; letter-spacing: -0.018em; font-weight: 500; }
.display-italic { font-style: italic; font-weight: 400; }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.eyebrow-num {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
}
.eyebrow-num::before {
  content: attr(data-num);
  color: var(--amber-2);
  font-weight: 600;
}
.eyebrow-num::after {
  content: '';
  width: 32px; height: 1px; background: var(--ink);
  display: inline-block;
}

/* Container */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}
.container-narrow {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Hairline rules */
.hairline { height: 1px; background: var(--rule); width: 100%; }
.hairline-strong { height: 1px; background: var(--ink); width: 100%; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--emerald);
  border-color: var(--emerald);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(14,26,23,0.04); }
.btn-amber {
  background: var(--amber);
  color: var(--ink);
  border-color: var(--amber);
}
.btn-amber:hover { background: var(--amber-2); border-color: var(--amber-2); }

.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-lg { padding: 18px 32px; font-size: 15px; }

/* Tag pills */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: transparent;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
}
.tag-emerald { border-color: var(--emerald); color: var(--emerald); background: rgba(31,95,74,0.06); }
.tag-amber { border-color: var(--amber-2); color: var(--amber-2); background: rgba(232,163,61,0.1); }
.tag-solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--pad-card);
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

/* Section spacing */
section { padding: var(--section-pad) 0; }
section.tight { padding: 60px 0; }

/* Inputs */
.input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 15px;
  transition: border-color 0.2s, background 0.2s;
}
.input:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
}

/* Compass / rose ornament rotation */
@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.rotate-slow { animation: rotate-slow 60s linear infinite; }

/* Marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track {
  animation: marquee 50s linear infinite;
  display: flex;
  gap: 64px;
  width: max-content;
}

/* Highlight underline (hand-drawn-ish) */
.hl {
  position: relative;
  display: inline-block;
}
.hl::after {
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 0.04em;
  height: 0.32em;
  background: var(--amber);
  z-index: -1;
  transform: skewX(-8deg);
  opacity: 0.85;
}
.hl-emerald::after { background: var(--emerald); opacity: 0.18; }

/* Reveal animation */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.15s; }
.rise-3 { animation-delay: 0.25s; }
.rise-4 { animation-delay: 0.35s; }

/* Underline width animate */
@keyframes ulwidth {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.ul-grow {
  display: inline-block;
  position: relative;
}
.ul-grow::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.28em;
  background: var(--amber);
  transform-origin: left center;
  animation: ulwidth 0.8s 0.6s cubic-bezier(0.6, 0, 0.2, 1) both;
  z-index: -1;
  opacity: 0.9;
}

/* Density modifiers */
[data-density="compact"] {
  --pad-card: 18px;
  --gap-grid: 16px;
  --section-pad: 80px;
}
[data-density="cozy"] {
  --pad-card: 24px;
  --gap-grid: 22px;
  --section-pad: 100px;
}
[data-density="comfortable"] {
  --pad-card: 28px;
  --gap-grid: 28px;
  --section-pad: 120px;
}
[data-density="spacious"] {
  --pad-card: 36px;
  --gap-grid: 36px;
  --section-pad: 160px;
}

/* Scrollbar polish */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* Utilities */
.flex { display: flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.gap-12 { gap: 48px; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.emerald { color: var(--emerald); }
.amber { color: var(--amber-2); }
.full { width: 100%; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mb-12 { margin-bottom: 48px; }
.mb-16 { margin-bottom: 64px; }
.mb-20 { margin-bottom: 80px; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mt-12 { margin-top: 48px; }

@media (max-width: 900px) {
  .hide-mobile { display: none !important; }
  .container, .container-narrow { padding: 0 20px; }
  section { padding: 64px 0; }
}

/* Inline icon adjustments */
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; flex-shrink: 0; }
.icon-lg { width: 22px; height: 22px; flex-shrink: 0; }

/* Selected pill (filter) */
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--card);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 0.2s;
  white-space: nowrap;
  cursor: pointer;
  color: var(--ink-2);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Page transition */
.page-enter { animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
