/* ==========================================================================
   O&G Engineering — style.css
   Tokens, base type, shell, header, hero, page head, footer.
   Every colour pair used here is measured; see DESIGN.md for the table.
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */

:root {
  /* Brand — both values sampled from images/logo_ong.png */
  --blue:          #124794;   /* the oil diamond.  8.92:1 on white  */
  --blue-deep:     #0E3A7A;   /* hover / pressed. 11.02:1 on white  */
  --blue-lift:     #9CB6EE;   /* blue for type on --ink. 7.54:1     */
  --green:         #179841;   /* the gas diamond. 3.75:1 — graphic only */
  --green-deep:    #0E7434;   /* green for type on light. 5.89:1    */
  --green-lift:    #45D57E;   /* green for type on --ink. 8.08:1    */

  /* Ground and surfaces */
  --ink:           #0B2350;   /* the brand blue taken down to a ground */
  --paper:         #FFFFFF;
  --mist:          #F1F4FA;
  --pearl:         #E8EDF7;   /* near-white type on --ink. 13.05:1   */

  /* Type colours */
  --text:          #16203A;   /* 16.13:1 on white */
  --text-muted:    #4A5570;   /*  7.43:1 on white */

  /* Hairlines */
  --border:        #DCE2EE;
  --border-strong: #BFC9DD;
  --border-ink:    rgba(232,237,247,.20);

  /* Type */
  --display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:    "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "Source Code Pro", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --fs-xs:   12px;
  --fs-sm:   13px;
  --fs-base: 15px;
  --fs-body: 17px;
  --fs-lg:   19px;
  --fs-xl:   22px;
  --fs-2xl:  clamp(23px, 2.4vw, 27px);
  --fs-3xl:  clamp(27px, 3.2vw, 34px);
  --fs-4xl:  clamp(32px, 4.4vw, 44px);
  --fs-5xl:  clamp(36px, 5.6vw, 58px);

  /* Layout */
  --shell:     1280px;
  --gutter:    20px;
  --section-y: clamp(60px, 7.5vw, 104px);
  --radius:    2px;          /* machined, not soft */
  --header-h:  88px;

  /* Motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --fast: 180ms;
}

@media (min-width: 700px)  { :root { --gutter: 32px; } }
@media (min-width: 1040px) { :root { --gutter: 44px; } }

/* --- 2. Reset and base --------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); letter-spacing: -.01em; }
h4 { font-size: var(--fs-lg); letter-spacing: 0; }

p  { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-deep); }

strong { font-weight: 700; color: var(--ink); }

::selection { background: var(--blue); color: #fff; }

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

/* --- 3. Shell ------------------------------------------------------------ */

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

.band { padding-block: var(--section-y); }
.band--mist  { background: var(--mist); }
.band--paper { background: var(--paper); }
.band--ink   { background: var(--ink); color: var(--pearl); }

.measure { max-width: 68ch; }

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
}
.skip-link:focus { inset-inline-start: 0; }

/* --- 4. The diamond ------------------------------------------------------
   The logo is two rotated squares — a blue one holding an oil drop, a green
   one holding a gas flame. That shape is the site's only ornament, and green
   consistently means "approved / current".
   ------------------------------------------------------------------------ */

.dia {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: none;
  background: var(--green);
  transform: rotate(45deg);
}
.dia--blue { background: var(--blue); }
.dia--lift { background: var(--green-lift); }

/* --- 5. Eyebrow and section head ----------------------------------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green-deep);
}
.band--ink .eyebrow, .page-head .eyebrow { color: var(--green-lift); }

.section-head { margin-bottom: clamp(28px, 3.4vw, 44px); }
.section-head h2 { margin: 0; }
.section-head p.lede {
  margin: 14px 0 0;
  max-width: 62ch;
  color: var(--text-muted);
}
.band--ink .section-head h2 { color: #fff; }
.band--ink .section-head p.lede { color: var(--pearl); }

/* --- 6. Header ----------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--fast) var(--ease);
}
.site-header.is-stuck { box-shadow: 0 1px 16px rgba(11, 35, 80, .10); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  transition: height var(--fast) var(--ease);
}
.site-header.is-stuck .header-inner { height: 66px; }

.brand { display: block; flex: none; }
.brand img {
  height: 46px;
  width: auto;
  transition: height var(--fast) var(--ease);
}
.site-header.is-stuck .brand img { height: 38px; }

/* Desktop nav */
.nav { display: none; }

@media (min-width: 1040px) {
  .nav { display: block; }
  .nav > ul {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .nav a, .nav .nav-parent {
    display: block;
    padding: 10px 13px;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: .002em;
    position: relative;
    background: none;
    border: 0;
    font-family: inherit;
    cursor: pointer;
  }
  .nav a::after {
    content: "";
    position: absolute;
    left: 13px;
    right: 13px;
    bottom: 4px;
    height: 2px;
    background: var(--blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--fast) var(--ease);
  }
  .nav a:hover { color: var(--blue); }
  .nav a:hover::after { transform: scaleX(1); }
  .nav a[aria-current="page"] { color: var(--blue); }
  .nav a[aria-current="page"]::after { transform: scaleX(1); background: var(--green); }
}

/* Dropdown */
.nav-item--has-child { position: relative; }
.nav-parent {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.nav-parent svg { transition: transform var(--fast) var(--ease); }
.nav-item--has-child.is-open .nav-parent svg { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-end: 0;
  min-width: 216px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--border);
  box-shadow: 0 12px 34px rgba(11, 35, 80, .14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease), visibility var(--fast);
}
.nav-item--has-child.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown a {
  padding: 9px 12px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 9px;
}
.nav-dropdown a::after { content: none; }
.nav-dropdown a:hover { background: var(--mist); color: var(--blue); }
.nav-dropdown a svg { flex: none; opacity: .5; }

/* Burger */
.burger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}
.burger:hover { border-color: var(--blue); color: var(--blue); }
.burger span { display: block; width: 16px; height: 9px; position: relative; }
.burger span::before, .burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
}
.burger span::before { top: 0; }
.burger span::after  { bottom: 0; }
@media (min-width: 1040px) { .burger { display: none; } }

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 150;
  visibility: hidden;
}
.drawer.is-open { visibility: visible; }
.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(11, 35, 80, .55);
  opacity: 0;
  transition: opacity 220ms var(--ease);
}
.drawer.is-open .drawer-scrim { opacity: 1; }
.drawer-panel {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(360px, 86vw);
  background: var(--paper);
  padding: 20px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 260ms var(--ease);
}
.drawer.is-open .drawer-panel { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.drawer-close {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
}
.drawer-close:hover { border-color: var(--blue); color: var(--blue); }
.drawer ul { list-style: none; margin: 0; padding: 0; }
.drawer > .drawer-panel > ul > li + li { border-top: 1px solid var(--border); }
.drawer a, .drawer .drawer-parent {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 4px;
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: 0;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
}
.drawer a[aria-current="page"] { color: var(--blue); }
.drawer-sub { padding: 0 0 10px 18px !important; }
.drawer-sub a { font-weight: 400; font-size: var(--fs-base); padding: 9px 4px; }
.drawer-parent svg { margin-inline-start: auto; transition: transform var(--fast) var(--ease); }
.drawer-parent[aria-expanded="true"] svg { transform: rotate(180deg); }
.drawer-sub[hidden] { display: none; }

/* --- 7. Hero -------------------------------------------------------------
   The ground is either a photograph or the diamond lattice — never both.
   ------------------------------------------------------------------------ */

.hero {
  position: relative;
  background: var(--ink);
  color: var(--pearl);
  overflow: hidden;
  isolation: isolate;
}

.hero-slides { position: absolute; inset: 0; z-index: -2; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1200ms var(--ease);
}
.hero-slide.is-active { opacity: 1; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(94deg, rgba(11,35,80,.96) 0%, rgba(11,35,80,.88) 42%, rgba(11,35,80,.62) 100%),
    linear-gradient(0deg, rgba(11,35,80,.55) 0%, rgba(11,35,80,0) 55%);
}

.hero-inner {
  padding-block: clamp(56px, 8vw, 96px);
  min-height: clamp(400px, 52vh, 540px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero h1 {
  color: #fff;
  font-size: var(--fs-5xl);
  max-width: 17ch;
  margin: 0 0 20px;
}
.hero .hero-lede {
  max-width: 56ch;
  font-size: var(--fs-lg);
  color: var(--pearl);
  margin: 0;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green-lift);
}

/* The standing bar — the bodies O&G is approved with, verbatim from the
   home page's closing line. This is the site's signature. */
.standing {
  margin-top: clamp(30px, 4vw, 44px);
  padding-top: 22px;
  border-top: 1px solid var(--border-ink);
}
.standing-label {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue-lift);
  margin: 0 0 14px;
}
.standing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.standing-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: .05em;
  color: #fff;
}

/* Slide dots */
.hero-dots {
  display: flex;
  gap: 8px;
  margin-top: 28px;
  padding: 0;
  list-style: none;
}
.hero-dots button {
  width: 26px;
  height: 3px;
  padding: 0;
  border: 0;
  background: rgba(232,237,247,.34);
  cursor: pointer;
  transition: background var(--fast) var(--ease);
}
.hero-dots button:hover { background: rgba(232,237,247,.7); }
.hero-dots button[aria-current="true"] { background: var(--green-lift); }

/* --- 8. Inner page head --------------------------------------------------
   No photograph here — the ground carries the diamond lattice instead.
   ------------------------------------------------------------------------ */

.page-head {
  position: relative;
  background: var(--ink);
  color: var(--pearl);
  overflow: hidden;
  isolation: isolate;
}
.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(45deg, var(--border-ink) 1px, transparent 1px),
    linear-gradient(-45deg, var(--border-ink) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(120% 100% at 78% 0%, #000 0%, transparent 72%);
          mask-image: radial-gradient(120% 100% at 78% 0%, #000 0%, transparent 72%);
  opacity: .85;
}
.page-head-inner { padding-block: clamp(44px, 6vw, 72px); }
.page-head h1 { color: #fff; margin: 0; max-width: 20ch; }
.page-head .page-lede {
  margin: 16px 0 0;
  max-width: 60ch;
  color: var(--pearl);
}

/* Breadcrumb */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: .06em;
}
.crumb a { color: var(--blue-lift); text-decoration: none; }
.crumb a:hover { color: #fff; text-decoration: underline; }
.crumb li { display: flex; align-items: center; gap: 8px; color: var(--pearl); }
.crumb li + li::before { content: "/"; color: rgba(232,237,247,.4); }
.crumb [aria-current="page"] { color: var(--pearl); }

/* --- 9. Footer ----------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: var(--pearl);
  padding-block: clamp(44px, 5vw, 64px) 0;
}
.footer-grid {
  display: grid;
  gap: 36px;
  padding-bottom: 40px;
}
@media (min-width: 760px)  { .footer-grid { grid-template-columns: 1.4fr 1fr; } }
@media (min-width: 1040px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; } }

.footer-brand img { height: 44px; width: auto; margin-bottom: 18px; }
.footer-brand p { color: var(--pearl); max-width: 42ch; margin: 0; }

.footer-col h2 {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue-lift);
  margin: 0 0 16px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li + li { margin-top: 9px; }
.footer-col a { color: var(--pearl); text-decoration: none; font-size: var(--fs-base); }
.footer-col a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.footer-contact { font-size: var(--fs-base); color: var(--pearl); }
.footer-contact dt {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue-lift);
  margin-top: 12px;
}
.footer-contact dt:first-child { margin-top: 0; }
.footer-contact dd { margin: 2px 0 0; }
.footer-contact a { color: var(--pearl); }

.footer-base {
  border-top: 1px solid var(--border-ink);
  padding-block: 22px 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--pearl);
}
.footer-base p { margin: 0; }

/* --- 10. Back to top ----------------------------------------------------- */

.to-top {
  position: fixed;
  inset-inline-end: 20px;
  inset-block-end: 20px;
  z-index: 90;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease), visibility var(--fast), background var(--fast);
}
.to-top.is-shown { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--blue); }

/* --- 11. Motion ---------------------------------------------------------- */

/* Scoped to .has-js, set by an inline script in the head: without the script
   the content is plainly visible rather than stranded at opacity 0. */
.has-js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}
.has-js .reveal.is-in { opacity: 1; transform: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.hero-inner > * { animation: rise 620ms var(--ease) both; }
.hero-inner > *:nth-child(1) { animation-delay:  60ms; }
.hero-inner > *:nth-child(2) { animation-delay: 130ms; }
.hero-inner > *:nth-child(3) { animation-delay: 200ms; }
.hero-inner > *:nth-child(4) { animation-delay: 270ms; }
.hero-inner > *:nth-child(5) { animation-delay: 340ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .has-js .reveal, .has-js .reveal.is-in { opacity: 1; transform: none; }
}
