:root {
  --paper: #f5f2ea;
  --paper-2: #ece7da;
  --ink: #26301c;
  --ink-soft: #5d6650;
  --line: #d6d0bf;
  --olive: #6f7a3a;
  --gold: #b08a2e;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  --max: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* language switching */
html[data-lang="it"] [lang="en"],
html[data-lang="en"] [lang="it"] { display: none; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 32px;
  padding: 20px var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.wordmark {
  font: 500 15px/1 var(--sans);
  letter-spacing: .32em;
}
.wordmark span { color: var(--olive); }
.links { display: flex; gap: 28px; margin-left: auto; }
.links a {
  font-size: 13px; letter-spacing: .08em; color: var(--ink-soft);
  transition: color .2s;
}
.links a:hover { color: var(--ink); }
.lang {
  background: none; border: 0; cursor: pointer;
  font: 500 12px/1 var(--sans); letter-spacing: .12em; color: var(--ink-soft);
  display: flex; gap: 6px; padding: 6px 0;
}
.lang i { font-style: normal; opacity: .4; }
html[data-lang="it"] .lang [data-l="it"],
html[data-lang="en"] .lang [data-l="en"] { color: var(--ink); }

/* type */
.eyebrow {
  font-size: 12px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--olive); margin-bottom: 20px;
}
h1, h2, .facts strong, .spec dd { font-variant-numeric: lining-nums; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.05; letter-spacing: -.01em; }
h1 { font-size: clamp(44px, 7vw, 96px); }
h2 { font-size: clamp(36px, 4.6vw, 60px); margin-bottom: 28px; }
h1 em, h2 em { font-style: italic; color: var(--olive); }
.lead { font-size: 18px; color: var(--ink-soft); max-width: 34em; }
.copy p + p { margin-top: 1em; }
.copy p:not(.eyebrow) { color: var(--ink-soft); max-width: 34em; }

.btn {
  display: inline-block; margin-top: 36px;
  padding: 15px 30px;
  border: 1px solid var(--ink);
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  transition: background .25s, color .25s;
}
.btn:hover { background: var(--ink); color: var(--paper); }

/* media + placeholders */
.media { position: relative; overflow: hidden; background: var(--paper-2); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--olive);
  background:
    radial-gradient(120% 80% at 30% 20%, #f1ecdf 0%, transparent 60%),
    var(--paper-2);
}
.ph svg { width: 28%; max-width: 120px; height: auto; opacity: .55; }

/* sections */
section { padding: clamp(80px, 12vw, 160px) var(--gutter); max-width: var(--max); margin: 0 auto; }

.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 96px);
  align-items: center;
  padding-top: clamp(48px, 8vw, 110px);
  min-height: min(calc(100svh - 64px), 860px);
}
.hero h1 { margin-bottom: 28px; }
.media--hero { aspect-ratio: 4 / 5; }

.facts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding-top: 0; padding-bottom: 0;
}
.facts div {
  border-top: 1px solid var(--line);
  padding: 28px 0 0;
  display: flex; flex-direction: column; gap: 6px;
}
.facts div + div { padding-left: 24px; }
.facts strong { font: 300 clamp(40px, 5vw, 64px)/1 var(--sans); letter-spacing: -.04em; }
.facts span { font-size: 13px; letter-spacing: .08em; color: var(--ink-soft); }

.split {
  display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 7vw, 120px);
  align-items: center;
}
.media--tall { aspect-ratio: 3 / 4; }

.land .narrow { max-width: 760px; margin: 0 auto 64px; text-align: center; }
.land .narrow p:not(.eyebrow) { margin-left: auto; margin-right: auto; }
.gallery { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 16px; align-items: end; }
.gallery .media { aspect-ratio: 3 / 4; }
.gallery .media:nth-child(2) { aspect-ratio: 4 / 5; }

.oil {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 7vw, 120px);
  align-items: start;
}
.spec { border-top: 1px solid var(--ink); }
.spec div {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.spec dt { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.spec dd { font-family: var(--serif); font-size: 21px; text-align: right; }
.spec dd.tbd { color: var(--line); }

.film { padding-top: 0; }
.media--wide { aspect-ratio: 16 / 9; }

.contact { text-align: center; }
.contact .lead { margin: 0 auto; }

.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 32px var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 12px; letter-spacing: .1em; color: var(--ink-soft);
}
.wordmark.small { font-size: 12px; }

/* ---------- motion ---------- */
:root {
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
html:not(.motion) { scroll-behavior: smooth; }

/* paper grain */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: .06; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* nav: hides going down, returns going up */
.nav { transition: border-color .3s, transform .7s var(--ease); }
.nav.hide { transform: translateY(-100%); }
.links a { position: relative; }
.links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .6s var(--ease);
}
.links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* button: ink rises from below */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: color .6s var(--ease); }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink);
  transform: translateY(101%); transition: transform .6s var(--ease);
}
.btn:hover { background: none; color: var(--paper); }
.btn:hover::before { transform: none; }

/* intro curtain — first visit of the session only */
.loader { display: none; }
html.motion:not(.no-intro) .loader {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  transition: transform 1.15s var(--ease-io);
  animation: ld-gone 0s 5s forwards; /* safety net if JS never runs */
}
.loader .wm { display: flex; overflow: hidden; padding-left: .5em; font: 500 clamp(18px, 2.4vw, 28px)/1.2 var(--sans); letter-spacing: .5em; }
.loader .wm span { display: inline-block; transform: translateY(110%); animation: ld-up 1s var(--ease) forwards; animation-delay: calc(var(--i) * 65ms + .15s); }
.loader .wm .o { color: #b3bd78; }
.loader .bar { position: absolute; left: 50%; bottom: 24%; width: 120px; height: 1px; margin-left: -60px; background: rgba(245, 242, 234, .18); overflow: hidden; }
.loader .bar::after { content: ""; position: absolute; inset: 0; background: var(--paper); transform: scaleX(0); transform-origin: left; animation: ld-bar 1.2s var(--ease-io) .25s forwards; }
html.motion .loader.done { transform: translateY(-100%); }
@keyframes ld-up { to { transform: none; } }
@keyframes ld-bar { to { transform: scaleX(1); } }
@keyframes ld-gone { to { visibility: hidden; } }

/* headings: words rise out of a mask */
html.motion .split-w .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
html.motion .split-w .w > span {
  display: inline-block; transform: translateY(110%);
  transition: transform 1.25s var(--ease);
  transition-delay: calc(var(--i) * 55ms + var(--d, 0ms));
}
html.motion .split-w.in .w > span { transform: none; }

/* text + blocks: soft rise */
html.motion [data-r] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
  transition-delay: var(--d, 0ms);
}
html.motion [data-r].in { opacity: 1; transform: none; }

/* images: wipe up, settle from a slight zoom, then drift with scroll */
/* (the clip lives on the child: IntersectionObserver treats a fully clipped
   element as invisible, so .media itself must stay unclipped) */
html.motion .media > * {
  clip-path: inset(100% 0 0 0);
  scale: 1.3; translate: 0 var(--py, 0px);
  transition: clip-path 1.5s var(--ease-io), scale 2s var(--ease-io);
  transition-delay: var(--d, 0ms);
  will-change: transform;
}
html.motion .media { background: transparent; }
html.motion .media.in > * { clip-path: inset(0 0 0 0); }
html.motion .media.in > * { scale: 1.12; }

/* line drawings sketch themselves in */
html.motion .ph svg { stroke-dasharray: 560; stroke-dashoffset: 560; transition: stroke-dashoffset 3s var(--ease) .6s; }
html.motion .media.in .ph svg { stroke-dashoffset: 0; }

/* hairlines draw across */
html.motion .facts div, html.motion .spec div { position: relative; border-color: transparent; }
html.motion .facts div::before, html.motion .spec div::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--line);
  transform: scaleX(0); transform-origin: left;
  transition: transform 1.4s var(--ease-io); transition-delay: var(--d, 0ms);
}
html.motion .facts div::before { top: -1px; }
html.motion .spec div::after { bottom: -1px; }
html.motion .facts div.in::before, html.motion .spec div.in::after { transform: none; }

/* slow italic band */
.marquee { overflow: hidden; margin: clamp(80px, 10vw, 140px) 0 0; padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.marquee .track { display: flex; align-items: center; width: max-content; animation: mq 48s linear infinite; }
.marquee span, .marquee i { font: italic 400 clamp(30px, 3.6vw, 48px)/1 var(--serif); color: var(--olive); white-space: nowrap; padding-right: .7em; }
.marquee i { font-style: normal; color: var(--line); }
@keyframes mq { to { transform: translateX(-50%); } }

/* language swap crossfade */
main, .links { transition: opacity .35s ease; }
html.swapping main, html.swapping .links { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .marquee .track { animation: none; }
}

/* mobile */
@media (max-width: 820px) {
  .links { display: none; }
  .lang { margin-left: auto; }
  .hero, .split, .oil { grid-template-columns: 1fr; }
  .hero { min-height: 0; }
  .media--hero { aspect-ratio: 4 / 5; }
  .facts div + div { padding-left: 14px; }
  .facts span { font-size: 12px; letter-spacing: .04em; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery .media:nth-child(2) { grid-column: 1 / -1; grid-row: 1; aspect-ratio: 4 / 3; }
  .foot { justify-content: center; text-align: center; }
}

/* ---------- lab results ---------- */
.lab { --chart: #66761c; --track: #e6e0d1; --grid: #ddd6c6; }
.lab-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); }
.lab-intro { color: var(--ink-soft); max-width: 34em; }
.sample-flag {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px;
  padding: 7px 12px; border: 1px solid #d9b97a; background: #f6ecd6;
  font-size: 12px; letter-spacing: .06em; color: #6b4f12;
}
.sample-flag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #b08a2e; }
.lab:not(.is-sample) .sample-flag { display: none; }

.lab-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.lab-stat, .lab-card { background: #fbf9f4; border: 1px solid var(--line); padding: clamp(22px, 3vw, 36px); }
.lab-stat { display: flex; flex-direction: column; gap: 8px; }
.ls-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.lab-stat strong { font: 500 clamp(52px, 7vw, 88px)/1 var(--sans); letter-spacing: -.035em; color: var(--ink); }
.lab-stat strong small { font-size: .26em; font-weight: 400; letter-spacing: 0; color: var(--ink-soft); margin-left: 8px; }
.ls-sub { font-size: 14px; color: var(--ink-soft); }

.lab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lab-card--wide { grid-column: 1 / -1; }
.lab-card h3 { font: 400 clamp(24px, 2.4vw, 30px)/1.15 var(--serif); margin-bottom: 8px; }
.lab-sub { font-size: 14px; color: var(--ink-soft); max-width: 46em; margin-bottom: 28px; }
.lab-note { font-size: 12.5px; color: var(--ink-soft); margin-top: 22px; max-width: 60em; }

/* purity rows: name | track (0–100% of limit) | × under */
.purity { --cols: minmax(110px, 190px) 1fr 56px; }
.pr-axis, .pr { display: grid; grid-template-columns: var(--cols); gap: 18px; align-items: center; }
.pr-axis { font-size: 11px; color: var(--ink-soft); margin-bottom: 6px; }
.pr-ticks { position: relative; height: 16px; }
.pr-ticks i { position: absolute; left: var(--x); transform: translateX(-50%); font-style: normal; font-variant-numeric: tabular-nums; }
.pr-ticks i:first-child { transform: none; }
.pr-ticks i:last-child { transform: translateX(-100%); color: var(--ink); }
.pr-xh { text-align: right; letter-spacing: .06em; }
.pr { padding: 10px 0; outline: none; }
.pr:focus-visible { box-shadow: inset 0 0 0 1px var(--ink); }
.pr-name { font-size: 14px; }
.pr-track {
  position: relative; height: 34px;
  background:
    linear-gradient(var(--grid), var(--grid)) 25% 0 / 1px 100% no-repeat,
    linear-gradient(var(--grid), var(--grid)) 50% 0 / 1px 100% no-repeat,
    linear-gradient(var(--grid), var(--grid)) 75% 0 / 1px 100% no-repeat;
  border-left: 1px solid var(--ink-soft);
  border-right: 1px solid var(--ink);
}
.pr-bar {
  position: absolute; left: 0; top: 5px; height: 24px; width: var(--w);
  background: var(--chart); border-radius: 0 4px 4px 0;
  transition: width 1.6s var(--ease, ease); transition-delay: calc(var(--d, 0ms) + 200ms);
}
.pr-val {
  position: absolute; top: 50%; left: var(--w); transform: translate(8px, -50%);
  font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink);
  transition: left 1.6s var(--ease, ease), opacity .6s; transition-delay: calc(var(--d, 0ms) + 200ms);
}
.pr-x { text-align: right; font: 500 15px/1 var(--sans); }
.pr:hover .pr-bar { filter: brightness(1.12); }

/* polyphenol bullet */
.bl { outline: none; }
.bl-track { position: relative; height: 34px; background: var(--track); border-radius: 0 4px 4px 0; }
.bl-bar { position: absolute; left: 0; top: 5px; height: 24px; width: var(--w); background: var(--chart); border-radius: 0 4px 4px 0; transition: width 1.6s var(--ease, ease) .3s; }
.bl-ref { position: absolute; top: -8px; bottom: -8px; left: var(--x); width: 2px; background: var(--ink); }
.bl-ref span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--ink); }
.bl-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-soft); margin-top: 10px; }

/* fatty acids */
.fa-bar { display: flex; gap: 2px; height: 40px; }
.fa-seg {
  flex: 0 0 calc(var(--w) - 2px); background: var(--c); position: relative; outline: none;
  display: flex; align-items: center; padding-left: 10px;
  transition: flex-basis 1.4s var(--ease, ease), opacity .8s; transition-delay: calc(var(--d, 0ms) + 200ms);
}
.fa-seg:first-child { border-radius: 4px 0 0 4px; }
.fa-seg:last-child { border-radius: 0 4px 4px 0; }
.fa-seg b { font: 500 12px/1 var(--sans); color: #fff; white-space: nowrap; }
.fa-seg:nth-child(2) b { color: var(--ink); }
.fa-seg:hover, .fa-seg:focus-visible { filter: brightness(1.1); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 18px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.legend em { font-style: normal; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* sensory */
.sensory { display: grid; gap: 6px; }
.sn { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 56px; gap: 18px; align-items: center; padding: 8px 0; outline: none; }
.sn-name { font-size: 14px; }
.sn-name small { display: block; font-size: 12px; color: var(--ink-soft); }
.sn-track {
  position: relative; height: 24px; background:
    linear-gradient(var(--grid), var(--grid)) 30% 0 / 1px 100% no-repeat,
    linear-gradient(var(--grid), var(--grid)) 60% 0 / 1px 100% no-repeat,
    var(--track);
  border-radius: 0 4px 4px 0;
}
.sn-bar { height: 100%; width: var(--w); background: var(--chart); border-radius: 0 4px 4px 0; transition: width 1.6s var(--ease, ease); transition-delay: calc(var(--d, 0ms) + 200ms); }
.sn-val { text-align: right; font: 500 15px/1 var(--sans); font-variant-numeric: tabular-nums; }
.sn-foot { margin-top: 18px; font-size: 14px; color: var(--ink-soft); }
.sn-foot strong { color: var(--ink); font-weight: 500; }

/* grow from zero when the card arrives */
html.motion .lab-card:not(.in) .pr-bar,
html.motion .lab-card:not(.in) .bl-bar,
html.motion .lab-card:not(.in) .sn-bar { width: 0; }
html.motion .lab-card:not(.in) .pr-val { left: 0; opacity: 0; }
.bl .pr-val { transition-delay: .3s; }
html.motion .lab-card:not(.in) .fa-seg { flex-basis: 0; opacity: 0; }

/* table view */
.lab-table { margin-top: 16px; border-top: 1px solid var(--line); }
.lab-table summary { cursor: pointer; padding: 18px 0; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); list-style: none; }
.lab-table summary::after { content: " +"; }
.lab-table[open] summary::after { content: " –"; }
.lab-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lab-table th { text-align: left; font-weight: 500; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding: 10px 0; border-bottom: 1px solid var(--ink); }
.lab-table td { padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lab-table th:not(:first-child), .lab-table td:not(:first-child) { text-align: right; }

.lab-tip {
  position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none;
  background: var(--ink); color: var(--paper); font-size: 12.5px; padding: 8px 11px; border-radius: 4px;
  opacity: 0; transition: opacity .15s; white-space: nowrap;
}
.lab-tip.on { opacity: 1; }

@media (max-width: 820px) {
  .lab-stats, .lab-grid { grid-template-columns: 1fr; }
  .purity { --cols: 1fr 44px; }
  .pr-axis, .pr { grid-template-columns: var(--cols); gap: 6px 12px; }
  .pr-name { grid-column: 1 / -1; }
  .pr-axis > span:first-child { display: none; }
  .sn { grid-template-columns: 1fr 44px; gap: 6px 12px; }
  .sn-name { grid-column: 1 / -1; }
  .sn-name small { display: inline; margin-left: 6px; }
}
