/* Design tokens. Every component reads colours, type and motion from here.
   Day = milk paper, sage and terracotta — the default. Night (the dark theme the moon turns on) is a separately tuned
   warm-dark palette, not an inversion. */
@font-face { font-family: 'Cormorant'; src: url('../assets/fonts/cormorant-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('../assets/fonts/cormorant-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('../assets/fonts/cormorant-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('../assets/fonts/cormorant-italic-400.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('../assets/fonts/cormorant-italic-500.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/inter-cyrillic.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

@property --light-x { syntax: '<percentage>'; inherits: true; initial-value: 72%; }
@property --light-strength { syntax: '<number>'; inherits: true; initial-value: 1; }

:root {
  color-scheme: light;

  /* Palette — day */
  --paper: #f8f7f2;
  --paper-2: #f1f0e8;
  --paper-3: #e9ecdf;
  --surface: #fcfcf8;
  --surface-raised: #ffffff;
  --peach: #f2e8dd;
  --peach-2: #eadccd;
  --ink: #2f3b31;
  --ink-soft: #3f4c41;
  --muted: #5f675b;
  --faint: #7d8576;
  --line: #dcdfd2;
  --line-strong: #c4cdb8;
  --sage-50: #f0f3e9;
  --sage-100: #e5ebdb;
  --sage-200: #d3dcc6;
  --sage-300: #b8c6a8;
  --sage-500: #6f8560;
  --green: #4b624d;
  --green-deep: #354b3c;
  --on-green: #fbfbf6;
  --terracotta: #b47a60;     /* display text ≥ 24px only */
  --terracotta-ink: #8f5a43; /* links, small accents, focus */
  --terracotta-soft: #ecd9cd;
  --lamp: #e9b37f;
  --band: #2f4234;           /* the calm dark breathing band */
  --band-2: #3a5040;
  --on-band: #eef0e6;
  --on-band-muted: #c6d0bd;
  --danger: #a3473a;         /* only SOS and irreversible actions */
  --focus: var(--terracotta-ink);
  --scrim: rgba(28, 40, 33, .46);
  --shadow-sm: 0 1px 2px rgba(35, 50, 38, .06), 0 2px 10px rgba(35, 50, 38, .05);
  --shadow-md: 0 10px 30px rgba(35, 50, 38, .09);
  --shadow-lg: 0 30px 80px rgba(23, 42, 37, .18);
  --photo-filter: saturate(.86) contrast(1.02);

  /* Light from the window — tinted by part of day; the spreads mix it into their panes and glow */
  --sky: #fff1d6;
  --glow: rgba(255, 252, 240, .5);

  /* Typography */
  --serif: 'Cormorant', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --text: 17px;
  --text-lead: clamp(19px, 1.1vw + 13px, 22px);
  --text-small: 15px;
  --text-micro: 13px;
  --control: 16px;
  --h1: clamp(52px, 8.6vw, 136px);
  --h2: clamp(42px, 5.4vw, 80px);
  --h3: clamp(28px, 2.4vw, 38px);
  --h4: clamp(24px, 1.7vw, 28px);
  --leading: 1.65;

  /* Space & shape */
  --gutter: clamp(16px, 4.4vw, 64px);
  --max: 1440px;
  --section: clamp(60px, 6.6vw, 104px);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --arch: 999px 999px var(--radius-sm) var(--radius-sm);

  /* Motion — one metronome: breathing */
  --ease-breath: cubic-bezier(.37, 0, .63, 1);
  --ease-settle: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 200ms;
  --t-mid: 480ms;
  --t-slow: 900ms;
  --lift: -3px;              /* hover lift; zero with «меньше движения» */
  --press: .97;              /* press squeeze; 1 with «меньше движения» */

  --header-h: 84px;
  --dock-h: 0px;
}

html.text-large { --text: 19px; --text-lead: clamp(21px, 1.1vw + 15px, 24px); --text-small: 17px; --text-micro: 15px; --control: 18px; }

/* Evening: the page warms a little, the light gets longer and amber. */
html[data-part='morning'] { --sky: #ffe7b0; --glow: rgba(255, 246, 222, .56); }
html[data-part='day']     { --sky: #fff4dc; --glow: rgba(255, 252, 240, .5); }
html[data-part='evening'] { --sky: #ffcf99; --glow: rgba(255, 232, 200, .56); --paper: #f6f2ea; --paper-2: #efeadf; }

/* Night — the dark theme, only when the visitor turns it on */
html[data-theme='night'] {
  color-scheme: dark;
  --paper: #171d19;
  --paper-2: #1c241f;
  --paper-3: #232c26;
  --surface: #202923;
  --surface-raised: #29332c;
  --peach: #2a2522;
  --peach-2: #342d28;
  --ink: #ece8dd;
  --ink-soft: #ddd8cb;
  --muted: #b5b8ad;
  --faint: #8e9488;
  --line: #333e36;
  --line-strong: #46534a;
  --sage-50: #1f2822;
  --sage-100: #26302a;
  --sage-200: #314036;
  --sage-300: #4a5c4d;
  --sage-500: #93aa8e;
  --green: #a9bea6;
  --green-deep: #c4d4bf;
  --on-green: #17201a;
  --terracotta: #dba486;
  --terracotta-ink: #d49a7e;
  --terracotta-soft: #3a2c25;
  --lamp: #e7a77f;
  --band: #121714;
  --band-2: #1a211c;
  --on-band: #e6e4da;
  --on-band-muted: #a8b2a2;
  --danger: #e08b7c;
  --scrim: rgba(5, 8, 6, .62);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .55);
  --photo-filter: brightness(.84) saturate(.85) contrast(1.02);
  --sky: #e7a77f;
}

/* Quiet mode (loss stage, help sheet, «тяжело»): no celebrations, softer colour. */
html.is-quiet { --terracotta: #a98a7a; }
