@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap');

:root {
  --bg: #14202a;
  --bg-accent: #132230;
  --bg-spot: #2a4657;
  --surface: #1d2e3a;
  --surface-muted: #253a49;
  --text: #dce8f2;
  --text-muted: #abc0cf;
  --primary: #5f9bb4;
  --primary-soft: #355f74;
  --accent: #b89356;
  --accent-soft: #c9aa77;
  --border: #355064;
  --shadow: 0 16px 40px rgba(6, 10, 18, 0.5);
  --header-bg: rgba(20, 32, 42, 0.9);
  --header-border: rgba(53, 80, 100, 0.9);
  --hero-bg: rgba(29, 46, 58, 0.9);
  --hero-border: rgba(53, 80, 100, 0.92);
  --nav-active-bg: rgba(95, 155, 180, 0.16);
  --card-bg-start: rgba(34, 53, 67, 0.96);
  --card-bg-end: rgba(29, 46, 58, 0.99);
  --callout-bg: rgba(95, 155, 180, 0.11);
  --focus-ring: rgba(95, 155, 180, 0.28);
  --footer-border: rgba(53, 80, 100, 0.9);
  --mobile-menu-bg: rgba(29, 46, 58, 0.96);
  --radius: 16px;
  --max-width: 1100px;
  --space-hero-top: 2.35rem;
  --space-hero-bottom: 0.95rem;
  --space-section-y: 1.75rem;
  --space-section-header-gap: 1rem;
  --space-footer-top: 1.4rem;
  --space-footer-pad-top: 1.35rem;
  --space-footer-pad-bottom: 1.7rem;
}

:root[data-theme='light'] {
  --bg: #e1e8ee;
  --bg-accent: #d8e2ea;
  --bg-spot: #bdceda;
  --surface: #f1f6fa;
  --surface-muted: #dde7ef;
  --text: #253846;
  --text-muted: #5f7686;
  --primary: #4a7c92;
  --primary-soft: #c6d9e4;
  --accent: #9f7f4c;
  --accent-soft: #b6996b;
  --border: #bcccda;
  --shadow: 0 12px 30px rgba(28, 53, 72, 0.14);
  --header-bg: rgba(225, 232, 238, 0.95);
  --header-border: rgba(188, 204, 218, 0.9);
  --hero-bg: rgba(241, 246, 250, 0.92);
  --hero-border: rgba(188, 204, 218, 0.9);
  --nav-active-bg: rgba(74, 124, 146, 0.11);
  --card-bg-start: rgba(241, 246, 250, 0.98);
  --card-bg-end: rgba(226, 235, 243, 0.99);
  --callout-bg: rgba(74, 124, 146, 0.1);
  --focus-ring: rgba(74, 124, 146, 0.2);
  --footer-border: rgba(188, 204, 218, 0.9);
  --mobile-menu-bg: rgba(239, 245, 250, 0.98);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 12% 10%, var(--bg-spot) 0, var(--bg) 45%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-accent) 100%);
  min-height: 100vh;
  line-height: 1.6;
}

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

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

.container {
  width: min(92%, var(--max-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 1rem;
  position: relative;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.brand small {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.nav-links {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.nav-links a {
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 180ms ease, color 180ms ease;
}

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

.nav-links a.active {
  background: var(--nav-active-bg);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border));
}

.theme-toggle {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-muted) 82%, var(--surface) 18%);
  color: var(--text-muted);
  border-radius: 999px;
  width: 56px;
  height: 32px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition:
    background 280ms cubic-bezier(0.22, 1, 0.36, 1),
    color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: color-mix(in srgb, var(--surface-muted) 90%, var(--surface) 10%);
  color: var(--text);
  border-color: var(--primary-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 72%, transparent);
  outline: none;
}

.theme-toggle-thumb {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, #fff 12%);
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--shadow) 36%, transparent);
  transition:
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
  will-change: transform;
}

.theme-toggle[aria-pressed='true'] .theme-toggle-thumb {
  transform: translateX(24px);
}

.theme-icon-wrap {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 240ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-icon-sun,
.theme-icon-moon {
  opacity: 0;
  transform: scale(0.78) rotate(-14deg);
}

.theme-toggle[data-theme='light'] .theme-icon-sun,
.theme-toggle[data-theme='dark'] .theme-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.theme-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 86%, var(--text) 14%);
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-toggle {
  display: none;
  border: 0;
  background: var(--surface);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--primary);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.hero {
  padding: var(--space-hero-top) 0 var(--space-hero-bottom);
}

.hero-panel {
  position: relative;
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(1.6rem, 2.4vw, 2.6rem);
  overflow: hidden;
}

.hero-panel--home {
  padding-bottom: clamp(1.15rem, 1.7vw, 1.55rem);
}

.hero-panel--media {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  align-items: center;
  gap: 1.2rem;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-panel--home::before {
  content: '';
  position: absolute;
  pointer-events: none;
}

.hero-panel--home::before {
  inset: 0;
  background:
    linear-gradient(
      115deg,
      color-mix(in srgb, var(--hero-bg) 92%, transparent) 0%,
      color-mix(in srgb, var(--hero-bg) 78%, transparent) 42%,
      color-mix(in srgb, var(--hero-bg) 58%, transparent) 100%
    ),
    url('images/hero-abstract-bg.jpg');
  background-size: cover, cover;
  background-position: center, center;
}

.hero-panel--home .hero-copy {
  max-width: min(67ch, 66%);
}

.hero-panel--about > *,
.hero-panel--research > *,
.hero-panel--contact > * {
  position: relative;
  z-index: 1;
}

.hero-panel--about::before,
.hero-panel--research::before,
.hero-panel--contact::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      120deg,
      color-mix(in srgb, var(--hero-bg) 94%, transparent) 0%,
      color-mix(in srgb, var(--hero-bg) 86%, transparent) 54%,
      color-mix(in srgb, var(--hero-bg) 72%, transparent) 100%
    ),
    url('images/hero-abstract-bg.jpg');
  background-size: cover, cover;
}

.hero-panel--about::before {
  background-position: center, 24% 46%;
}

.hero-panel--research::before {
  background-position: center, 50% 42%;
}

.hero-panel--contact::before {
  background-position: center, 76% 48%;
}

.hero-figure {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.hero-figure img {
  width: 100%;
  height: auto;
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.15;
  margin: 0;
  max-width: 17ch;
}

.hero p {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.8vw, 1.1rem);
  max-width: 58ch;
}

.hero-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.button,
.button-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.72rem 1.1rem;
  font-weight: 700;
  font-size: 0.93rem;
  border: 1px solid transparent;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.button {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary) 78%, var(--surface) 22%),
    color-mix(in srgb, var(--primary) 70%, var(--accent) 30%)
  );
  border-color: color-mix(in srgb, var(--primary) 44%, var(--border));
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 14%, transparent);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary) 82%, var(--surface) 18%),
    color-mix(in srgb, var(--primary) 74%, var(--accent) 26%)
  );
}

.button-outline {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button-outline:hover,
.button-outline:focus-visible {
  background: var(--surface-muted);
}

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

.section + .section {
  padding-top: calc(var(--space-section-y) * 0.55);
}

.section-header {
  margin-bottom: var(--space-section-header-gap);
}

.section-tag {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--nav-active-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
}

.section h2 {
  font-family: 'Outfit', sans-serif;
  margin: 0.55rem 0 0;
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
}

.section p.lead {
  color: var(--text-muted);
  margin-top: 0.5rem;
  max-width: 66ch;
  text-wrap: pretty;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  background: linear-gradient(165deg, var(--card-bg-start), var(--card-bg-end));
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.1rem;
}

.section-tag + h3,
.section-tag + h2 {
  margin-top: 0.75rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
}

.card--research {
  display: flex;
  flex-direction: column;
}

.recent-work-list {
  margin: 0.95rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.recent-work-list li + li {
  margin-top: 0.55rem;
}

.recent-work-list strong {
  color: var(--accent);
  margin-right: 0.3rem;
}

.research-actions {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding-top: 1rem;
}

.card-figure {
  margin: 0.9rem 0 1rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.card-figure img {
  width: 100%;
  height: auto;
}

.article-meta {
  color: var(--accent);
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
}

.academic-list {
  margin: 0;
  padding-left: 1.2rem;
}

.academic-item {
  padding: 0.9rem 0 1.1rem;
  border-bottom: 1px solid var(--border);
}

.academic-item:last-child {
  border-bottom: 0;
}

.academic-title {
  margin: 0 0 0.45rem;
  font-size: 1.06rem;
}

.academic-title a {
  color: var(--text);
  text-decoration: none;
}

.academic-title a:hover,
.academic-title a:focus-visible {
  color: var(--accent);
}

.academic-item p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.academic-item strong {
  color: var(--text);
}

.academic-item p a {
  color: color-mix(in srgb, var(--primary) 84%, var(--accent) 16%);
  font-weight: 700;
  margin-left: 0.35rem;
}

.academic-item p a:hover,
.academic-item p a:focus-visible {
  color: var(--accent);
}

.citation-text {
  margin: 0;
  line-height: 1.7;
}

.citation-text a {
  color: color-mix(in srgb, var(--primary) 84%, var(--accent) 16%);
  font-weight: 700;
  margin-left: 0;
}

.citation-links {
  margin-top: 0.6rem;
  font-size: 0.92rem;
}

.citation-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.copy-citation {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.copy-citation:hover,
.copy-citation:focus-visible {
  border-color: var(--primary);
  color: var(--accent);
  outline: none;
}

.copy-citation:active {
  transform: translateY(1px);
}

.copy-citation.is-copied {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-citation.is-error {
  border-color: #d06d7a;
  color: #d06d7a;
}

.callout {
  border-left: 4px solid var(--primary);
  background: var(--callout-bg);
  border-radius: 12px;
  padding: 1rem 1rem 1rem 0.95rem;
  margin-top: 1.4rem;
  color: var(--text-muted);
}

.card p + .callout {
  margin-top: 1.5rem;
}

.callout--emergency {
  border-left-color: color-mix(in srgb, #b89356 78%, var(--primary));
  background: color-mix(in srgb, #b89356 20%, var(--callout-bg));
}

.form-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.1rem;
}

.hp-field {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--text);
  background: var(--surface-muted);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--focus-ring);
  border-color: var(--primary);
}

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

.turnstile-wrap {
  margin-top: 0.95rem;
  display: grid;
  place-items: center;
  width: 100%;
}

.turnstile-wrap .cf-turnstile {
  margin-inline: auto;
  max-width: 100%;
}

.turnstile-wrap iframe {
  display: block !important;
  margin-inline: auto !important;
}

.form-actions {
  margin-top: 0.95rem;
  display: flex;
  justify-content: center;
}

.form-note {
  margin: 0.85rem 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  text-align: center;
}

.form-status {
  margin: 0 0 0.8rem;
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
}

.form-status.is-success {
  border-color: rgba(70, 168, 123, 0.5);
  background: rgba(70, 168, 123, 0.12);
  color: #46a87b;
}

.form-status.is-error {
  border-color: rgba(208, 109, 122, 0.5);
  background: rgba(208, 109, 122, 0.12);
  color: #d06d7a;
}

.site-footer {
  margin-top: var(--space-footer-top);
  padding: var(--space-footer-pad-top) 0 var(--space-footer-pad-bottom);
  color: var(--text-muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--footer-border);
  text-align: center;
}

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 560ms ease forwards;
}

.fade-in.delay-1 {
  animation-delay: 80ms;
}

.fade-in.delay-2 {
  animation-delay: 160ms;
}

.fade-in.delay-3 {
  animation-delay: 240ms;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --space-hero-top: 1.7rem;
    --space-hero-bottom: 0.8rem;
    --space-section-y: 1.4rem;
    --space-section-header-gap: 0.9rem;
    --space-footer-top: 1.15rem;
    --space-footer-pad-top: 1.1rem;
    --space-footer-pad-bottom: 1.35rem;
  }

  .nav {
    min-height: 76px;
    padding-block: 0.35rem;
  }

  .hero-panel--home::before {
    background:
      linear-gradient(
        130deg,
        color-mix(in srgb, var(--hero-bg) 93%, transparent) 0%,
        color-mix(in srgb, var(--hero-bg) 82%, transparent) 55%,
        color-mix(in srgb, var(--hero-bg) 66%, transparent) 100%
      ),
      url('images/hero-abstract-bg.jpg');
    background-size: cover, cover;
    background-position: center, center;
  }

  .hero-panel--home .hero-copy {
    max-width: 100%;
  }

  .hero-panel--about::before,
  .hero-panel--research::before,
  .hero-panel--contact::before {
    background:
      linear-gradient(
        130deg,
        color-mix(in srgb, var(--hero-bg) 95%, transparent) 0%,
        color-mix(in srgb, var(--hero-bg) 90%, transparent) 60%,
        color-mix(in srgb, var(--hero-bg) 82%, transparent) 100%
      ),
      url('images/hero-abstract-bg.jpg');
    background-size: cover, cover;
    background-position: center, 50% 45%;
  }

  .hero-panel--media {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    right: 4%;
    left: 4%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    background: var(--mobile-menu-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: var(--shadow);
    transform: scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .nav-links.open {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    border-radius: 10px;
  }

  .theme-toggle {
    width: 52px;
    height: 30px;
    padding: 0 3px;
  }

  .theme-toggle-thumb {
    width: 22px;
    height: 22px;
  }

  .theme-toggle[aria-pressed='true'] .theme-toggle-thumb {
    transform: translateX(22px);
  }

  .theme-icon {
    width: 13px;
    height: 13px;
  }

  .hero-panel--home {
    padding-bottom: 1.1rem;
  }

  .card,
  .form-wrap {
    padding: 1rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
