/* ============================================================
   Pharmacist Clinical Skills — University of Tartu
   Modern academic landing page
   Palette anchored on the authentic UT blue (#2C5697)
   ============================================================ */

:root {
  --ut-blue: #2c5697;        /* official University of Tartu blue */
  --ut-blue-deep: #213f6e;
  --ink: #14233d;            /* headings / primary text */
  --ink-soft: #475168;       /* body text */
  --ink-faint: #76809a;      /* meta / captions */
  --paper: #fbf9f5;          /* warm page background */
  --surface: #ffffff;
  --surface-tint: #f3f6fb;   /* light blue wash */
  --line: #e8e2d6;           /* warm hairline */
  --line-cool: #dce3ef;
  --gold: #a8803a;           /* restrained academic accent */
  --gold-soft: #efe3cd;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 35, 61, 0.05), 0 4px 14px rgba(20, 35, 61, 0.05);
  --shadow-md: 0 12px 40px rgba(20, 35, 61, 0.10);

  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --wrap: 1140px;
  --pad: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-soft);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--ut-blue); text-decoration: none; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- Typography ---------- */
h1, h2, h3 { color: var(--ink); font-family: var(--font-serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; margin: 0; }

.kicker {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.9rem;
}
.kicker-light { color: rgba(255, 255, 255, 0.72); }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ut-blue);
  margin: 0 0 1.4rem;
}

.h-sm {
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.8rem 0 0.5rem;
}
.h-sm:first-child { margin-top: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  background: var(--ut-blue);
  color: #fff;
  border: 1.5px solid var(--ut-blue);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--ut-blue-deep); border-color: var(--ut-blue-deep); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(44, 86, 151, 0.28); }
.btn-lg { padding: 1.05rem 1.8rem; font-size: 1rem; }
.btn-sm { padding: 0.6rem 1.1rem; font-size: 0.86rem; }

.btn-ghost { background: transparent; color: var(--ut-blue); border-color: var(--line-cool); }
.btn-ghost:hover { background: var(--surface-tint); border-color: var(--ut-blue); color: var(--ut-blue); box-shadow: none; }

.btn-on-dark { background: #fff; color: var(--ut-blue-deep); border-color: #fff; }
.btn-on-dark:hover { background: var(--gold-soft); border-color: var(--gold-soft); color: var(--ut-blue-deep); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 249, 245, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 2px 18px rgba(20, 35, 61, 0.05); }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 72px; }

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-mark { flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-family: var(--font-serif); font-size: 1.08rem; font-weight: 600; color: var(--ink); }
.brand-sub { font-size: 0.74rem; font-weight: 500; letter-spacing: 0.04em; color: var(--ink-faint); }

.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav > a:not(.btn) {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 0.2rem 0;
}
.nav > a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--ut-blue);
  transition: width 0.22s ease;
}
.nav > a:not(.btn):hover { color: var(--ink); }
.nav > a:not(.btn):hover::after,
.nav > a.is-active::after { width: 100%; }
.nav > a.is-active { color: var(--ink); }

.nav-toggle { display: none; }

.mobile-nav { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 116px) 0 clamp(48px, 7vw, 92px); }
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(44, 86, 151, 0.10), transparent 60%),
    radial-gradient(760px 420px at 8% 8%, rgba(168, 128, 58, 0.08), transparent 62%);
  pointer-events: none;
}
.hero-inner { position: relative; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero-text { max-width: 36rem; }

.hero-media { position: relative; }
.hero-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translate(18px, 18px);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--ut-blue);
  opacity: 0.28;
  z-index: -1;
}
.hero-media-badge {
  position: absolute;
  left: 18px;
  bottom: 18px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(20, 35, 61, 0.62);
  backdrop-filter: blur(4px);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
}

.hero-title {
  font-size: clamp(2.7rem, 7.2vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 1.5rem;
}
.hero-lead { font-size: clamp(1.12rem, 2.1vw, 1.38rem); color: var(--ink-soft); max-width: 40ch; margin: 0 0 2.2rem; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 3.4rem; }

.facts {
  list-style: none;
  margin: 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
.facts li { display: flex; flex-direction: column; gap: 0.25rem; }
.fact-num { font-family: var(--font-serif); font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 500; color: var(--ut-blue); line-height: 1; }
.fact-label { font-size: 0.82rem; font-weight: 500; color: var(--ink-faint); }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-alt { background: var(--surface-tint); border-block: 1px solid var(--line-cool); }

.section-head { max-width: 760px; margin-bottom: clamp(2.4rem, 5vw, 3.6rem); }
.section-title { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 500; }
.section-intro { font-size: 1.1rem; color: var(--ink-soft); margin: 1.1rem 0 0; max-width: 60ch; }

.lead-statement {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink);
  max-width: 56ch;
  margin: 0 0 clamp(2.4rem, 5vw, 3.4rem);
  padding-left: 1.4rem;
  border-left: 3px solid var(--gold);
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about-col p { margin: 0 0 0.4rem; }

.tick-list { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.tick-list li { position: relative; padding-left: 1.7rem; color: var(--ink-soft); }
.tick-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.5em;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--gold);
  transform: rotate(45deg);
}

.outcomes-card {
  background: var(--ut-blue);
  background: linear-gradient(160deg, var(--ut-blue) 0%, var(--ut-blue-deep) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 3.6vw, 2.6rem);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 96px;
}
.outcomes { list-style: none; counter-reset: o; margin: 0; padding: 0; display: grid; gap: 1.3rem; }
.outcomes li { position: relative; padding-left: 3rem; counter-increment: o; }
.outcomes li::before {
  content: counter(o);
  position: absolute;
  left: 0; top: -2px;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
}
.outcomes li span { color: rgba(255, 255, 255, 0.92); font-size: 0.98rem; line-height: 1.55; }

/* ---------- Curriculum ---------- */
.courses { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.course {
  background: var(--surface);
  border: 1px solid var(--line-cool);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}
.course:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--ut-blue); }

.course-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.course-code { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); background: var(--surface-tint); border: 1px solid var(--line-cool); padding: 0.3rem 0.6rem; border-radius: 6px; }
.ects { font-family: var(--font-serif); font-size: 0.95rem; font-weight: 600; color: var(--gold); }

.course-title { font-size: 1.32rem; font-weight: 600; margin-bottom: 1rem; }
.course-points { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: 0.6rem; flex: 1; }
.course-points li { position: relative; padding-left: 1.4rem; font-size: 0.95rem; color: var(--ink-soft); }
.course-points li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; border-radius: 50%; background: var(--ut-blue); opacity: 0.45; }
.course-hours { margin: 0; padding-top: 1rem; border-top: 1px solid var(--line-cool); font-size: 0.85rem; font-weight: 500; color: var(--ink-faint); }

.total-bar {
  margin-top: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.3rem clamp(1.4rem, 3vw, 2.2rem);
}
.total-label { font-weight: 600; }
.total-val { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; color: #fff; margin-right: auto; }
.total-note { font-size: 0.9rem; color: rgba(255, 255, 255, 0.7); }

/* ---------- Apply ---------- */
.apply-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.info-block { padding-bottom: 1.4rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.info-block:last-of-type { border-bottom: none; }
.info-block p { margin: 0; }

.apply-facts { display: grid; gap: 0; margin: 0.6rem 0 0; }
.apply-facts > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px dashed var(--line); }
.apply-facts dt { font-weight: 600; color: var(--ink); margin: 0; }
.apply-facts dd { margin: 0; text-align: right; color: var(--ink-soft); }
.todo { color: var(--gold); font-style: italic; font-size: 0.85em; }

.apply-cta {
  background: linear-gradient(165deg, var(--ut-blue) 0%, var(--ut-blue-deep) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 2.8rem);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 96px;
}
.cta-mark { margin-bottom: 1.2rem; filter: brightness(0) invert(1); opacity: 0.9; }
.cta-title { color: #fff; font-size: 1.5rem; font-weight: 600; margin-bottom: 0.8rem; }
.cta-text { color: rgba(255, 255, 255, 0.85); margin: 0 0 1.6rem; font-size: 0.97rem; }
.apply-cta .btn { width: 100%; }
.cta-foot { color: rgba(255, 255, 255, 0.68); font-size: 0.85rem; margin: 1.3rem 0 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, 0.7); padding: clamp(48px, 7vw, 72px) 0 2.4rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-bottom: 2.2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.footer-brand { display: flex; align-items: center; gap: 1rem; }
.footer-mark { filter: brightness(0) invert(1); opacity: 0.92; }
.footer-title { font-family: var(--font-serif); font-size: 1.25rem; color: #fff; margin: 0; }
.footer-sub { font-size: 0.88rem; margin: 0.2rem 0 0; color: rgba(255, 255, 255, 0.6); }
.footer-nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.footer-nav a { color: rgba(255, 255, 255, 0.75); font-size: 0.95rem; font-weight: 500; }
.footer-nav a:hover { color: #fff; }
.footer-legal { padding-top: 1.6rem; }
.footer-legal p { font-size: 0.82rem; color: rgba(255, 255, 255, 0.45); margin: 0; }

/* ---------- Faculty band ---------- */
.band { position: relative; height: clamp(320px, 44vw, 540px); overflow: hidden; }
.band-img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.band-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(90deg, rgba(20, 35, 61, 0.78) 0%, rgba(20, 35, 61, 0.42) 45%, rgba(20, 35, 61, 0.08) 100%);
  padding-block: clamp(2rem, 5vw, 3.4rem);
}
.band-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  font-weight: 400;
  line-height: 1.32;
  color: #fff;
  max-width: 22ch;
  margin: 0;
}

/* ---------- Apply photo ---------- */
.apply-photo {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.apply-photo img { width: 100%; height: auto; aspect-ratio: 16 / 8; object-fit: cover; object-position: center 30%; display: block; }

.footer-credit { font-size: 0.78rem; color: rgba(255, 255, 255, 0.38); margin: 0.4rem 0 0; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .hero-text { max-width: none; order: 1; }
  .hero-media { order: 2; max-width: 440px; }
  .hero-media::before { transform: translate(12px, 12px); }
  .about-grid, .apply-grid { grid-template-columns: 1fr; }
  .outcomes-card, .apply-cta { position: static; }
  .courses { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(3, 1fr); row-gap: 1.4rem; }
}

@media (max-width: 680px) {
  .nav { display: none; }
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 44px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
  }
  .nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin-inline: auto; transition: transform 0.2s ease, opacity 0.2s ease; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .mobile-nav { display: block; border-top: 1px solid var(--line); background: var(--paper); }
  .mobile-nav[hidden] { display: none; }
  .mobile-nav a { display: block; padding: 0.95rem var(--pad); font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--line); }

  .brand-sub { display: none; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .total-val { margin-right: 0; }
  .apply-facts dd { text-align: left; }
}
