/* Castalia Platform — design system (GitHub Pages) */
@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap");

:root {
  --bg-deep: #06080f;
  --bg-panel: #0c101c;
  --bg-elevated: #121a2c;
  --bg-parchment: #1a1410;
  --border: rgba(255, 245, 220, 0.08);
  --border-strong: rgba(201, 162, 39, 0.35);
  --text: #f4f1ea;
  --text-muted: rgba(244, 241, 234, 0.68);
  --text-dim: rgba(244, 241, 234, 0.45);
  --accent: #d4a853;
  --accent-bright: #e8c066;
  --accent-soft: rgba(212, 168, 83, 0.12);
  --accent-glow: rgba(212, 168, 83, 0.25);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --max: 1120px;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(212, 168, 83, 0.07), transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, #04060b 100%);
}

/* Subtle network / parchment overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23d4a853' stroke-opacity='0.04'%3E%3Cpath d='M0 40h80M40 0v80'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse at 20% 30%, rgba(90, 70, 40, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 70%, rgba(40, 50, 80, 0.06) 0%, transparent 40%);
  z-index: 0;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
  color: #fff;
}

img {
  max-width: 100%;
  height: auto;
}

.serif {
  font-family: var(--serif);
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  background: rgba(6, 8, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: calc(var(--max) + 2rem);
}

.logo {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}

.logo span {
  color: var(--accent);
}

.nav-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.nav-main a:hover,
.nav-main a[aria-current="page"] {
  color: var(--accent-bright);
}

.nav-cta {
  margin-left: 0.5rem;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(145deg, var(--accent) 0%, #a87d2e 100%);
  color: #0a0a0a;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 4px 24px var(--accent-glow);
}

.btn-primary:hover {
  color: #0a0a0a;
  filter: brightness(1.08);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-bright);
  border-color: transparent;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.btn-ghost:hover {
  color: #fff;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* —— Typography —— */
h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  margin: 0 0 1rem;
}

h3 {
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 38rem;
  margin: 0 0 1.5rem;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  position: relative;
  z-index: 1;
}

.section-tight {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.section-muted {
  background: rgba(12, 16, 28, 0.5);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* —— Hero —— */
.hero {
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-copy .tagline {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 1rem;
}

.hero-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  min-height: 280px;
}

@media (max-width: 500px) {
  .hero-visual {
    grid-template-columns: 1fr;
  }
}

.mock-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  animation: panelPulse 6s ease-in-out infinite;
}

.mock-panel:nth-child(2) {
  animation-delay: -3s;
}

@keyframes panelPulse {
  0%,
  100% {
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  }
  50% {
    box-shadow: 0 24px 56px rgba(212, 168, 83, 0.08);
  }
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mock-dots {
  display: flex;
  gap: 4px;
}

.mock-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}

.mock-dots span:nth-child(1) {
  background: #e85d4c;
}
.mock-dots span:nth-child(2) {
  background: #e8b84c;
}
.mock-dots span:nth-child(3) {
  background: #5cb85c;
}

.mock-body {
  padding: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mock-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mock-row:last-child {
  border-bottom: none;
}

.mock-icon {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.mock-chat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bubble {
  max-width: 92%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.bubble.ai {
  align-self: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.bubble.user {
  align-self: flex-end;
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

/* —— Grids & cards —— */
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 800px) {
  .three-col {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: rgba(212, 168, 83, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.card h3 {
  font-size: 1.2rem;
}

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

.card ul {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
}

/* —— Pricing table —— */
.pricing-wrap {
  overflow-x: auto;
  margin-top: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

table.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.price-table th,
.price-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.price-table th {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text);
}

.price-table tr:last-child td {
  border-bottom: none;
}

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

.price-table .tier-popular {
  position: relative;
  background: linear-gradient(180deg, rgba(212, 168, 83, 0.1) 0%, rgba(12, 16, 28, 0.3) 100%);
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: var(--accent);
  color: #0a0a0a;
  margin-bottom: 0.35rem;
}

.price-em {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--accent-bright);
  font-weight: 600;
}

/* —— Faculty stack —— */
.faculty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .faculty-grid {
    grid-template-columns: 1fr;
  }
}

.faculty-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--bg-panel) 0%, var(--bg-parchment) 100%);
}

.faculty-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.faculty-card .role {
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

/* —— Comparison —— */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.compare-table th:first-child,
.compare-table td:first-child {
  text-align: left;
}

.compare-table th {
  font-family: var(--serif);
  background: var(--bg-elevated);
}

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

.check {
  color: #6fcf97;
  font-weight: 700;
}
.cross {
  color: var(--text-dim);
}

/* —— Add-ons —— */
.addon-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 700px) {
  .addon-row {
    grid-template-columns: 1fr;
  }
}

/* —— CTA band —— */
.cta-band {
  text-align: center;
  padding: clamp(3rem, 6vw, 4.5rem) 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(ellipse at 50% 0%, var(--accent-glow), transparent 55%),
    var(--bg-panel);
}

.cta-band h2 {
  margin-bottom: 0.5rem;
}

.cta-band .sub {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

/* —— Footer —— */
.site-footer {
  padding: 2.5rem 1rem 3rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

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

/* —— Page hero (inner pages) —— */
.page-hero {
  padding: clamp(2.5rem, 6vw, 4rem) 0 2rem;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  margin-bottom: 0.75rem;
}

.prose {
  max-width: 42rem;
}

.prose p,
.prose li {
  color: var(--text-muted);
}

.prose ul {
  padding-left: 1.2rem;
}

.prose h2 {
  margin-top: 2rem;
  font-size: 1.5rem;
}

/* —— FAQ —— */
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
  background: var(--bg-panel);
  padding: 0 1rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 1rem 0;
  list-style: none;
  color: var(--text);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq details[open] summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.faq .answer {
  padding-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* —— Catalog —— */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.catalog-card {
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

.catalog-card h3 {
  font-size: 1.1rem;
}

.catalog-card .meta {
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.catalog-card.featured {
  border-color: rgba(212, 168, 83, 0.4);
  background: linear-gradient(145deg, var(--bg-panel) 0%, rgba(26, 20, 16, 0.6) 100%);
  grid-column: 1 / -1;
}

@media (min-width: 700px) {
  .catalog-card.featured {
    grid-column: span 2;
  }
}

/* —— Program / degree pages —— */
.program-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.program-stats div {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

.program-stats dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0;
}

.program-stats dd {
  margin: 0.35rem 0 0;
  font-weight: 600;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.35;
}

.objectives-list {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.objectives-list li {
  margin-bottom: 0.5rem;
}

table.course-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.course-table th,
.course-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.course-table th {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text);
}

.course-table td:first-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--accent-bright);
  font-weight: 600;
  font-size: 0.82rem;
}

.course-table tr:last-child td {
  border-bottom: none;
}

.spec-block {
  margin-top: 1.75rem;
}

.spec-block h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.course-desc {
  margin-top: 2rem;
}

.course-desc details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  background: var(--bg-panel);
  padding: 0 1rem;
}

.course-desc summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.9rem 0;
  list-style: none;
  color: var(--text);
  font-size: 0.95rem;
}

.course-desc summary::-webkit-details-marker {
  display: none;
}

.course-desc details[open] summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.65rem;
}

.course-desc .desc-body {
  padding-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.course-desc .desc-body p {
  margin: 0;
}

/* —— Contact form —— */
.form-grid {
  display: grid;
  gap: 1rem;
  max-width: 32rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.form-note {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* —— Docs layout —— */
.arch-grid {
  display: grid;
  gap: 1.25rem;
}

.arch-block {
  padding: 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

.arch-block h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.arch-block code {
  font-size: 0.85rem;
  color: var(--accent-bright);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* —— Demo split —— */
.demo-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 800px) {
  .demo-split {
    grid-template-columns: 1fr;
  }
}

/* —— Mobile nav —— */
@media (max-width: 720px) {
  .site-header .wrap {
    flex-direction: column;
    height: auto;
    padding: 0.75rem 0;
  }

  .nav-main {
    justify-content: center;
  }

  .nav-cta {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }

  .nav-cta .btn {
    width: 100%;
  }
}
