/* ==========================================================================
   CAVELAB - redesign from Figma "UI" page
   Font: Atkinson Hyperlegible | Yellow #d9ce1b | Beige #d1cfac

   Scaling model: the root font-size tracks viewport width (16px at the
   1440px design width), and every dimension below is in rem. The whole
   composition therefore zooms proportionally, so a 27" monitor and a
   13" laptop show the same layout, just bigger or smaller.
   ========================================================================== */

html {
  font-size: clamp(10px, 1.1111vw, 26px); /* 16px at 1440w */
  scroll-behavior: smooth;
}

:root {
  --bg: #ffffff;
  --text: #000000;
  --text-2: #1e1e1e;
  --muted: rgba(0, 0, 0, 0.5);
  --line: rgba(0, 0, 0, 0.15);
  /* brand yellow for accents on dark surfaces */
  --yellow: #d9ce1b;
  /* darker yellow for text on light backgrounds (readable contrast) */
  --yellow-text: #a89e00;
  --beige: #d1cfac;
  --beige-50: rgba(209, 207, 172, 0.5);
  --btn-primary-bg: #000000;
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: #ffffff;
  --btn-secondary-border: #000000;
  --btn-secondary-text: #000000;
  --marker-bg: rgba(0, 0, 0, 0.5);
  --grad: linear-gradient(124.898deg, #a89e00 11.941%, #8f8d60 62.879%);
  --grad-r: linear-gradient(to right, #a89e00, #8f8d60);

  --rail-x: 6.75rem;        /* 108px */
  --content-left: 10.1875rem; /* 163px */
  --header-h: 4.625rem;     /* 74px */

  --fs-display: 2.875rem;   /* 46px */
  --fs-40: 1.875rem;        /* 30px */
  --fs-28: 1.3125rem;       /* 21px */
  --fs-20: 1rem;            /* 16px */
  --fs-16: 0.875rem;        /* 14px */
  --fs-96: 4.5rem;          /* 72px */
}

html[data-theme="dark"] {
  --bg: #000000;
  --text: #ffffff;
  --text-2: #e5e5e5;
  --muted: rgba(255, 255, 255, 0.5);
  --line: rgba(255, 255, 255, 0.18);
  --yellow-text: #d9ce1b; /* full yellow reads fine on black */
  --btn-primary-bg: #d9ce1b;
  --btn-primary-text: #000000;
  --btn-secondary-bg: #ffffff;
  --btn-secondary-border: #000000;
  --btn-secondary-text: #000000;
  --marker-bg: #e5e5e5;
  --grad: linear-gradient(124.898deg, #d9ce1b 11.941%, #d1cfac 62.879%);
  --grad-r: linear-gradient(to right, #d9ce1b, #d1cfac);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.3; /* readable default for running text */
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

img { display: block; }

::selection { background: var(--yellow); color: #000; }

/* ==========================================================================
   Custom cursor - a dot inside a circle
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button { cursor: none; }
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  will-change: transform;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--text);
}
.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--text);
  opacity: 0.55;
  transition: width 0.25s ease, height 0.25s ease, opacity 0.25s ease;
}
.cursor-ring.is-hover {
  width: 52px;
  height: 52px;
  opacity: 1;
  border-color: var(--yellow);
}
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ==========================================================================
   Left rail + scrolling 20x20 marker
   ========================================================================== */
.rail {
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: var(--rail-x);
  width: 1px;
  background: var(--line);
  z-index: 50;
}

.rail-marker {
  position: fixed;
  left: var(--rail-x);
  transform: translateX(-100%); /* square sits flush on the LEFT of the line */
  top: var(--header-h); /* driven by JS */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 51;
  will-change: top;
}
.rail-label {
  font-size: var(--fs-16);
  color: var(--muted);
  white-space: nowrap;
  order: -1;
  line-height: 1;
  transition: opacity 0.3s ease;
}
.rail-square {
  width: 1.25rem;
  height: 1.25rem;
  background: var(--marker-bg);
  opacity: 0.2;
  flex: none;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  z-index: 100;
  overflow: hidden;
  transition: background-color 0.35s ease;
}

/* continuation of the vertical rail through the header,
   cutting between the hexagon logo and the wordmark */
.site-header::before {
  content: '';
  position: absolute;
  left: var(--rail-x);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.logo-hex {
  position: absolute;
  left: 0.875rem;
  top: 1.0625rem;
  width: 4.9375rem;
  height: 2.8125rem;
}
.logo-hex img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-word {
  position: absolute;
  left: calc(var(--rail-x) - 0.9375rem);
  top: -1.5rem;
  width: 14.0625rem;
  height: 7.9375rem;
}
.logo-word img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-nav {
  position: absolute;
  right: 1.5rem;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 3.3125rem;
}
.site-nav a {
  font-size: var(--fs-20);
  color: var(--muted);
  text-decoration: none;
  position: relative;
  line-height: 1;
  transition: color 0.25s ease;
}
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.3em;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after { transform: scaleX(1); }
html[data-theme="dark"] .site-nav a { color: #ffffff; }
html[data-theme="dark"] .site-nav a:hover { color: var(--yellow); }

.theme-toggle {
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 50%;
  border: 1px solid var(--muted);
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.theme-toggle:hover { border-color: var(--text); transform: rotate(20deg); }
.theme-toggle svg { width: 1.0625rem; height: 1.0625rem; }
.theme-toggle .sun-icon { display: none; }
html[data-theme="dark"] .theme-toggle .moon-icon { display: none; }
html[data-theme="dark"] .theme-toggle .sun-icon { display: block; }

/* ==========================================================================
   Sections - shared
   ========================================================================== */
.section {
  position: relative;
  min-height: 100vh;
  padding: calc(var(--header-h) + 4vh) 5.5% 8vh var(--content-left);
  border-bottom: 1px solid var(--line);
}

.display {
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: 1.0; /* tight leading stays on display type only */
  color: var(--text);
}
.display.sub { margin-top: 1.6rem; }
.text-2 { color: var(--text-2); }

.yellow { color: var(--yellow-text); }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.grad-text-r {
  background: var(--grad-r);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.body-40 {
  font-size: var(--fs-40);
  line-height: 1.3;
}
.body-40 p + p { margin-top: 1em; }
.body-40.bold { font-weight: 700; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(1.75rem);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  height: max(100vh, 45rem);
  padding: 0;
  overflow: hidden;
}

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-title {
  position: absolute;
  left: var(--content-left);
  top: 25.8vh;
  width: 31.9375rem;
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: 1.0;
  z-index: 2;
}

.hero-circle {
  position: absolute;
  top: 14.25vh;
  right: 5.5%;
  width: min(40.375rem, 66vh);
  aspect-ratio: 1;
  z-index: 1;
  will-change: transform;
}
.hero-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hero-bottom {
  position: absolute;
  left: var(--content-left);
  right: 4.9%;
  bottom: 8.8vh;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  z-index: 2;
}
.hero-sub {
  font-size: var(--fs-28);
  width: 31.9375rem;
  line-height: 1.3;
}
.hero-cta {
  display: flex;
  gap: 2.0625rem;
  flex: none;
}
.btn {
  width: 15.625rem;
  height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-28);
  text-decoration: none;
  transition: transform 0.25s ease, background-color 0.25s ease, opacity 0.25s ease;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.btn-primary:hover { opacity: 0.85; }
.btn-secondary {
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--btn-secondary-text);
}

/* ==========================================================================
   01 What
   ========================================================================== */
.what-body {
  margin-top: clamp(3rem, 28vh, 30vh);
  max-width: 68.25rem;
}

/* ==========================================================================
   02 Why
   ========================================================================== */
.callout-row {
  display: flex;
  align-items: flex-start;
  gap: 3.3125rem;
  margin-top: 9vh;
  max-width: 72.5rem;
}
.callout-row-right {
  justify-content: flex-end;
  margin-top: 6vh;
}
.alert-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  margin-top: 2.5rem;
  color: var(--text);
}
.callout {
  font-size: var(--fs-28);
  line-height: 1.3;
  min-height: 7.5rem;
  display: flex;
  align-items: center;
}
.callout-dark {
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  width: min(30.9375rem, 100%);
  padding: 2.25rem 3.5rem;
}
html[data-theme="dark"] .callout-dark { background: #1e1e1e; }
.callout-outline {
  background: var(--bg);
  border: 3px solid var(--muted);
  color: var(--text);
  width: min(34.6875rem, 100%);
  padding: 1.375rem 2.8125rem;
}
.why-conclusion {
  margin-top: 6vh;
  max-width: 58.4375rem;
}

/* ==========================================================================
   03 Who
   ========================================================================== */
.who-body {
  margin-top: clamp(3rem, 18vh, 20vh);
  max-width: 69.8125rem;
}

/* ==========================================================================
   Services
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 4.5vh;
  max-width: 73.5rem;
}
.card {
  background: linear-gradient(to bottom, var(--beige-50), transparent);
  min-height: 32.5rem;
  padding: 1.75rem 2.5rem 2.1875rem;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: transform 0.35s ease;
}
.card:hover { transform: translateY(-0.5rem); }
.card h3 {
  font-size: var(--fs-40);
  font-weight: 700;
  line-height: 1.0;
}
.card-body {
  font-size: var(--fs-28);
  line-height: 1.35;
  margin-top: 2rem;
  max-width: 19rem;
  margin-left: auto;
  margin-right: auto;
}
.card-list {
  list-style: none;
  margin-top: 2.25rem;
  font-size: var(--fs-20);
  line-height: 1.5;
  color: var(--text-2);
}
.card-list li + li {
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--line);
}
.card-foot {
  font-size: var(--fs-28);
  color: var(--muted);
  margin-top: auto;
  padding-top: 2rem;
}

/* ==========================================================================
   Products
   ========================================================================== */
.products-intro {
  margin-top: 5.5vh;
  max-width: 58.4375rem;
}
.product-row {
  display: flex;
  align-items: flex-start;
  gap: 4.5625rem;
  margin-top: 4vh;
}
.product-shot {
  width: min(48.6875rem, 60%);
  flex: none;
  display: block;
  transition: transform 0.35s ease;
}
.product-shot:hover { transform: scale(1.015); }
.product-shot img {
  width: 100%;
  height: auto;
}
.product-side {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-self: stretch;
}
.product-proof {
  font-size: var(--fs-28);
  line-height: 1.3;
  margin-top: 2vh;
}
.grip-link {
  margin-top: clamp(2rem, 10vh, 10vh);
  width: min(18.75rem, 100%);
  height: 4.5rem;
  background: var(--beige-50);
  color: var(--text);
  font-size: var(--fs-28);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.9375rem 0 2.25rem;
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.grip-link:hover { background: var(--beige); transform: translateX(0.375rem); }
html[data-theme="dark"] .grip-link:hover { color: #000; }
.grip-link svg { width: 1.5rem; height: 1.5rem; flex: none; }
.next-product {
  margin-top: auto;
  font-size: var(--fs-20);
  text-align: right;
  line-height: 1.3;
  color: var(--text);
}

/* ==========================================================================
   Contact
   ========================================================================== */
.section-contact {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  padding-right: 4.9%;
}
.contact-main { flex: 1; }
.section-contact .display { margin-top: clamp(2rem, 14vh, 15vh); }
.contact-list {
  margin-top: 5vh;
  padding-left: 3.75rem;
  max-width: 58.4375rem;
}
.contact-list li { line-height: 1.3; }
.contact-list li + li { margin-top: 0.35em; }
.email-link {
  display: inline-block;
  font-size: var(--fs-96);
  line-height: 1.0;
  text-decoration: none;
  margin-top: clamp(2.5rem, 12vh, 13vh);
  transition: opacity 0.3s ease;
}
.email-link:hover { opacity: 0.75; }

.site-footer {
  border-top: 1px solid var(--line);
  margin-left: calc(-1 * var(--content-left) + var(--rail-x));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  font-size: var(--fs-28);
  padding: 4.5vh 0 4.5vh calc(var(--content-left) - var(--rail-x));
}

/* ==========================================================================
   Responsive - tablet & mobile
   ========================================================================== */
@media (max-width: 1100px) and (min-width: 861px) {
  .hero-title { width: 46vw; }
  .hero-bottom { flex-direction: column; align-items: flex-start; }
  .hero-sub { width: 100%; max-width: 32rem; }
}

@media (max-width: 860px) {
  html { font-size: 16px; } /* fixed root on small screens */

  :root {
    --rail-x: 40px;
    --content-left: 64px;
    --fs-display: 1.75rem;
    --fs-40: 1.25rem;
    --fs-28: 1.0625rem;
    --fs-20: 0.9rem;
    --fs-16: 0.8125rem;
  }

  .rail-label { display: none; }

  .logo-hex { width: 56px; height: 32px; top: 21px; left: 8px; }
  .logo-word { display: none; }
  .site-nav { gap: 16px; right: 12px; }
  .site-nav a { font-size: 0.85rem; }

  .section { padding: calc(var(--header-h) + 3vh) 20px 8vh var(--content-left); min-height: auto; }

  /* Hero stacks */
  .hero {
    height: auto;
    min-height: 100vh;
    padding: calc(var(--header-h) + 4vh) 20px 6vh var(--content-left);
    display: flex;
    flex-direction: column;
    gap: 32px;
  }
  .hero-title { position: static; width: 100%; max-width: 511px; }
  .hero-circle { position: static; width: min(420px, 78vw); align-self: center; }
  .hero-bottom { position: static; flex-direction: column; align-items: flex-start; }
  .hero-sub { width: 100%; max-width: 511px; }
  .hero-cta { flex-direction: column; gap: 16px; width: 100%; }
  .btn { width: 100%; max-width: 340px; height: 56px; }

  .what-body, .who-body { margin-top: 12vh; }

  .callout-row { gap: 20px; margin-top: 6vh; }
  .callout-row-right { justify-content: flex-start; }
  .alert-icon { width: 32px; height: 32px; margin-top: 24px; }
  .callout-dark, .callout-outline { padding: 20px 24px; min-height: auto; }

  .cards { grid-template-columns: 1fr; max-width: 480px; }
  .card { min-height: auto; padding: 28px 24px 32px; }
  .card-foot { margin-top: 40px; padding-top: 0; }

  .product-row { flex-direction: column; gap: 24px; }
  .product-shot { width: 100%; }
  .product-side { width: 100%; }
  .grip-link { margin-top: 8px; height: 60px; }
  .next-product { margin-top: 32px; }

  .contact-list { padding-left: 36px; }
  .email-link { font-size: clamp(1.7rem, 8.5vw, 3.2rem); word-break: break-all; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
}
