/* =====================================================================
   SYED KAMRUL AHSAN : PORTFOLIO WEBSITE : STYLES

   WHERE TO CHANGE THINGS
   1. COLOURS   the first block below (light page), then the dark page.
                The dark colours are written twice; change both copies.
   2. FONTS     the two --font lines in the first block.
   3. SIZES     --wrap (page width) and the type sizes, also in that block.
   Everything further down builds on those names, so most changes are
   made in the first 90 lines.
   ===================================================================== */

/* The fonts are in css/fonts. They are TeX Gyre Heros and Heros Condensed,
   free fonts (see GUST-FONT-LICENSE.txt in that folder). */
@font-face { font-family: "TeX Gyre Heros"; src: url("fonts/texgyreheros-regular.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "TeX Gyre Heros"; src: url("fonts/texgyreheros-bold.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "TeX Gyre Heros Cn"; src: url("fonts/texgyreheroscn-regular.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "TeX Gyre Heros Cn"; src: url("fonts/texgyreheroscn-bold.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------------------------------------------------------------------
   1. COLOURS, FONTS AND SIZES  (light page)
   Layout idea: the page is a section through the ground. One column of
   content on the left, a cased well down the right-hand side, one rock
   layer per section, the storage formation at the bottom.
   --------------------------------------------------------------------- */
:root {
  /* text and lines */
  --ink: #1B2320;                      /* main text, drawing lines */
  --ink-2: #48524C;                    /* quieter text */
  --ink-3: #78827B;                    /* small tick marks */
  --line: rgba(27, 35, 32, .16);       /* faint rules */
  --line-2: rgba(27, 35, 32, .3);      /* stronger rules, panel borders */

  /* surfaces */
  --sky: #F1F4EF;                      /* above ground: top bar and hero */
  --paper: #FCFCF8;                    /* figure panels, cards, tables */
  --bore: #FCFCF8;                     /* inside of the well */

  /* fluids, by oilfield convention: gas is red, water is blue. CO2 is teal. */
  --co2: #0B6A72;                      /* accent: links, main button, CO2 */
  --on-co2: #FFFFFF;                   /* text on the accent colour */
  --co2-soft: rgba(11, 106, 114, .14);
  --co2-bright: #5FC4C2;               /* CO2 on dark backgrounds */
  --gas: #A63C27;
  --water: #2B6CB0;

  /* rock layers (one per section) */
  --rock-alluvium: #ECE8D4;
  --rock-sandstone: #F1E6C0;
  --rock-shale: #DEE5DD;
  --rock-limestone: #DCE5E8;
  --rock-siltstone: #E8E2D8;
  --rock-caprock: #B4C2B8;
  --rock-storage: #EEDCA6;
  --rock-basement: #262D2A;
  --on-basement: #E9E7DB;
  --on-basement-2: #B4B8AC;
  --pat-ink: rgba(27, 35, 32, .4);     /* colour of the rock patterns */

  /* fonts */
  --font: "TeX Gyre Heros", "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --font-cn: "TeX Gyre Heros Cn", "Helvetica Neue Condensed", "Arial Narrow", "Liberation Sans Narrow", "Roboto Condensed", sans-serif;

  /* type sizes */
  --t-1: 1.32rem;                                /* entry titles */
  --t-3: clamp(1.9rem, 3.6vw, 2.7rem);           /* section titles */
  --t-4: clamp(3rem, 6.2vw, 4.7rem);             /* your name */

  /* page geometry */
  --wrap: 1180px;                                /* widest the content gets */
  --pad-x: clamp(16px, 4vw, 40px);
  --pad-y: clamp(56px, 8vw, 104px);
  --bar-h: 56px;
  --gauge-h: 30px;
  --track: 80px;                                 /* width of the rock column the well runs in */
  --scale-w: 54px;                               /* room for the depth labels beside it */
  --gutter: calc(var(--track) + var(--scale-w) + 24px);
  --w-cond: 56px; --w-surf: 42px; --w-int: 30px; --w-prod: 18px; --w-tub: 7px;   /* casing and tubing widths */

  /* rock patterns and layer boundaries (drawings, not colours) */
  --pat-pebbles: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Cg fill='none' stroke='black' stroke-width='1.1'%3E%3Cellipse cx='7' cy='7' rx='3.6' ry='2.4'/%3E%3Cellipse cx='19' cy='17' rx='4.2' ry='2.8'/%3E%3Ccircle cx='19' cy='5' r='1.5'/%3E%3Ccircle cx='6' cy='19' r='1.7'/%3E%3C/g%3E%3C/svg%3E");
  --pat-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Ccircle cx='3' cy='4' r='1.1'/%3E%3Ccircle cx='12' cy='8' r='1.1'/%3E%3Ccircle cx='6' cy='14' r='1.1'/%3E%3Ccircle cx='15.5' cy='15.5' r='.8'/%3E%3C/svg%3E");
  --pat-dashes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='12'%3E%3Cpath d='M1 3h11M14 9h11' stroke='black' stroke-width='1.2'/%3E%3C/svg%3E");
  --pat-dashes-dense: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='8'%3E%3Cpath d='M0 2h9M11 6h9' stroke='black' stroke-width='1.3'/%3E%3C/svg%3E");
  --pat-bricks: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='18'%3E%3Cpath d='M0 .6h30M0 9.6h30M8 .6v9M23 9.6v8.4' stroke='black' stroke-width='1.1' fill='none'/%3E%3C/svg%3E");
  --pat-dashdot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='14'%3E%3Cpath d='M1 4h8M15 11h8' stroke='black' stroke-width='1.2'/%3E%3Ccircle cx='16' cy='4' r='1'/%3E%3Ccircle cx='5' cy='11' r='1'/%3E%3C/svg%3E");
  --pat-crosses: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Cpath d='M3 6h6M6 3v6M14 17h6M17 14v6' stroke='black' stroke-width='1.1'/%3E%3C/svg%3E");
  --wave-fill: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='18' viewBox='0 0 1200 18' preserveAspectRatio='none'%3E%3Cpath d='M0 9C100 2 200 2 300 8S480 17 600 10S800 1 900 7S1100 16 1200 9V18H0Z'/%3E%3C/svg%3E");
  --wave-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='18' viewBox='0 0 1200 18' preserveAspectRatio='none'%3E%3Cpath d='M0 9C100 2 200 2 300 8S480 17 600 10S800 1 900 7S1100 16 1200 9' fill='none' stroke='black' stroke-width='1.3'/%3E%3C/svg%3E");

  color-scheme: light;
}

/* ---------------------------------------------------------------------
   THE DARK PAGE  (copy 1 of 2: used when the visitor's device is in dark mode)
   --------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E9E7DB; --ink-2: #B9BCAF; --ink-3: #868C82;
    --line: rgba(233, 231, 219, .14); --line-2: rgba(233, 231, 219, .28);
    --sky: #11181A; --paper: #1C2624; --bore: #0D1312;
    --co2: #5FC4C2; --on-co2: #0C1413; --co2-soft: rgba(95, 196, 194, .16); --co2-bright: #5FC4C2;
    --gas: #E88C72; --water: #7DB3EA;
    --rock-alluvium: #24251C; --rock-sandstone: #2B2819; --rock-shale: #19211E; --rock-limestone: #19232A;
    --rock-siltstone: #252220; --rock-caprock: #0E1413; --rock-storage: #372F17; --rock-basement: #0A0D0C;
    --on-basement: #DAD8CC; --on-basement-2: #9BA096;
    --pat-ink: rgba(233, 231, 219, .3);
    color-scheme: dark;
  }
}
/* THE DARK PAGE  (copy 2 of 2: used when the visitor presses the moon button) */
:root[data-theme="dark"] {
  --ink: #E9E7DB; --ink-2: #B9BCAF; --ink-3: #868C82;
  --line: rgba(233, 231, 219, .14); --line-2: rgba(233, 231, 219, .28);
  --sky: #11181A; --paper: #1C2624; --bore: #0D1312;
  --co2: #5FC4C2; --on-co2: #0C1413; --co2-soft: rgba(95, 196, 194, .16); --co2-bright: #5FC4C2;
  --gas: #E88C72; --water: #7DB3EA;
  --rock-alluvium: #24251C; --rock-sandstone: #2B2819; --rock-shale: #19211E; --rock-limestone: #19232A;
  --rock-siltstone: #252220; --rock-caprock: #0E1413; --rock-storage: #372F17; --rock-basement: #0A0D0C;
  --on-basement: #DAD8CC; --on-basement-2: #9BA096;
  --pat-ink: rgba(233, 231, 219, .3);
  color-scheme: dark;
}

/* Narrower screens: a narrower well */
@media (max-width: 900px) {
  :root { --track: 54px; --scale-w: 46px; --gutter: calc(var(--track) + var(--scale-w) + 18px);
          --w-cond: 42px; --w-surf: 32px; --w-int: 23px; --w-prod: 14px; --w-tub: 6px; }
}
@media (max-width: 640px) {
  :root { --track: 22px; --scale-w: 0px; --gutter: calc(var(--track) + 14px); --gauge-h: 28px;
          --w-cond: 20px; --w-surf: 16px; --w-int: 12px; --w-prod: 9px; --w-tub: 5px; }
}

/* ---------------------------------------------------------------------
   2. BASICS
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--font);
  color: var(--ink);
  background: var(--sky);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
sub { font-size: .72em; line-height: 0; }
a { color: var(--co2); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2.5px solid var(--co2); outline-offset: 3px; border-radius: 2px; }
strong, b { font-weight: 700; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad-x); }
.sprite { position: absolute; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--sky); }
.skip:focus { top: 12px; }
.i { width: 1em; height: 1em; flex: none; }

/* small headings above lists, such as "Research interests" */
.label { font: 700 .98rem/1.2 var(--font-cn); color: var(--ink-2); margin: 1.7em 0 .65em; }

/* ---------------------------------------------------------------------
   3. BUTTONS AND CHIPS  (capsule shaped, like a pressure vessel)
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .66em 1.2em;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  font: 700 1.02rem/1 var(--font-cn); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--ink); color: var(--sky); }
.btn--primary { background: var(--co2); border-color: var(--co2); color: var(--on-co2); }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--sky); }
.btn--small { padding: .5em .95em; font-size: .95rem; }
.iconbtn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 1.5px solid transparent; border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer;
}
.iconbtn:hover { border-color: var(--ink); }
.iconbtn .i { width: 19px; height: 19px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--after { margin-top: 1.5em; }
.chips li {
  padding: .26em .8em; border: 1px solid var(--line-2); border-radius: 999px;
  font: 400 .95rem/1.3 var(--font-cn); background: transparent;
}

/* ---------------------------------------------------------------------
   4. TOP BAR AND THE DEPTH STRIP
   --------------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--sky); border-bottom: 1px solid var(--line-2); }
.topbar__in { display: flex; align-items: center; gap: 18px; height: var(--bar-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 1.22rem/1 var(--font-cn); white-space: nowrap; }
.brand__mark { width: 26px; height: 26px; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { padding: 9px 11px; border-radius: 999px; font: 400 1.02rem/1 var(--font-cn); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--line); }
.nav a[aria-current="true"] { color: var(--ink); font-weight: 700; }
.tools { display: flex; align-items: center; gap: 6px; }
.nav-toggle { display: none; }
.i--sun { display: none; }      /* the button shows the page you would switch to */
:root[data-theme="dark"] .i--moon { display: none; }
:root[data-theme="dark"] .i--sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i--moon { display: none; }
  :root:not([data-theme="light"]) .i--sun { display: block; }
}

.gauge { border-top: 1px solid var(--line); background: var(--sky); transition: background-color .5s; }
.gauge[data-rock="alluvium"] { background: var(--rock-alluvium); }
.gauge[data-rock="sandstone"] { background: var(--rock-sandstone); }
.gauge[data-rock="shale"] { background: var(--rock-shale); }
.gauge[data-rock="limestone"] { background: var(--rock-limestone); }
.gauge[data-rock="siltstone"] { background: var(--rock-siltstone); }
.gauge[data-rock="caprock"] { background: var(--rock-caprock); }
.gauge[data-rock="storage"] { background: var(--rock-storage); }
.gauge__in { display: flex; align-items: center; gap: clamp(14px, 3vw, 36px); height: var(--gauge-h); overflow: hidden; white-space: nowrap; font: 400 .92rem/1 var(--font-cn); color: var(--ink-2); }
.gauge__i { display: inline-flex; align-items: baseline; gap: .45em; }
.gauge b { color: var(--ink); font-variant-numeric: tabular-nums; }
html:not(.js) .gauge { display: none; }

/* ---------------------------------------------------------------------
   5. HERO  (above ground)
   --------------------------------------------------------------------- */
.hero { background: var(--sky); padding-top: clamp(28px, 4.4vw, 54px); overflow-x: clip; }
.hero__in { padding-right: calc(var(--pad-x) + var(--track) / 2); }   /* the drawing ends exactly on the axis of the well */
.hero__id { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 28px); margin-bottom: clamp(22px, 3vw, 36px); }
.hero__photo { flex: none; display: block; width: 112px; height: 112px; border-radius: 50%; border: 1.5px solid var(--ink); object-fit: cover; background: var(--paper); }
.hero__name { min-width: 0; }
h1 { font: 700 var(--t-4)/.94 var(--font-cn); letter-spacing: -.012em; margin-bottom: .14em; text-wrap: balance; }
.hero__role { font: 400 1.34rem/1.25 var(--font-cn); color: var(--ink-2); text-wrap: balance; }
.hero__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); }
.hero__text { padding-bottom: clamp(36px, 5vw, 64px); min-width: 0; }
.lead { font-size: 1.2rem; line-height: 1.5; max-width: 31em; margin-bottom: 1.3em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1.5em; }
.quick { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.quick__k { font: 400 .95rem/1 var(--font-cn); color: var(--ink-2); margin-right: .35em; }
.hero__figure { display: flex; flex-direction: column; justify-content: flex-end; gap: 18px; min-width: 0; }
.hero__figure figcaption { max-width: 34em; font: 400 1rem/1.45 var(--font-cn); color: var(--ink-2); }
.plant svg { display: block; width: 100%; height: auto; overflow: visible; }

/* ---------------------------------------------------------------------
   6. BELOW GROUND : ROCK LAYERS
   --------------------------------------------------------------------- */
.overburden { position: relative; border-top: 2px solid var(--ink); }
.overburden::before {       /* ground hatching under the surface line */
  content: ""; position: absolute; z-index: 1; left: 0; right: 0; top: 0; height: 8px; pointer-events: none;
  background: repeating-linear-gradient(135deg, var(--ink) 0 1.2px, transparent 1.2px 8px); opacity: .42;
}

[data-rock="alluvium"]  { --rock: var(--rock-alluvium);  --pat: var(--pat-pebbles); }
[data-rock="sandstone"] { --rock: var(--rock-sandstone); --pat: var(--pat-dots); }
[data-rock="shale"]     { --rock: var(--rock-shale);     --pat: var(--pat-dashes); }
[data-rock="limestone"] { --rock: var(--rock-limestone); --pat: var(--pat-bricks); }
[data-rock="siltstone"] { --rock: var(--rock-siltstone); --pat: var(--pat-dashdot); }
[data-rock="storage"]   { --rock: var(--rock-storage);   --pat: var(--pat-dots); }
[data-rock="basement"]  { --rock: var(--rock-basement);  --pat: var(--pat-crosses); }

.layer {
  --pt: var(--pad-y); --pb: var(--pad-y);
  position: relative; background: var(--rock); padding-block: var(--pt) var(--pb);
  scroll-margin-top: calc(var(--bar-h) + var(--gauge-h));
}
.layer > .wrap, .footer > .wrap, .caprock > .wrap { position: relative; padding-right: calc(var(--pad-x) + var(--gutter)); }

/* the rock column the well runs in: the pattern of each layer */
.layer > .wrap::after, .footer > .wrap::after {
  content: ""; position: absolute; z-index: 1; pointer-events: none;
  top: calc(-1 * var(--pt)); bottom: calc(-1 * var(--pb)); right: var(--pad-x); width: var(--track);
  background: var(--pat-ink);
  -webkit-mask: var(--pat) repeat; mask: var(--pat) repeat;
}

/* gently folded boundary between two layers */
.layer--wavy::before, .layer--wavy::after {
  content: ""; position: absolute; left: 0; right: 0; top: -17px; height: 18px; pointer-events: none;
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
  -webkit-mask-size: 1200px 18px; mask-size: 1200px 18px;
  -webkit-mask-position: var(--wave-x, 0) 0; mask-position: var(--wave-x, 0) 0;
}
.layer--wavy::before { background: var(--rock); -webkit-mask-image: var(--wave-fill); mask-image: var(--wave-fill); }
.layer--wavy::after { background: var(--line-2); -webkit-mask-image: var(--wave-line); mask-image: var(--wave-line); }
#education { --wave-x: -180px; }
#research { --wave-x: -760px; }
#fieldwork { --wave-x: -420px; }
#training { --wave-x: -1010px; }
#skills { --wave-x: -90px; }
#leadership { --wave-x: -610px; }

.layer__head { display: flex; align-items: baseline; gap: 18px; margin-bottom: clamp(24px, 4vw, 42px); }
.layer__head h2 { font: 700 var(--t-3)/1.05 var(--font-cn); letter-spacing: -.006em; text-wrap: balance; }
.layer__head::after { content: ""; order: 1; flex: 1; min-width: 20px; border-top: 1px solid var(--line-2); transform: translateY(-.36em); }
.top__depth { order: 2; font: 400 .95rem/1 var(--font-cn); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------------
   7. THE WELL  (runs from the surface to the caprock)
   --------------------------------------------------------------------- */
.well { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.well__in { position: relative; height: 100%; max-width: var(--wrap); margin-inline: auto; }
.well__bore { position: absolute; top: 0; bottom: 0; right: var(--pad-x); width: var(--track); border-inline: 1px solid var(--line-2); }
.csg { position: absolute; top: 0; left: 50%; width: var(--w); height: var(--h); transform: translateX(-50%); background: var(--bore); border-inline: 1.5px solid var(--ink); }
.csg::before, .csg::after { content: ""; position: absolute; bottom: 0; width: 0; height: 0; border-bottom: 8px solid var(--ink); }   /* casing shoes */
.csg::before { left: -7.5px; border-left: 6px solid transparent; }
.csg::after { right: -7.5px; border-right: 6px solid transparent; }
.csg--conductor { --w: var(--w-cond); --h: 76px; }
.csg--surface { --w: var(--w-surf); --h: 13%; }
.csg--intermediate { --w: var(--w-int); --h: 52%; }
.csg--production { --w: var(--w-prod); --h: 100%; }
.csg--production::before, .csg--production::after { display: none; }
.tubing { position: absolute; top: 0; bottom: 0; left: 50%; width: var(--w-tub); transform: translateX(-50%); overflow: hidden; background: var(--bore); border-inline: 1px solid var(--ink); }
.tubing__fill { position: absolute; inset: 0; background: var(--co2); transform-origin: 50% 0; transform: scaleY(var(--fill, 1)); will-change: transform; }
.packer {
  position: absolute; bottom: 30px; left: 50%; width: calc(var(--w-prod) - 3px); height: 11px; transform: translateX(-50%);
  background: linear-gradient(to right, var(--ink) 0, var(--ink) calc(50% - var(--w-tub) / 2), transparent calc(50% - var(--w-tub) / 2), transparent calc(50% + var(--w-tub) / 2), var(--ink) calc(50% + var(--w-tub) / 2), var(--ink) 100%);
}

.well__scale { position: absolute; top: 0; bottom: 0; right: calc(var(--pad-x) + var(--track)); width: var(--scale-w); }
.tick { position: absolute; right: 0; width: 7px; border-top: 1px solid var(--ink-3); }
.tick--major { width: 13px; border-top-color: var(--ink-2); }
.tick__l { position: absolute; right: 19px; top: -.55em; font: 400 .84rem/1 var(--font-cn); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* the caprock: the seal above the storage formation */
.caprock { position: relative; height: 66px; background: var(--rock-caprock); border-top: 1.5px solid var(--ink); }
.caprock::before { content: ""; position: absolute; inset: 0; background: var(--pat-ink); -webkit-mask: var(--pat-dashes-dense) repeat; mask: var(--pat-dashes-dense) repeat; }
.caprock > .wrap { height: 100%; display: flex; align-items: center; }
.caprock__label { position: relative; padding: 5px 12px 5px 0; background: var(--rock-caprock); font: 700 .95rem/1.2 var(--font-cn); }

/* the storage formation: bottom of the well and the CO2 plume */
.layer--storage { --pt: 0px; border-top: 2px solid var(--ink); }
.plumezone { height: 178px; }
.plume {
  position: absolute; top: 0; right: calc(var(--pad-x) + var(--track) / 2); height: 150px;
  width: min(780px, calc(100% - var(--pad-x) * 2 - var(--track) / 2));
  -webkit-mask-image: linear-gradient(to left, #000 0, #000 calc(var(--plume, 1) * 100% - 90px), transparent calc(var(--plume, 1) * 100%));
  mask-image: linear-gradient(to left, #000 0, #000 calc(var(--plume, 1) * 100% - 90px), transparent calc(var(--plume, 1) * 100%));
}
.plume svg { display: block; width: 100%; height: 100%; }
.wellfoot { position: absolute; z-index: 2; top: 0; right: var(--pad-x); width: var(--track); height: 122px; }
.wellfoot__csg { position: absolute; top: 0; left: 50%; width: var(--w-prod); height: 100%; transform: translateX(-50%); overflow: hidden; background: var(--bore); border-inline: 1.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); }
.wellfoot__fill { position: absolute; inset: 0; background: var(--co2); transform-origin: 50% 0; transform: scaleY(var(--foot, 1)); }
.wellfoot::before, .wellfoot::after {      /* perforations */
  content: ""; position: absolute; top: 40px; height: 70px; width: 7px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 1.5px, transparent 1.5px 8px);
}
.wellfoot::before { right: calc(50% + var(--w-prod) / 2); }
.wellfoot::after { left: calc(50% + var(--w-prod) / 2); }
.plumezone__label { position: absolute; left: var(--pad-x); top: 132px; max-width: calc(100% - var(--pad-x) * 2 - var(--gutter)); font: 400 .92rem/1.3 var(--font-cn); color: var(--ink-2); }

/* ---------------------------------------------------------------------
   8. WHAT GOES INSIDE THE SECTIONS
   --------------------------------------------------------------------- */
h3 { font: 700 var(--t-1)/1.2 var(--font-cn); margin-bottom: .4em; text-wrap: balance; }
.prose p { max-width: 38em; }
.prose p + p { margin-top: .95em; }
.kicker { display: flex; flex-wrap: wrap; margin-bottom: .5em; font: 400 1rem/1.35 var(--font-cn); color: var(--ink-2); }
.kicker span:not(:last-child)::after { content: ""; display: inline-block; width: 1px; height: .9em; margin: 0 .7em; background: var(--line-2); vertical-align: -.08em; }
.meta { font: 400 1.02rem/1.4 var(--font-cn); color: var(--ink-2); margin-bottom: .85em; }
.plain { margin-bottom: .55em; }
.footnote { margin-top: 28px; font: 400 .92rem/1.4 var(--font-cn); color: var(--ink-2); }
.note { display: block; font: 400 .92rem/1.3 var(--font-cn); color: var(--ink-2); margin-top: .2em; }

.points, .facts { display: grid; gap: .55em; margin-bottom: 1.15em; }
.points li, .facts li { position: relative; padding-left: 1.45em; }
.points li::before, .facts li::before { content: ""; position: absolute; left: 0; top: .78em; width: .78em; border-top: 2px solid var(--co2); }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: clamp(28px, 4.5vw, 60px); align-items: start; }
.wellcard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--paper); border: 1.5px solid var(--ink); }
.wc { padding: 10px 14px 11px; border-bottom: 1px solid var(--line-2); }
.wc:nth-last-child(-n+2) { border-bottom: 0; }
.wc--full { grid-column: 1 / -1; }
.wc:not(.wc--full) + .wc:not(.wc--full) { border-left: 1px solid var(--line-2); }
.wc dt { font: 400 .86rem/1.2 var(--font-cn); color: var(--ink-2); margin-bottom: .2em; }
.wc dd { font-size: 1rem; line-height: 1.35; }
.status { display: flex; align-items: center; gap: .6em; margin-top: 1.5em; font: 700 1.02rem/1.3 var(--font-cn); }
.status__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--co2); flex: none; }

/* education */
.tl { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 0 28px; padding-block: 28px; border-top: 1px solid var(--line-2); }
.tl:first-child { border-top: 0; padding-top: 0; }
.tl:last-child { padding-bottom: 0; }
.tl__when { font: 700 1.25rem/1.25 var(--font-cn); color: var(--ink-2); }
.tl__body .label { margin-top: 1.3em; }

/* research entries: words on the left, a figure on the right */
.entry { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding-block: clamp(32px, 4.5vw, 52px); border-top: 1px solid var(--line-2); }
.entry:first-of-type { border-top: 0; padding-top: 0; }
.entry:last-child { padding-bottom: 0; }
.entry--single { grid-template-columns: minmax(0, 1fr); }
.entry--single .entry__text { max-width: 44em; }
.entry__text p:not([class]) { margin-bottom: .6em; }

.fig { align-self: start; padding: clamp(14px, 2.4vw, 22px); background: var(--paper); border: 1px solid var(--line-2); min-width: 0; }
.fig__title { font: 700 1.04rem/1.25 var(--font-cn); margin-bottom: .75em; }
.fig__title--gap { margin-top: 1.5em; padding-top: 1.2em; border-top: 1px solid var(--line); }
.fig__canvas svg { display: block; width: 100%; height: auto; }
.fig__note { margin-top: .6em; min-height: 2.8em; font: 400 1.02rem/1.4 var(--font-cn); }
.fig figcaption { margin-top: .9em; padding-top: .8em; border-top: 1px solid var(--line); font: 400 .92rem/1.45 var(--font-cn); color: var(--ink-2); }

.slider { display: grid; gap: 4px; margin-top: .8em; }
.slider__label { font: 400 .95rem/1.3 var(--font-cn); color: var(--ink-2); }
.slider input { width: 100%; margin: 0; accent-color: var(--co2); cursor: pointer; }

/* steps joined by a short pipe, like vessels on a flow sheet */
.flow { display: grid; justify-items: start; gap: 20px; }
.flow li { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 8px 16px; border: 1.3px solid var(--ink); border-radius: 999px; background: var(--paper); font: 700 .96rem/1.2 var(--font-cn); }
.flow li small { font: 400 .84rem/1.2 var(--font-cn); color: var(--ink-2); }
.flow li:not(:last-child)::after { content: ""; position: absolute; left: 26px; top: 100%; height: 14px; border-left: 1.3px solid var(--ink); }
.flow li:not(:last-child)::before { content: ""; position: absolute; left: 22.5px; top: calc(100% + 13px); border: 4px solid transparent; border-top: 7px solid var(--ink); border-bottom: 0; }
.flow__under { margin-top: .8em; font: 400 .92rem/1.4 var(--font-cn); color: var(--ink-2); }

.checks { display: grid; gap: 12px; }
.checks li { display: grid; gap: 2px; padding-left: 14px; border-left: 2px solid var(--co2); }
.checks__k { font: 700 .98rem/1.25 var(--font-cn); }
.checks__v { font-size: .97rem; line-height: 1.45; }

.readouts { display: flex; flex-wrap: wrap; gap: 14px 30px; margin-bottom: 1.2em; padding-block: 14px; border-block: 1px solid var(--line-2); }
.readout dt { font: 400 .9rem/1.2 var(--font-cn); color: var(--ink-2); margin-bottom: .25em; }
.readout__v { font: 700 1.95rem/1 var(--font-cn); font-variant-numeric: tabular-nums; }
.readout__v small { margin-left: .3em; font: 400 .98rem/1 var(--font-cn); color: var(--ink-2); }

/* numbered parts of a drawing */
.parts { counter-reset: part; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 5px 14px; margin-top: .9em; font: 400 .95rem/1.3 var(--font-cn); }
.parts li { counter-increment: part; display: flex; align-items: baseline; gap: .5em; }
.parts li::before { content: counter(part); flex: none; width: 1.5em; height: 1.5em; border: 1px solid var(--ink); border-radius: 50%; font: 700 .78rem/1.42em var(--font-cn); text-align: center; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: clamp(32px, 4.5vw, 52px); }
.card { padding: clamp(16px, 2.4vw, 24px); background: var(--paper); border: 1px solid var(--line-2); min-width: 0; }
.card__fig { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.card__fig svg { display: block; width: 100%; height: auto; }
.card .chips { margin-top: .2em; }

/* tables */
.tablewrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line-2); }
.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { padding: .8em 1.1em; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-weight: 400; }
.grid tbody tr:last-child > * { border-bottom: 0; }
.grid thead th { font: 700 .95rem/1.2 var(--font-cn); color: var(--ink-2); border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.grid tbody th { font-weight: 700; }
.grid--training td:first-child { white-space: nowrap; font: 400 1rem/1.6 var(--font-cn); color: var(--ink-2); }
.grid--training td:nth-child(3) { font-size: .98rem; }
.grid--skills tbody th { white-space: nowrap; }
.doc { display: inline-flex; align-items: center; gap: .45em; padding: .34em .85em; border: 1.2px solid var(--ink); border-radius: 999px; color: var(--ink); font: 700 .93rem/1.2 var(--font-cn); text-decoration: none; white-space: nowrap; cursor: pointer; }
.doc:hover { background: var(--ink); color: var(--paper); }
.hide-docs .doc, .hide-docs .col-doc { display: none; }

/* contact */
.contact { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.contact .label { margin-top: 0; }
.contact__email { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 1.5em; }
.contact__email a { font: 700 clamp(1.35rem, 3.4vw, 2.1rem)/1.1 var(--font-cn); color: var(--ink); overflow-wrap: anywhere; }
.contact__list { display: grid; gap: 10px; }
.contact__list div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
.contact__list dt { font: 400 .98rem/1.6 var(--font-cn); color: var(--ink-2); }
.cvlink { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 14px; padding: 16px 18px; background: var(--paper); border: 1.5px solid var(--ink); color: var(--ink); text-decoration: none; }
.cvlink:hover { background: var(--ink); color: var(--paper); }
.cvlink:hover .cvlink__s { color: inherit; }
.cvlink__t { font: 700 1.2rem/1.2 var(--font-cn); }
.cvlink__s { grid-column: 1; font: 400 .93rem/1.2 var(--font-cn); color: var(--ink-2); }
.cvlink .i { grid-column: 2; grid-row: 1 / span 2; width: 22px; height: 22px; }

/* ---------------------------------------------------------------------
   9. FOOTER  (basement rock: the legend of the drawing)
   --------------------------------------------------------------------- */
.footer { --pt: clamp(40px, 6vw, 64px); --pb: 26px; --pat-ink: rgba(233, 231, 219, .2); position: relative; padding-block: var(--pt) var(--pb); background: var(--rock-basement); color: var(--on-basement); }
.footer a { color: var(--on-basement); }
.footer .label { margin-top: 0; color: var(--on-basement); }
.legend { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding-bottom: 30px; }
.legend__text p:not(.label) { max-width: 42em; font-size: .98rem; color: var(--on-basement-2); }
.legend__keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; align-content: start; font: 400 .98rem/1.3 var(--font-cn); }
.legend__keys li { display: flex; align-items: center; gap: 10px; }
.swatch { position: relative; flex: none; width: 36px; height: 20px; overflow: hidden; background: var(--rock); border: 1px solid var(--on-basement-2); }
.swatch[data-rock]::after { content: ""; position: absolute; inset: 0; background: var(--ink); opacity: .5; -webkit-mask: var(--pat) repeat; mask: var(--pat) repeat; }
.swatch--casing { background: linear-gradient(to right, transparent 0, transparent 30%, var(--on-basement) 30%, var(--on-basement) 36%, transparent 36%, transparent 64%, var(--on-basement) 64%, var(--on-basement) 70%, transparent 70%); }
.swatch--co2 { background: var(--co2-bright); }
.footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; border-top: 1px solid rgba(233, 231, 219, .22); font: 400 .98rem/1.4 var(--font-cn); color: var(--on-basement-2); }
.footer__in a { display: inline-flex; align-items: center; gap: .4em; }

/* ---------------------------------------------------------------------
   10. ENLARGED PICTURE VIEWER
   --------------------------------------------------------------------- */
.lightbox { max-width: min(94vw, 900px); max-height: 94vh; padding: 14px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); }
.lightbox::backdrop { background: rgba(8, 12, 11, .74); }
.lightbox img { display: block; max-width: 100%; max-height: 74vh; margin-inline: auto; }
.lightbox figcaption { margin-top: 10px; font: 400 1rem/1.4 var(--font-cn); color: var(--ink-2); }
.lightbox form { margin-top: 10px; text-align: right; }

/* ---------------------------------------------------------------------
   11. THE DRAWINGS  (made by js/drawings.js; colours follow the page)
   --------------------------------------------------------------------- */
.d-line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.d-body { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.d-thin { fill: none; stroke: var(--ink); stroke-width: .9; opacity: .62; }
.d-soft { fill: none; stroke: var(--ink-2); stroke-width: 1.2; stroke-linejoin: round; }
.d-dash { stroke-dasharray: 4 4; }
.d-ink { fill: var(--ink); }
.d-paper { fill: var(--paper); }
.d-skyfill { fill: var(--sky); }
.d-co2 { fill: none; stroke: var(--co2); stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.d-co2-thin { fill: none; stroke: var(--co2); stroke-width: 1.8; }
.d-co2fill { fill: var(--co2); }
.d-co2soft { fill: var(--co2-soft); }
.d-gas { fill: none; stroke: var(--gas); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.d-gasfill { fill: var(--gas); }
.d-water { fill: none; stroke: var(--water); stroke-width: 2; stroke-linecap: round; }
.d-waterfill { fill: var(--water); }
.d-sand { fill: var(--rock-sandstone); }
.d-shale { fill: var(--rock-shale); }
.d-axis { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.d-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.d-label { font: 400 13px var(--font-cn); fill: var(--ink-2); }
.d-label--b { font-weight: 700; fill: var(--ink); }
.d-label--co2 { font-weight: 700; fill: var(--co2); }
.d-label--gas { font-weight: 700; fill: var(--gas); }
.d-tick { font: 400 12px var(--font-cn); fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.d-num { font: 700 11.5px var(--font-cn); fill: var(--ink); text-anchor: middle; }

/* the CO2 line in the hero draws itself once when the page opens */
.plant .d-co2 { stroke-dasharray: 1; stroke-dashoffset: 1; animation: co2-in 2.4s .4s cubic-bezier(.45, 0, .2, 1) forwards; }
@keyframes co2-in { to { stroke-dashoffset: 0; } }

/* ---------------------------------------------------------------------
   12. SMALLER SCREENS
   --------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .nav-toggle { display: inline-grid; }
  .tools { margin-left: auto; }
  .nav { display: none; position: absolute; top: var(--bar-h); left: 0; right: 0; z-index: 2; flex-direction: column; gap: 0; margin: 0; padding: 8px var(--pad-x) 14px; background: var(--sky); border-bottom: 1px solid var(--line-2); box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .35); }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 4px; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
  .nav a:last-child { border-bottom: 0; }
}
@media (max-width: 900px) {
  .hero__grid, .about, .entry, .contact, .legend { grid-template-columns: minmax(0, 1fr); }
  .hero__text { padding-bottom: 4px; }
  .hero__figure figcaption { max-width: 36em; }
  .entry__fig { max-width: 560px; }
}
@media (max-width: 720px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .tl { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .legend__keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .hero__photo { width: 84px; height: 84px; }
  .hero__id { align-items: flex-start; }
  .hero__role { font-size: 1.18rem; }
  .lead { font-size: 1.1rem; }
  .gauge__i:nth-child(2) .gauge__k, .gauge__i:nth-child(3) .gauge__k { display: none; }
  .well__scale { display: none; }
  .well__bore { border-inline-color: var(--line); }
  .csg::before, .csg::after, .csg--conductor, .csg--surface, .csg--intermediate, .packer { display: none; }   /* a simpler well: one casing and the tubing */
  .csg--production { border-inline-width: 1px; }
  .tubing { border-inline: 0; }
  .layer__head { flex-wrap: wrap; row-gap: 8px; }
  .layer__head h2 { flex: 1 1 100%; }
  .wc, .wc--full { grid-column: 1 / -1; }
  .wc:not(.wc--full) + .wc:not(.wc--full) { border-left: 0; }
  .wc:nth-last-child(-n+2) { border-bottom: 1px solid var(--line-2); }
  .wc:last-child { border-bottom: 0; }
  .plumezone { height: 190px; }
  .plumezone__label { top: 140px; }
  .contact__list div { grid-template-columns: minmax(0, 1fr); gap: 0; }

  /* tables become stacked blocks */
  .grid, .grid tbody, .grid tr, .grid th, .grid td { display: block; }
  .grid thead { display: none; }
  .grid tr { padding: .9em 1em; border-bottom: 1px solid var(--line); }
  .grid tbody tr:last-child { border-bottom: 0; }
  .grid th, .grid td { padding: 0; border: 0; }
  .grid td + td, .grid th + td, .grid td + th { margin-top: .35em; }
  .grid--skills tbody th { white-space: normal; font-family: var(--font-cn); font-size: 1.1rem; }
  .grid--skills td:last-child::before { content: "Experience: "; font-family: var(--font-cn); color: var(--ink-2); }
  .grid--training td.col-doc { margin-top: .7em; }
}

/* ---------------------------------------------------------------------
   13. REDUCED MOTION AND PRINT
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plant .d-co2 { animation: none; stroke-dashoffset: 0; }
  .gauge { transition: none; }
}
@media print {
  .topbar, .well, .plumezone, .caprock, .lightbox, .slider, .skip { display: none !important; }
  .layer > .wrap::after, .footer > .wrap::after, .layer--wavy::before, .layer--wavy::after, .overburden::before { display: none; }
  body, .hero, .layer, .footer { background: #fff !important; color: #000 !important; }
  .layer > .wrap, .footer > .wrap { padding-right: var(--pad-x); }
  .layer { --pt: 28px; --pb: 28px; break-inside: avoid-page; }
  .footer .label, .legend__text p:not(.label), .footer__in { color: #000; }
}
