/* ========================================================================
   Klas Markström — personal academic homepage

   This file is intentionally unminified and arranged for hand editing.
   The most frequently adjusted colours and dimensions are listed first.
   ======================================================================== */

:root {
  /* EDIT: COLOUR PALETTE — inspired by the Umeå University website. */
  --umu-blue: #005293;
  --umu-blue-dark: #003b6f;
  --umu-blue-soft: #eaf2f9;
  --umu-yellow: #f2b600;

  --ink: #122033;
  --muted: #4d5a69;
  --background: #ffffff;
  --panel: #ffffff;
  --border: #d9e1e8;
  --rule: #e5eaf0;
  --focus: #7b2cbf;

  /* EDIT: OVERALL WIDTH AND CORNER ROUNDING. */
  --page-width: 1280px;
  --radius: 8px;
  --shadow: 0 10px 30px rgb(18 32 51 / 5%);
}

/* ------------------------------------------------------------------------
   Base styles
   ------------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--umu-blue);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--umu-blue-dark);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

img,
svg {
  display: block;
}

.page-width {
  width: min(calc(100% - 3rem), var(--page-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  color: #ffffff;
  background: var(--umu-blue-dark);
  border-radius: 4px;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ------------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: rgb(255 255 255 / 96%);
}

.site-nav {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 3rem;
}

.nav-link {
  position: relative;
  padding: 1.35rem 0 1.2rem;
  color: var(--ink);
  font-size: 1.03rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  content: "";
  background: transparent;
}

.nav-link:hover,
.nav-link.is-current {
  color: var(--umu-blue);
}

.nav-link.is-current::after {
  background: var(--umu-blue);
}

/* ------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px max-content;
  gap: 3rem;
  align-items: start;
  padding-block: clamp(2.25rem, 5vw, 4.5rem) clamp(2rem, 4vw, 3.25rem);
}

.hero-copy {
  align-self: center;
}

h1,
.resource-title {
  font-family: Georgia, Cambria, "Times New Roman", serif;
}

h1 {
  max-width: 12ch;
  margin: 0;
  color: #0d1724;
  font-size: clamp(3.25rem, 6.4vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.position {
  margin: 0.55rem 0 0;
  color: var(--umu-blue);
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  font-weight: 750;
  line-height: 1.25;
}

.affiliation {
  max-width: 47rem;
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.accent-line {
  width: 5.5rem;
  height: 3px;
  margin: 1.65rem 0 1.25rem;
  background: var(--umu-yellow);
}

.research-summary {
  max-width: 49rem;
  margin: 0;
  font-size: clamp(1.03rem, 1.35vw, 1.18rem);
  line-height: 1.75;
}

.portrait-frame {
  align-self: center;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--umu-blue-soft);
  box-shadow: var(--shadow);
}

.portrait {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.profile-action {
  padding-top: 2.35rem;
}

.profile-button {
  display: inline-flex;
  min-width: 13rem;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  color: var(--umu-blue);
  border: 2px solid var(--umu-blue);
  border-radius: 7px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition:
    color 140ms ease,
    background-color 140ms ease;
}

.profile-button:hover {
  color: #ffffff;
  background: var(--umu-blue);
}

.button-icon,
.external-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

/* ------------------------------------------------------------------------
   Main resource cards
   ------------------------------------------------------------------------ */

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  margin-bottom: 1.4rem;
}

.resource-card {
  display: flex;
  min-height: 15rem;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(1.25rem, 2.4vw, 1.75rem);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 1px 0 rgb(18 32 51 / 2%);
  text-decoration: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.resource-card:hover {
  color: var(--ink);
  border-color: #adc4d8;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.resource-icon {
  display: grid;
  width: 3.65rem;
  height: 3.65rem;
  margin-bottom: 1rem;
  place-items: center;
  color: var(--umu-blue);
  border-radius: 50%;
  background: var(--umu-blue-soft);
}

.resource-icon svg {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.resource-content {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.resource-title {
  color: #111b27;
  font-size: clamp(1.42rem, 2vw, 1.72rem);
  line-height: 1.2;
}

.resource-description {
  margin-top: 0.5rem;
  color: var(--muted);
  line-height: 1.55;
}

.resource-link-text {
  margin-top: auto;
  padding-top: 1rem;
  color: var(--umu-blue);
  font-weight: 750;
}

.arrow {
  margin-left: 0.35rem;
  color: var(--umu-yellow);
  font-size: 1.35em;
  line-height: 0;
}

/* ------------------------------------------------------------------------
   Contact and people panels
   ------------------------------------------------------------------------ */

.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 1.4rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel h2 {
  margin: 0;
  color: var(--umu-blue);
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.3;
}

.section-underline {
  width: 4rem;
  height: 2px;
  margin-top: 0.45rem;
  background: var(--umu-yellow);
}

.contact-panel {
  padding: 1.35rem 1.45rem 0.35rem;
}

.contact-list {
  margin: 0.8rem 0 0;
}

.contact-row {
  display: grid;
  grid-template-columns: minmax(9rem, 0.68fr) minmax(0, 1.45fr);
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}

.contact-row:last-child {
  border-bottom: 0;
}

.contact-row dt,
.contact-row dd {
  margin: 0;
}

.contact-row dt {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 600;
}

.contact-row dd {
  color: var(--muted);
}

.contact-row a {
  font-weight: 650;
  text-decoration: none;
}

.contact-icon {
  width: 1.55rem;
  height: 1.55rem;
  flex: none;
  fill: none;
  color: var(--umu-blue);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.people-stack {
  display: grid;
  gap: 1.4rem;
}

.people-panel {
  padding: 1.2rem 1.45rem;
}

.people-panel ul {
  margin: 0.7rem 0 0;
  padding-left: 1.25rem;
}

.people-panel li {
  padding-left: 0.15rem;
}

.people-panel li::marker {
  color: var(--umu-blue);
}

.detail {
  color: var(--muted);
  font-size: 0.92em;
}

/* ------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--rule);
}

.footer-inner {
  padding-block: 1.25rem 1.5rem;
  text-align: center;
}

.footer-inner p {
  max-width: 55rem;
  margin: 0 auto;
  color: var(--muted);
}

.footer-inner a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  font-weight: 700;
  text-decoration: none;
}

.external-icon {
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
}

/* ------------------------------------------------------------------------
   Responsive layout
   ------------------------------------------------------------------------ */

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .profile-action {
    grid-column: 2;
    padding-top: 0;
  }

  .profile-button {
    width: 100%;
  }
}

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

  .resource-card {
    min-height: 0;
  }

  .resource-link-text {
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  .page-width {
    width: min(calc(100% - 2rem), var(--page-width));
  }

  .site-nav {
    min-height: 62px;
    gap: 1.4rem;
    overflow-x: auto;
  }

  .nav-link {
    padding-block: 1.1rem 1rem;
    white-space: nowrap;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-copy,
  .portrait-frame,
  .profile-action {
    grid-column: 1;
  }

  .portrait-frame {
    width: min(74vw, 260px);
  }

  .profile-button {
    width: min(100%, 260px);
  }

  .contact-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .contact-row dd {
    padding-left: 2.35rem;
  }
}

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

  .profile-button,
  .resource-card {
    transition: none;
  }
}

@media print {
  .skip-link,
  .site-header,
  .profile-action {
    display: none;
  }

  body {
    font-size: 11pt;
  }

  .hero,
  .resource-grid,
  .details-grid {
    display: block;
  }

  .portrait-frame {
    width: 160px;
    margin-block: 1rem;
  }

  .resource-card,
  .panel {
    margin-bottom: 1rem;
    break-inside: avoid;
    box-shadow: none;
  }
}
