/* Sesame Labs — shared styles.
   Dark, cinematic, minimal. Poppins and a warm accent carry over from the
   Structura site so the two read as one company. */

:root {
  --bg: #08090b;
  --surface: rgba(255, 255, 255, 0.032);
  --surface-2: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f5f2ec;
  --muted: #96918a;
  --accent: #f0913f;
  --accent-dim: #c9762f;
  --accent-soft: rgba(240, 145, 63, 0.13);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #12100c; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 2rem); }

/* ---------- ambient background ----------
   Layers of slow-drifting light plus two parallax star fields.

   Rules this obeys, because a background animates for the entire life of the
   page and is the easiest place to quietly cost 60fps:
     - every layer animates transform ONLY, so it composites and never repaints
     - the gradients themselves never animate (that would repaint each frame)
     - no filter: blur() on big elements; the radial gradients are already soft
       and blur on a viewport-sized layer is expensive to composite
     - .bg clips, so translated layers can never create a scrollbar
     - long, prime-ish durations so the loops don't visibly sync up */
.bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

.orb { position: absolute; border-radius: 50%; will-change: transform; }
.orb-1 {
  width: 78vmax; aspect-ratio: 1; top: -32%; left: 50%; margin-left: -39vmax;
  background: radial-gradient(circle, rgba(240,145,63,0.17), rgba(240,145,63,0.05) 45%, transparent 66%);
  animation: drift-a 29s ease-in-out infinite;
}
.orb-2 {
  width: 52vmax; aspect-ratio: 1; top: 8%; left: 4%;
  background: radial-gradient(circle, rgba(255,178,102,0.11), transparent 62%);
  animation: drift-b 37s ease-in-out infinite;
}
.orb-3 {
  width: 46vmax; aspect-ratio: 1; bottom: -14%; right: 2%;
  background: radial-gradient(circle, rgba(201,118,47,0.13), transparent 64%);
  animation: drift-c 43s ease-in-out infinite;
}

/* two star fields at different speeds = parallax depth. Each is oversized so
   the edges never swing into view as it translates. */
.stars { position: absolute; top: -15%; left: -15%; width: 130%; height: 130%; will-change: transform; }
.stars-a {
  background-image:
    radial-gradient(1.4px 1.4px at 12% 22%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.2px 1.2px at 82% 16%, rgba(255,255,255,0.42), transparent),
    radial-gradient(1.3px 1.3px at 68% 62%, rgba(240,145,63,0.55), transparent),
    radial-gradient(1.5px 1.5px at 92% 78%, rgba(255,255,255,0.34), transparent),
    radial-gradient(1.2px 1.2px at 44% 12%, rgba(240,145,63,0.45), transparent);
  animation: float-a 71s linear infinite;
}
.stars-b {
  opacity: 0.6;
  background-image:
    radial-gradient(1px 1px at 26% 74%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 6% 54%, rgba(255,255,255,0.34), transparent),
    radial-gradient(1.1px 1.1px at 58% 34%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 36% 88%, rgba(240,145,63,0.4), transparent),
    radial-gradient(1.1px 1.1px at 74% 46%, rgba(255,255,255,0.28), transparent);
  animation: float-b 97s linear infinite;
}

/* keeps the corners dark so the orbs read as light rather than as smudges */
.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(115% 85% at 50% 40%, transparent 52%, rgba(8,9,11,0.72) 100%);
}
/* the arc that frames the hero, echoing the reference's big circle */
.arc {
  position: absolute; left: 50%; top: 0; translate: -50% -46%;
  /* 100% (of the full-width hero), never a vw value: anything over 100vw adds a
     horizontal scrollbar, and the usual overflow-x:hidden patch on html/body
     would kill the sticky nav. */
  width: min(100%, 1180px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--line); pointer-events: none; z-index: 0;
  background: radial-gradient(circle at 50% 62%, rgba(240,145,63,0.055), transparent 62%);
}

/* ---------- nav ---------- */
.nav-wrap { position: sticky; top: 0; z-index: 50; padding: 1.1rem 0 0; }
.nav {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.5rem 0.5rem 0.5rem 1.15rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(12, 13, 16, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); flex: 0 0 auto;
  box-shadow: 0 0 14px 2px rgba(240,145,63,0.55); }
.nav-links { display: flex; gap: 1.5rem; margin-left: auto; }
.nav-links a { font-size: 0.93rem; color: var(--muted); transition: color 0.15s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.72rem 1.4rem; border-radius: 999px; font-size: 0.95rem; font-weight: 500;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.18s var(--ease), box-shadow 0.18s;
}
.btn-primary { background: var(--accent); color: #12100c; font-weight: 600; box-shadow: 0 0 26px rgba(240,145,63,0.3); }
.btn-primary:hover { background: #f6a459; transform: translateY(-2px); box-shadow: 0 0 34px rgba(240,145,63,0.45); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.9rem; }

/* ---------- hero ---------- */
.hero { position: relative; z-index: 1; text-align: center;
  padding: clamp(3.5rem, 11vw, 7rem) 0 clamp(3rem, 8vw, 5rem); }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.95rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 0.82rem; color: var(--muted); letter-spacing: 0.02em;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px 1px rgba(240,145,63,0.6); }

h1 {
  margin-top: 1.6rem;
  font-size: clamp(2.3rem, 6.6vw, 4.4rem);
  font-weight: 600; letter-spacing: -0.035em; line-height: 1.06;
  text-wrap: balance;
}
h1 em { font-style: normal; color: var(--accent); }

.sub { margin: 1.35rem auto 0; max-width: 46ch; color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem); text-wrap: pretty; }

.hero-cta { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; }

/* ---------- the formula ----------
   The idea is proportions, not a list: each card states its measure and draws
   it as a bar, so the eye reads the mix before the words. Speed is dosed at 5
   parts and its bar deliberately overruns the track. */
.formula { position: relative; z-index: 1; padding: clamp(2.5rem, 7vw, 4.5rem) 0 clamp(4rem, 9vw, 6rem); }
.formula-head { text-align: center; margin-bottom: clamp(2rem, 5vw, 3rem); }
.formula-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); }
.formula-note { margin: 0.7rem auto 0; max-width: 42ch; color: var(--muted); font-size: clamp(0.95rem, 2vw, 1.05rem); text-wrap: pretty; }

.recipe { display: flex; align-items: stretch; justify-content: center; flex-wrap: wrap; gap: 0.6rem; }
.ing {
  position: relative; flex: 1 1 200px; max-width: 258px; text-align: left;
  padding: 1.5rem 1.3rem 1.6rem; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.ing:hover { transform: translateY(-5px); border-color: var(--line-2); background: var(--surface-2); }

.measure { font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: #6d6962; }
.measure .qty { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text);
  margin-right: 0.22rem; vertical-align: -0.06em; }
.ing h3 { margin-top: 0.55rem; font-size: 1.06rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.ing p { margin-top: 0.4rem; font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

/* proportion bar — scaleX, not width, so the fill animates on the compositor */
.bar { position: relative; height: 3px; margin-top: 1.25rem; border-radius: 999px;
  background: rgba(255,255,255,0.07); overflow: hidden; }
.bar i {
  position: absolute; inset: 0; display: block; border-radius: 999px;
  background: linear-gradient(90deg, rgba(240,145,63,0.55), var(--accent));
  transform: scaleX(0); transform-origin: left center;
  transition: transform 1.1s var(--ease);
}
.reveal.is-in .bar i { transform: scaleX(var(--scale, 0.4)); }

/* the overdosed ingredient: bar runs past its track and bleeds light */
.ing--x { border-color: rgba(240,145,63,0.4); background: var(--accent-soft); }
.ing--x:hover { border-color: var(--accent); background: rgba(240,145,63,0.17);
  box-shadow: 0 0 34px rgba(240,145,63,0.16); }
.ing--x .measure { color: var(--accent-dim); }
.ing--x .measure .qty, .ing--x h3 { color: var(--accent); }
.ing--x p { color: #c9b39c; }
.bar--over { overflow: visible; }
.bar--over i { box-shadow: 0 0 16px 2px rgba(240,145,63,0.75); }
/* the sliver that spills past the end of the track */
.bar--over::after {
  content: ""; position: absolute; right: -10px; top: 50%; translate: 0 -50%;
  width: 10px; height: 3px; border-radius: 999px; background: var(--accent);
  opacity: 0; transition: opacity 0.5s var(--ease) 0.9s;
  box-shadow: 0 0 14px 3px rgba(240,145,63,0.8);
}
.reveal.is-in .bar--over::after { opacity: 1; }

/* the line that explains why the bars keep moving */
.mix-note { margin: clamp(1.6rem, 4vw, 2.2rem) auto 0; text-align: center; max-width: 44ch;
  font-size: clamp(0.9rem, 1.9vw, 1rem); color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.mix-note b { color: var(--text); font-weight: 500; }
.mix-dots { display: inline-flex; gap: 0.35rem; }
.mix-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-2);
  transition: background 0.4s var(--ease), transform 0.4s var(--ease); }
.mix-dots i.on { background: var(--accent); transform: scale(1.35); }

.result { margin-top: clamp(2.2rem, 5vw, 3rem); text-align: center; }
.result .rule { width: min(100%, 640px); height: 1px; margin: 0 auto 1.7rem;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent); }
.result p { font-size: clamp(1.15rem, 3vw, 1.65rem); font-weight: 500;
  letter-spacing: -0.02em; line-height: 1.35; text-wrap: balance; }
.result b { color: var(--accent); font-weight: 600; }
.result .aside { margin-top: 1.15rem; font-size: clamp(0.9rem, 1.8vw, 0.98rem);
  font-weight: 400; color: #6d6962; max-width: 48ch; margin-inline: auto; }

/* ---------- contact page ---------- */
.page { position: relative; z-index: 1; padding: clamp(3rem, 9vw, 5.5rem) 0 clamp(4rem, 9vw, 6rem); }
.page h1 { margin-top: 0; }
.contact-grid { margin-top: clamp(2.5rem, 6vw, 3.5rem); display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 0.55rem; }
.ccard { padding: 1.6rem 1.4rem; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.ccard .n { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: #6d6962; }
.ccard .big { margin-top: 0.7rem; font-size: 1.12rem; font-weight: 600; letter-spacing: -0.015em; }
.ccard .big a { border-bottom: 1px solid rgba(240,145,63,0.5); padding-bottom: 1px; transition: color 0.15s; }
.ccard .big a:hover { color: var(--accent); }
.ccard address { font-style: normal; margin-top: 0.7rem; font-size: 1.02rem; color: var(--muted); line-height: 1.55; }

/* ---------- footer ---------- */
footer.site { position: relative; z-index: 1; border-top: 1px solid var(--line); }
footer.site .container { padding-top: 2rem; padding-bottom: 2rem;
  display: flex; flex-wrap: wrap; gap: 0.8rem 2rem; align-items: center; justify-content: space-between; }
footer .fnote { font-size: 0.86rem; color: #6d6962; }
footer .fnote b { color: var(--muted); font-weight: 500; }

/* ---------- motion ----------
   Everything here animates transform/opacity only, so it runs on the compositor
   and never triggers layout or paint. */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.7s var(--ease) both; }
.d1 { animation-delay: 0.06s; } .d2 { animation-delay: 0.13s; }
.d3 { animation-delay: 0.2s; }  .d4 { animation-delay: 0.27s; }

/* scroll reveal — .is-in is set by an IntersectionObserver, which costs nothing
   per frame, unlike a scroll listener measuring positions */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-in { opacity: 1; transform: none;
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease); }
.recipe .reveal:nth-child(1).is-in { transition-delay: 0.04s; }
.recipe .reveal:nth-child(2).is-in { transition-delay: 0.12s; }
.recipe .reveal:nth-child(3).is-in { transition-delay: 0.2s; }
.recipe .reveal:nth-child(4).is-in { transition-delay: 0.28s; }

/* Background drift. Percentages here resolve against each layer's own size, so
   these read as slow wandering rather than a fixed pixel distance that would
   look different on a phone and a monitor. */
@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33%      { transform: translate3d(-4%, 3%, 0) scale(1.06); }
  66%      { transform: translate3d(3%, -2%, 0) scale(0.97); }
}
@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  40%      { transform: translate3d(7%, 5%, 0) scale(1.1); }
  70%      { transform: translate3d(-3%, 8%, 0) scale(0.95); }
}
@keyframes drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  45%      { transform: translate3d(-6%, -5%, 0) scale(1.08); }
  75%      { transform: translate3d(4%, -8%, 0) scale(1); }
}
/* the two fields travel opposite ways, which is what sells the depth */
@keyframes float-a {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-4%, -3%, 0); }
}
@keyframes float-b {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(3.5%, 2.5%, 0); }
}

/* the framing arc drifts almost imperceptibly */
@keyframes arcdrift {
  0%, 100% { transform: translate(-50%, -46%) rotate(0deg); }
  50%      { transform: translate(-50%, -46%) rotate(7deg); }
}
.arc { animation: arcdrift 46s ease-in-out infinite; }

/* accent word catches a slow sweep of light.
   This is the one animation that repaints rather than just compositing, so the
   script parks it whenever the hero is scrolled out of view — no point burning
   a repaint per frame on a heading nobody is looking at. */
@keyframes sweep { to { background-position: 200% center; } }
h1 em {
  background: linear-gradient(100deg, var(--accent) 38%, #ffd7ab 50%, var(--accent) 62%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: sweep 7s linear infinite;
}
.hero-offscreen h1 em, .hero-offscreen .arc { animation-play-state: paused; }

/* nav tightens once you leave the top */
.nav { transition: background 0.3s var(--ease), border-color 0.3s var(--ease); }
.nav-wrap.scrolled .nav { background: rgba(12, 13, 16, 0.9); border-color: var(--line-2); }

/* buttons and cards get a real press, not just a hover */
.btn:active { transform: translateY(0) scale(0.985); }
.ing:active { transform: translateY(-3px) scale(0.995); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .recipe { flex-direction: column; align-items: stretch; }
  /* flex-basis is the MAIN axis, so the 200px that set card width in a row
     becomes a 200px minimum HEIGHT once this turns into a column, padding every
     card with dead space. Size to content instead. */
  .ing { flex: 0 0 auto; max-width: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  /* Each animated layer is a separate compositor surface holding roughly
     width x height x 4 bytes of GPU memory. Three light sources aren't
     distinguishable on a phone anyway, so drop to one and hand the memory back. */
  .orb-2, .orb-3, .stars-b { display: none; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  /* Brand + two links + button can't share one row here: everything wraps onto
     several lines and the pill turns into a block. Drop the button — the
     "Say hello" link next to it goes to the same place. */
  .nav > .btn { display: none; }
  .nav { gap: 0.9rem; padding: 0.55rem 1.05rem; }
  .nav-links { gap: 1.05rem; }
  .brand, .nav-links a { white-space: nowrap; }
  .brand { font-size: 0.95rem; }
}
@media (max-width: 380px) {
  .brand { font-size: 0.9rem; }
  .nav-links a { font-size: 0.85rem; }
  .nav { gap: 0.7rem; padding: 0.5rem 0.9rem; }
}
/* iPhone SE and narrower: the nowrap nav row runs ~1px past the viewport at the
   normal gutter, so buy back a little horizontal room. */
@media (max-width: 340px) {
  .container { padding: 0 1rem; }
  .nav { gap: 0.5rem; padding: 0.5rem 0.75rem; }
  .nav-links { gap: 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rise, .reveal { opacity: 1; transform: none; }
  /* the sweep paints the word transparent while it runs; with animation off it
     would never fill in, so hand the colour back */
  h1 em { -webkit-text-fill-color: var(--accent); color: var(--accent); background: none; }
  .bar i { transform: scaleX(var(--scale, 0.4)); }
  .bar--over::after { opacity: 1; }
}
