/* Alderleaf Studios. Driftwood ground, pine for the mark and headings, lake for links, honey
   for the one bright note. Fraunces for headlines, Figtree for text. Each app's own band
   borrows that app's materials; Muisto's is the black paper of an old photo album. */

@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-opsz.woff2") format("woff2"); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-opsz-italic.woff2") format("woff2"); font-style: italic; font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-wght.woff2") format("woff2"); font-style: normal; font-weight: 300 900; font-display: swap; }
/* Muisto's band is set in the app's own face */
@font-face { font-family: "EB Garamond"; src: url("../../muisto/fonts/eb-garamond.woff2") format("woff2"); font-style: normal; font-weight: 400 800; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../../muisto/fonts/eb-garamond-italic.woff2") format("woff2"); font-style: italic; font-weight: 400 800; font-display: swap; }

:root {
  --driftwood: #E9E5DE;
  --pine: #1F4A3A;
  --lake: #2F5D7C;
  --honey: #D8A549;
  --slate: #1C2A27;
  --soft: rgba(28, 42, 39, 0.74);
  --rule: rgba(28, 42, 39, 0.14);
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --wide: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--driftwood); color: var(--slate);
  font-family: var(--text); font-size: clamp(17px, 0.45vw + 14px, 19px); line-height: 1.6;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--lake); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--pine); }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 560; color: var(--pine); font-optical-sizing: auto; }
:focus-visible { outline: 2px solid var(--honey); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 10px; z-index: 10; background: var(--pine); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip:focus { left: 12px; }

/* ------------------------------------------------------------------ header */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  max-width: var(--wide); margin: 0 auto; padding: 22px var(--gutter);
}
.wordmark img { height: 46px; width: auto; }
.site-head nav { display: flex; gap: clamp(18px, 3vw, 34px); }
.site-head nav a {
  color: var(--pine); font-weight: 600; font-size: 17px; text-decoration: none;
  background: linear-gradient(var(--honey), var(--honey)) left bottom / 0 2px no-repeat; padding-bottom: 2px;
  transition: background-size 0.3s;
}
.site-head nav a:hover { background-size: 100% 2px; }

/* ------------------------------------------------------------------ hero: the tree grows, once */
.hero {
  display: grid; grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1fr); align-items: center;
  gap: clamp(32px, 6vw, 100px); max-width: var(--wide); margin: 0 auto;
  min-height: min(82vh, 860px); padding: clamp(16px, 4vh, 60px) var(--gutter) clamp(70px, 12vh, 150px);
}
.tree { position: relative; width: 100%; max-width: 470px; aspect-ratio: 1; justify-self: end; }
.tree svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 28px 34px rgba(31, 74, 58, 0.22)) drop-shadow(0 4px 8px rgba(31, 74, 58, 0.18)); }
.tree-still { width: 100%; height: 100%; }
/* with scripts on, the drawn tree grows in its place; the still one shows only if it can't */
.js .tree-still { visibility: hidden; animation: show-late 0s 2.5s forwards; }
@keyframes show-late { to { visibility: visible; } }
.tree .leaf { fill: #F3EFE6; transform-box: view-box; transform-origin: var(--ox) var(--oy); cursor: pointer; }
.tree .falling { transform-box: fill-box; transform-origin: 50% 30%; pointer-events: none; }
.tree .board { transform-box: view-box; transform-origin: 50% 60%; }
.hero h1 {
  font-size: clamp(40px, 5.4vw, 82px); line-height: 1.02; letter-spacing: -0.024em;
  max-width: 11.5em; text-wrap: balance;
}
.hero .lede { margin-top: clamp(18px, 2.4vw, 30px); max-width: 33rem; font-size: clamp(18px, 0.6vw + 14px, 21px); color: var(--soft); }
.now {
  display: inline-flex; align-items: center; gap: 12px; margin-top: clamp(26px, 3vw, 40px);
  padding: 7px 20px 7px 7px; border-radius: 999px; text-decoration: none; color: var(--slate); font-size: 16px;
  background: rgba(255, 255, 255, 0.42); border: 1px solid rgba(28, 42, 39, 0.1);
  box-shadow: 0 1px 2px rgba(31, 74, 58, 0.08); transition: background-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.now img { width: 40px; height: 40px; border-radius: 9px; box-shadow: 0 2px 5px rgba(60, 40, 90, 0.25); }
.now strong { font-weight: 650; color: var(--pine); }
.now:hover { color: var(--slate); background: rgba(255, 255, 255, 0.8); box-shadow: 0 6px 16px rgba(31, 74, 58, 0.14); transform: translateY(-1px); }
.hero-words > * { animation: rise 1s cubic-bezier(.2, .8, .2, 1) both; }
.hero-words > :nth-child(1) { animation-delay: 0.5s; }
.hero-words > :nth-child(2) { animation-delay: 0.7s; }
.hero-words > :nth-child(3) { animation-delay: 1.6s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ an app's band: Muisto */
.app-band { position: relative; overflow: hidden; }
.app-band.muisto {
  color: #EDE6D6;
  background:
    radial-gradient(48% 60% at 30% 50%, rgba(255, 214, 160, 0.13), rgba(255, 214, 160, 0) 70%),
    #22201E url("../../muisto/img/paper-night.webp") repeat;
  background-size: auto, 320px;
}
.app-band .motes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.band-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(36px, 6vw, 96px);
  max-width: var(--wide); margin: 0 auto; padding: clamp(90px, 13vw, 180px) var(--gutter);
}
.icon-stage { position: relative; width: min(440px, 78vw); aspect-ratio: 1; justify-self: center; perspective: 1500px; }
.icon-rig { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.icon-rig .plane { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; will-change: transform; }
.icon-rig .plane.glass { filter: drop-shadow(0 5px 7px rgba(24, 14, 46, 0.26)); }
.icon-stage .ground {
  position: absolute; left: 8%; right: 8%; bottom: -9%; height: 16%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0)); filter: blur(6px);
}
.band-words h2 {
  font-family: "EB Garamond", Georgia, serif; font-weight: 500; color: #EDE6D6;
  font-size: clamp(64px, 8.6vw, 124px); line-height: 0.9; letter-spacing: -0.01em;
}
.band-tagline { margin-top: 14px; font-family: "EB Garamond", Georgia, serif; font-style: italic; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.2; }
.band-words .about { margin-top: 18px; max-width: 30rem; color: #BDB09C; }
.band-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px; margin-top: 28px; }
.band-words .soon {
  display: inline-block; padding: 6px 18px 8px; border-radius: 999px;
  font-family: "EB Garamond", Georgia, serif; font-weight: 500; font-size: 19px; color: #241D12;
  background: linear-gradient(135deg, #F7E099, #B38738 38%, #F2D68C 64%, #A37A30);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.band-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; color: #EDE6D6; text-decoration: none; font-size: 18px;
  border-bottom: 1.5px solid rgba(237, 230, 214, 0.4); padding-bottom: 3px; transition: border-color 0.25s, color 0.25s;
}
.band-link:hover { color: #F7E099; border-color: #F7E099; }
.band-link .page-corner { width: 14px; height: 14px; transition: transform 0.35s cubic-bezier(.2, .8, .2, 1.4); }
.band-link:hover .page-corner { transform: rotate(-14deg) translateY(-2px); }

/* ------------------------------------------------------------------ the studio */
.studio {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 6vw, 100px);
  max-width: var(--wide); margin: 0 auto; padding: clamp(80px, 11vw, 150px) var(--gutter) clamp(60px, 8vw, 110px);
}
.studio h2 { font-size: clamp(32px, 3.4vw, 50px); line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; }
.studio .big { font-family: var(--display); font-weight: 400; font-size: clamp(23px, 1.7vw + 8px, 31px); line-height: 1.32; color: var(--slate); letter-spacing: -0.005em; }
.studio .big + p { margin-top: 22px; color: var(--soft); max-width: 34rem; }

.contact {
  max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter) clamp(90px, 12vw, 160px);
}
.contact-card {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 6vw, 100px); align-items: end;
  padding-top: clamp(40px, 5vw, 60px); border-top: 1px solid var(--rule);
}
.contact h2 { font-size: clamp(32px, 3.4vw, 50px); line-height: 1.08; letter-spacing: -0.015em; }
.contact p { color: var(--soft); }
.contact .mail {
  display: inline-block; margin-top: 8px; font-family: var(--display); font-weight: 500; font-size: clamp(24px, 2.6vw, 40px);
  color: var(--pine); text-decoration: none; letter-spacing: -0.01em;
  background: linear-gradient(var(--honey), var(--honey)) left 92% / 100% 3px no-repeat; transition: background-size 0.3s, color 0.3s;
  overflow-wrap: anywhere;
}
.contact .mail:hover { color: var(--lake); background-size: 100% 0.45em; }

/* ------------------------------------------------------------------ footer */
.site-foot { background: var(--pine); color: #E9E5DE; }
.foot-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px 40px;
  max-width: var(--wide); margin: 0 auto; padding: 36px var(--gutter) 40px; font-size: 15px;
}
.foot-inner img { height: 56px; width: auto; }
.foot-inner nav { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.foot-inner a { color: #E9E5DE; text-decoration: none; font-weight: 500; }
.foot-inner a:hover { color: var(--honey); }
.foot-inner p { color: rgba(233, 229, 222, 0.65); }

/* ------------------------------------------------------------------ narrow screens */
@media (max-width: 820px) {
  .site-head { padding-top: 16px; padding-bottom: 16px; }
  .wordmark img { height: 38px; }
  .hero { grid-template-columns: 1fr; min-height: 0; text-align: left; gap: 34px; padding-top: 18px; }
  .tree { justify-self: center; width: min(72vw, 360px); }
  .band-inner { grid-template-columns: 1fr; gap: 56px; }
  .studio, .contact-card { grid-template-columns: 1fr; gap: 20px; }
  .contact-card { align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-delay: 0s !important; transition-duration: 0.001s !important; }
}
