/* ============================================================
   CIBORO FOODS — BASE CSS
   Reset, tokens, typography, base styles
   ============================================================ */

/* ---------- FONT LOADING ---------- */
@import url('https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,ital,wght@9..144,0,300;9..144,0,400;9..144,0,600;9..144,0,700;9..144,1,300;9..144,1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Fonts */
  --font-display: 'Fraunces', 'Times New Roman', Georgia, serif;
  --font-body:    'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  /* Light Mode — Paper palette */
  --bg:           #F5F1EA;
  --surface:      #FBF8F2;
  --surface-alt:  #EDE7DC;
  --border:       #D9D2C3;
  --border-subtle:#E7E1D3;
  --text:         #14241C;
  --text-muted:   #4A5A50;
  --text-faint:   #8A9389;
  --primary:      #0F2E22;
  --primary-mid:  #2D6A4F;
  --accent:       #7FA487;
  --accent-warm:  #B8956A;
  --highlight:    #E4DCC8;
  --focus:        #2D6A4F;

  /* Spacing (8px base) */
  --sp-1: 0.5rem;   /*  8px */
  --sp-2: 1rem;     /* 16px */
  --sp-3: 1.5rem;   /* 24px */
  --sp-4: 2rem;     /* 32px */
  --sp-5: 2.5rem;   /* 40px */
  --sp-6: 3rem;     /* 48px */
  --sp-8: 4rem;     /* 64px */
  --sp-10: 5rem;    /* 80px */
  --sp-12: 6rem;    /* 96px */
  --sp-16: 8rem;    /* 128px */
  --sp-20: 10rem;   /* 160px */

  /* Type scale */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1.0625rem;  /* 17px */
  --text-lg:   1.25rem;    /* 20px */
  --text-xl:   1.5rem;     /* 24px */
  --text-2xl:  clamp(2rem, 4vw, 3.5rem);   /* 32–56px */
  --text-3xl:  clamp(3rem, 6vw, 5.5rem);   /* 48–88px */
  --text-hero: clamp(4rem, 9vw, 9rem);     /* 64–144px */
  --text-stat: clamp(5.5rem, 12vw, 11.25rem); /* 88–180px — larger floor for mobile impact */

  /* Easing */
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-hair:      cubic-bezier(0.65, 0, 0.35, 1);
  --ease-hover:     cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --content-max: 1440px;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --col-gap: 1.5rem;

  /* Transitions */
  --t-fast:   150ms var(--ease-hover);
  --t-mid:    300ms var(--ease-out-quint);
  --t-slow:   700ms var(--ease-out-quint);
}

/* Light mode only — dark mode removed by design */
/* html always gets data-theme="light" from the HTML attribute */

/* ---------- RESET ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
  position: relative;
}

/* Paper texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 300px 300px;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role='list'], ol[role='list'] { list-style: none; }

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.05;
  font-family: var(--font-display);
  font-weight: 400;
}

p, li, figcaption {
  text-wrap: pretty;
  max-width: 62ch;
}

button { cursor: pointer; background: none; border: none; }
table  { border-collapse: collapse; width: 100%; }

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

::selection {
  background: color-mix(in oklab, var(--accent) 30%, transparent);
  color: var(--text);
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .split-char { opacity: 1 !important; transform: none !important; }
}

/* ---------- UTILITIES ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section-pad {
  padding-block: clamp(var(--sp-8), 10vw, var(--sp-20));
}

/* ---------- SCROLL PROGRESS ---------- */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 1px;
  width: 0%;
  background: var(--accent);
  z-index: 10000;
  transition: width 50ms linear;
}

/* ---------- CURSOR ---------- */
#cursor {
  position: fixed;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--primary) 70%, transparent);
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition:
    width 250ms var(--ease-out-quint),
    height 250ms var(--ease-out-quint),
    opacity 250ms var(--ease-out-quint);
  will-change: transform;
}
#cursor.large { width: 56px; height: 56px; }
#cursor.hidden { opacity: 0; }
[data-theme='dark'] #cursor { mix-blend-mode: screen; }
@media (hover: none) { #cursor { display: none; } }

/* ---------- HAIRLINE DRAW ---------- */
.hairline-draw {
  display: block;
  height: 1px;
  background: var(--border);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 800ms var(--ease-hair);
}
.hairline-draw.drawn { transform: scaleX(1); }

/* ---------- SPLIT TEXT REVEAL ---------- */
.split-word { display: inline-block; overflow: hidden; }
.split-char {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 700ms var(--ease-out-quint), opacity 700ms var(--ease-out-quint);
}
.split-char.revealed { transform: translateY(0); opacity: 1; }

/* ---------- CLIP REVEAL (images) ---------- */
.clip-reveal {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 900ms var(--ease-out-quint);
}
.clip-reveal.revealed { clip-path: inset(0 0 0% 0); }

/* ---------- FADE IN ---------- */
.fade-in {
  opacity: 0;
  transition: opacity 700ms var(--ease-out-quint);
}
.fade-in.revealed { opacity: 1; }

/* ---------- COUNT-UP STAT UNDERLINE ---------- */
.stat-underline {
  display: block;
  height: 1px;
  background: var(--accent);
  width: 60%;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 800ms var(--ease-hair);
}
.stat-underline.drawn { transform: scaleX(1); }
