@font-face {
  font-family: "Gloock";
  src: url("fonts/gloock.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --night: #03040a;
  --soil: #1f1411;
  --ink: #fbf4f6;
  --blossom: #ffcfe0;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  background: #110b0a;
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  overflow-x: clip;
}

a,
button {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover,
button:hover {
  color: var(--blossom);
  text-decoration-thickness: 2px;
}

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

button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

/* Above the ground. Everything scrolls with the page; the ground already shows on the first screen. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 92vh;
  min-height: 92svh;
  padding: 3vw 3vw max(4vh, 30px);
  background: var(--night);
}

.hero:only-child {
  min-height: 100vh;
  min-height: 100svh;
}

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(90% 62% at 46% 94%, rgb(255 120 170 / 0.13), transparent),
    linear-gradient(#03040a, #070a16 62%, #14101f);
}

.scene canvas {
  position: absolute;
  display: block;
}

/* Until the script has placed them. On a slow device the browser paints before that, and they would jump. */
#tree,
#sway {
  visibility: hidden;
}

/* No height until the script sets one: otherwise a canvas this wide is half as high as it is wide. */
#ground {
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
}

.poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right bottom;
}

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

/* Over the name, so petals can come to rest on it, but only as far as the sky goes. */
#petals {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.name {
  font-family: "Gloock", Georgia, serif;
  font-size: min(13vw, 23vh);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.012em;
}

.name span {
  display: inline-block;
}

.about {
  margin-top: min(2.2vw, 3.8vh);
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.4;
}

.about nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em 1.3em;
  margin-top: 0.35em;
}

.gap {
  flex: 1;
}

/* Below the ground: the roots, and on them the projects. */
.underground {
  position: relative;
  isolation: isolate;
  padding: clamp(110px, 20vh, 190px) 3vw 3.2vh;
  background: linear-gradient(var(--soil), #170f0d 30rem, #110b0a);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.5;
}

.surface {
  position: absolute;
  z-index: -2;
  top: -13px;
  left: 0;
  display: block;
  width: 100%;
  height: 26px;
}

/* Its top edge is where the trunk ends, so the main root carries straight on from it. One pixel of overlap keeps the night from shining through. */
.roots {
  position: absolute;
  z-index: -1;
  overflow: hidden;
  inset: -1px 0 0;
  pointer-events: none;
}

.root,
.bloom,
.stones {
  position: absolute;
  display: block;
}

.stones {
  inset: 0;
  width: 100%;
  height: 100%;
  fill: #271a16;
}

.roots.grows .bloom {
  transition: transform 0.5s ease-out;
}

.roots.grows .bloom.wait {
  transform: scale(0);
}

.lead,
.projects,
.notes,
.contact {
  max-width: min(46rem, 58vw);
}

.lead p {
  font-size: clamp(1.45rem, 2.5vw, 2.5rem);
  line-height: 1.22;
  letter-spacing: -0.012em;
}

.lead p + p {
  margin-top: 0.7em;
}

.projects {
  margin-top: clamp(4.5rem, 14vh, 9rem);
}

.projects h2,
.contact h2,
.legal h1 {
  font-family: "Gloock", Georgia, serif;
  font-size: clamp(2.6rem, 6vw, 5.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.012em;
}

.projects ul {
  padding: 0;
  list-style: none;
}

.projects li {
  margin-top: clamp(2.8rem, 8vh, 5rem);
}

.projects h3 {
  margin-bottom: 0.3em;
  font-family: "Gloock", Georgia, serif;
  font-size: clamp(1.75rem, 2.8vw, 2.75rem);
  font-weight: 400;
  line-height: 1.1;
  word-spacing: 0.08em;
  overflow-wrap: anywhere;
}

.meta {
  margin-top: 0.5em;
  color: var(--blossom);
}

.notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 2.5em 3em;
  margin-top: clamp(4.5rem, 14vh, 9rem);
}

.notes h2 {
  margin-bottom: 0.4em;
  font-size: inherit;
  font-weight: 600;
}

.notes p + p {
  margin-top: 0.7em;
}

.notes strong {
  display: block;
  font-weight: 600;
}

.contact {
  margin-top: clamp(4.5rem, 14vh, 9rem);
}

.contact .mail {
  margin: 0.2em 0 0.5em;
  font-size: clamp(1.4rem, 3.4vw, 3.2rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.underground footer {
  display: flex;
  gap: 1.3em;
  margin-top: clamp(3.5rem, 10vh, 6rem);
  font-size: clamp(15px, 1.2vw, 18px);
}

/* Portrait: same threshold as the scene choice in tree.js. */
@media (max-aspect-ratio: 23/25) {
  .hero {
    padding: 4vw 4vw max(3vh, 26px);
  }

  .name {
    font-size: 27vw;
    line-height: 0.92;
  }

  .name span {
    display: block;
  }

  .about {
    margin-top: 2.6vh;
  }

  .underground {
    padding: clamp(100px, 16vh, 150px) 44px 2.4vh 4vw;
  }

  .lead,
  .projects,
  .notes,
  .contact {
    max-width: none;
  }
}

.legal {
  max-width: 44rem;
  padding: clamp(24px, 6vh, 72px) clamp(16px, 4vw, 48px);
  font-size: 17px;
  line-height: 1.55;
}

.back {
  display: inline-block;
  margin-bottom: 2.5em;
}

.legal h2 {
  margin-top: 2em;
  font-size: 1.15em;
  font-weight: 600;
}

.legal p,
.legal dl {
  margin-top: 0.7em;
}

.legal dt {
  margin-top: 0.7em;
  font-weight: 600;
}

.legal dd {
  margin: 0;
}

html.poster-only .hero-text,
html.poster-only .underground {
  visibility: hidden;
}

html.poster-only .hero {
  min-height: 100svh;
}
