/* ==========================================================================
   M² Domaća Priča — foundations
   Palette is sampled from the brand assets: the ink and olive come from the
   logo badge, the flavour accents from each bottle's own liquid.
   ========================================================================== */

@font-face {
  font-family: 'Fraunces';
  src: url('../assets/fonts/fraunces-latin-ext.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../assets/fonts/fraunces-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  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: 'Instrument Sans';
  src: url('../assets/fonts/instrument-sans-latin-ext.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('../assets/fonts/instrument-sans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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: 'Petit Formal Script';
  src: url('../assets/fonts/petit-formal-script-latin-ext.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Petit Formal Script';
  src: url('../assets/fonts/petit-formal-script-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  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;
}

:root {
  /* Ink & paper -------------------------------------------------------- */
  --ink: #2a1810;
  --ink-70: #5c463a;
  /* Darkest of the three paper tones sets the floor: 4.8:1 on --paper-deep. */
  --ink-45: #70594a;
  --paper: #fbf6ec;
  --paper-warm: #f4e9d7;
  --paper-deep: #ebdcc3;
  --night: #1a1008;

  /* Brand ------------------------------------------------------------- */
  --leaf: #4a5a31;
  --leaf-deep: #2f3a20;
  --order: #22532f;
  --order-hover: #2c6a3c;
  --gold: #c99a22;

  /* Type -------------------------------------------------------------- */
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --script: 'Petit Formal Script', 'Snell Roundhand', cursive;

  --step--1: clamp(0.78rem, 0.75rem + 0.15vw, 0.86rem);
  --step-0: clamp(0.95rem, 0.9rem + 0.25vw, 1.06rem);
  --step-1: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
  --step-2: clamp(1.35rem, 1.15rem + 1vw, 1.9rem);
  --step-3: clamp(1.8rem, 1.4rem + 2vw, 3rem);
  --step-4: clamp(2.4rem, 1.6rem + 3.6vw, 4.6rem);

  /* Rhythm ------------------------------------------------------------ */
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 62ch;
  --section-y: clamp(4.5rem, 11vw, 9.5rem);

  /* Motion ------------------------------------------------------------ */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-scene: cubic-bezier(0.33, 0.9, 0.28, 1);
  /* Overshoots by a hair so the bottle settles on the floor instead of
     simply stopping. Kept far below a bounce — this should read as weight. */
  --ease-land: cubic-bezier(0.18, 0.89, 0.32, 1.05);
  --scene-duration: 720ms;

  /* Set per hero slide by scripts/hero.js */
  --accent: #ef5533;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* `clip` rather than `hidden`: hidden makes a scroll container, and a fixed
     header's backdrop-filter does not sample through one on WebKit — which is
     why the glass bar came out fully transparent on iOS Chrome. */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
figure,
blockquote {
  margin: 0;
}

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

img {
  height: auto;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

:focus-visible {
  outline: 2px solid var(--order);
  outline-offset: 3px;
  border-radius: 2px;
}

.hero[data-scheme='dark'] :focus-visible,
.closing :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--paper);
}

/* Typographic primitives ----------------------------------------------- */

.script {
  font-family: var(--script);
  font-weight: 400;
  line-height: 1.3;
}

.eyebrow {
  font-size: var(--step--1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-45);
}

.display {
  font-family: var(--serif);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 120, 'SOFT' 30;
  text-wrap: balance;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-70);
  max-width: 46ch;
}

/* Section scaffolding -------------------------------------------------- */

.shell {
  width: min(100% - var(--gutter) * 2, 82rem);
  margin-inline: auto;
}

.section-mark {
  display: flex;
  align-items: center;
  gap: 0.85em;
  font-size: var(--step--1);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-45);
}

.section-mark::before {
  content: '';
  width: clamp(1.5rem, 4vw, 3.5rem);
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

/* Buttons -------------------------------------------------------------- */

.order-btn {
  --btn-bg: var(--order);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.95em 1.6em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--step-0);
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: background 240ms var(--ease-out), transform 240ms var(--ease-out),
    box-shadow 240ms var(--ease-out);
  box-shadow: 0 10px 24px -14px rgb(20 45 25 / 0.9);
}

.order-btn:hover {
  background: var(--btn-hover, var(--order-hover));
  transform: translateY(-2px);
}

.order-btn:active {
  transform: translateY(0);
}

.order-btn .icon {
  width: 1.35em;
  height: 1.35em;
  flex: none;
}

.order-btn .arrow {
  width: 1em;
  height: 1em;
  flex: none;
  transition: transform 240ms var(--ease-out);
}

.order-btn:hover .arrow {
  transform: translateX(3px);
}

.order-btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  box-shadow: inset 0 0 0 1px rgb(42 24 16 / 0.28);
}

.order-btn--ghost:hover {
  --btn-bg: rgb(42 24 16 / 0.06);
  --btn-hover: rgb(42 24 16 / 0.06);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding-bottom: 0.15em;
  border-bottom: 1px solid currentColor;
  transition: gap 240ms var(--ease-out);
}

.text-link:hover {
  gap: 0.8em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 200;
  padding: 0.7em 1.2em;
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* Scroll reveal -------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    /* Without this the hero's staggered scene would still trickle in. */
    transition-delay: 0ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
