:root {
  --paper: #f5f1e7;
  --paper-warm: #f1e8d8;
  --ink: #034c2c;
  --logo-ink: #034c2c;
  --cream: #fff7df;
  --blush: #dba5a3;
  --poppy: #c85e4f;
  --cornflower: #718bb5;
  --gold: #d3b56d;
  --violet: #8d7da7;
  --autumn: #9a5d35;
  --logo-image: url("../assets/brand/otium-farm-logo.png");
  color-scheme: light;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--paper);
}

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

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
}

button,
a {
  font: inherit;
}

.experience {
  --germination: 0;
  --root-growth: 0;
  --leaf-one: 0;
  --leaf-two: 0;
  --spring: 0;
  --summer: 0;
  --autumn-progress: 0;
  --winter: 0;
  --scene-opacity: 1;
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 420px;
  isolation: isolate;
  overflow: hidden;
  background: var(--paper);
}

.paper {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 23%, rgb(255 255 255 / 18%) 0 0.6px, transparent 0.8px),
    radial-gradient(circle at 72% 68%, rgb(80 60 35 / 4%) 0 0.55px, transparent 0.8px),
    var(--paper);
  background-size: 13px 17px, 19px 23px, auto;
}

.static-mode,
.static-mode .experience,
.static-mode .paper,
.static-mode .noscript-identity {
  background: #fff;
}

.static-mode .identity {
  pointer-events: auto;
  transition: none;
}

.static-mode .stage,
.static-mode .controls {
  display: none !important;
}

.stage {
  position: absolute;
  inset: 0;
  opacity: var(--scene-opacity);
  overflow: hidden;
  pointer-events: none;
}

.meadow-canvas,
.botanical-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.meadow-canvas {
  z-index: 1;
}

.botanical-scene {
  z-index: 2;
  overflow: visible;
}

.botanical-scene .draw-path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.root {
  opacity: 0.38;
  stroke-width: 2.3 !important;
}

.root--main {
  stroke-dashoffset: calc(1 - var(--root-growth));
}

.root--left,
.root--right {
  stroke-dashoffset: calc(1 - var(--spring));
}

.seed {
  fill: var(--ink);
  opacity: clamp(0, calc(var(--germination) * 5), 1);
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(calc(0.3 + var(--germination) * 0.7));
}

.stem--hero {
  stroke-dashoffset: calc(1 - var(--germination));
}

.leaf,
.bud,
.flower {
  transform-box: fill-box;
  transform-origin: bottom center;
}

.leaf {
  fill: color-mix(in srgb, var(--ink) 91%, var(--paper));
  stroke: var(--ink);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.leaf--one {
  opacity: var(--leaf-one);
  transform: scale(var(--leaf-one)) rotate(calc((1 - var(--leaf-one)) * -11deg));
}

.leaf--two {
  opacity: var(--leaf-two);
  transform: scale(var(--leaf-two)) rotate(calc((1 - var(--leaf-two)) * 12deg));
}

.bud {
  fill: var(--cream);
  stroke: var(--ink);
  stroke-width: 3;
  opacity: var(--leaf-two);
  transform: scale(var(--leaf-two));
}

.principal-plants {
  opacity: var(--spring);
}

.principal-plants .stem,
.tree .draw-path {
  stroke-dashoffset: calc(1 - var(--spring));
}

.secondary-leaf {
  opacity: var(--spring);
  transform: scale(var(--spring));
}

.secondary-leaf--late {
  opacity: var(--summer);
  transform: scale(var(--summer));
}

.flower {
  opacity: var(--summer);
  transform: scale(var(--summer));
  stroke: var(--ink);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.flower--poppy path {
  fill: var(--poppy);
}

.flower--cornflower path {
  fill: var(--cornflower);
}

.flower circle {
  fill: var(--gold);
}

.tree {
  opacity: var(--spring);
}

.tree .trunk {
  stroke-width: 7;
}

.tree .branch {
  stroke-width: 4.5;
}

.tree-crown {
  fill: color-mix(in srgb, var(--ink) 82%, var(--paper));
  opacity: calc(var(--summer) * (1 - var(--winter)));
  transform-box: fill-box;
  transform-origin: center bottom;
  transform: scale(calc(0.35 + var(--summer) * 0.65));
}

.winter-lines {
  opacity: var(--winter);
}

.winter-line {
  stroke-dashoffset: calc(1 - var(--winter)) !important;
  stroke-width: 3 !important;
}

.identity {
  position: absolute;
  inset: max(1.5rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(1.1rem, 2.6vh, 2rem);
  opacity: 1;
  transition: opacity 1.35s cubic-bezier(.2, .7, .2, 1);
}

.is-preparing .identity,
.is-running:not(.is-resolving) .identity {
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.is-running .identity:focus-within {
  opacity: 1;
  pointer-events: auto;
}

.is-resolving .identity,
.is-complete .identity,
.asset-error .identity {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 1.35s cubic-bezier(.2, .7, .2, 1);
}

.identity__logo {
  position: relative;
  width: min(42vw, 390px);
  aspect-ratio: 1122 / 1402;
}

.identity__logo-fallback,
.identity__logo-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.identity__logo-fallback {
  display: block;
  object-fit: contain;
}

.identity__logo-mask {
  display: none;
}

@supports ((mask-image: url("")) or (-webkit-mask-image: url(""))) {
  .identity__logo-fallback {
    display: none;
  }

  .identity__logo-mask {
    display: block;
    background: var(--logo-ink);
    -webkit-mask: var(--logo-image) center / contain no-repeat;
    mask: var(--logo-image) center / contain no-repeat;
  }
}

.identity__text-fallback {
  display: none;
  width: 100%;
  height: 100%;
  place-items: center;
  text-align: center;
  font-size: clamp(2.4rem, 9vw, 5rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.asset-error .identity__logo-fallback,
.asset-error .identity__logo-mask {
  display: none;
}

.asset-error .identity__text-fallback {
  display: grid;
}

.identity__email {
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(0.78rem, 1.25vw, 0.98rem);
  font-weight: 450;
  letter-spacing: 0.13em;
  line-height: 1.5;
  text-decoration: none;
  text-underline-offset: 0.35em;
}

.identity__email:hover {
  text-decoration: underline;
}

.controls {
  position: absolute;
  z-index: 6;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
}

.controls-visible .controls,
.is-complete .controls {
  opacity: 1;
  pointer-events: auto;
}

.control {
  appearance: none;
  border: 0;
  border-bottom: 1px solid rgb(3 76 44 / 34%);
  padding: 0.35rem 0.1rem;
  color: var(--ink);
  background: transparent;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.control:hover {
  border-bottom-color: currentColor;
}

.control:focus-visible,
.identity__email:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
  border-radius: 1px;
}

.noscript-identity {
  display: grid;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  place-content: center;
  justify-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--paper);
}

.noscript-identity img {
  width: min(68vw, 390px);
  max-height: 70svh;
  object-fit: contain;
}

.noscript-identity a {
  color: var(--ink);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.11em;
}

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

@media (max-width: 700px) {
  .experience {
    min-height: 360px;
  }

  .identity__logo {
    width: min(64vw, 310px);
    max-height: 67svh;
  }

  .identity__email {
    font-size: clamp(0.72rem, 3.2vw, 0.9rem);
    letter-spacing: 0.09em;
  }

  .controls {
    right: max(0.8rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .tree {
    transform-box: fill-box;
    transform-origin: center bottom;
  }

  .tree--left {
    transform: translateX(330px) scale(0.5);
  }

  .tree--right {
    transform: translateX(-330px) scale(0.5);
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .identity {
    grid-template-columns: auto auto;
    gap: clamp(1.25rem, 4vw, 3rem);
  }

  .identity__logo {
    width: auto;
    height: min(72svh, 310px);
  }

  .identity__email {
    align-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .identity,
  .controls {
    transition-duration: 240ms;
  }

  .stage {
    display: none;
  }

  .force-motion .stage {
    display: block;
  }
}
