/* Legend Forage SARL — static site styles */

:root {
  --blue: #0070ff;
  --red: #ff3131;
  --ink: #000;
  --text: #2a2e35;
  --graphite: #202020;
  --mist: #f3f7ff;
  --line: #e3e7ee;
  --white: #fff;
  --font-body: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Geist', system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: 20px;
  --radius: 6px;
}
@media (min-width: 768px) { :root { --gutter: 32px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  margin: 0;
  font: 400 1.0625rem/1.65 var(--font-body);
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 3px; }
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
p { margin: 0 0 1.1em; text-wrap: pretty; }
strong { color: var(--ink); font-weight: 600; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.wrap { width: min(1200px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.i {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; transition: top .2s;
}
.skip:focus { top: 12px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--ink); color: #fff; font-size: .875rem; font-weight: 600; }
.topbar__in { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 32px; padding-block: 9px; }
.topbar a, .topbar span { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.topbar a { transition: opacity .25s; }
.topbar a:hover { opacity: .75; }
.topbar .i { color: var(--red); }
@media (max-width: 700px) { .topbar__extra { display: none !important; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(255 255 255 / .94);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .4s var(--ease), border-color .4s;
  view-transition-name: site-header;
}
.scrolled .site-header { border-color: var(--line); box-shadow: 0 10px 30px -14px rgb(0 0 0 / .2); }
.header__in {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 84px; transition: height .4s var(--ease);
}
.scrolled .header__in { height: 68px; }
.brand img { height: 56px; width: auto; transition: height .4s var(--ease); }
.scrolled .brand img { height: 44px; }

.nav { display: flex; align-items: center; gap: 30px; }
.nav a { position: relative; color: var(--ink); font-weight: 600; font-size: .95rem; text-decoration: none; padding-block: 6px; }
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--red);
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease);
}
.nav a:not(.btn):hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav a[aria-current="page"] { color: var(--red); }
.nav .btn { padding: 11px 22px; }
.nav-toggle { display: none; }

@media (max-width: 1023px) {
  .nav-toggle {
    display: grid; place-content: center; gap: 6px;
    width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 26px; height: 2px; background: var(--ink); transition: transform .4s var(--ease), opacity .3s; }
  .nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 28px; background: #fff;
    border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px -24px rgb(0 0 0 / .3);
    clip-path: inset(0 0 100% 0); visibility: hidden;
    transition: clip-path .55s var(--ease), visibility 0s .55s;
  }
  .nav-open .nav { clip-path: inset(0 0 -60px 0); visibility: visible; transition-delay: 0s; }
  .nav a {
    font-size: 1.2rem; padding: 14px 0; border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-10px);
    transition: opacity .45s var(--ease), transform .45s var(--ease);
    transition-delay: calc(var(--i, 0) * 45ms);
  }
  .nav-open .nav a { opacity: 1; transform: none; }
  .nav a:not(.btn)::after { display: none; }
  .nav .btn { margin-top: 20px; justify-content: center; border-bottom: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--red); color: #fff !important;
  font: 600 1rem/1.2 var(--font-body); text-decoration: none;
  transition: color .35s var(--ease), transform .2s;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink);
  transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease);
}
.btn:hover::before { transform: scaleX(1); transform-origin: left; }
.btn:active { transform: translateY(1px); }
.on-dark .btn::before { background: #fff; }
.on-dark .btn:hover { color: var(--ink) !important; }

/* ---------- Home hero slider ---------- */
.hero { position: relative; height: clamp(540px, calc(100svh - 124px), 780px); overflow: hidden; background: #000; color: #fff; }
.slide {
  position: absolute; inset: 0; display: flex; align-items: center;
  opacity: 0; visibility: hidden; transition: opacity 1.2s var(--ease), visibility 0s 1.2s;
}
.slide.is-active { opacity: 1; visibility: visible; z-index: 1; transition-delay: 0s; }
.slide__media {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.1); transition: transform 8s linear;
}
.slide.is-active .slide__media { transform: scale(1); }
.slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgb(0 0 0 / .72), rgb(0 0 0 / .35) 55%, rgb(0 0 0 / .1));
}
.slide .wrap { position: relative; z-index: 1; padding-bottom: 40px; }
.hero__copy { max-width: 800px; }
.hero__title { color: #fff; font-size: clamp(2.4rem, 5.4vw, 4.4rem); font-weight: 700; line-height: 1.04; margin-bottom: .4em; }
.hero__copy p { font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: rgb(255 255 255 / .88); max-width: 60ch; margin-bottom: 1.8em; }
.slide.is-active .hero__copy > * { animation: rise 1s var(--ease) both; animation-delay: calc(.25s + var(--i, 0) * .12s); }

.hero__dots { position: absolute; z-index: 2; left: 0; right: 0; bottom: 32px; }
.hero__dots .wrap { display: flex; gap: 10px; }
.hero__dot { position: relative; width: 64px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.hero__dot::before, .hero__dot::after { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 3px; background: rgb(255 255 255 / .3); }
.hero__dot::after { background: #fff; transform: scaleX(0); transform-origin: left; }
.hero__dot.is-active::after { animation: fill 7s linear forwards; }

/* ---------- Inner page hero ---------- */
.page-hero { position: relative; display: flex; align-items: flex-end; height: clamp(260px, 34vw, 420px); overflow: hidden; background: #000; }
.page-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: settle 1.8s var(--ease) both; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgb(0 0 0 / .55)); }
.page-hero .wrap { position: relative; z-index: 1; padding-bottom: clamp(32px, 5vw, 56px); }
.page-hero h1 { color: #fff; font-size: clamp(2.75rem, 7vw, 5.5rem); margin: 0; animation: rise 1s .2s var(--ease) both; }
.page-hero h1::after { content: ""; display: block; width: 72px; height: 4px; margin-top: 18px; background: var(--red); transform-origin: left; animation: grow 1s .55s var(--ease) both; }

/* ---------- Sections & type ---------- */
.section { padding-block: clamp(72px, 10vw, 128px); }
.section--mist { background: var(--mist); }
.stack { display: grid; gap: clamp(72px, 10vw, 128px); }
.title { color: var(--red); font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 700; }
.h3 { font-size: 1.5rem; }
.lead { font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.55; color: var(--ink); max-width: 62ch; }
.prose { max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 48px; }
.head-row .title { margin: 0; }
.mt { margin-top: clamp(48px, 7vw, 88px); }

.split { display: grid; gap: clamp(36px, 6vw, 88px); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.aside-head { display: grid; gap: 24px 64px; }
@media (min-width: 960px) {
  .aside-head { grid-template-columns: 4fr 7fr; }
  .aside-head > .title { position: sticky; top: 120px; align-self: start; }
}

.media { overflow: hidden; border-radius: var(--radius); background: var(--line); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--portrait { aspect-ratio: 4 / 5; }
.media--land { aspect-ratio: 4 / 3; }
.media--natural { background: none; justify-self: center; }
.media--natural img { width: auto; height: auto; }
.media--small { max-width: 420px; justify-self: center; width: 100%; }

/* ---------- Home ---------- */
.tiles { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile { position: relative; display: block; aspect-ratio: 5 / 6; overflow: hidden; border-radius: var(--radius); background: #000; text-decoration: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgb(0 0 0 / .8)); }
.tile h3 { position: absolute; z-index: 1; left: 24px; right: 24px; bottom: 22px; margin: 0; color: #fff; font-size: 1.5rem; }
.tile h3::after { content: ""; display: block; width: 36px; height: 3px; margin-top: 12px; background: var(--red); transition: width .6s var(--ease); }
.tile:hover img { transform: scale(1.07); }
.tile:hover h3::after { width: 80px; }

.checks { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.checks li { display: flex; gap: 14px; align-items: flex-start; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 1.125rem; color: var(--ink); }
.checks .i { color: var(--blue); margin-top: .3em; }

.duo { display: grid; gap: 48px; }
.duo .i { width: 44px; height: 44px; color: var(--red); margin-bottom: 20px; }
.duo h2 { font-size: 1.75rem; }
.duo p { font-size: 1.125rem; margin: 0; max-width: 46ch; }
@media (min-width: 800px) {
  .duo { grid-template-columns: 1fr 1fr; gap: 0; }
  .duo > :first-child { padding-right: 56px; }
  .duo > :last-child { padding-left: 56px; border-left: 1px solid var(--line); }
}

.cta { background: var(--ink); padding-block: clamp(56px, 7vw, 88px); }
.cta .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 48px; }
.cta h2 { color: #fff; font-size: clamp(1.75rem, 3.4vw, 2.75rem); margin: 0; max-width: 22ch; }

/* ---------- About ---------- */
.people { border-top: 1px solid var(--line); }
.person { display: grid; gap: 16px 56px; padding-block: 40px; border-bottom: 1px solid var(--line); }
@media (min-width: 860px) { .person { grid-template-columns: 320px 1fr; } }
.person__id { display: flex; gap: 18px; align-items: center; align-self: start; }
.monogram {
  flex: none; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%;
  background: var(--blue); color: #fff; font: 600 1.15rem var(--font-display);
  transition: transform .5s var(--ease), background .3s;
}
.person:hover .monogram { transform: rotate(-8deg) scale(1.06); background: var(--red); }
.person h3 { font-size: 1.35rem; margin: 0 0 4px; }
.person__role { margin: 0; color: var(--red); font-weight: 600; font-size: .98rem; }
.person > p { margin: 0; max-width: 70ch; }

/* ---------- Services ---------- */
.grid3 { display: grid; gap: 56px 32px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.service .media { aspect-ratio: 4 / 3; margin-bottom: 22px; }
.service .media img { transition: transform 1.2s var(--ease); }
.service:hover .media img { transform: scale(1.05); }
.service h3 { font-size: 1.4rem; }
.service p { margin: 0; }

/* ---------- Drilling rigs ---------- */
.specs { display: grid; gap: 28px; margin-top: 36px; }
.spec { border-left: 3px solid var(--red); padding-left: 20px; }
.spec h2 { font-size: 1.25rem; margin-bottom: .35em; }
.spec p { margin: 0; }
.pair { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); max-width: 960px; margin-inline: auto; }

/* ---------- Projects ---------- */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cat { display: flex; align-items: center; gap: 18px; padding: 30px 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cat .i { width: 40px; height: 40px; color: var(--blue); transition: transform .5s var(--ease), color .3s; }
.cat:hover .i { transform: translateY(-3px); color: var(--red); }
.cat h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.01em; }

.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.gallery a { position: relative; display: block; aspect-ratio: 400 / 284; overflow: hidden; border-radius: 4px; background: var(--line); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.gallery a::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 0 var(--red); transition: box-shadow .4s var(--ease); }
.gallery a:hover img { transform: scale(1.08); }
.gallery a:hover::after { box-shadow: inset 0 0 0 4px var(--red); }

.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgb(0 0 0 / .9); place-items: center;
  opacity: 0; transition: opacity .35s var(--ease), overlay .35s allow-discrete, display .35s allow-discrete;
}
.lightbox[open] { display: grid; opacity: 1; }
@starting-style { .lightbox[open] { opacity: 0; } }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: min(1200px, 88vw); max-height: 86vh; width: auto; height: auto; border-radius: 4px; transition: transform .45s var(--ease); }
@starting-style { .lightbox[open] img { transform: scale(.94); } }
.lb-btn {
  position: absolute; display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / .12); color: #fff; font-size: 1.4rem; cursor: pointer; transition: background .25s;
}
.lb-btn:hover { background: var(--red); }
.lb-prev, .lb-next { top: 50%; translate: 0 -50%; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-close { top: 16px; right: 16px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 56px; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 5fr 6fr; gap: 88px; } }
.info { display: grid; gap: 30px; }
.info__item { display: flex; gap: 18px; }
.info__item .i { width: 26px; height: 26px; color: var(--red); margin-top: 3px; }
.info__item h3 { font-size: 1.15rem; margin: 0 0 6px; }
.info__item p { margin: 0; }
.info__item a { color: var(--ink); text-decoration: none; transition: color .25s; }
.info__item a:hover { color: var(--blue); }

.form { display: grid; gap: 18px; padding: clamp(24px, 4vw, 44px); background: var(--mist); border-radius: var(--radius); }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: .95rem; color: var(--ink); }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: #fff;
  padding: 13px 14px; border: 1px solid #cfd6e1; border-radius: 4px;
  transition: border-color .25s, box-shadow .25s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgb(0 112 255 / .15); }
.field textarea { min-height: 160px; resize: vertical; }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.notice { display: none; margin-bottom: 18px; padding: 16px 18px; border-radius: 4px; font-weight: 500; scroll-margin-top: 130px; }
.notice:target { display: block; animation: rise .6s var(--ease) both; }
.notice--ok { background: #e7f6ec; color: #0f5132; border-left: 4px solid #1f9d55; }
.notice--err { background: #fdecec; color: #842029; border-left: 4px solid var(--red); }

/* ---------- Footer ---------- */
.site-footer { background: var(--graphite); color: rgb(255 255 255 / .78); padding-top: 72px; font-size: .98rem; }
.footer__grid { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding-bottom: 56px; }
.footer__logo { display: inline-block; width: 150px; padding: 14px; background: #fff; border-radius: 10px; transition: transform .5s var(--ease); }
.footer__logo:hover { transform: rotate(-2deg) scale(1.03); }
.site-footer h2 { color: #fff; font-size: 1.125rem; letter-spacing: 0; margin-bottom: 18px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.site-footer li { display: flex; gap: 12px; align-items: flex-start; }
.site-footer .i { color: var(--red); margin-top: .25em; }
.site-footer a { color: inherit; text-decoration: none; transition: color .25s; }
.site-footer a:hover { color: #fff; }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-block: 22px; border-top: 1px solid rgb(255 255 255 / .1);
  font-size: .875rem; color: rgb(255 255 255 / .55);
}
.footer__bottom p { margin: 0; }
.footer__bottom a { color: #2ea3f2; }

/* ---------- Depth gauge (scroll progress as drill depth, 0–150 m) ---------- */
.depth { display: none; }
@media (min-width: 1320px) {
  .depth {
    display: block; position: fixed; z-index: 40; right: 26px; top: 50%; translate: 0 -50%;
    width: 2px; height: 42vh; background: rgb(127 127 127 / .28);
    pointer-events: none;
  }
  .depth__fill { position: absolute; inset: 0; background: var(--red); transform-origin: top; transform: scaleY(var(--progress, 0)); }
  .depth__read {
    position: absolute; right: 12px; top: calc(var(--progress, 0) * 100%); translate: 0 -50%;
    padding: 4px 7px; border-radius: 4px; background: #fff; box-shadow: 0 2px 10px rgb(0 0 0 / .15);
    font: 600 .75rem/1 var(--font-display); color: var(--red); white-space: nowrap; font-variant-numeric: tabular-nums;
  }
  .depth__read::after {
    content: ""; position: absolute; right: -9px; top: 50%; width: 7px; height: 7px; translate: 0 -50%;
    background: var(--red); transform: rotate(45deg);
  }
}

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: .4; transform: scale(1.12); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes fill { to { transform: scaleX(1); } }

.js [data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), clip-path 1.3s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
/* "drill" reveal: image is uncovered top-to-bottom, like a borehole going down */
.js [data-reveal="drill"] { opacity: 1; transform: none; clip-path: inset(0 0 100% 0); }
.js [data-reveal="drill"] img { transform: scale(1.15); transition: transform 1.6s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; clip-path: inset(0); }
.js [data-reveal="drill"].in img { transform: none; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .4s; animation-timing-function: var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0s !important;
    transition-duration: .01ms !important; transition-delay: 0s !important;
  }
  .js [data-reveal], .js [data-reveal="drill"] { opacity: 1; transform: none; clip-path: none; }
  .js [data-reveal="drill"] img { transform: none; }
  @view-transition { navigation: none; }
}
