:root {
  --ink: #14181f;
  --ink-soft: #1e2530;
  --parchment: #efe9dd;
  --parchment-soft: #e4ddcc;
  --brass: #c9a24b;
  --teal: #4c6b65;
  --text-light: #f5f2ea;
  --text-dark: #1b1f26;
  --line-light: rgba(245, 242, 234, 0.14);
  --line-dark: rgba(27, 31, 38, 0.14);
  --nav-h: 4.25rem;
  --transition: 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--ink);
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* ============ NAV ============ */

.nav {
  background: var(--ink);
  border-bottom: 1px solid var(--line-light);
  position: relative;
  z-index: 30;
  flex: none;
}

.nav__inner {
  max-width: 1180px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text-light);
}

.nav__brand-mark {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  border: 1.5px solid var(--brass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--brass);
  flex: none;
}

.nav__brand-name {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.nav__link {
  color: rgba(245, 242, 234, 0.6);
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--text-light);
}

.nav__link.is-active {
  color: var(--text-light);
  border-bottom-color: var(--brass);
}

.nav__langs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: rgba(245, 242, 234, 0.4);
  white-space: nowrap;
}

.nav__langs .dot { opacity: 0.4; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 4.5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex: none;
}

.nav__toggle span {
  width: 20px;
  height: 1.5px;
  background: var(--text-light);
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============ HOME / SPLIT ============ */

body.page--home { height: 100vh; overflow: hidden; }

.split-wrap {
  position: relative;
  display: flex;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.panel {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  overflow: hidden;
  transition: flex var(--transition);
}

.panel--institute {
  background: linear-gradient(150deg, var(--ink) 0%, var(--ink-soft) 100%);
  color: var(--text-light);
}

.panel--students {
  background: linear-gradient(150deg, var(--parchment) 0%, var(--parchment-soft) 100%);
  color: var(--text-dark);
}

.split-wrap:hover .panel { flex: 0.85; }
.split-wrap .panel:hover { flex: 1.15; }

.panel__inner {
  max-width: 380px;
  padding: 0 2.5rem;
  text-align: left;
  transform: translateY(6px);
  opacity: 0.92;
  transition: transform var(--transition), opacity var(--transition);
}

.panel:hover .panel__inner {
  transform: translateY(0);
  opacity: 1;
}

.panel__eyebrow {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0.6;
  margin-bottom: 1rem;
}

.panel--institute .panel__eyebrow { color: var(--brass); }
.panel--students .panel__eyebrow { color: var(--teal); }

.panel__title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1;
  margin-bottom: 1rem;
}

.panel__desc {
  font-size: 0.98rem;
  line-height: 1.5;
  opacity: 0.75;
  margin-bottom: 1.25rem;
  max-width: 32ch;
}

.panel__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.75rem;
}

.tag {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 0.6;
}

.panel__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding-bottom: 3px;
  border-bottom: 1px solid currentColor;
}

.panel--institute .panel__cta { color: var(--brass); }
.panel--students .panel__cta { color: var(--teal); }

.arrow { display: inline-block; transition: transform 0.3s ease; }
.panel:hover .arrow { transform: translateX(4px); }

.divider {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.divider__label {
  position: absolute;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  background: var(--ink);
  padding: 0.9rem 0.4rem;
  border-radius: 2px;
}

.footer {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.35);
  z-index: 6;
  pointer-events: none;
}

@media (max-width: 720px) {
  body.page--home { height: auto; overflow-y: auto; }
  .split-wrap { flex-direction: column; flex: none; }
  .panel { flex: none; height: 62vh; }
  .split-wrap:hover .panel,
  .split-wrap .panel:hover { flex: none; }
  .divider {
    top: 50%; left: 0; transform: translateY(-50%);
    width: 100%; height: 1px;
  }
  .divider__label { writing-mode: horizontal-tb; padding: 0.4rem 0.9rem; }
  .footer { position: static; margin: 1.5rem 0; text-align: center; color: rgba(0,0,0,0.35); }
}

/* ============ CONTENT PAGES (About / Contact) ============ */

body.page--content {
  overflow-y: auto;
  background: var(--parchment);
  color: var(--text-dark);
}

.section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.hero-content {
  padding-top: 6rem;
  padding-bottom: 3.5rem;
}

.eyebrow {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--teal);
  margin-bottom: 1.1rem;
}

.eyebrow--brass { color: var(--brass); }

.section__title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(2.1rem, 4.6vw, 3.2rem);
  line-height: 1.08;
  margin-bottom: 1.25rem;
  max-width: 16ch;
}

.section__lede {
  font-size: 1.08rem;
  line-height: 1.65;
  max-width: 56ch;
  color: rgba(27, 31, 38, 0.72);
}

hr.rule {
  border: none;
  height: 1px;
  background: var(--line-dark);
  margin: 0 auto;
  max-width: 1000px;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 2rem;
  margin-top: 2.5rem;
}

.step {
  display: flex;
  gap: 1.1rem;
  padding: 1.5rem;
  border: 1px dashed var(--line-dark);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
}

.step__num {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  color: var(--brass);
  line-height: 1;
  flex: none;
}

.step__title {
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
}

.step__desc {
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(27, 31, 38, 0.68);
}

/* Feature cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.card {
  position: relative;
  padding: 1.75rem;
  background: var(--text-light);
  border: 1px dashed var(--line-dark);
  border-radius: 4px;
}

.card::before {
  content: "";
  position: absolute;
  top: -1px; left: 1.5rem;
  width: 0.55rem; height: 0.55rem;
  background: var(--brass);
  border-radius: 50%;
  transform: translateY(-50%);
}

.card__title {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.card__desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(27, 31, 38, 0.68);
}

.chip-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.chip {
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(76, 107, 101, 0.1);
  color: var(--teal);
  border: 1px solid rgba(76, 107, 101, 0.3);
}

/* For institutes strip */
.strip {
  background: var(--ink);
  color: var(--text-light);
}

.strip .section__lede { color: rgba(245, 242, 234, 0.68); }

.strip-list {
  margin-top: 1.75rem;
  display: grid;
  gap: 0.9rem;
}

.strip-list li {
  list-style: none;
  display: flex;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: rgba(245, 242, 234, 0.85);
  line-height: 1.5;
}

.strip-list li::before {
  content: "—";
  color: var(--brass);
  flex: none;
}

.cta-block {
  text-align: center;
  padding: 4.5rem 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text-light);
  background: var(--ink);
  padding: 0.85rem 1.6rem;
  border-radius: 3px;
  border: 1px solid var(--ink);
  transition: transform 0.25s ease, background 0.25s ease;
}

.btn:hover { background: var(--ink-soft); transform: translateY(-1px); }

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

.btn--ghost:hover { background: rgba(27,31,38,0.05); }

/* Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  margin-top: 2.5rem;
  align-items: start;
}

.form-field {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.form-field input,
.form-field select,
.form-field textarea {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  background: var(--text-light);
  color: var(--text-dark);
}

.form-field textarea { resize: vertical; min-height: 110px; }

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--teal);
}

.form-note {
  font-size: 0.82rem;
  color: rgba(27,31,38,0.55);
  margin-top: 0.75rem;
}

.form-success {
  display: none;
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px dashed var(--teal);
  border-radius: 4px;
  font-size: 0.88rem;
  color: var(--teal);
  background: rgba(76,107,101,0.08);
}

.form-success.is-visible { display: block; }

.contact-card {
  border: 1px dashed var(--line-dark);
  border-radius: 4px;
  padding: 1.75rem;
  background: rgba(255,255,255,0.4);
}

.contact-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line-dark);
  font-size: 0.88rem;
}

.contact-row:last-child { border-bottom: none; }
.contact-row span:first-child { color: rgba(27,31,38,0.55); }
.contact-row span:last-child { font-weight: 600; text-align: right; }

.site-footer {
  background: var(--ink);
  color: rgba(245, 242, 234, 0.5);
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 1.75rem 2rem;
}

@media (max-width: 860px) {
  .steps, .card-grid, .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav__links, .nav__langs { display: none; }
  .nav__links.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--ink);
    padding: 1rem 2rem 1.5rem;
    gap: 0.25rem;
    border-bottom: 1px solid var(--line-light);
  }
  .nav__toggle { display: flex; }
  .section { padding: 3.5rem 1.25rem; }
  .hero-content { padding-top: 4rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .panel, .panel__inner, .arrow, .btn, .nav__toggle span { transition: none !important; }
}

/* Keyboard focus visibility */
.panel:focus-visible,
.nav__link:focus-visible,
.btn:focus-visible,
.nav__toggle:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
