/* Oilandgas – process journey, cinematic hero and motion.
   Scoped to .og-* components. Reuses the site tokens from _next/static/css. */

:root {
  --og-indigo: #170a5e;
  --og-royal: #2135a9;
  --og-sky: #35b6f5;
  --og-cyan: #2ee3e3;
  --og-sand: #f6e6d9;
  --og-sand-2: #e5d9cf;
  --og-paper: #fbf6f1;
  --og-crude: #c9731c;
  --og-gas: #13a8a8;
  --og-water: #2b9be0;
  --og-cooling: #4754d6;
  --og-steam: #8d9bb0;
  --og-produced: #3f8a7e;
  --og-waste: #8d6e47;
  --og-lpg: #78ffff;
  --og-naphtha: #f0eb64;
  --og-kero: #b4dc6e;
  --og-diesel: #fa937a;
  --og-resid: #d39a64;
  --og-ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Anchored sections clear the fixed header */
#main, #overview, #operations, #sustainability, .og-stage, .og-seq { scroll-margin-top: 96px; }

/* ---------- Hero ---------- */
.og-hero-media { background: #120b33; }
.og-hero-media picture img,
.og-hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 75%;   /* keep the foreground pump */
}
.og-hero-video { opacity: 0; transition: opacity 1.2s var(--og-ease); }
.og-hero.is-playing .og-hero-video { opacity: 1; }
.og-hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(18, 11, 51, .45) 0, rgba(18, 11, 51, 0) 24%),
    linear-gradient(0deg, rgba(18, 11, 51, .18) 0, rgba(18, 11, 51, 0) 16%);
}
/* the camera move is rendered into the loop, so the video itself is not zoomed */
.og-hero-toggle {
  position: absolute; z-index: 5; right: max(24px, calc((100% - 1296px) / 2 + 24px)); top: 112px;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 10px 18px 10px 14px; border-radius: 9999px;
  color: #fff; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font: 500 14px/1 var(--font-ibm-plex-sans); cursor: pointer;
  transition: background-color .2s;
}
.og-hero-toggle:hover { background: rgba(255, 255, 255, .28); }
.og-hero-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.og-hero-toggle svg { width: 18px; height: 18px; }
.og-hero-toggle .og-i-play { display: none; }
.og-hero-toggle[aria-pressed="true"] .og-i-play { display: block; }
.og-hero-toggle[aria-pressed="true"] .og-i-pause { display: none; }
@media (max-width: 767px) {
  .og-hero-media picture img, .og-hero-video { object-position: 50% 50%; }
  .og-hero-toggle { right: 24px; padding: 10px; }
  .og-hero-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Overview (existing section): mobile stacking fix + process index ---------- */
@media (max-width: 767px) {
  #overview > .grid { grid-template-columns: 1fr !important; padding: 64px 24px !important; }
  #overview > .grid > .order-2 img { width: 100%; max-width: 420px; }
}
.og-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.og-index a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px 8px 8px;
  border-radius: 9999px; border: 1px solid rgba(23, 10, 94, .25); background: rgba(255, 255, 255, .55);
  color: var(--og-indigo); font: 400 14px/1.2 var(--font-ibm-plex-sans);
  transition: background-color .2s, border-color .2s, color .2s;
}
.og-index a:hover { background: var(--og-indigo); border-color: var(--og-indigo); color: #fff; }
.og-index a:focus-visible { outline: 2px solid var(--og-royal); outline-offset: 2px; }
.og-index b {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--og-indigo); color: #fff; font-weight: 500; font-size: 12px;
}
.og-index a:hover b { background: #fff; color: var(--og-indigo); }

/* ---------- Reliability capsule: industrial photo with readable text ---------- */
.og-shade-img {
  filter: brightness(.48) saturate(.85) contrast(1.05);
  /* the original capsule shape came from the photo's own transparency; keep it as a mask */
  object-fit: cover; object-position: 50% 55%;
}
@media (min-width: 1024px) {
  .og-shade-img {
    -webkit-mask: url(media/process/capsule-mask.png) center / 100% 100% no-repeat;
    mask: url(media/process/capsule-mask.png) center / 100% 100% no-repeat;
  }
}

/* ---------- Stage sections ---------- */
.og-journey { position: relative; }
.og-stage { position: relative; padding: 112px 0 104px; color: var(--og-indigo); --rail: var(--og-crude); --fill: 1; }
.og-stage--sand { background: var(--og-sand); }
.og-stage--white { background: #fff; }
.og-stage__inner { position: relative; max-width: 1296px; margin: 0 auto; padding: 0 24px 0 104px; }

/* process line */
.og-rail { position: absolute; top: 0; bottom: 0; left: max(52px, calc((100% - 1296px) / 2 + 52px)); width: 4px; }
.og-rail__track, .og-rail__fill { position: absolute; inset: 0; border-radius: 4px; }
.og-rail__track { background: rgba(23, 10, 94, .12); }
.og-rail__fill { background: var(--rail); transform-origin: 50% 0; transform: scaleY(var(--fill)); }
.og-rail__node {
  position: absolute; top: 112px; left: 50%; width: 48px; height: 48px; margin-left: -24px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--og-indigo); color: #fff; border: 4px solid var(--rail);
  font: 500 15px/1 var(--font-ibm-plex-sans);
}
.og-stage--sand .og-rail__node { box-shadow: 0 0 0 6px var(--og-sand); }
.og-stage--white .og-rail__node { box-shadow: 0 0 0 6px #fff; }
.og-rail--water { left: max(76px, calc((100% - 1296px) / 2 + 76px)); }
.og-rail--water .og-rail__fill { background: var(--og-water); }
.og-rail--water .og-rail__node { border-color: var(--og-water); top: 168px; }
.og-rail__branch { position: absolute; left: max(52px, calc((100% - 1296px) / 2 + 52px)); top: 0; width: 30px; height: 172px; overflow: visible; }
.og-rail__dim .og-rail__fill { opacity: .35; }

.og-stage__head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px 64px; align-items: center; }
.og-stage__copy .og-eyebrow { display: block; margin-bottom: 16px; line-height: 100%; }
.og-stage__copy h2 { margin-bottom: 28px; line-height: 110%; }
.og-stage__copy p { margin-bottom: 16px; line-height: 150%; max-width: 62ch; }
.og-points { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.og-points li { position: relative; padding-left: 28px; line-height: 140%; }
.og-points li::before {
  content: ""; position: absolute; left: 0; top: .42em; width: 14px; height: 8px; border-radius: 9999px; background: var(--rail);
}

/* photos keep the site's capsule language */
.og-photo { margin: 0; }
.og-photo__frame {
  position: relative; overflow: hidden; border-radius: 9999px; aspect-ratio: 16 / 10; background: var(--og-sand-2);
  box-shadow: 0 24px 60px -30px rgba(23, 10, 94, .45);
}
.og-photo__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.og-photo figcaption, .og-fig figcaption { margin-top: 14px; font: 400 14px/1.45 var(--font-ibm-plex-sans); color: rgba(23, 10, 94, .8); padding-left: 24px; }
.og-photo--tall .og-photo__frame { aspect-ratio: 4 / 3; border-radius: 240px 240px 240px 32px; }
.og-photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.og-photo-pair .og-photo__frame { aspect-ratio: 4 / 3; border-radius: 9999px 9999px 9999px 9999px; }

/* tank-farm camera move */
.og-pan { margin: 56px 0 0; }
.og-pan .og-photo__frame { aspect-ratio: 21 / 8; }
.og-pan img { width: 124% !important; max-width: none; left: 0; transform: translate3d(calc(var(--pan, .5) * -19.4%), 0, 0); will-change: transform; }

/* diagrams */
.og-fig { margin: 56px 0 0; }
.og-fig__plate {
  position: relative; border-radius: 32px; background: #fff; padding: 28px;
  box-shadow: 0 30px 80px -50px rgba(23, 10, 94, .5);
}
.og-stage--white .og-fig__plate { background: var(--og-paper); }
.og-fig__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.og-fig__svg { display: block; width: 100%; height: auto; }
.og-fig__hint { display: none; }
.og-legend-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 16px 0 0; padding: 0 0 0 24px; list-style: none; font: 400 14px/1.3 var(--font-ibm-plex-sans); }
.og-legend-row li { display: inline-flex; align-items: center; gap: 8px; }
.og-legend-row i { display: inline-block; width: 22px; height: 6px; border-radius: 4px; background: var(--c); }
.og-legend-row i.og-dashed { background: repeating-linear-gradient(90deg, var(--c) 0 6px, transparent 6px 10px); }

/* svg typography */
.og-fig__svg text { font-family: var(--font-ibm-plex-sans); font-size: 17px; fill: var(--og-indigo); }
.og-fig__svg .og-t-small { font-size: 15px; }
.og-fig__svg .og-t-strong { font-size: 18px; font-weight: 500; }
.og-fig__svg .og-t-muted { opacity: .7; }
.og-fig__svg .og-lbl text, .og-fig__svg text.og-halo { paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.og-stage--white .og-fig__svg .og-lbl text { stroke: var(--og-paper); }
.og-leader { stroke: var(--og-indigo); stroke-width: 1.3; fill: none; opacity: .7; }
.og-eq { fill: #fff; stroke: var(--og-indigo); stroke-width: 2.2; }
.og-eq--soft { fill: var(--og-paper); }
.og-box { fill: #fff; stroke: var(--og-indigo); stroke-width: 2; }
.og-pipe { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.og-flow { fill: none; stroke: rgba(255, 255, 255, .9); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 2 14; }
.og-flow--dark { stroke: rgba(23, 10, 94, .55); }

/* drilling progress (scroll-linked, reversible) */
.og-well-drill { stroke-dasharray: 1 1; stroke-dashoffset: calc(1 - var(--drill, 1)); }
.og-perf { opacity: clamp(0, calc((var(--drill, 1) - .86) * 8), 1); }

/* separator internals */
.og-bubble, .og-drop { transform-box: fill-box; }

/* ---------- Refinery showcase (scroll-driven) ---------- */
.og-seq { position: relative; color: #fff; background: radial-gradient(120% 80% at 70% 30%, #23177a 0, #170a5e 45%, #0e0640 100%); --rail: var(--og-crude); --fill: 1; }
.og-seq .og-rail__track { background: rgba(255, 255, 255, .14); }
.og-seq .og-rail__node { box-shadow: 0 0 0 6px #170a5e; }
.og-seq__intro { position: relative; max-width: 1296px; margin: 0 auto; padding: 112px 24px 24px 104px; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 32px 64px; align-items: end; }
.og-seq__intro h2 { margin-bottom: 28px; line-height: 110%; }
.og-seq__intro p { line-height: 150%; color: rgba(255, 255, 255, .86); margin-bottom: 14px; }
.og-seq__intro .og-eyebrow { display: block; margin-bottom: 16px; line-height: 100%; color: var(--og-cyan); }
.og-seq__track { position: relative; }
.og-seq__sticky { position: relative; max-width: 1296px; margin: 0 auto; padding: 32px 24px 112px 104px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: center; }
.og-steps { margin: 0; padding: 0; list-style: none; counter-reset: og-step; display: grid; gap: 18px; }
.og-steps li { counter-increment: og-step; position: relative; padding: 0 0 0 52px; transition: opacity .35s var(--og-ease); }
.og-steps li::before {
  content: counter(og-step, decimal-leading-zero); position: absolute; left: 0; top: -4px;
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .5); font: 500 13px/1 var(--font-ibm-plex-sans);
}
.og-steps h3 { font: 500 20px/1.25 var(--font-ibm-plex-sans); margin: 2px 0 8px; }
.og-steps p { font: 400 16px/1.5 var(--font-ibm-plex-sans); color: rgba(255, 255, 255, .82); margin: 0; }
.og-seq__progress { display: none; }
.og-seq__fig { margin: 0; }
.og-seq__fig .og-fig__svg { max-height: calc(100vh - 150px); }
.og-seq__note { margin-top: 10px; font: 400 13px/1.4 var(--font-ibm-plex-sans); color: rgba(255, 255, 255, .66); }

/* refinery svg styling */
.og-ref text { font-family: var(--font-ibm-plex-sans); font-size: 21px; fill: #fff; paint-order: stroke; stroke: #160a57; stroke-width: 5px; stroke-linejoin: round; }
.og-ref .og-t-small { font-size: 18px; fill: rgba(255, 255, 255, .8); }
.og-ref .og-t-strong { font-weight: 500; font-size: 22px; }
.og-ref .og-t-dark { fill: var(--og-indigo); stroke: none; font-weight: 500; }
.og-ref .og-eq { fill: rgba(255, 255, 255, .07); stroke: #a9b6ff; stroke-width: 2; }
.og-ref .og-box { fill: rgba(33, 53, 169, .55); stroke: #a9b6ff; stroke-width: 1.6; }
.og-ref .og-pipe { stroke-width: 6; }
.og-ref .og-base { stroke: rgba(255, 255, 255, .14); }
.og-ref .og-tray { stroke: rgba(255, 255, 255, calc(.25 + .5 * var(--heat))); stroke-width: 2; }

/* scroll variables: default (no JS, mobile, reduced motion) = complete diagram */
.og-ref { --p1: 1; --p2: 1; --p3: 1; --p4: 1; }
.og-ref .og-g1 { --on: clamp(0, calc(var(--p1) * 3), 1); }
.og-ref .og-g2 { --on: clamp(0, calc(var(--p2) * 3), 1); }
.og-ref .og-g3 { --on: clamp(0, calc(var(--p3) * 3), 1); }
.og-ref .og-g4 { --on: clamp(0, calc(var(--p4) * 3), 1); }
.og-ref .og-g1, .og-ref .og-g2 { opacity: calc(.5 + .5 * var(--on)); }
.og-ref .og-draw { stroke-dasharray: 1 1; stroke-dashoffset: calc(1 - var(--d)); }
.og-ref .og-g1 .og-draw { --d: var(--p1); }
.og-ref .og-g3 .og-draw { --d: clamp(0, calc(var(--p3) * 8 - var(--i, 0)), 1); }
.og-ref .og-g3 .og-item { opacity: calc(.6 + .4 * clamp(0, calc(var(--p3) * 8 - var(--i, 0)), 1)); }
.og-ref .og-g4 .og-draw { --d: clamp(0, calc(var(--p4) * 7 - var(--i, 0)), 1); }
.og-ref .og-g4 .og-item { opacity: calc(.6 + .4 * clamp(0, calc(var(--p4) * 7 - var(--i, 0)), 1)); }
.og-ref .og-flow { opacity: var(--d, 1); }
.og-ref .og-heat { --heat: clamp(0, calc(var(--p2) * 1.5), 1); transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(var(--heat)); }
.og-ref .og-g2 { --heat: clamp(0, calc(var(--p2) * 1.5), 1); }
.og-ref .og-vap { opacity: calc(var(--on) * .9); }

/* ---------- motion (only when allowed and in view) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .og-js .og-flow { animation: og-dash 1.1s linear infinite; animation-play-state: paused; }
  .og-js .is-active .og-flow { animation-play-state: running; }
  .og-js .og-bubble { animation: og-rise 3.2s ease-in infinite; animation-play-state: paused; }
  .og-js .og-drop { animation: og-fall 3.6s ease-in infinite; animation-play-state: paused; }
  .og-js .og-vap { animation: og-vapour 4s linear infinite; animation-play-state: paused; }
  .og-js .og-wisp { animation: og-wisp 5s ease-in-out infinite; animation-play-state: paused; }
  .og-js .og-pig { animation: og-pig 9s linear infinite; animation-play-state: paused; }
  .og-js .is-active .og-bubble, .og-js .is-active .og-drop, .og-js .is-active .og-vap,
  .og-js .is-active .og-wisp, .og-js .is-active .og-pig { animation-play-state: running; }

  .og-js .og-reveal { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .9s var(--og-ease), transform .9s var(--og-ease); }
  .og-js .og-reveal.is-in { opacity: 1; transform: none; }
}
@keyframes og-dash { to { stroke-dashoffset: -16; } }
@keyframes og-rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-46px); opacity: 0; } }
@keyframes og-fall { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(30px); opacity: 0; } }
@keyframes og-vapour { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: .9; } 100% { transform: translateY(-120px); opacity: 0; } }
@keyframes og-wisp { 0%, 100% { transform: translate(0, 0); opacity: .55; } 50% { transform: translate(-6px, -10px); opacity: .95; } }
.og-pig { offset-path: path("M228 168H470Q486 168 490 182L500 232Q504 246 520 246H640Q656 246 660 232L664 196"); offset-rotate: auto; offset-distance: 40%; }
@keyframes og-pig { from { offset-distance: 0%; } to { offset-distance: 100%; } }

/* ---------- desktop scroll-driven sequence (JS + motion allowed) ---------- */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .og-js .og-seq__track { height: 360vh; }
  .og-js .og-seq__sticky { position: sticky; top: 0; height: 100vh; padding-top: 104px; padding-bottom: 24px; }
  .og-js .og-steps li { opacity: .42; }
  .og-js .og-steps li.is-current { opacity: 1; }
  .og-js .og-steps li p { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .45s var(--og-ease), opacity .35s; }
  .og-js .og-steps li.is-current p { max-height: 14em; opacity: 1; }
  .og-js .og-steps li.is-current::before { background: var(--og-cyan); border-color: var(--og-cyan); color: var(--og-indigo); }
  .og-js .og-seq__progress { display: block; height: 3px; margin-top: 28px; border-radius: 3px; background: rgba(255, 255, 255, .16); overflow: hidden; }
  .og-js .og-seq__progress span { display: block; height: 100%; background: var(--og-cyan); transform-origin: 0 50%; transform: scaleX(var(--seq, 0)); }
}

/* ---------- sustainability expansion ---------- */
.og-sus-intro { max-width: 760px; text-shadow: 0 1px 14px rgba(23, 10, 94, .65); }
@media (min-width: 1024px) {
  .og-sus-grid > div { width: calc(33.333% - 16px) !important; max-width: 404px !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .og-stage__head { grid-template-columns: 1fr; }
  .og-seq__intro { grid-template-columns: 1fr; }
  .og-seq__sticky { grid-template-columns: 1fr; }
}
@media (max-width: 1023px), (prefers-reduced-motion: reduce) {
  .og-seq__fig .og-fig__svg { max-height: none; }
}
@media (max-width: 767px) {
  .og-stage { padding: 72px 0 72px; }
  .og-stage__inner, .og-seq__intro, .og-seq__sticky { padding-left: 24px; padding-right: 24px; }
  .og-seq__intro { padding-top: 72px; }
  .og-seq__sticky { padding-bottom: 72px; }
  .og-rail, .og-rail__branch { display: none; }
  .og-stage__copy .og-eyebrow::before, .og-seq__intro .og-eyebrow::before {
    content: attr(data-stage); display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 10px;
    border-radius: 50%; background: var(--rail); color: #fff; font-weight: 500; letter-spacing: 0; vertical-align: middle;
  }
  .og-fig__plate { padding: 16px; border-radius: 24px; }
  .og-fig__scroll .og-fig__svg { min-width: 820px; }
  .og-seq .og-fig__scroll .og-fig__svg { min-width: 900px; }
  .og-fig__hint { display: block; margin: 0 0 10px; font: 400 13px/1.3 var(--font-ibm-plex-sans); opacity: .75; }
  .og-photo-pair { grid-template-columns: 1fr; }
  .og-pan .og-photo__frame { aspect-ratio: 16 / 9; }
  .og-photo figcaption, .og-fig figcaption { padding-left: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .og-pan img { transform: translate3d(-9.7%, 0, 0); }
}
.og-hero-toggle[hidden] { display: none; }
/* grid children must be allowed to shrink so wide diagrams scroll inside their own container */
.og-stage__head > *, .og-seq__intro > *, .og-seq__sticky > *, .og-photo-pair > * { min-width: 0; }

/* ---------- footer image credits ---------- */
.og-credits { max-width: 760px; color: var(--og-indigo); }
.og-credits summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.og-credits ul { margin: 12px 0 0; padding: 0 0 0 18px; list-style: disc; display: grid; gap: 6px; line-height: 1.45; }
.og-credits a { text-decoration: underline; }
