/* ==========================================================================
   Sigma Plastic Factory — custom layer on top of Tailwind (CDN)
   ========================================================================== */
:root {
  --ink: #181d4e;
  --brand: #2d3590;
  --brand-tint: #b8bde5;
  --primary: #ed1c24;
  --primary-dark: #cf131a;
  --body: #3b4256;
  --surface: #f7f8fc;
  --band-h: 7rem;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: Inter, system-ui, sans-serif; color: var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--primary); color: #fff; }
h1, h2, h3, h4 { font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; text-wrap: balance; }
p { text-wrap: pretty; }

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

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: #fff; padding: .75rem 1rem; border-radius: .5rem; transition: top .2s; }
.skip-link:focus { top: 1rem; }

body.is-locked { overflow: hidden; }

/* ---------- Header ---------- */
.site-header { transition: background-color .3s ease, box-shadow .3s ease; }
.site-header.is-scrolled {
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 1px 0 rgba(24, 29, 78, .06), 0 10px 30px -14px rgba(24, 29, 78, .25);
}
.nav-link { position: relative; padding: .5rem 0; color: #4a5068; font-weight: 500; font-size: .9375rem; transition: color .2s; }
.nav-link:hover { color: var(--ink); }
.nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: .75rem; font-weight: 600; font-size: .9375rem; line-height: 1; padding: .95rem 1.35rem; transition: background-color .2s, color .2s, box-shadow .25s, transform .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 22px -10px rgba(237, 28, 36, .7); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 12px 28px -10px rgba(207, 19, 26, .8); }
.btn-ghost-dark { color: #fff; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.btn-ghost-dark:hover { background: rgba(255, 255, 255, .12); }
.btn-outline { color: var(--brand); background: #fff; box-shadow: inset 0 0 0 1px #cfd3ea; }
.btn-outline:hover { box-shadow: inset 0 0 0 1px var(--primary); color: var(--primary); background: #fef1f1; }
.btn-sm { padding: .65rem .95rem; font-size: .875rem; border-radius: .625rem; }

/* ---------- Glass ---------- */
.glass {
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), 0 6px 20px -12px rgba(24, 29, 78, .35);
}
.glass-dark {
  background: rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(184, 189, 229, .2);
}

/* ---------- Signature: the film band ----------
   A translucent strip of film running off the roll in the hero. Edge lines
   mimic the lay-flat edges of blown film; one sheen pass plays on load. */
.film-band {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(184, 189, 229, .18), rgba(184, 189, 229, .06) 55%, rgba(184, 189, 229, .12));
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  border-top: 2px solid var(--primary);
  border-bottom: 1px solid rgba(184, 189, 229, .35);
}
.film-band::after {
  content: ""; position: absolute; inset: 7px 0; pointer-events: none;
  border-block: 1px solid rgba(255, 255, 255, .10);
}
.film-band .sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .22) 48%, rgba(255, 255, 255, .04) 56%, transparent 70%);
  transform: translateX(-110%);
  animation: film-sheen 2.6s .5s cubic-bezier(.45, 0, .2, 1) forwards;
}
@keyframes film-sheen { to { transform: translateX(110%); } }

.roll-spin { transform-box: fill-box; transform-origin: center; animation: roll-unspool 2.6s .5s cubic-bezier(.45, 0, .2, 1) both; }
@keyframes roll-unspool { from { transform: rotate(0deg); } to { transform: rotate(-220deg); } }

/* Light variant used for capacity bars */
.film-bar {
  position: relative; height: 3.25rem; border-radius: .5rem;
  background: linear-gradient(180deg, rgba(45, 53, 144, .20), rgba(45, 53, 144, .08) 55%, rgba(45, 53, 144, .16));
  box-shadow: inset 0 0 0 1px rgba(45, 53, 144, .30);
  transform-origin: left; transform: scaleX(var(--grow, 1));
  transition: transform 1.1s cubic-bezier(.2, .7, .2, 1);
}
.film-bar::after { content: ""; position: absolute; inset: 6px 0; border-block: 1px solid rgba(255, 255, 255, .55); }
[data-reveal]:not(.is-visible) .film-bar { --grow: .02; }

/* ---------- Reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
[data-reveal].is-visible { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ---------- Product media fallback ---------- */
.media-fallback { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 1.5rem; color: var(--brand);
  background: repeating-linear-gradient(180deg, rgba(45, 53, 144, .07) 0 14px, rgba(45, 53, 144, .02) 14px 28px), linear-gradient(135deg, #eff0f9, #f7f8fc); }
[data-media].is-missing .media-fallback { display: grid; }

/* ---------- Product filtering ---------- */
.filter-tab { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1rem; border-radius: 999px; font-size: .875rem; font-weight: 600; color: #4a5068; transition: background-color .2s, color .2s, box-shadow .2s; white-space: nowrap; }
.filter-tab:hover { color: var(--ink); background: rgba(45, 53, 144, .06); }
.filter-tab[aria-pressed="true"] { background: var(--brand); color: #fff; }
.filter-tab .count { font-size: .75rem; font-weight: 600; padding: .1rem .45rem; border-radius: 999px; background: rgba(45, 53, 144, .08); }
.filter-tab[aria-pressed="true"] .count { background: rgba(255, 255, 255, .18); }
[data-product-card] { transition: opacity .3s ease, transform .3s ease, box-shadow .3s ease; }
[data-product-card].is-leaving { opacity: 0; transform: scale(.97); }
[data-product-card][hidden] { display: none !important; }

/* ---------- Drawer ---------- */
.drawer { visibility: hidden; transition: visibility 0s linear .35s; }
.drawer.is-open { visibility: visible; transition-delay: 0s; }
.drawer-overlay { opacity: 0; transition: opacity .35s ease; }
.drawer.is-open .drawer-overlay { opacity: 1; }
.drawer-panel { transform: translateX(100%); transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.drawer.is-open .drawer-panel { transform: none; }
.drawer-link { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; font-family: "Plus Jakarta Sans", Inter, sans-serif; font-weight: 700; font-size: 1.25rem; color: var(--ink); border-bottom: 1px solid #e2e8f0; }
.drawer-link[aria-current="page"] { color: var(--primary); }

/* ---------- Modal ---------- */
.modal { visibility: hidden; transition: visibility 0s linear .3s; }
.modal.is-open { visibility: visible; transition-delay: 0s; }
.modal-overlay { opacity: 0; transition: opacity .3s ease; }
.modal.is-open .modal-overlay { opacity: 1; }
.modal-panel { opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .3s ease, transform .3s cubic-bezier(.2, .7, .2, 1); }
.modal.is-open .modal-panel { opacity: 1; transform: none; }

/* ---------- Forms ---------- */
.field-label { display: block; font-size: .875rem; font-weight: 600; color: var(--ink); margin-bottom: .4rem; }
.field-label .opt { font-weight: 400; color: #64748b; }
.field { width: 100%; border-radius: .75rem; background: #fff; border: 1px solid #cfd3ea; padding: .8rem 1rem; font-size: .9375rem; color: var(--ink); transition: border-color .2s, box-shadow .2s; appearance: none; -webkit-appearance: none; }
.field::placeholder { color: #94a3b8; }
.field:hover { border-color: #9097d4; }
.field:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(45, 53, 144, .14); }
select.field { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.5rem; }
textarea.field { min-height: 7.5rem; resize: vertical; }
.field[aria-invalid="true"] { border-color: #dc2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, .10); background: #fffafa; }
.field[aria-invalid="false"].was-checked { border-color: #059669; }
.field-error { display: none; margin-top: .4rem; font-size: .8125rem; color: #b91c1c; align-items: center; gap: .35rem; }
.field-error.is-shown { display: flex; }
.form-status { display: none; border-radius: .875rem; padding: 1rem 1.1rem; font-size: .9375rem; }
.form-status.is-shown { display: flex; gap: .75rem; align-items: flex-start; animation: status-in .35s ease; }
.form-status.is-success { background: #ecfdf5; color: #065f46; box-shadow: inset 0 0 0 1px #a7f3d0; }
.form-status.is-error { background: #fef2f2; color: #991b1b; box-shadow: inset 0 0 0 1px #fecaca; }
@keyframes status-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.btn[aria-busy="true"] { opacity: .75; pointer-events: none; }
.spinner { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Lightbox ---------- */
.lightbox { visibility: hidden; opacity: 0; transition: opacity .3s ease, visibility 0s linear .3s; }
.lightbox.is-open { visibility: visible; opacity: 1; transition-delay: 0s; }
.lightbox img { transition: opacity .25s ease; }

/* ---------- Prose (article) ---------- */
.prose-sigma p { margin-top: 1.1rem; line-height: 1.75; font-size: 1.0625rem; max-width: 68ch; }

/* ---------- Hero slider ----------
   Crossfading slides; the active photo drifts slowly (Ken Burns) and keeps
   drifting while it fades out, so motion never stops between slides. */
.hero-slider { --slide-dur: 7000ms; --fade-dur: 1200ms; position: relative; isolation: isolate; overflow: hidden; background: var(--ink);
  height: clamp(560px, 82vh, 760px); }
@media (max-width: 639px) { .hero-slider { height: max(600px, 88svh); } }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity var(--fade-dur) ease, visibility 0s linear var(--fade-dur); }
.hero-slide.is-active { opacity: 1; visibility: visible; z-index: 2; transition: opacity var(--fade-dur) ease, visibility 0s; }
.hero-slide.is-leaving { opacity: 0; visibility: visible; z-index: 1; transition: opacity var(--fade-dur) ease, visibility 0s; }
.hero-slide picture, .hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-slide img { object-fit: cover; transform-origin: var(--kb-origin, 50% 50%); will-change: transform; }
.hero-slide.is-active img, .hero-slide.is-leaving img { animation: var(--kb, kb-zoom-in) calc(var(--slide-dur) + var(--fade-dur) * 2) linear forwards; }
@keyframes kb-zoom-in  { from { transform: scale(1.02) translate3d(0, 0, 0); } to { transform: scale(1.14) translate3d(-1.5%, -1%, 0); } }
@keyframes kb-zoom-out { from { transform: scale(1.16) translate3d(1.5%, 0, 0); } to { transform: scale(1.03) translate3d(0, 0, 0); } }
@keyframes kb-pan      { from { transform: scale(1.12) translate3d(2.5%, 1%, 0); } to { transform: scale(1.12) translate3d(-2.5%, -1%, 0); } }

.hero-slide[data-theme="light"] { background: #fff; }
@media (min-width: 1024px) { .hero-slide[data-fit="right"] picture { left: 30%; } }

/* Readability overlays: dark slides fade from the left (bottom on mobile), light slides from white */
.hero-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-slide[data-theme="dark"] .hero-shade { background: linear-gradient(90deg, rgba(24, 29, 78, .92) 0%, rgba(24, 29, 78, .72) 34%, rgba(24, 29, 78, .18) 62%, rgba(24, 29, 78, 0) 78%), linear-gradient(0deg, rgba(24, 29, 78, .55), transparent 35%); }
.hero-slide[data-theme="light"] .hero-shade { background: linear-gradient(90deg, rgba(255, 255, 255, .97) 0%, rgba(255, 255, 255, .88) 30%, rgba(255, 255, 255, 0) 56%), linear-gradient(0deg, rgba(24, 29, 78, .35), transparent 30%); }
@media (max-width: 1023px) {
  .hero-slide[data-theme="dark"] .hero-shade { background: linear-gradient(0deg, rgba(24, 29, 78, .97) 0%, rgba(24, 29, 78, .88) 52%, rgba(24, 29, 78, .45) 76%, rgba(24, 29, 78, .12) 100%); }
  .hero-slide[data-theme="light"] .hero-shade { background: linear-gradient(0deg, #fff 0%, rgba(255, 255, 255, .96) 56%, rgba(255, 255, 255, .55) 70%, rgba(255, 255, 255, 0) 84%); }
}

/* Caption reveal: staggered, only on the active slide */
.hero-slide [data-anim] { opacity: 0; transform: translate3d(0, 26px, 0); transition: opacity .7s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.hero-slide.is-active [data-anim] { opacity: 1; transform: none; }
.hero-slide.is-active [data-anim="1"] { transition-delay: .35s; }
.hero-slide.is-active [data-anim="2"] { transition-delay: .5s; }
.hero-slide.is-active [data-anim="3"] { transition-delay: .65s; }
.hero-slide.is-active [data-anim="4"] { transition-delay: .8s; }
.hero-slide .accent-rule { display: block; width: 3.5rem; height: 4px; border-radius: 4px; background: var(--primary); transform-origin: left; }
.hero-slide [data-anim].accent-rule { transform: scaleX(0); }
.hero-slide.is-active [data-anim].accent-rule { transform: scaleX(1); }

/* Controls */
.hero-controls { position: absolute; z-index: 5; left: 0; right: 0; bottom: 1.5rem; }
.hero-dot { position: relative; display: flex; flex-direction: column; gap: .55rem; min-width: 0; padding: .35rem 0; text-align: left; color: rgba(255, 255, 255, .7); font-size: .8125rem; font-weight: 600; transition: color .3s; }
.hero-dot:hover, .hero-dot[aria-current="true"] { color: #fff; }
.hero-dot .track { position: relative; display: block; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.hero-dot .fill { position: absolute; inset: 0; background: var(--primary); transform: scaleX(0); transform-origin: left; }
.hero-dot.is-done .fill { transform: scaleX(1); background: rgba(255, 255, 255, .85); }
.hero-dot[aria-current="true"] .fill { animation: hero-progress var(--slide-dur) linear forwards; }
@keyframes hero-progress { to { transform: scaleX(1); } }
.hero-slider.is-paused .hero-dot .fill, .hero-slider.is-paused .hero-slide img, .hero-slider.is-held .hero-dot .fill { animation-play-state: paused; }
.hero-arrow { display: inline-flex; height: 2.75rem; width: 2.75rem; align-items: center; justify-content: center; border-radius: 999px; color: #fff; transition: background-color .2s, transform .2s; }
.hero-arrow:hover { background: rgba(255, 255, 255, .16); }
.hero-arrow:active { transform: scale(.94); }

/* ---------- About tabs (Introduction / Vision / Mission) ---------- */
.about-tablist { display: flex; gap: 1.75rem; border-bottom: 1px solid #dcdff2; }
.about-panels { display: grid; }
.about-panel { grid-area: 1 / 1; }
.about-panel[aria-hidden="true"] { visibility: hidden; opacity: 0; }
.about-tab { position: relative; padding: .7rem 0; margin-bottom: -1px; font-weight: 600; font-size: .9375rem; color: #6b7088; transition: color .2s; }
.about-tab:hover { color: var(--ink); }
.about-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.about-tab[aria-selected="true"] { color: var(--primary); }
.about-tab[aria-selected="true"]::after { transform: scaleX(1); }
.about-panel[aria-hidden="false"] { animation: panel-in .45s ease; }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- CTA band ---------- */
.btn-light { background: #fff; color: var(--primary); box-shadow: 0 10px 24px -12px rgba(92, 8, 11, .6); }
.btn-light:hover { background: #fff5f5; color: var(--primary-dark); }

/* ---------- Interior page hero with background photo ---------- */
.page-hero-bg, .page-hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.page-hero-bg img { object-fit: cover; transform-origin: 70% 50%; animation: hero-drift 14s ease-out both; }
.page-hero-bg.is-flipped { transform: scaleX(-1); }
@keyframes hero-drift { from { transform: scale(1.12); } to { transform: scale(1.02); } }
.page-hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(24, 29, 78, .94) 0%, rgba(24, 29, 78, .82) 38%, rgba(24, 29, 78, .45) 68%, rgba(24, 29, 78, .25) 100%), linear-gradient(0deg, rgba(24, 29, 78, .6), transparent 45%); }
@media (max-width: 767px) { .page-hero-shade { background: linear-gradient(0deg, rgba(24, 29, 78, .95) 0%, rgba(24, 29, 78, .8) 55%, rgba(24, 29, 78, .55) 100%); } }

/* ---------- Capacity bars ---------- */
.cap-track { height: .75rem; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.cap-fill { display: block; height: 100%; width: var(--w); border-radius: inherit; transform-origin: left; transform: scaleX(1); transition: transform 1.2s cubic-bezier(.2, .7, .2, 1) .2s; }
[data-reveal]:not(.is-visible) .cap-fill { transform: scaleX(0); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .film-band .sheen { display: none; }
  [data-reveal]:not(.is-visible) .film-bar { --grow: 1; }
  [data-reveal]:not(.is-visible) .cap-fill { transform: none; }
  .hero-slide img, .page-hero-bg img { animation: none !important; transform: none !important; }
  .hero-slide [data-anim] { opacity: 1; transform: none; }
}
