/* The drill string: three strings that telescope, PQ to 1,000 m, HQ inside it to 1,900 m, NQ inside that to 2,500 m.
   Widths follow the real hole diameters (122.6 : 96.0 : 75.7 mm). Heights are set by js/main.js as the page scrolls. */
.bore { --pq: 80px; --hq: 63px; --nq: 50px; }
.str {
  position: absolute; top: 0; left: 50%; height: 0; width: var(--w);
  transform: translateX(-50%); visibility: hidden; pointer-events: none;
}
.str.on { visibility: visible; }
.str[data-size="PQ"] { --w: var(--pq); z-index: 1; }
.str[data-size="HQ"] { --w: var(--hq); z-index: 2; }
.str[data-size="NQ"] { --w: var(--nq); z-index: 3; }

/* the hole in the rock: only below the point where this size takes over from the larger one */
.str::before {
  content: ""; position: absolute; top: var(--from, 0px); bottom: 2px; left: -3px; right: -3px;
  background: rgba(20, 12, 9, 0.7);
  box-shadow: inset 6px 0 8px -4px rgba(0, 0, 0, 0.75), inset -6px 0 8px -4px rgba(0, 0, 0, 0.75);
}
/* the rod: a steel tube with a joint every 3 m length of rod (drawn as a thin line) */
.str::after {
  content: ""; position: absolute; top: 0; bottom: calc(var(--w) * 3.35); left: 8%; right: 8%;
  background:
    repeating-linear-gradient(to top, rgba(0, 0, 0, 0.5) 0 2px, rgba(255, 255, 255, 0.16) 2px 3px, transparent 3px 190px),
    linear-gradient(90deg, #2c2e30 0%, #6d7276 14%, #b9bec2 34%, #8b9094 52%, #55595c 78%, #232526 100%);
}
.tool { position: absolute; left: 0; bottom: 0; width: 100%; height: calc(var(--w) * 3.4); display: block; }

.gauge {
  position: absolute; top: 0; left: calc(50% + var(--pq) / 2 + 10px); z-index: 5;
  transform: translateY(-120%); will-change: top;
}
.gauge b { font-weight: 700; margin-right: 0.45em; opacity: 0.7; }

@media (max-width: 820px) {
  .bore { --pq: 36px; --hq: 28px; --nq: 22px; }

  .gauge { left: 50%; top: 0; transform: translate(-50%, 8px); font-size: 0.7rem; padding: 0.2em 0.35em; }
  .gauge b { display: none; }
}

/* wide screens: the rock column is slim, so the depth tag sits just under the bit instead of beside the string */
@media (min-width: 821px) {
  .gauge { left: 50%; transform: translate(-50%, 10px); font-size: 0.85rem; }
}

/* RC rigs: one string with a down-the-hole hammer at its end (drawn by js/descent.js). --tk is the tool height in diameters. */
.bore { --rc: 76px; }
.str[data-size="RC"] { --w: var(--rc); --tk: 5.1; z-index: 1; }
.str::after { bottom: calc(var(--w) * (var(--tk, 3.4) - 0.05)); }
.tool { height: calc(var(--w) * var(--tk, 3.4)); }
.str[data-size="RC"]::after { left: 14%; right: 14%; }
/* rock chips and cracks at the bit: a layer that travels with the tip */
.chips { position: absolute; left: 0; top: 0; width: 100%; height: 230px; z-index: 4; pointer-events: none; will-change: top; }
@media (max-width: 820px) { .bore { --rc: 36px; } }

/* machine pages: the hole runs beside the whole page body */
.m-top { padding-bottom: clamp(2rem, 5vh, 3.5rem); }
.m-bottom { padding-top: 0; }
.log h3 { font-size: 1.15rem; margin: 2.2rem 0 0; }
.log h2 + h3 { margin-top: 1.6rem; }
.log .spec-table { margin-top: 0.6rem; }
.block.basalt .depths { margin-top: 2.2rem; }
.big-depth { margin-top: 1.4rem; font-size: clamp(3rem, 8vw, 6.5rem); line-height: 1; font-weight: 700; font-variation-settings: "wdth" 122; color: var(--apricot); font-variant-numeric: tabular-nums; }
.big-depth span { display: block; margin-top: 0.6rem; font-size: 1rem; font-weight: 400; font-variation-settings: "wdth" 100; color: var(--sand); opacity: 0.75; }

/* the top of a machine page sits inside the rock column layout, so the rock starts right under the menu bar */
.block.m-first { padding-top: clamp(1.8rem, 4vh, 3rem); padding-bottom: clamp(2.5rem, 6vh, 4.5rem); }
.log h1 { font-size: clamp(2.6rem, 6vw, 5.5rem); font-variation-settings: "wdth" 122; font-weight: 700; }
.log h1 + .kind { margin-top: 0.5rem; font-size: clamp(1.05rem, 1.6vw, 1.4rem); }
.log .kind + .lead { margin-top: 1rem; }
/* the machine, cut out, standing large on the page: the words beside two views that share one ground line */
.m-hero { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 1.5rem clamp(1rem, 4vw, 4rem); align-items: end; }
.m-hero .m-words { grid-column: 1 / -1; }
.m-hero .facts-list { columns: 2 16rem; column-gap: 2.5rem; max-width: 46rem; }
.m-hero img { width: 100%; height: auto; max-height: 88vh; object-fit: contain; object-position: bottom; filter: drop-shadow(0 18px 14px rgba(42, 28, 24, 0.28)); }
@media (max-width: 700px) { .m-hero { grid-template-columns: minmax(0, 1fr); } }
