@font-face {
  font-family: "Marcellus";
  src: url("assets/fonts/marcellus-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("assets/fonts/jost-var-latin.woff2") format("woff2");
  font-weight: 300 400;
  font-display: swap;
}
@font-face {
  font-family: "Tiro Devanagari Sanskrit";
  src: url("assets/fonts/tiro-devanagari-sumeru.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* Two lights on one mountain. Every colour token carries its light and dark value together;
   color-scheme picks one: the system setting by default, or the visitor's choice via data-theme. */
:root {
  color-scheme: light dark;
  --ground: light-dark(#FAF7EF, #0A0908);
  --ink: light-dark(#16140F, #E9E0CD);
  --head: light-dark(#0F0D0A, #EFE6D4);
  --soft: light-dark(#4C473D, #ABA08B);
  --muted: light-dark(#676154, #8A806E);
  --accent: light-dark(#86682F, #B09772);
  --line: light-dark(#E9E3D5, #241E17);
  --sky: linear-gradient(180deg, light-dark(#F3EEE2, #0A0908) 0%, light-dark(#FAF7EF, #15110C) 58%);
  /* Dawn light, blended with color-dodge: a warm multiplier that brightens rock without lifting the blacks. */
  --dawn: light-dark(rgb(22, 16, 4), rgb(84, 70, 44));
  --selection: light-dark(rgba(134, 104, 47, 0.2), rgba(176, 151, 114, 0.28));
  --metal: linear-gradient(176deg, #C9A86A 0%, #9C7B3E 38%, #7B5E2C 68%, #B08F55 100%);
  --mtn-lg: url("assets/img/mountain-light-2400.webp");
  --mtn-sm: url("assets/img/mountain-light-1600.webp");
  --mtn-pt: url("assets/img/mountain-light-portrait.webp");
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
/* The few theme values that are not single colours (the metal ramp and the photograph) switch here. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --metal: linear-gradient(176deg, #E6D6B3 0%, #C7AD7D 32%, #9C8154 60%, #7A6340 80%, #B59A6B 100%);
    --mtn-lg: url("assets/img/mountain-dark-2400.webp");
    --mtn-sm: url("assets/img/mountain-dark-1600.webp");
    --mtn-pt: url("assets/img/mountain-dark-portrait.webp");
  }
}
:root[data-theme="dark"] {
  --metal: linear-gradient(176deg, #E6D6B3 0%, #C7AD7D 32%, #9C8154 60%, #7A6340 80%, #B59A6B 100%);
  --mtn-lg: url("assets/img/mountain-dark-2400.webp");
  --mtn-sm: url("assets/img/mountain-dark-1600.webp");
  --mtn-pt: url("assets/img/mountain-dark-portrait.webp");
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); scrollbar-color: var(--accent) var(--ground); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 300 1.0625rem/1.8 "Jost", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Theme switch: one cross-fade of the whole page, hero included (see script.js). */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.7s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
::selection { background: var(--selection); color: var(--head); }
h1, h2 { margin: 0; font-weight: 400; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 5px; }

.metal {
  background: var(--metal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
@media (forced-colors: active) {
  .metal { background: none; color: CanvasText; -webkit-text-fill-color: currentColor; }
}

/* ---------- Theme toggle: the page's only chrome ---------- */
.theme-toggle {
  position: fixed;
  z-index: 10;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--ground) 55%, transparent);
  color: var(--accent);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, background-color 0.6s ease;
}
.js .theme-toggle[hidden] { display: grid; }
/* On narrow screens the toggle stays at the top of the page rather than floating over the text. */
@media (max-width: 860px) {
  .theme-toggle { position: absolute; }
}
html:not(.js) .theme-toggle { display: none; }
.theme-toggle:hover { border-color: var(--accent); color: var(--head); }
.theme-toggle svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
/* The icon shows the theme you would switch to. */
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-45deg) scale(0.8); }
.theme-toggle .icon-moon { opacity: 1; }
:root[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(45deg) scale(0.8); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { opacity: 1; transform: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { opacity: 0; transform: rotate(45deg) scale(0.8); }
}

/* ---------- Hero: the name behind the mountain ---------- */
.hero {
  --p: 0;
  --y: 0;
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--sky);
}
/* The stage keeps the photograph's 3:2 geometry at any viewport (object-fit: cover by hand),
   so the name and the ridge stay registered to each other. */
.stage {
  container-type: inline-size;
  position: absolute;
  left: 50%;
  top: -9%;
  width: max(106vw, 159svh);
  aspect-ratio: 3 / 2;
  transform: translateX(-50%);
}
.sky { position: absolute; inset: 0; }
.mountain {
  --mtn: var(--mtn-lg);
  --mtn-size: 100% 100%;
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--mtn) center top / var(--mtn-size) no-repeat;
  /* Rises a little faster than the page, so it climbs over the pinned name. */
  transform: translate3d(0, calc(var(--p) * -6%), 0);
  will-change: transform;
}
@media (max-width: 900px) {
  .mountain { --mtn: var(--mtn-sm); }
}
/* Portrait phones only ever see the middle of the stage, so they get a crop of just that
   (the centre 45% of the photograph), placed back at the same spot. */
@media (max-aspect-ratio: 2/3) {
  .mountain { --mtn: var(--mtn-pt); --mtn-size: 45% 100%; }
}
/* Dawn: the mountain's own silhouette is a fixed stencil; inside it a band of warm light
   slides down the face by transform and opacity alone, so scrolling never repaints the photograph. */
.dawn {
  position: absolute;
  inset: 0;
  -webkit-mask: var(--mtn) center top / var(--mtn-size) no-repeat;
  mask: var(--mtn) center top / var(--mtn-size) no-repeat;
}
.dawn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--dawn) 0%, var(--dawn) 84%, transparent 100%);
  mix-blend-mode: color-dodge;
  transform: translate3d(0, calc(-66% + var(--p) * 58%), 0);
  opacity: calc(0.35 + var(--p) * 0.65);
  will-change: transform, opacity;
}
.name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 56.6%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* The name holds its place on screen while the mountain rises over it. */
  transform: translate3d(0, calc(var(--y, 0) * 1px), 0);
  will-change: transform;
}
.wordmark {
  font-family: "Marcellus", serif;
  font-size: min(15.1cqw, 19.5vw);
  line-height: 0.74;
  letter-spacing: 0.1em;
  margin-right: -0.1em;
  text-transform: uppercase;
  padding-top: 0.04em;
}
.deva {
  font-family: "Tiro Devanagari Sanskrit", serif;
  font-size: clamp(1.1rem, 1.55cqw, 1.6rem);
  line-height: 1;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: min(3.4cqw, 7vw);
}
.legal-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(48px, 7svh);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--soft);
  /* Extra left padding equal to the tracking centres the letter-spaced line without a negative margin. */
  padding: 0 24px 0 calc(24px + 0.42em);
  z-index: 2;
  opacity: calc(1 - var(--p) * 2.2);
}
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  background: linear-gradient(180deg, transparent, var(--ground));
  pointer-events: none;
}

/* ---------- The company ---------- */
.company {
  --q: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: calc(-1 * max(40px, 6svh) + 12px);
  padding: 0 24px clamp(140px, 18svh, 200px);
  position: relative;
  z-index: 1;
}
.axis {
  display: block;
  width: 1px;
  height: clamp(180px, 30svh, 300px);
  margin-bottom: 64px;
  background: linear-gradient(180deg, transparent, var(--accent));
  /* Always present; scrolling draws the rest of it down from the mountain. */
  transform: scaleY(calc(0.35 + var(--q) * 0.65));
  transform-origin: top;
}
.company h2 {
  font-family: "Marcellus", serif;
  font-size: clamp(2rem, 4.1vw, 3.75rem);
  line-height: 1.2;
  letter-spacing: 0.005em;
  color: var(--head);
  max-width: 17em;
  text-wrap: balance;
}
/* Each sentence of the statement starts its own line. */
.company h2 .line { display: block; }
.company p {
  margin-top: 40px;
  max-width: 34em;
  color: var(--soft);
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  text-wrap: pretty;
}

/* ---------- Brand and company record ---------- */
.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-top: 1px solid var(--line);
}
.brand, .register { padding: clamp(96px, 13vw, 184px) clamp(24px, 8.3vw, 120px); }
.register { border-left: 1px solid var(--line); }
/* Vrenel's own logo (mark over wordmark), drawn in the theme's ink so the brand keeps its monochrome identity. */
.brand-lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(22px, 2.4vw, 34px);
}
.logo-mark, .logo-word {
  display: block;
  background: var(--head);
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
}
.logo-mark { --logo: url("assets/img/vrenel-mark.svg"); width: clamp(84px, 8.4vw, 120px); aspect-ratio: 1; }
.logo-word { --logo: url("assets/img/vrenel-wordmark.svg"); width: clamp(220px, 23vw, 330px); aspect-ratio: 5.544; }
@media (forced-colors: active) {
  .logo-mark, .logo-word { forced-color-adjust: none; background: CanvasText; }
}
.brand .brand-lede {
  margin-top: 44px;
  max-width: 15em;
  font-family: "Marcellus", serif;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.3;
  color: var(--head);
  text-wrap: balance;
}
.brand .brand-lede + p { margin-top: 24px; }
.brand p {
  margin-top: 36px;
  max-width: 26em;
  color: var(--soft);
  font-size: clamp(1rem, 1.25vw, 1.125rem);
}
.out {
  display: inline-block;
  margin-top: 28px;
  padding: 12px 0;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 8px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: text-decoration-color 0.3s ease, color 0.3s ease;
}
.out:hover { color: var(--head); text-decoration-color: var(--accent); }
.register h2 {
  font-family: "Marcellus", serif;
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  line-height: 1.2;
  color: var(--head);
  margin-bottom: 40px;
}
.register dl { margin: 0; border-top: 1px solid var(--line); }
.register dl > div {
  display: grid;
  grid-template-columns: minmax(9.5rem, 0.8fr) 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.register dt {
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}
.register dl > div > * { min-width: 0; }
.register dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.975rem;
  font-weight: 400;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
}
.pending { color: var(--muted) !important; font-style: italic; font-weight: 300 !important; }

/* ---------- Close ---------- */
.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: clamp(120px, 16svh, 180px) clamp(24px, 8.3vw, 120px) max(48px, env(safe-area-inset-bottom));
}
.foot-axis {
  width: 1px;
  height: 96px;
  margin-bottom: 36px;
  background: linear-gradient(180deg, transparent, var(--accent));
}
.foot-deva {
  font-family: "Tiro Devanagari Sanskrit", serif;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.foot-mark {
  font-family: "Marcellus", serif;
  font-size: min(1.75rem, 7.5vw);
  letter-spacing: 0.5em;
  margin-right: -0.5em;
  text-transform: uppercase;
  margin-bottom: 96px;
}
.foot-line {
  align-self: stretch;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Not found ---------- */
.lost {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
}
.lost-mark { width: clamp(120px, 14vw, 160px); height: auto; margin-bottom: 56px; }
.lost h1 {
  font-family: "Marcellus", serif;
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  line-height: 1.2;
  color: var(--head);
}
.lost p { margin-top: 20px; color: var(--soft); }

/* On narrow screens the crop centres on the tallest peak, which stands higher in the frame. */
@media (max-aspect-ratio: 1/1) {
  .name { bottom: 59%; }
}
@media (max-width: 860px) {
  .record { grid-template-columns: minmax(0, 1fr); }
  .register { border-left: 0; border-top: 1px solid var(--line); }
  .register dl > div { grid-template-columns: 1fr; gap: 6px; }
  .register dd { text-align: left; }
  .foot-line { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
}
@media (max-width: 480px) {
  .legal-line { letter-spacing: 0.3em; padding-left: calc(24px + 0.3em); font-size: 0.6875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle, .theme-toggle svg { transition: none; }
}
