:root {
  color-scheme: dark;
  --sand: #faf4e9;
  --orange: #ff9856;
  --dark: #211612;
  font-family: system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--sand); background: var(--dark); }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 2px solid #ffbc8f; outline-offset: 5px; }

.welcome {
  min-height: 100svh; display: grid; padding: clamp(15px, 3vw, 44px);
  position: relative; isolation: isolate; overflow: hidden;
  background: #211612;
}
.landscape, .shade, .survey { position: absolute; inset: 0; pointer-events: none; }
.landscape { z-index: -3; overflow: hidden; }
.scene-photo {
  position: absolute; left: 18%; top: 0; width: 82%; height: 100%; object-fit: cover;
  transform: scale(1.025) translate(var(--photo-x, 0px), var(--photo-y, 0px));
  transition: opacity .65s ease, transform .55s ease-out;
}
.scene-photo { opacity: 0; }
.scene-mine { object-position: 62% 55%; }
.scene-chantier { object-position: 58% 58%; }
.scene-manutention { object-position: 55% 57%; }
.scene-marine { object-position: 68% 63%; }
[data-scene="mine"] .scene-mine,
[data-scene="chantier"] .scene-chantier,
[data-scene="manutention"] .scene-manutention,
[data-scene="marine"] .scene-marine { opacity: 1; }
[data-scene="marine"] { --orange: #82efde; background: #062f32; }
[data-scene="marine"] .welcome-label, [data-scene="marine"] .scene-credit { color: #b7fff2; }
[data-scene="marine"] .shade {
  background: linear-gradient(90deg, #062f32 1%, #062f32fa 17%, #062f32d1 32%, #062f3252 59%, transparent 78%),
              linear-gradient(0deg, #062f32 0%, #062f32c9 13%, transparent 38%),
              linear-gradient(180deg, #062f32ae, transparent 32%);
}
.shade {
  z-index: -2;
  background: linear-gradient(90deg, #211612 1%, #211612fa 17%, #211612db 31%, #21161252 56%, transparent 77%),
              linear-gradient(0deg, #211612 0%, #211612c9 12%, transparent 37%),
              linear-gradient(180deg, #211612bc, transparent 32%);
}
.survey {
  z-index: -1;
  background: url('assets/relief.svg') left -220px bottom -340px / 900px auto no-repeat;
}
[data-scene="marine"] .survey { background: none; }
.welcome-frame {
  position: relative; display: grid; grid-template-rows: auto auto 1fr auto; width: min(100%, 1600px); min-width: 0;
  margin-inline: auto; padding: clamp(16px, 2.6vw, 41px); gap: 12px;
  border: 1px solid #f1ddc359;
}
.welcome-frame::before, .welcome-frame::after {
  content: ''; position: absolute; width: 19px; height: 19px; pointer-events: none;
}
.welcome-frame::before { top: -1px; left: -1px; border-top: 2px solid var(--orange); border-left: 2px solid var(--orange); }
.welcome-frame::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--orange); border-right: 2px solid var(--orange); }
.welcome-top { display: flex; align-items: center; justify-content: space-between; gap: 13px; }
.welcome-top, .scene-credit, .terrain-control > p {
  font: 750 .68rem/1.4 ui-monospace, monospace; letter-spacing: .12em;
}
.welcome-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.welcome-identity img { display: block; width: clamp(42px, 6vw, 65px); height: auto; flex: none; }
.welcome-identity span { letter-spacing: .08em; }
.scene-caption a span { color: var(--orange); }

.welcome-content { align-self: center; padding-block: clamp(22px, 3vh, 48px); }
.welcome-brand { display: block; width: clamp(226px, 27vw, 395px); max-width: 100%; height: auto; margin-bottom: clamp(22px, 4vh, 48px); }
.welcome-copy { max-width: 680px; }
.welcome-label {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 6px 12px;
  color: #ffbb8e; background: #211612d9; border: 1px solid currentColor;
  font: 800 clamp(1rem, 1.65vw, 1.5rem)/1.2 ui-monospace, monospace;
  letter-spacing: .13em; text-transform: uppercase;
}
.welcome-label::before { content: ''; width: 8px; height: 8px; background: currentColor; transform: rotate(45deg); }
[data-scene="marine"] .welcome-label { background: #062f32d9; }
h1 { margin: 0; font: 850 clamp(3rem, 7.15vw, 7rem)/.89 "Aptos Display", "Arial", sans-serif; letter-spacing: -.075em; }
h1 em { color: var(--orange); font-style: normal; }
.welcome-lead { margin: 18px 0 24px; max-width: 350px; color: #fff4e9; font-size: clamp(.95rem, 1.25vw, 1.1rem); line-height: 1.52; }
.welcome-enter {
  display: inline-flex; min-height: 53px; align-items: center; justify-content: space-between; gap: 29px;
  padding: 9px 16px; background: var(--orange); color: #24140d; font-weight: 800; transition: background .2s;
}
.welcome-enter:hover { background: #ffc094; }
.welcome-enter span { font-size: 1.1rem; transition: transform .2s; }
.welcome-enter:hover span { transform: translate(2px, -2px); }

.welcome-bottom { display: grid; justify-items: center; gap: 12px; margin-block-start: 8px; }
.terrain-control { place-self: center; width: min(100%, 710px); text-align: center; }
.sector-map-root {
  display: inline-flex; align-items: center; gap: 8px; position: relative;
  margin: 0; padding: 5px 10px; border: 1px solid #e8d5be76;
  background: #211612b5; color: var(--sand); text-transform: uppercase;
}
.sector-map-root i { width: 6px; height: 6px; background: var(--orange); transform: rotate(45deg); }
.sector-map-root::after { content: ''; position: absolute; width: 1px; height: 12px; top: 100%; left: 50%; background: #e8d5be90; }
.terrain-options {
  position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 11px;
}
.terrain-options::before { content: ''; position: absolute; inset: 0 12.5% auto; border-top: 1px solid #e8d5be90; }
.terrain-options button {
  display: grid; align-content: start; justify-items: center; position: relative; gap: 5px;
  padding: 12px 3px 0; border: 0; background: transparent; color: var(--sand);
  font-size: .78rem; font-weight: 750; text-align: center; cursor: pointer; text-shadow: 0 1px 4px #111;
}
.terrain-options button::before { content: ''; position: absolute; width: 1px; height: 12px; top: 0; left: 50%; background: #e8d5be90; }
.sector-node {
  width: clamp(47px, 5.6vw, 69px); aspect-ratio: 1; border-radius: 50%; border: 1px solid #e8d5beaa;
  display: grid; place-items: center; background: #2f211be6; color: #a4f4e8; transition: background .2s, border-color .2s, transform .2s;
}
.terrain-options img { width: 80%; height: 80%; object-fit: contain; }
.terrain-options button:hover .sector-node, .terrain-options button[aria-pressed="true"] .sector-node {
  border-color: var(--orange); background: #58321f; box-shadow: 0 0 0 3px #ff975631;
}
.terrain-options button:hover .sector-node { transform: translateY(-2px); }
[data-scene="marine"] .terrain-options button[aria-pressed="true"] .sector-node { background: #115659; box-shadow: 0 0 0 3px #82efde40; }
.scene-caption { text-align: center; }
.scene-credit { display: block; color: #ffddc7; margin-bottom: 6px; }
.scene-caption a { display: inline-block; padding: 8px 0 5px; border-bottom: 1px solid #ffddc794; font-size: .9rem; font-weight: 750; }
.scene-caption a:hover { border-color: var(--orange); }

@media (max-width: 700px) {
  .welcome-frame { gap: 0; }
  .scene-photo { left: 0; width: 100%; height: 58%; top: 5%; }
  .scene-mine { object-position: 65% 51%; }
  .scene-chantier { object-position: 53% 56%; }
  .scene-marine { object-position: 51% 58%; }
  [data-scene="marine"] .shade { background: linear-gradient(180deg, #062f32e0 0%, #062f3252 15%, transparent 28%, #062f32a8 42%, #062f32 63%); }
  .shade { background: linear-gradient(180deg, #211612f7 0%, #21161272 14%, #21161205 28%, #211612a8 42%, #211612 63%); }
  .survey { background-position: left -170px bottom -230px; background-size: 600px auto; }
  .welcome-top { gap: 7px; }
  .welcome-identity { gap: 6px; }
  .welcome-content { padding-top: clamp(135px, 25svh, 235px); padding-bottom: 25px; }
  .welcome-brand { width: min(67vw, 285px); margin-bottom: 21px; }
  .welcome-lead { margin: 14px 0 17px; }
  .welcome-bottom { gap: 13px; }
  .terrain-options button { min-width: 0; font-size: .7rem; }
  .sector-node svg { width: 27px; height: 27px; }
  .scene-credit { font-size: .6rem; margin-bottom: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .welcome-content { animation: arrive .75s ease-out both; }
  @keyframes arrive { from { opacity: .45; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.sector-node { width: clamp(55px, 9vw, 96px); }
.sector-node svg { width: 56%; height: 56%; }
.terrain-options button { font-size: clamp(.65rem, 1.25vw, .91rem); }

[data-scene="chantier"] { background: radial-gradient(ellipse at 78% 52%, #9a5e36, #271b15 65%); }
.scene-chantier, .scene-manutention { left: 34%; width: 66%; }
.scene-chantier { object-position: 70% 55%; }
.scene-manutention { object-position: 60% 50%; }
@media (max-width: 700px) {
  .scene-chantier, .scene-manutention { left: 0; width: 100%; }
  .scene-chantier { object-position: 70% 47%; }
}

.welcome-copyright { color: #fff; font-size: .7rem; }
