/* ───────── Fonts: Inter variable with optical size axis (Inter Display at large opsz) ───────── */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-opsz-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-cyrillic-opsz-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ───────── Tokens (from Figma variables) ───────── */
:root {
  --bg-default: #fff;
  --bg-secondary: #f9f9f9;
  --text-primary: #111;
  --text-secondary: rgba(17, 17, 17, 0.65);
  --text-tertiary: rgba(17, 17, 17, 0.4);
  --text-ondark: #fff;
  --info: #007aff;
  --info-hover: #0068d9;
  --border-default: #ededed;
  --glass-transparent: rgba(255, 255, 255, 0);
  --glass-default: rgba(255, 255, 255, 0.65);
  --radius-900: 32px;
  --radius-infinite: 10000px;

  --pad-x: 40px;
  --header-top: 40px;
  --footer-h: 80px;

  /* Motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --stagger: 60ms;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-default);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-variation-settings: "opsz" 32; /* Inter Display */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100svh;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, ul { margin: 0; }

/* ───────── Header ───────── */
.site-header {
  position: absolute;
  top: var(--header-top);
  left: var(--pad-x);
  right: var(--pad-x);
  display: flex;
  align-items: center;
  height: 24px;
  z-index: 10;
  view-transition-name: site-header;
}
.logo { display: block; width: 115px; height: 24px; flex: none; }
.logo img { width: 115px; height: 24px; }

.nav { display: flex; align-items: center; gap: 0; margin-left: 48px; }
.nav a {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-secondary);
  padding: 4px 0;
  white-space: nowrap;
  transition: color 150ms ease;
}
.nav a + a { margin-left: 34px; }
.nav a[aria-current="page"] { color: var(--text-primary); }
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--text-primary); }
}

/* ───────── Footer (glass bar) ───────── */
.site-footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--footer-h);
  padding: 0 var(--pad-x) 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.15;
  white-space: nowrap;
  color: var(--text-secondary);
  background: linear-gradient(to bottom, var(--glass-transparent), var(--glass-default));
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  z-index: 10;
  view-transition-name: site-footer;
}
.site-footer .contact {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
}
.site-footer .contact span { color: var(--text-tertiary); }
.site-footer .contact a { color: var(--text-primary); transition: color 150ms ease; }
@media (hover: hover) and (pointer: fine) {
  .site-footer .contact a:hover { color: var(--info); }
}

/* ───────── Button ───────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 20px; /* 16 + 4 label padding */
  border-radius: var(--radius-infinite);
  background: var(--info);
  color: var(--text-ondark);
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  font-variation-settings: normal; /* Inter text, not Display */
  white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.button:active { transform: scale(0.97); }
.button:focus-visible { outline: 2px solid var(--info); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--info-hover); }
}

/* ───────── Home ───────── */
.home {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 22px;
  padding: 92px 16px 92px var(--pad-x);
}
.hero { display: flex; flex-direction: column; gap: 32px; align-items: flex-start; max-width: 662px; }
.hero-top { display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.hero h1 {
  font-weight: 600;
  font-size: 40px;
  line-height: 48px;
  letter-spacing: 0;
}

/* App icon stack */
.apps {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  width: 180px;
  margin-left: -1px;
}
.app {
  position: relative;
  flex: none;
  width: 70.339px;
  height: 70.339px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -20px;
  transition: transform 220ms var(--ease-out);
}
.app:last-child { margin-right: 0; }
.app-inner { position: relative; width: 64px; height: 64px; flex: none; }
.app:nth-child(1) .app-inner, .app:nth-child(3) .app-inner { transform: rotate(-6deg); }
.app:nth-child(2) { z-index: 1; }
.app:nth-child(2) .app-inner { transform: rotate(6deg); }
.app-svg { position: absolute; left: -15.5556px; top: -2.2222px; width: 95.1111px; height: 100.667px; max-width: none; }
.app-tile {
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 22.222px 12.222px 0 rgba(0,0,0,0.02), 0 12px 16px 0 rgba(0,0,0,0), 0 2px 4px 0 rgba(0,0,0,0.06);
}
.app-tile .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.app-tile .glyph { position: absolute; left: calc(50% + 3px); top: calc(50% - 3px); width: 30px; height: 34px; transform: translate(-50%, -50%); }
.app-tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 -5px 6px 0 rgba(255,255,255,0.8); pointer-events: none; }

@media (hover: hover) and (pointer: fine) {
  .apps:hover .app:nth-child(1) { transform: translate(-6px, -3px); }
  .apps:hover .app:nth-child(2) { transform: translateY(-6px); }
  .apps:hover .app:nth-child(3) { transform: translate(6px, -3px); }
}

/* Embedded garden block */
.stage {
  position: relative;
  width: min(48.6111vw, calc((100svh - 200px) * 1.2963));
  aspect-ratio: 700 / 540;
  background: var(--bg-secondary);
  overflow: hidden;
}
.stage garden-tree {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100% !important;
  display: block;
  opacity: 0;
  transition: opacity 400ms var(--ease-out);
}
.stage garden-tree.is-loaded { opacity: 1; }

/* ───────── Content pages (About / Privacy) ───────── */
.page {
  padding: 224px var(--pad-x) calc(var(--footer-h) + 120px);
  display: grid;
  grid-template-columns: minmax(0, 594fr) minmax(0, 650fr);
  column-gap: clamp(40px, 8.06vw, 116px);
  align-items: start;
}
.page--text { grid-template-columns: minmax(0, 594px); }

.prose { display: flex; flex-direction: column; gap: 48px; }
.prose section { display: flex; flex-direction: column; gap: 24px; }
.prose h1, .prose h2.title {
  font-weight: 600;
  font-size: 32px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.prose .body {
  font-weight: 400;
  font-size: 24px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.prose .body strong, .prose .body h3 { font-weight: 600; font-size: inherit; line-height: inherit; }
.prose .stack > * + * { margin-top: 33.6px; } /* one empty line, as in the design */
.prose .stack p span { display: block; }

/* Privacy policy specifics */
.legal .meta { color: var(--text-secondary); }
.legal h2 { font-weight: 600; font-size: 24px; line-height: 1.4; letter-spacing: -0.01em; }
.legal h3 { font-weight: 600; font-size: 24px; line-height: 1.4; letter-spacing: -0.01em; margin-top: 8px; }
.legal section { gap: 16px; }
.legal ul { padding-left: 1.1em; display: flex; flex-direction: column; gap: 8px; }
.legal li::marker { color: var(--text-tertiary); }
.legal a { color: var(--info); }
.legal address { font-style: normal; }

/* Gallery */
.gallery { display: flex; flex-direction: column; gap: 12px; }
.shot {
  position: relative;
  border-radius: var(--radius-900);
  overflow: hidden;
  aspect-ratio: 650 / 489;
}
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot--bordered::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--border-default); border-radius: inherit; pointer-events: none; }

/* ───────── Motion ───────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.rise { animation: rise 600ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * var(--stagger)); }

/* Scroll reveal — only when JS is on, so content never stays hidden.
   The clip lives on the image, not the observed figure: a fully clipped target never reports as intersecting. */
.js .reveal img {
  clip-path: inset(0 0 100% 0);
  transform: scale(1.06);
  transition: clip-path 700ms var(--ease-in-out), transform 900ms var(--ease-out);
}
.js .reveal::after { opacity: 0; transition: opacity 400ms ease 300ms; }
.js .reveal.is-visible img { clip-path: inset(0 0 0 0); transform: none; }
.js .reveal.is-visible::after { opacity: 1; }

/* Cross-document page transitions */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 160ms ease both; }
::view-transition-new(root) { animation: vt-in 240ms var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  @keyframes rise { from { opacity: 0; } to { opacity: 1; } }
  .rise { animation-duration: 300ms; animation-delay: 0ms; }
  .js .reveal img { clip-path: none; transform: none; opacity: 0; transition: opacity 300ms ease; }
  .js .reveal.is-visible img { opacity: 1; }
  .app, .button { transition: none; }
  @view-transition { navigation: none; }
}

/* ───────── Responsive ───────── */
@media (max-width: 1200px) {
  .hero h1 { font-size: 36px; line-height: 44px; }
  .prose .body, .legal h2, .legal h3 { font-size: 21px; }
  .prose h1, .prose h2.title { font-size: 30px; }
  .prose .stack > * + * { margin-top: 29.4px; }
}

@media (max-width: 900px) {
  :root { --pad-x: 20px; --header-top: 24px; }

  .home {
    grid-template-columns: 1fr;
    align-items: start;
    row-gap: 48px;
    padding: 120px var(--pad-x) 40px;
    min-height: 0;
  }
  .stage { width: 100%; aspect-ratio: 4 / 5; max-height: 75svh; justify-self: stretch; border-radius: 24px; }

  .page, .page--text { grid-template-columns: minmax(0, 1fr); padding: 120px var(--pad-x) 48px; row-gap: 48px; }
  .page--text { max-width: 680px; }
  .shot { border-radius: 24px; }

  .prose { gap: 40px; }
  .prose section { gap: 16px; }
  .prose h1, .prose h2.title { font-size: 26px; }
  .prose .body, .legal h2, .legal h3 { font-size: 18px; }
  .prose .stack > * + * { margin-top: 25.2px; }

  .site-footer {
    position: static;
    height: auto;
    padding: 24px var(--pad-x) 32px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-top: 1px solid var(--border-default);
    white-space: normal;
  }
  .site-footer .contact { position: static; transform: none; order: -1; flex-wrap: wrap; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 30px; line-height: 38px; }
  .hero h1 br { display: none; }
  .nav { margin-left: auto; }
  .nav a { font-size: 15px; }
  .nav a + a { margin-left: 20px; }
  .logo, .logo img { width: 96px; height: 20px; }
}

@media (max-width: 360px) {
  .nav a { font-size: 14px; }
  .nav a + a { margin-left: 14px; }
  .logo, .logo img { width: 84px; height: 17.5px; }
}

/* legal: tighter rhythm inside long sections */
.legal .stack > * + * { margin-top: 16px; }
.legal .stack > h3 { margin-top: 28px; }
