@font-face {
  font-family: "Lora";
  src: url("./fonts/Lora-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f5f2eb;
  --ink: #233b50;
  --muted: #4e6070;
  --frame-inset: 24px;
  --frame-width: 1.6px;
  --identity-padding-inline: 40px;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Lora", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #d6dfdf; color: var(--ink); }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  container-type: size;
}

.sound-field {
  position: absolute;
  inset: 0;
  opacity: 0.8;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  pointer-events: none;
}

.sound-field svg { display: block; width: 100%; height: 100%; }

.page-frame {
  position: fixed;
  inset: var(--frame-inset);
  z-index: 10;
  border: var(--frame-width) solid var(--muted);
  pointer-events: none;
}

main {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: end center;
  height: 100%;
  height: 100dvh;
  padding: calc(var(--frame-inset) + var(--frame-width));
  text-align: center;
}

.identity {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  width: 100%;
  padding: 28px var(--identity-padding-inline);
  background: var(--paper);
  border-top: var(--frame-width) solid var(--muted);
}

.brand {
  flex: 1 0 max-content;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
}

h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 1.12;
  text-align: left;
}

.mission {
  position: relative;
  z-index: 1;
  width: calc(100% - 80px);
  max-width: 24ch;
  margin: 0;
  --mission-size: clamp(28px, min(4.85cqw, 9.35cqh), 78px);
  font-size: var(--mission-size);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.045em;
  text-wrap: balance;
  color: var(--ink);
  text-shadow: 0 2px 12px var(--paper), 0 0 32px var(--paper);
}

nav {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
  margin: 0;
  font-size: 16px;
}

a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.link-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

a:hover .link-label { border-bottom-color: currentColor; }

a:focus-visible { outline: 1px solid var(--ink); outline-offset: 6px; border-radius: 1px; }
.arrow { display: block; flex: 0 0 auto; width: 17px; height: 17px; }
.separator { height: 17px; width: 1px; background: rgb(35 59 80 / 24%); }

@media (max-width: 1000px) and (min-width: 601px) {
  :root { --identity-padding-inline: 32px; }
  .identity { gap: 32px; padding: 26px var(--identity-padding-inline); }
}

@media (max-width: 600px) {
  :root { --frame-inset: 14px; --identity-padding-inline: 16px; }
  .identity { display: flex; flex-direction: column; gap: 15px; padding: 22px var(--identity-padding-inline) 16px; }
  .brand { width: 100%; text-align: center; }
  .title-row { gap: 12px; }
  .brand-mark { width: 44px; height: 44px; }
  h1 { font-size: 36px; text-align: center; }
  .mission { width: calc(100% - 40px); --mission-size: clamp(24px, min(8.5cqw, 9.35cqh), 38px); }
  nav { justify-content: center; gap: 18px; font-size: 14px; }
  .link-label { gap: 7px; }
  .arrow { width: 15px; height: 15px; }
}

@media (max-width: 350px) {
  :root { --identity-padding-inline: 12px; }
  nav { gap: 12px; font-size: 13px; }
  .link-label { gap: 5px; }
}

@media (max-height: 500px) and (min-width: 600px) {
  :root { --identity-padding-inline: 24px; }
  .identity { padding: 16px var(--identity-padding-inline); gap: 10px 20px; }
  h1 { font-size: 32px; }
  .brand-mark { width: 40px; height: 40px; }
}

/* Measured slogan and continent bounds define the stacked 2:1:2 spacing. */
main:has(.identity.is-stacked) .mission {
  position: absolute;
  top: var(--stacked-slogan-top, 0px);
  left: var(--stacked-slogan-center, 50%);
  width: var(--stacked-slogan-width, 80%);
  max-width: none;
  font-size: min(var(--mission-size), 8.5cqh);
  transform: translateX(-50%);
}

main:has(.identity.is-stacked) .sound-field svg {
  position: absolute;
  top: var(--stacked-map-top, 0px);
  left: 0;
  height: var(--stacked-map-height, calc(200% / 3));
  overflow: visible;
}

.identity.is-stacked {
  align-content: center;
  justify-content: center;
  padding-block: 32px;
  row-gap: 32px;
}

.identity.is-stacked .brand { flex-grow: 0; }
.identity.is-stacked .title-row {
  flex-direction: row;
  justify-content: center;
}

.identity.is-stacked .brand,
.identity.is-stacked h1 { text-align: center; }
.identity.is-stacked nav { justify-content: center; }

@media (max-width: 600px) {
  .identity.is-stacked { padding-block: 24px; row-gap: 24px; }
}

@media (max-height: 500px) {
  .identity.is-stacked { padding-block: 12px; row-gap: 12px; }
}

@media (max-height: 450px) and (max-width: 600px) {
  .identity.is-stacked { padding-block: 12px; row-gap: 10px; }
  h1 { font-size: 30px; }
  .brand-mark { width: 38px; height: 38px; }
  .mission { --mission-size: clamp(18px, 8.5cqh, 28px); }
}
