/* ==========================================================================
   PEMBRIX EDUCATION — Design System
   Aesthetic: Editorial-scholarly, warm ivory + deep forest + burnt ochre
   Typography: Fraunces (display serif) + Inter Tight (body)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400&family=Inter+Tight:wght@300;400;500;600&display=swap');

:root {
  --ivory: #f5f0e6;
  --ivory-deep: #ebe3d1;
  --forest: #1f3a2e;
  --forest-deep: #15271f;
  --ochre: #c87533;
  --ochre-deep: #a85a1f;
  --ink: #1a1a18;
  --muted: #6b6860;
  --line: #d8cfb8;
  --cream: #faf7ef;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter Tight', -apple-system, sans-serif;

  --max-w: 1280px;
  --pad-x: clamp(1.5rem, 4vw, 4rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

img { max-width: 100%; display: block; }

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

/* ========== NAVIGATION ========== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 240, 230, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.1rem var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.brand-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--ochre);
  border-radius: 50%;
  transform: translateY(-2px);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  font-size: 0.92rem;
  font-weight: 400;
}

.nav-links a {
  position: relative;
  padding: 0.3rem 0;
  color: var(--ink);
  transition: color 0.2s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--ochre);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-links a.active { color: var(--forest); font-weight: 500; }

.nav-cta {
  padding: 0.65rem 1.4rem;
  background: var(--forest);
  color: var(--cream);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.25s, transform 0.25s;
}

.nav-cta:hover {
  background: var(--forest-deep);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: 0.3s;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.8rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--forest);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--forest-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -10px rgba(31, 58, 46, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--cream);
}

.btn-arrow {
  transition: transform 0.25s;
}

.btn:hover .btn-arrow { transform: translateX(4px); }

/* ========== SECTION / LAYOUT ========== */
section {
  padding: clamp(4rem, 8vw, 7rem) var(--pad-x);
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ochre);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}

.eyebrow::before {
  content: '';
  width: 30px;
  height: 1px;
  background: var(--ochre);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  font-variation-settings: "opsz" 144;
}

h1 { font-size: clamp(2.8rem, 6.5vw, 5.5rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.8rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 2rem); }

.italic {
  font-style: italic;
  font-weight: 300;
  color: var(--ochre);
}

/* ========== HERO ========== */
.hero {
  position: relative;
  padding: clamp(4rem, 10vw, 9rem) var(--pad-x) clamp(5rem, 10vw, 9rem);
  overflow: hidden;
}

.hero-decor {
  position: absolute;
  pointer-events: none;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  color: var(--ivory-deep);
  font-size: clamp(10rem, 25vw, 22rem);
  line-height: 1;
  top: -2rem;
  right: -3rem;
  user-select: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

.hero h1 {
  margin: 0.5rem 0 2rem;
}

.hero-sub {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 2.5rem;
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ========== STATS / MARQUEE ========== */
.stats-bar {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 3rem var(--pad-x);
  background: var(--cream);
}

.stats-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 400;
  color: var(--forest);
  line-height: 1;
  font-variation-settings: "opsz" 144;
}

.stat-num sup {
  color: var(--ochre);
  font-size: 0.5em;
  font-style: italic;
  font-weight: 300;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
}

/* ========== CARDS ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2rem 1.8rem;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -20px rgba(31, 58, 46, 0.25);
  border-color: var(--forest);
}

.card-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  color: var(--ochre);
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  display: block;
}

.card h3 {
  margin-bottom: 0.8rem;
  color: var(--forest);
}

.card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ========== SECTION HEADER ========== */
.section-head {
  max-width: 780px;
  margin-bottom: 1rem;
}

.section-head p {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 1.5rem;
  line-height: 1.65;
  max-width: 620px;
}

/* ========== DARK SECTION ========== */
.section-dark {
  background: var(--forest);
  color: var(--cream);
}

.section-dark .eyebrow { color: var(--ochre); }
.section-dark h2 { color: var(--cream); }
.section-dark .section-head p { color: rgba(250, 247, 239, 0.75); }
.section-dark .card {
  background: transparent;
  border-color: rgba(250, 247, 239, 0.15);
}
.section-dark .card:hover {
  background: rgba(250, 247, 239, 0.04);
  border-color: var(--ochre);
}
.section-dark .card h3 { color: var(--cream); }
.section-dark .card p { color: rgba(250, 247, 239, 0.7); }

/* ========== CTA BLOCK ========== */
.cta-block {
  background: var(--forest);
  color: var(--cream);
  border-radius: 16px;
  padding: clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin: 2rem auto;
}

.cta-block::after {
  content: '';
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ochre) 0%, transparent 70%);
  opacity: 0.35;
}

.cta-block h2 { color: var(--cream); position: relative; z-index: 1; }

.cta-block p {
  color: rgba(250, 247, 239, 0.75);
  margin-top: 1.2rem;
  max-width: 420px;
  position: relative; z-index: 1;
}

.cta-block .btn-primary {
  background: var(--ochre);
  white-space: nowrap;
  position: relative;
  z-index: 1;
  justify-self: end;
}

.cta-block .btn-primary:hover { background: var(--ochre-deep); }

/* ========== FOOTER ========== */
.footer {
  background: var(--forest-deep);
  color: rgba(250, 247, 239, 0.7);
  padding: 4rem var(--pad-x) 2rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(250, 247, 239, 0.1);
}

.footer .brand { color: var(--cream); font-size: 1.6rem; margin-bottom: 1rem; }
.footer-about { max-width: 320px; font-size: 0.9rem; line-height: 1.7; }

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ochre);
  margin-bottom: 1.2rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.7rem; font-size: 0.92rem; }
.footer-col a { transition: color 0.2s; }
.footer-col a:hover { color: var(--cream); }

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.delay-1 { animation-delay: 0.12s; }
.delay-2 { animation-delay: 0.24s; }
.delay-3 { animation-delay: 0.36s; }
.delay-4 { animation-delay: 0.48s; }

/* ========== PAGE HEADER (interior pages) ========== */
.page-header {
  padding: clamp(4rem, 8vw, 7rem) var(--pad-x) clamp(3rem, 5vw, 5rem);
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  position: relative;
  overflow: hidden;
}

.page-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.page-header h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  max-width: 900px;
  margin-top: 0.5rem;
}

.page-header-decor {
  position: absolute;
  right: var(--pad-x);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(6rem, 18vw, 16rem);
  color: var(--ivory-deep);
  line-height: 1;
  z-index: 1;
  user-select: none;
  pointer-events: none;
}

/* ========== PROSE ========== */
.prose {
  max-width: 720px;
}

.prose p {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.prose p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 400;
  float: left;
  line-height: 0.85;
  padding: 0.3rem 0.8rem 0 0;
  color: var(--ochre);
  font-style: italic;
}

/* ========== TWO-COL ========== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.values-list { list-style: none; }
.values-list li {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.8rem;
  align-items: start;
}
.values-list li:last-child { border-bottom: none; }
.values-list .v-num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ochre);
  font-size: 1rem;
  padding-top: 0.2rem;
  min-width: 2rem;
}
.values-list h3 {
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
  color: var(--forest);
}
.values-list p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ========== SERVICE ROW ========== */
.service-row {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--line);
  align-items: start;
}

.service-row:last-child { border-bottom: 1px solid var(--line); }

.service-tag {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  color: var(--ochre);
  font-size: 1.1rem;
}

.service-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: var(--forest);
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.service-desc {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  max-width: 620px;
}

.service-details {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 2rem;
  margin-top: 1rem;
}

.service-details li {
  font-size: 0.9rem;
  color: var(--ink);
  padding-left: 1.2rem;
  position: relative;
}

.service-details li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--ochre);
  border-radius: 50%;
}

/* ========== CONTACT ========== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 6vw, 5rem);
  align-items: start;
}

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

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

.field label {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  padding: 0.9rem 1rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--forest);
  background: var(--ivory);
}

.field textarea {
  resize: vertical;
  min-height: 130px;
  font-family: var(--font-body);
}

.contact-info h3 {
  color: var(--forest);
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.contact-info p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.info-item {
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
}

.info-item:last-child { border-bottom: 1px solid var(--line); }

.info-label {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ochre);
  margin-bottom: 0.4rem;
}

.info-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--forest);
}

/* ========== TESTIMONIAL (home) ========== */
.testimonial {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.testimonial blockquote {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  line-height: 1.3;
  color: var(--forest);
  margin-bottom: 2rem;
}

.testimonial cite {
  font-style: normal;
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.testimonial cite strong {
  color: var(--ink);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.82rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 860px) {
  .two-col,
  .contact-grid,
  .cta-block,
  .service-row {
    grid-template-columns: 1fr;
  }

  .cta-block .btn-primary { justify-self: start; }

  .service-details { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ivory);
    flex-direction: column;
    padding: 1.5rem var(--pad-x);
    gap: 1.2rem;
    border-bottom: 1px solid var(--line);
  }

  .nav-links.open { display: flex; }

  .nav-toggle { display: block; }

  .nav-cta { display: none; }
}

@media (max-width: 500px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}
