/* ==========================================================================
   ARKHOS ENERGY — Projects page
   Page-only components built from the tokens in style.css:
   portfolio cards + toolbar, project sheet dialog, pipeline Gantt,
   Halcyon milestone strip, delivery table accents, partner wall.
   ========================================================================== */

/* ---------- Extra status dot: exploration (hollow steel ring) ---------- */
.dot--hollow {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px #9fb4c0, 0 0 0 4px rgba(159, 180, 192, 0.16);
}

/* ==========================================================================
   1. Portfolio explorer
   ========================================================================== */
.explorer__bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 16px 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.explorer__search { position: relative; flex: 0 1 380px; min-width: 0; }
.explorer__search .icon {
  position: absolute; left: 17px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  color: var(--muted); pointer-events: none;
}
.explorer__search input {
  width: 100%; min-height: 46px;
  padding: 0 18px 0 46px;
  border: 1px solid var(--rule-strong); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-size: 0.95rem;
  transition: border-color .2s, box-shadow .2s;
}
.explorer__search input::placeholder { color: var(--muted); opacity: 1; }
.explorer__search input:focus { outline: none; border-color: var(--flare); box-shadow: 0 0 0 3px rgba(255, 139, 43, 0.22); }
@media (max-width: 760px) { .explorer__search { flex: 1 1 100%; } }

.explorer__meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 12px 32px;
  padding: 18px 0 clamp(28px, 3vw, 44px);
}
.explorer__count { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.explorer__count b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.status-key {
  display: flex; flex-wrap: wrap; gap: 10px 22px; list-style: none;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2);
}
.status-key li { display: inline-flex; align-items: center; gap: 10px; }

.explorer__grid { row-gap: clamp(24px, 2.6vw, 36px); }
.explorer__empty { display: grid; gap: 12px; justify-items: start; padding: 48px 0 8px; border-top: 1px solid var(--rule); }
.explorer__empty p:not(.h4) { color: var(--text-2); max-width: 56ch; }

/* Project card (light band) */
.pcard {
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .3s;
}
.pcard:hover { transform: translateY(-4px); border-color: var(--rule-strong); box-shadow: 0 30px 50px -34px rgba(10, 26, 34, 0.5); }
.pcard__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); flex: none; }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); transition: transform 1.2s var(--ease); }
.pcard:hover .pcard__media img { transform: scale(1.05); }
.pcard__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 15, 21, 0.5) 0%, rgba(5, 15, 21, 0) 42%);
}
.pcard__flags {
  position: absolute; z-index: 1; top: 14px; left: 14px; right: 14px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.pcard__flags .chip,
.pmodal__flags .chip {
  background: rgba(5, 15, 21, 0.62); color: var(--fg); border-color: rgba(255, 255, 255, 0.24);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pcard__body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 22px 22px 20px; }
.pcard__loc {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-text);
}
.pcard__loc span { color: var(--muted); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.pcard__title { font-size: clamp(1.2rem, 1.06rem + 0.45vw, 1.45rem); }
.pcard__open {
  padding: 0; border: 0; background: none;
  font: inherit; color: inherit; letter-spacing: inherit; text-align: left; line-height: inherit;
  cursor: pointer;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: left bottom; background-size: 0 1px; background-repeat: no-repeat;
  transition: background-size .5s var(--ease);
}
.pcard__open::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: var(--radius-lg); }
.pcard__open:focus-visible { outline: none; }
.pcard__open:focus-visible::after { outline: 2px solid var(--flare); outline-offset: 3px; }
.pcard:hover .pcard__open { background-size: 100% 1px; }
.pcard__sum { color: var(--text-2); font-size: 0.96rem; }
.pcard__specs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: auto;
  border-top: 1px solid var(--rule);
}
.pcard__specs > div { display: grid; gap: 3px; align-content: start; padding: 14px 10px 0 0; min-width: 0; }
.pcard__specs > div + div { padding-left: 12px; border-left: 1px solid var(--rule); }
.pcard__specs dt { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pcard__specs dd { font-family: var(--font-display); font-stretch: 108%; font-weight: 600; font-size: 0.98rem; line-height: 1.25; color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 420px) {
  .pcard__body { padding-inline: 18px; }
  .pcard__specs > div { padding-right: 8px; }
  .pcard__specs > div + div { padding-left: 10px; }
  .pcard__specs dd { font-size: 0.9rem; font-stretch: 100%; }
}
.pcard__more {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-2); transition: color .25s;
}
.pcard__more .icon { width: 16px; height: 16px; transition: transform .35s var(--ease); }
.pcard:hover .pcard__more { color: var(--accent-text); }
.pcard:hover .pcard__more .icon { transform: translateX(4px); }

/* ==========================================================================
   Project sheet dialog
   ========================================================================== */
/* Keep the sticky close button over the photo instead of beside it
   (a float would narrow the media box, which clips its overflow). */
.pmodal > .modal__close { float: none; margin: 12px 12px -56px auto; }
.pmodal__media { position: relative; }
@media (max-width: 640px) { .pmodal .modal__media { aspect-ratio: 16 / 10; } }
.pmodal__media img { object-position: var(--focus, 50% 50%); }
.pmodal__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 15, 21, 0) 45%, rgba(8, 22, 31, 0.85) 100%);
}
.pmodal__flags { position: absolute; z-index: 1; left: clamp(24px, 4vw, 48px); bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.pmodal__head { display: grid; gap: 12px; }
.modal__body .pmodal__loc {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold);
}
.pmodal__loc span + span { color: var(--fg-mute); letter-spacing: 0.06em; }
.modal__body .pmodal__lead { font-size: var(--fs-lead); font-weight: 300; line-height: 1.5; color: var(--fg-2); max-width: 60ch; }
.pmodal__specs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Values sit directly under their labels, even when a neighbour wraps. */
.pmodal__specs > div,
.case .specs > div { align-content: start; }
.pmodal__specs dd,
.case .specs dd { text-wrap: balance; }
@media (max-width: 640px) {
  .pmodal__specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pmodal__specs dd { font-size: 1rem; }
}
.pmodal__cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 760px) { .pmodal__cols { grid-template-columns: minmax(0, 1fr); } }
.pmodal__side { display: grid; gap: 16px; min-width: 0; }
.pmodal__miles { list-style: none; display: grid; border-left: 1px solid var(--line-strong); margin-left: 4px; }
.pmodal__miles li { position: relative; display: grid; gap: 2px; padding: 0 0 18px 22px; }
.pmodal__miles li:last-child { padding-bottom: 0; }
.pmodal__miles li::before {
  content: ""; position: absolute; left: -5px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--flare); box-shadow: 0 0 0 3px var(--petrol-900);
}
.pmodal__miles li.is-planned::before { background: var(--petrol-900); box-shadow: inset 0 0 0 1.5px var(--fg-mute), 0 0 0 3px var(--petrol-900); }
.pmodal__when { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-mute); }
.pmodal__miles li:not(.is-planned) .pmodal__when { color: var(--flare); }
.pmodal__what { color: var(--fg); font-size: 0.95rem; line-height: 1.45; }
.pmodal__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  padding-top: 20px; border-top: 1px solid var(--line);
}
.pmodal__nav { display: flex; align-items: center; gap: 12px; }
.pmodal__nav .icon-btn { width: 44px; height: 44px; }
.pmodal__pos { min-width: 5ch; text-align: center; font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.08em; color: var(--fg-mute); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   2. Pipeline Gantt (pure CSS positioning; months since Jan 2024)
   ========================================================================== */
.pipeline__tools {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 16px 32px; margin-bottom: 28px;
}
.pipeline__tools .btn { margin-left: auto; }
.gantt-legend {
  display: flex; flex-wrap: wrap; gap: 12px 24px; list-style: none;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2);
}
.gantt-legend li { display: inline-flex; align-items: center; gap: 10px; }
.gantt-key { flex: none; width: 26px; height: 10px; border-radius: 2px; }
.gantt-key--define,
.gantt__bar--define {
  background: repeating-linear-gradient(-45deg, rgba(159, 180, 192, 0.42) 0 2px, rgba(159, 180, 192, 0.1) 2px 7px);
  box-shadow: inset 0 0 0 1px rgba(159, 180, 192, 0.6);
}
.gantt-key--fid { width: 10px; height: 10px; margin: 0 8px; border-radius: 1px; background: var(--fg); transform: rotate(45deg); }
.gantt-key--build,
.gantt__bar--build { background: var(--flare-grad); }
.gantt-key--start,
.gantt__bar--start { background: var(--gold); }
.gantt-key--run { height: 4px; border-radius: 4px; background: var(--up); }
.gantt-key--now { width: 0; height: 16px; margin: 0 13px; border-radius: 0; border-left: 1.5px dashed var(--flare); }

.gantt-wrap { position: relative; }
.gantt-hint {
  display: none; align-items: center; gap: 10px; margin-bottom: 14px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.gantt-hint .icon { width: 18px; height: 18px; color: var(--flare); }
@media (max-width: 1100px) { .gantt-hint { display: flex; } }

.gantt {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-top: 1px solid var(--rule-strong);
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}
.gantt__inner { --label-w: 240px; --months: 108; position: relative; min-width: 960px; }
@media (max-width: 760px) { .gantt__inner { --label-w: 140px; min-width: 820px; } }

.gantt__head,
.gantt__row { display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr); }
.gantt__corner,
.gantt__label {
  position: sticky; left: 0; z-index: 3;
  background: var(--bg);
  box-shadow: -4px 0 0 var(--bg); /* covers sub-pixel slivers at the scroll edge */
  border-right: 1px solid var(--rule);
}
.gantt__corner {
  display: flex; align-items: flex-end; padding: 0 16px 12px 0;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.gantt__years { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); }
.gantt__years span {
  padding: 44px 0 12px 10px; border-left: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.gantt__inner { border-bottom: 1px solid var(--rule); }
.gantt__row { border-top: 1px solid var(--rule); transition: background .25s; }
.gantt__row:hover { background: rgba(196, 222, 235, 0.035); }
.gantt__label { display: grid; align-content: center; gap: 4px; min-height: 74px; padding: 12px 16px 12px 0; }
.gantt__label b { font-family: var(--font-display); font-stretch: 108%; font-weight: 600; font-size: 0.98rem; line-height: 1.2; color: var(--text); transition: color .2s; }
.gantt__label span { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.gantt__row:hover .gantt__label b { color: var(--flare); }
.gantt__label b, .gantt__label span { text-wrap: balance; }
@media (max-width: 760px) {
  .gantt__label { padding-right: 12px; }
  .gantt__label b { font-size: 0.86rem; }
  .gantt__label span { font-size: 0.58rem; letter-spacing: 0.08em; }
}

.gantt__track {
  position: relative;
  background-image: linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: calc(100% / 9) 100%;
}
.gantt__track > * { position: absolute; top: 50%; left: calc(var(--s) / var(--months) * 100%); }
.gantt__bar {
  width: calc((var(--e) - var(--s)) / var(--months) * 100% - 2px);
  height: 18px; margin-top: -9px;
  border-radius: 3px;
  transition: filter .2s, box-shadow .2s;
}
/* The phase name slides along its bar so it stays readable when the start of
   the bar is scrolled under the sticky project column. */
.gantt__bar i {
  position: sticky; left: var(--label-w);
  display: inline-block; vertical-align: top; max-width: 100%; padding: 0 8px;
  font-style: normal; font-family: var(--font-mono); font-size: 0.6rem; font-weight: 500; letter-spacing: 0.1em; line-height: 18px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: clip;
  color: #170a02;
}
.gantt__bar--define i { color: var(--fg); }
.gantt__bar--build i { padding-left: 14px; } /* clears the FID diamond at the bar's start */
.gantt__bar--run {
  height: 6px; margin-top: -3px; border-radius: 6px 0 0 6px;
  background: linear-gradient(90deg, var(--up) 0%, rgba(69, 208, 139, 0.55) 55%, rgba(69, 208, 139, 0.06) 100%);
}
.gantt__bar:hover,
.gantt__bar.is-tip { filter: brightness(1.12); box-shadow: 0 0 0 2px var(--fg); }
.gantt__fid {
  z-index: 1;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 1px; background: var(--fg);
  box-shadow: 0 0 0 3px var(--bg);
  transform: rotate(45deg);
  transition: background .2s;
}
.gantt__fid:hover,
.gantt__fid.is-tip { background: var(--flare); }

.gantt__now {
  position: absolute; top: 0; bottom: 0; z-index: 2;
  left: calc(var(--label-w) + (100% - var(--label-w)) * var(--now) / var(--months));
  border-left: 1.5px dashed var(--flare);
  pointer-events: none;
}
.gantt__now span {
  position: absolute; top: 10px; left: 0; transform: translateX(-50%);
  padding: 4px 10px; border-radius: 999px;
  background: var(--flare); color: #170a02;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}

.gantt-tip {
  position: absolute; z-index: 5; left: 0; top: 0;
  min-width: 200px; max-width: 280px;
  padding: 12px 14px;
  background: rgba(5, 15, 21, 0.96);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transform: translate(-50%, calc(-100% - 6px));
  transition: opacity .18s, transform .18s, visibility .18s;
}
.gantt-tip.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, calc(-100% - 12px)); }
.gantt-tip b { display: block; font-family: var(--font-display); font-stretch: 110%; font-weight: 650; font-size: 0.98rem; color: var(--fg); }
.gantt-tip span { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.gantt-tip p { margin-top: 4px; font-size: 0.86rem; line-height: 1.4; color: var(--fg-2); }

/* Table view (visible when toggled; screen-reader-only otherwise) */
.gantt-table .data-table { min-width: 760px; }
.gantt-table .data-table td { white-space: nowrap; }
.gantt-table .data-table tbody th { font-weight: 500; color: var(--text); text-align: left; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); font-family: var(--font-body); font-size: 1rem; letter-spacing: 0; text-transform: none; }

/* ==========================================================================
   3. Halcyon case study
   ========================================================================== */
.case .media-frame { box-shadow: var(--shadow); }
.case__miles {
  position: relative; list-style: none;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: clamp(56px, 7vw, 104px);
}
.case__miles::before {
  content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 1px;
  background: linear-gradient(90deg, var(--flare) 0%, var(--gold) 60%, var(--up) 100%);
  opacity: 0.7;
}
.case__miles li { position: relative; display: grid; gap: 6px; align-content: start; padding: 34px 24px 0 0; min-width: 0; }
.case__miles li::before {
  content: ""; position: absolute; left: 0; top: 0;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--flare);
}
.case__miles li:last-child::before { background: var(--flare); box-shadow: 0 0 0 5px rgba(255, 139, 43, 0.18); }
.case__miles time { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.case__miles strong { font-family: var(--font-display); font-stretch: 110%; font-weight: 650; font-size: 1.1rem; line-height: 1.25; color: var(--text); }
.case__miles p { font-size: 0.9rem; color: var(--text-2); }
@media (max-width: 900px) {
  .case__miles { grid-template-columns: minmax(0, 1fr); }
  .case__miles::before { left: 7px; right: auto; top: 8px; bottom: 8px; width: 1px; height: auto; background: linear-gradient(180deg, var(--flare) 0%, var(--gold) 60%, var(--up) 100%); }
  .case__miles li { padding: 0 0 30px 44px; }
  .case__miles li:last-child { padding-bottom: 0; }
}
.case__quote {
  max-width: none;
  margin-top: clamp(56px, 7vw, 104px);
  padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--rule);
}
.case__quote .quote__text { max-width: 980px; }

/* ==========================================================================
   4. Delivery record
   ========================================================================== */
.delivery__table { margin-top: clamp(56px, 6vw, 96px); }
.delivery__table .flex-between { align-items: baseline; }
/* Scroll sideways on phones instead of squeezing dates onto two lines. */
.delivery__table .data-table { min-width: 720px; }
.delivery__table .data-table th,
.delivery__table .data-table td { white-space: nowrap; }
.data-table .var-good { color: var(--sea-ink); font-weight: 500; }
.data-table .var-bad { color: var(--flare-ink); font-weight: 500; }

/* ==========================================================================
   5. Partners and contractors
   ========================================================================== */
.partners__specs { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Labels wrap to different line counts; keep the three figures on one baseline. */
.partners__specs > div { grid-template-rows: 1fr auto; }
.partners__specs dd { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.8rem); }
.partners__wall { margin-top: clamp(56px, 6vw, 96px); display: grid; gap: 20px; }
.pwall {
  list-style: none;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
  border-left: 1px solid var(--rule);
}
.pwall li {
  display: grid; grid-template-rows: 1fr auto auto; gap: 10px;
  min-width: 0; min-height: 168px;
  padding: 24px 20px 20px;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  transition: background .3s;
}
.pwall li:hover { background: var(--surface); }
.pwall__name {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.86rem; letter-spacing: 0.12em; line-height: 1.4; text-transform: uppercase;
  color: var(--text); overflow-wrap: anywhere; transition: color .25s;
}
.pwall li:hover .pwall__name { color: var(--accent-text); }
.pwall__role { font-size: 0.88rem; line-height: 1.4; color: var(--text-2); }
.pwall__on { padding-top: 10px; border-top: 1px solid var(--rule); font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 1080px) { .pwall { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pwall li { min-height: 0; } }
@media (max-width: 400px) { .pwall li { padding: 20px 14px 16px; } .pwall__name { font-size: 0.78rem; letter-spacing: 0.08em; } }
