/* Berth von Kantzows stiftelse */

:root {
  --ink:        #16202b;
  --ink-soft:   #44525f;
  --ink-faint:  #7b8794;
  --line:       #dfe4e9;
  --paper:      #ffffff;
  --paper-alt:  #f5f8fa;
  --blue:       #1d5f9c;
  --blue-deep:  #0f3f6e;
  --blue-tint:  #eaf2f9;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --wide: 1120px;
  --text: 720px;
}

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

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

html, body { overflow-x: hidden; }

body {
  margin: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue-deep);
  color: #fff;
  padding: .75rem 1.25rem;
  z-index: 200;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
}
.brand span { color: var(--blue); font-weight: 500; }

.site-header nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.site-header nav a {
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding: .35rem 0;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.site-header nav a:hover { color: var(--blue); border-bottom-color: var(--blue); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 38px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 24px;
  background: var(--ink);
  transition: transform .22s ease, opacity .18s 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); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(360px, 58vh, 560px);
  padding: 4rem 1.5rem;
  text-align: center;
  color: #fff;
  /* the artwork is bright white at the edges, so the scrim has to be strong
     enough that white type stays legible across the whole frame */
  background:
    radial-gradient(ellipse 74% 66% at 50% 50%, rgba(6,26,46,.90), rgba(6,26,46,.72) 62%, rgba(6,26,46,.62) 100%),
    var(--blue-deep) url("images/hero.jpg") center / cover no-repeat;
}

.hero-inner {
  max-width: 780px;
  position: relative;
  z-index: 1;
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 5vw, 4rem);
}

/* the artwork runs to pure white in places, so the text block carries its own
   scrim rather than relying on the page-wide gradient alone */
.hero-inner::before {
  content: "";
  position: absolute;
  inset: -22% -14%;
  z-index: -1;
  background: radial-gradient(ellipse 50% 46% at 50% 50%,
              rgba(6,26,46,.86) 0%,
              rgba(6,26,46,.78) 42%,
              rgba(6,26,46,.52) 68%,
              rgba(6,26,46,.22) 85%,
              rgba(6,26,46,0) 100%);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.12;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(4,18,34,.72), 0 2px 28px rgba(4,18,34,.55);
}

.hero .tagline {
  margin: 1.5rem auto 0;
  max-width: 34em;
  font-size: clamp(.9rem, 1.7vw, 1.05rem);
  font-weight: 400;
  letter-spacing: .13em;
  text-transform: uppercase;
  line-height: 2;
  color: #fff;
  text-shadow: 0 1px 3px rgba(4,18,34,.8), 0 1px 16px rgba(4,18,34,.6);
}

/* ---------- sections ---------- */

.section {
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.25rem, 5vw, 3rem);
}
.section-alt { background: var(--paper-alt); }

.section-head {
  max-width: var(--wide);
  margin: 0 auto clamp(2.5rem, 5vw, 3.5rem);
}

.kicker {
  margin: 0 0 .6rem;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blue);
}

.section h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: .01em;
  color: var(--ink);
}

.section h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 2px;
  margin-top: 1.25rem;
  background: var(--blue);
}

.section-intro {
  margin: 1.5rem 0 0;
  max-width: var(--text);
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* ---------- om stiftelsen ---------- */

.om-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  max-width: var(--wide);
  margin: 0 auto;
}

.om-text p { margin: 0 0 1.35rem; color: var(--ink-soft); }
.om-text p:first-child {
  font-size: 1.12rem;
  line-height: 1.68;
  color: var(--ink);
}
.om-text p:last-child { margin-bottom: 0; }

.om-portrait {
  margin: 0;
  position: sticky;
  top: 6.5rem;
}
.om-portrait img {
  width: 100%;
  border-radius: 2px;
  filter: grayscale(.15);
  box-shadow: 0 12px 32px rgba(22,32,43,.14);
}
.om-portrait figcaption {
  margin-top: .9rem;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* ---------- destinatörer ---------- */

.lead-figure {
  max-width: var(--wide);
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
}
.lead-figure img {
  width: 100%;
  border-radius: 3px;
  box-shadow: 0 14px 40px rgba(22,32,43,.13);
}
.lead-figure figcaption,
.card .credit {
  font-size: .88rem;
  line-height: 1.6;
  color: var(--ink-faint);
}
.lead-figure figcaption { margin-top: 1rem; max-width: var(--text); }

.credit { font-style: italic; }
.lead-figure .credit { display: inline; }

.cards {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.25rem);
  max-width: var(--wide);
  margin: 0 auto;
}

.card {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(22,32,43,.04);
  transition: box-shadow .22s ease, transform .22s ease;
}
.card:hover {
  box-shadow: 0 16px 38px rgba(22,32,43,.11);
  transform: translateY(-2px);
}

.card-media {
  background: var(--blue-tint);
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  min-height: 240px;
}

/* wide, information-bearing images (diagrams, screenshots) must not be cropped */
.card-wide {
  grid-template-columns: 1fr;
}
.card-wide .card-media {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: clamp(1rem, 3vw, 2rem);
}
.card-wide .card-media img {
  width: auto;
  max-width: min(100%, 860px);
  height: auto;
  min-height: 0;
  margin: 0 auto;
  object-fit: contain;
}

.card-body {
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.card-body h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--blue-deep);
}

.card-body .role {
  margin: .4rem 0 1.2rem;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.card-body h3 + p:not(.role) { margin-top: 1.2rem; }

.card-body p {
  margin: 0 0 1rem;
  font-size: .97rem;
  color: var(--ink-soft);
}
.card-body p:last-child { margin-bottom: 0; }
.card-body .credit { margin-top: 1.25rem; }

/* ---------- ansökan ---------- */

.notice {
  max-width: var(--text);
  margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--blue-tint);
  border-left: 3px solid var(--blue);
  border-radius: 2px;
}
.notice p { margin: 0 0 1rem; color: var(--ink-soft); }
.notice p:last-child { margin-bottom: 0; }
.notice-lead {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--ink) !important;
}

/* ---------- footer ---------- */

.site-footer {
  padding: clamp(3rem, 6vw, 4.5rem) clamp(1.25rem, 5vw, 3rem);
  background: var(--ink);
  color: rgba(255,255,255,.72);
  text-align: center;
}
.site-footer p { margin: 0 auto .8rem; max-width: 46em; font-size: .95rem; }
.footer-brand {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: #fff;
}
.copyright {
  margin-top: 2rem;
  font-size: .82rem;
  color: rgba(255,255,255,.45);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .om-grid { grid-template-columns: 1fr; }
  .om-portrait {
    position: static;
    max-width: 240px;
  }
  .card { grid-template-columns: 1fr; }
  .card-media img {
    max-height: 380px;
    min-height: 0;
    object-position: center;
  }
  .card-media.portrait img { max-height: 460px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  .nav-toggle { display: flex; }

  .site-header { flex-wrap: wrap; }

  .site-header nav {
    display: none;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding-top: .75rem;
    margin-top: .75rem;
    border-top: 1px solid var(--line);
  }
  .site-header nav.open { display: flex; }
  .site-header nav a {
    padding: .8rem 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
  }
  .brand { font-size: 1.1rem; }
  .site-header nav a:last-child { border-bottom: 0; }

  .hero { min-height: 420px; }
  .hero .tagline { letter-spacing: .1em; line-height: 1.9; }

  /* hard line breaks would force the hero wider than the viewport */
  .br-wide { display: none; }
  .hero h1 { letter-spacing: .015em; hyphens: auto; }
}

@media print {
  .site-header, .nav-toggle, .skip-link { display: none; }
  .hero { min-height: 0; color: var(--ink); background: none; padding: 2rem 0; }
  .hero h1, .hero .tagline { color: var(--ink); text-shadow: none; }
  .card, .section-alt { break-inside: avoid; background: none; }
}
