/* =========================================================
   pm-professor.com
   Global shared stylesheet
   ========================================================= */

/* ------------------------------
   1. Design tokens
   ------------------------------ */
:root {
  --bg: #f9f9ff;
  --bg-alt: #f0f3ff;
  --bg-accent: #dee8ff;
  --card: #ffffff;
  --text: #111c2d;
  --muted: #424754;
  --primary: #0058be;
  --primary-strong: #2170e4;
  --primary-soft: #d8e2ff;
  --outline: rgba(194, 198, 214, 0.22);
  --footer: #0f1d37;
  --shadow: 0 18px 40px rgba(17, 28, 45, 0.06);

  --radius-card: 18px;
  --radius-panel: 28px;
  --radius-pill: 999px;

  --max-width: 1200px;

  --space-section: 86px;
  --space-section-hero: 96px;
  --space-section-compact: 72px;
  --space-card: 28px;
  --space-card-compact: 20px;

  --transition-fast: 0.2s ease;
  --transition-medium: 0.22s ease;
}

/* ------------------------------
   2. Reset and base
   ------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
p,
ul,
ol,
dl,
dt,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-size: 0.95rem;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 12px;
}

/* ------------------------------
   3. Typography
   ------------------------------ */
.section-label,
.meta-label,
.fact-label,
.subject-code,
.publication-year,
.journal-name,
.update-date,
.contact-label,
.network-abbr,
.site-footer {
  text-transform: uppercase;
  font-weight: 800;
}

.section-label {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.meta-label,
.update-date {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.hero-title-home,
.hero-title-internal {
  margin-bottom: 22px;
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.hero-title-home {
  font-size: clamp(3.6rem, 7vw, 5.6rem);
  max-width: 700px;
}

.hero-title-internal {
  font-size: clamp(3.4rem, 6.2vw, 5.5rem);
  max-width: 700px;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.58rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

h4 {
  margin-bottom: 8px;
  font-size: 1.18rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h5 {
  margin-bottom: 4px;
  font-size: 1.02rem;
  line-height: 1.3;
  font-weight: 700;
}

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

.text-body,
.hero-copy,
.section-copy,
.card-copy,
.row-copy {
  color: var(--muted);
  font-size: 1rem;
}

.hero-copy {
  max-width: 620px;
  font-size: 1.05rem;
}

.section-copy {
  max-width: 760px;
}

.body-small,
.row-meta,
.publication-meta,
.history-meta,
.supervision-meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.accent {
  color: var(--primary);
  font-style: italic;
}

/* ------------------------------
   4. Header and navigation
   ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(249, 249, 255, 0.72);
  box-shadow: 0 1px 0 rgba(17, 28, 45, 0.04);
}

.nav {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  font-size: 0.95rem;
  color: var(--muted);
}

.nav-links a {
  padding-bottom: 6px;
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.nav-links a.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  font-weight: 600;
}

/* ------------------------------
   5. Shared sections
   ------------------------------ */
.section {
  padding: var(--space-section) 0;
}

.section--hero {
  padding: var(--space-section-hero) 0 84px;
}

.section--compact {
  padding: var(--space-section-compact) 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section-header {
  margin-bottom: 38px;
}

.section-header--center {
  margin-bottom: 34px;
  text-align: center;
}

.section-header--narrow .section-copy {
  max-width: 720px;
}

.section-action {
  margin-top: 32px;
}

.section-action--center {
  text-align: center;
}

.section-action--end {
  display: flex;
  justify-content: flex-end;
}

/* ------------------------------
   6. Hero system
   ------------------------------ */
.hero {
  padding: var(--space-section-hero) 0 84px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 56px;
  align-items: center;
  min-height: 68vh;
}

.hero-copy--wide {
  max-width: 700px;
}

.hero-media-wrap {
  position: relative;
  min-height: 520px;
}

.hero-media-backdrop {
  position: absolute;
  inset: 8px 0 0 12px;
  border-radius: var(--radius-panel);
  background: var(--bg-accent);
  opacity: 0.55;
  transform: rotate(1.2deg);
}

.hero-media {
  position: relative;
  z-index: 1;
  height: 520px;
  overflow: hidden;
  border-radius: calc(var(--radius-panel) - 6px);
  box-shadow: var(--shadow);
  background: #d8d8d8;
}

.hero-media img {
  height: 100%;
  object-fit: cover;
}

/* ------------------------------
   7. Shared grids
   ------------------------------ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.stack-list {
  display: grid;
  gap: 12px;
}

/* ------------------------------
   8. Shared cards
   ------------------------------ */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: inset 0 0 0 1px var(--outline);
}

.card--standard {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 28px 28px 24px;
}

.card--feature {
  display: flex;
  flex-direction: column;
  min-height: 290px;
  padding: 28px 28px 26px;
}

.card--compact {
  display: flex;
  flex-direction: column;
  padding: var(--space-card-compact);
}

.card--row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 18px 16px;
  border-radius: 12px;
}

.card-link {
  display: flex;
  height: 100%;
  color: inherit;
}

.card-link--block {
  display: block;
  width: 100%;
  color: inherit;
}

.card-link:focus-visible,
.card-link--block:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: var(--radius-card);
}

.card-hover {
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.card-link:hover .card-hover,
.card-link:focus-visible .card-hover,
.card-link--block:hover .card-hover,
.card-link--block:focus-visible .card-hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(17, 28, 45, 0.06);
}

/* ------------------------------
   9. Shared row/list items
   ------------------------------ */
.row-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 18px 16px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--outline);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.row-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(17, 28, 45, 0.06);
}

.row-content {
  min-width: 0;
  flex: 1 1 auto;
}

.row-meta {
  margin-top: 4px;
}

.row-year {
  width: 64px;
  color: rgba(0, 88, 190, 0.5);
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  line-height: 1;
  flex: 0 0 auto;
}

.row-badge {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 18px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-weight: 800;
  text-transform: uppercase;
}

/* ------------------------------
   10. Icon system
   ------------------------------ */
.icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  flex: 0 0 auto;
}

.icon-box--large {
  width: 56px;
  height: 56px;
  margin-bottom: 22px;
}

.icon-box svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-box--large svg {
  width: 28px;
  height: 28px;
}

/* ------------------------------
   11. Shared lists
   ------------------------------ */
.bullet-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.bullet-list li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
  opacity: 0.8;
  transform: translateY(-50%);
}

/* ------------------------------
   12. Buttons and links
   ------------------------------ */
.button-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 88, 190, 0.18);
  transition: opacity var(--transition-fast);
}

.button-primary:hover,
.button-primary:focus-visible {
  opacity: 0.9;
}

.button-primary svg,
.link-secondary svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 700;
  transition: opacity var(--transition-fast), gap var(--transition-fast);
}

.link-secondary:hover,
.link-secondary:focus-visible {
  opacity: 0.84;
  gap: 11px;
}

/* ------------------------------
   13. Shared footer
   ------------------------------ */
.site-footer {
  padding: 34px 24px;
  background: var(--footer);
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
  font-size: 0.74rem;
  line-height: 1.6;
  letter-spacing: 0.12em;
}

/* ------------------------------
   14. Shared focus styles
   ------------------------------ */
.nav-links a:focus-visible,
.button-primary:focus-visible,
.link-secondary:focus-visible,
.card-link:focus-visible,
.card-link--block:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ------------------------------
   15. Responsive rules
   ------------------------------ */
@media (max-width: 980px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 0;
  }

  .hero {
    padding-top: 72px;
  }

  .hero-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: auto;
  }

  .hero-media-wrap {
    min-height: 0;
  }

  .hero-media {
    height: 420px;
  }

  .card--row,
  .row-item {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--max-width), calc(100% - 32px));
  }

  .hero-title-home,
  .hero-title-internal {
    font-size: clamp(2.8rem, 14vw, 4.1rem);
  }

  .hero-copy,
  .section-copy,
  .card-copy,
  .row-copy,
  .body-small,
  .row-meta,
  .publication-meta,
  .history-meta,
  .supervision-meta {
    font-size: 1rem;
  }

  .hero-media {
    height: 340px;
  }

  .card--feature,
  .card--standard,
  .card--compact {
    min-height: auto;
  }

  .card--row,
  .row-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .row-year {
    width: auto;
  }
}
