/* ---------- Fonts ---------- */

@font-face {
  font-family: "Google Sans Flex";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/google-sans-flex.woff2") format("woff2");
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/space-mono-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/space-mono-bold.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */

:root {
  --color-background-primary: #ebd0c7;
  --color-content-primary: #1d59ee;
  --color-content-primary-alpha-50: #1d59ee80;
  --color-content-primary-inverse: #ebd0c7;

  --font-family-display: "Google Sans Flex", sans-serif;
  --font-family-body: "Space Mono", monospace;

  --font-size-display-xl: 98px;
  --font-size-display-xl-mobile: 40px;
  --font-size-body-md: 14px;

  --line-height-display-xl: 1.2;
  --line-height-body-md: 1.5;

  --letter-spacing-body-md: 0.42px;

  --space-page-padding-desktop: 24px;
  --space-page-padding-mobile: 16px;

  --breakpoint-desktop: 900px;
}

/* ---------- Reset ---------- */

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

html,
body {
  height: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--color-background-primary);
  color: var(--color-content-primary);
  font-family: var(--font-family-body);
  font-size: var(--font-size-body-md);
  line-height: var(--line-height-body-md);
  letter-spacing: var(--letter-spacing-body-md);
}

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

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Reveal-on-load ---------- */

@keyframes reveal-mask {
  from {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
  }
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

.reveal {
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  animation: reveal-mask 0.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  animation-delay: 0.1s;
}

.reveal--delay-1 {
  animation-delay: 0.1s;
}

.reveal--delay-2 {
  animation-delay: 0.2s;
}

.reveal--delay-3 {
  animation-delay: 0.3s;
}

.reveal--delay-4 {
  animation-delay: 0.4s;
}

.reveal--delay-5 {
  animation-delay: 0.5s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
    clip-path: none;
    opacity: 1;
  }

  .hero__float {
    animation: none;
  }
}

/* ---------- Page shell ---------- */

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: var(--space-page-padding-mobile);
}

.wordmark {
  font-weight: 700;
}

.contact-links {
  display: none;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.contact-link:hover,
.contact-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon {
  display: block;
  flex-shrink: 0;
}

.icon--arrow {
  width: 9px;
  height: 9px;
}

.icon--plus {
  width: 10px;
  height: 10px;
}

.icon--x-close {
  width: 9px;
  height: 9px;
}

.icon--arrow-inverse {
  width: 9px;
  height: 9px;
}

/* ---------- Bracket button ---------- */

.bracket-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.bracket-button:hover .bracket-button__label,
.bracket-button:focus-visible .bracket-button__label {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bracket-button__bracket {
  user-select: none;
}

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

.hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-page-padding-mobile);
  padding-bottom: 20px;
  min-height: 0;
}

.hero__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__tree {
  position: relative;
  flex-shrink: 0;
  width: min(750px, 175vw, 90vh);
  aspect-ratio: 1563 / 1024;
  transform: translateY(7%);
}

.hero__visual {
  position: absolute;
  inset: 0;
}

.hero__float {
  position: relative;
  width: 100%;
  height: 100%;
  animation: hero-float 6s ease-in-out infinite;
  will-change: transform;
}

@keyframes hero-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-3%) rotate(0.6deg);
  }
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero__image-tint {
  position: absolute;
  inset: 0;
  background-color: rgba(235, 208, 199, 0.5);
}

.hero__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero__caption {
  position: absolute;
  left: 50%;
  top: 59%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  width: min(360px, 92%);
}

.hero__headline {
  font-family: var(--font-family-display);
  font-weight: 500;
  font-size: var(--font-size-display-xl-mobile);
  line-height: var(--line-height-display-xl);
  font-variation-settings: "GRAD" 0, "ROND" 0, "wdth" 100;
}

.caption-word {
  color: var(--color-content-primary-alpha-50);
  transition: color 0.35s ease-in-out;
}

.caption-word--revealed {
  color: var(--color-content-primary);
}

.hero__intro {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
  max-width: 420px;
}

.hero__local-info {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero__local-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon--pin {
  width: 14px;
  height: 14px;
}

.hero__intro-text--desktop {
  display: none;
}

.hero__definition {
  display: none;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 8px;
}

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

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Info overlay ---------- */

body.no-scroll {
  overflow: hidden;
}

.info-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.info-overlay[hidden] {
  display: none;
}

.info-overlay__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(235, 208, 199, 0.8);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.info-overlay--open .info-overlay__backdrop {
  opacity: 1;
}

.info-panel {
  position: relative;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 32px;
  background-color: var(--color-content-primary);
  color: var(--color-content-primary-inverse);
  padding: var(--space-page-padding-mobile);
  transform: translateY(100%);
  transition: transform 0.4s ease;
  overflow-y: auto;
}

.info-overlay--open .info-panel {
  transform: translateY(0);
}

.info-panel__close {
  order: 0;
  align-self: center;
  flex-shrink: 0;
}

.info-panel__content {
  order: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-height: 0;
}

.info-panel__heading {
  font-family: var(--font-family-display);
  font-weight: 400;
  font-size: 24px;
  line-height: var(--line-height-display-xl);
  letter-spacing: 0.72px;
  font-variation-settings: "GRAD" 0, "ROND" 0, "wdth" 100;
}

.info-panel__row {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.info-panel__intro {
  display: none;
}

.info-panel__links {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.info-panel__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-panel__list-title {
  font-weight: 400;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.info-panel__link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.info-panel__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
}

.info-panel__link:hover,
.info-panel__link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.info-panel__contact {
  order: 2;
  display: flex;
  justify-content: space-between;
}

.info-panel__contact a:hover,
.info-panel__contact a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Quote overlay ---------- */

.quote-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.quote-overlay[hidden] {
  display: none;
}

.quote-overlay__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(235, 208, 199, 0.8);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.quote-overlay--open .quote-overlay__backdrop {
  opacity: 1;
}

.quote-panel {
  position: relative;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 32px;
  background-color: var(--color-content-primary);
  color: var(--color-content-primary-inverse);
  padding: var(--space-page-padding-mobile);
  transform: translateY(-100%);
  transition: transform 0.4s ease;
  overflow-y: auto;
}

.quote-overlay--open .quote-panel {
  transform: translateY(0);
}

.quote-panel__close {
  flex-shrink: 0;
}

.quote-panel__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
}

.quote-panel__label {
  font-weight: 400;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.quote-panel__polymath {
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Polymath toast ---------- */

.polymath-toast {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding: var(--space-page-padding-mobile);
  background-color: var(--color-background-primary);
  color: var(--color-content-primary);
  transform: translateY(100%);
  transition: transform 0.35s ease;
}

.polymath-toast[hidden] {
  display: none;
}

.polymath-toast--open {
  transform: translateY(0);
}

.polymath-toast__close {
  flex-shrink: 0;
}

.polymath-toast__text {
  width: 100%;
}

@media (min-width: 900px) {
  .site-header {
    justify-content: space-between;
    padding: var(--space-page-padding-desktop);
  }

  .contact-links {
    display: contents;
  }

  .hero {
    padding: var(--space-page-padding-desktop);
    min-height: 700px;
  }

  .site-footer {
    padding: var(--space-page-padding-desktop);
  }

  .hero__stage {
    display: contents;
  }

  .hero__tree {
    display: contents;
  }

  .hero__visual {
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    width: min(1560px, 108vw);
    aspect-ratio: 1563 / 1024;
    margin: 0;
  }

  .hero__image-tint {
    background-color: rgba(235, 208, 199, 0.4);
  }

  .hero__intro {
    position: absolute;
    left: 10.8%;
    top: 19.8%;
    width: 292px;
    max-width: 292px;
    margin-top: 0;
  }

  .hero__intro-text--mobile {
    display: none;
  }

  .hero__intro-text--desktop {
    display: block;
  }

  .hero__caption {
    position: absolute;
    left: 50%;
    top: 54.4%;
    transform: translate(-50%, -50%);
    width: min(1360px, 94.4%);
    margin-top: 0;
  }

  .hero__headline {
    font-size: clamp(56px, 6.8vw, 98px);
    white-space: nowrap;
  }

  .hero__actions {
    display: contents;
  }

  .hero__actions-quote {
    position: absolute;
    left: 10.8%;
    top: 72.36%;
  }

  .site-footer {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
  }

  .hero__definition {
    display: block;
    position: absolute;
    right: 7%;
    top: 72.36%;
    width: 254px;
  }

  .info-panel {
    height: 512px;
    padding: var(--space-page-padding-desktop);
    gap: 24px;
  }

  .info-panel__close {
    order: 2;
  }

  .info-panel__content {
    gap: 80px;
  }

  .info-panel__heading {
    font-size: 40px;
    letter-spacing: 1.2px;
    max-width: 1322px;
  }

  .info-panel__row {
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 64px;
  }

  .info-panel__intro {
    display: block;
    width: 333px;
    flex-shrink: 0;
  }

  .info-panel__links {
    flex-direction: row;
    gap: 33px;
  }

  .info-panel__contact {
    display: none;
  }

  .quote-panel {
    height: 512px;
    padding: var(--space-page-padding-desktop);
    align-items: center;
  }

  .quote-panel__content {
    width: 372px;
  }

  .quote-panel__polymath {
    text-decoration: none;
    cursor: default;
  }
}
