/*
 * Hills & Fort — static HTML version of the Lovable homepage.
 * Layer order mirrors the original Tailwind build: preflight in `base`, button
 * utilities in `utilities`, and the site's own (unlayered) styles win over both.
 */
@layer base, utilities;

:root {
  --radius: 0.375rem;
  --cinematic: oklch(0.18 0.015 220);
  --cinematic-foreground: oklch(0.985 0.003 90);
  --detail: oklch(0.76 0.07 80);
  --background: oklch(0.985 0.002 90);
  --foreground: oklch(0.25 0.015 220);
  --primary: oklch(0.49 0.17 29);
  --primary-foreground: oklch(0.984 0.003 247.858);
  --muted-foreground: oklch(0.5 0.012 220);
  --border: oklch(0.929 0.013 255.508);
  --ring: oklch(0.704 0.04 256.788);
  --font-sans: "Manrope", sans-serif;
  --font-editorial: "Cormorant Garamond", Georgia, serif;
  --shadow-menu: 0 16px 50px oklch(0.1 0 0 / 12%);
}

/* ---------- Base (Tailwind preflight subset) ---------- */
@layer base {
  *,
  ::after,
  ::before,
  ::backdrop {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0 solid;
    border-color: var(--border);
  }
  html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    font-family: var(--font-sans);
    -webkit-tap-highlight-color: transparent;
  }
  body {
    line-height: inherit;
    background-color: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
  }
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-size: inherit;
    font-weight: inherit;
  }
  a {
    color: inherit;
    -webkit-text-decoration: inherit;
    text-decoration: inherit;
  }
  img,
  svg,
  video {
    display: block;
    vertical-align: middle;
  }
  img,
  video {
    max-width: 100%;
    height: auto;
  }
  button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    border-radius: 0;
    background-color: transparent;
    opacity: 1;
    appearance: button;
  }
  [hidden]:where(:not([hidden="until-found"])) {
    display: none !important;
  }
  .icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

/* ---------- Button component (shadcn/cva variants, as computed) ---------- */
@layer utilities {
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    line-height: calc(1.25 / 0.875);
    font-weight: 500;
    cursor: pointer;
    transition-property: color, background-color, border-color, outline-color, text-decoration-color,
      fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 0.15s;
    height: 2.25rem;
    padding: 0.5rem 1rem;
  }
  .btn:focus-visible {
    outline-style: none;
    box-shadow: 0 0 0 1px var(--ring);
  }
  .btn svg {
    pointer-events: none;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
  }
  .btn-cinematic {
    border-width: 1px;
    border-color: color-mix(in oklab, var(--cinematic-foreground) 50%, transparent);
    color: var(--cinematic-foreground);
    background-color: transparent;
    border-radius: 0;
    font-size: 10px;
    line-height: inherit;
  }
  .btn-nav {
    background-color: transparent;
    color: inherit;
    border-radius: 0;
    box-shadow: none;
  }
  @media (hover: hover) {
    .btn-cinematic:hover {
      background-color: var(--cinematic-foreground);
      color: var(--cinematic);
    }
    .btn-nav:hover {
      opacity: 0.7;
    }
  }
  .btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
  }
  .btn-xl {
    justify-content: space-between;
    font-size: 1.25rem;
    line-height: calc(1.75 / 1.25);
  }
  .h-auto {
    height: auto;
  }
  .icon-inline {
    display: inline;
    width: 0.75rem;
    height: 0.75rem;
  }
}

/* ---------- Hills & Fort — cinematic editorial system ---------- */
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  letter-spacing: 0;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  text-decoration: none;
}
::selection {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* Header */
.site-header {
  position: absolute;
  z-index: 50;
  inset: 0 0 auto;
  color: var(--cinematic-foreground);
}
.header-inner {
  max-width: 1600px;
  margin: auto;
  padding: 24px 5%;
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  border-bottom: 1px solid color-mix(in oklab, currentColor 22%, transparent);
}
.brand {
  width: 205px;
  display: block;
}
.brand img {
  width: 100%;
  height: 70px;
  object-fit: contain;
}
.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.nav-item {
  position: relative;
}
.nav-link {
  padding: 16px 0;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 5px;
  height: 1px;
  width: 0;
  background: var(--detail);
  transition: width 0.3s;
}
.nav-item:hover .nav-link::after {
  width: 100%;
}
.nav-chevron {
  width: 11px;
  height: 11px;
  opacity: 0.7;
}
.mega-menu {
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px);
  position: absolute;
  top: 100%;
  left: -30px;
  width: 290px;
  padding: 24px 30px;
  color: var(--foreground);
  background: var(--background);
  box-shadow: var(--shadow-menu);
  transition: 0.25s;
  display: grid;
  gap: 15px;
}
.mega-menu.expertise-menu {
  width: 560px;
  grid-template-columns: 1fr 1fr;
  left: -120px;
}
.nav-item:hover .mega-menu,
.nav-item:focus-within .mega-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.mega-menu a {
  font-size: 12px;
  padding: 4px 0;
  transition: color 0.2s;
}
.mega-menu a:hover {
  color: var(--primary);
}

/* Mobile navigation */
.mobile-toggle {
  display: none;
}
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--cinematic);
  color: var(--cinematic-foreground);
  padding: 22px 26px;
  overflow-y: auto;
  animation: reveal 0.4s ease both;
}
.mobile-menu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-links {
  display: grid;
  gap: 22px;
  padding-top: 40px;
}
.mobile-links > a {
  font-family: var(--font-editorial);
  font-size: 38px;
}
.mobile-sub {
  display: grid;
  gap: 16px;
  padding: 8px 0 8px 15px;
  border-left: 1px solid var(--detail);
  font-size: 13px;
}

/* Scroll cue + section dots */
.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  font-size: 8px;
  text-transform: uppercase;
}
.scroll-cue svg {
  width: 15px;
  height: 22px;
  animation: cue 2s ease infinite;
}
.section-dots {
  --section-dot-size: clamp(12px, 5svh, 24px);
  position: fixed;
  right: max(7px, env(safe-area-inset-right), min(2vw, 25px));
  top: 50%;
  transform: translateY(-50%);
  z-index: 35;
  display: grid;
  justify-items: center;
  gap: clamp(1px, calc((100svh - 340px) / 30), 6px);
  color: var(--cinematic-foreground);
}
.section-dot {
  width: var(--section-dot-size);
  height: var(--section-dot-size);
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
}
.section-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 1px var(--cinematic);
}
.section-dot.active {
  border: 1px solid currentColor;
  background: var(--cinematic);
}

/* Footer */
.footer {
  background: var(--cinematic);
  color: var(--cinematic-foreground);
  padding: 60px 8% 22px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 45px;
}
.footer h2 {
  font-family: var(--font-editorial);
  font-size: 42px;
  font-weight: 400;
  margin: 0 0 20px;
}
.footer-label {
  font-size: 10px;
  opacity: 0.5;
  margin: 0 0 18px;
}
.footer-links {
  display: grid;
  gap: 14px;
  font-size: 11px;
}
.footer-bottom {
  border-top: 1px solid color-mix(in oklab, var(--cinematic-foreground) 20%, transparent);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  opacity: 0.6;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes cue {
  50% {
    transform: translateY(5px);
  }
}

@media (max-width: 1100px) {
  .header-inner {
    grid-template-columns: 180px minmax(0, 1fr) auto;
    gap: 18px;
  }
  .brand {
    width: 175px;
  }
  .desktop-nav {
    gap: 18px;
  }
  .nav-link {
    font-size: 10px;
  }
}
@media (max-width: 800px) {
  .desktop-nav,
  .header-contact {
    display: none;
  }
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 15px 6%;
  }
  .brand {
    width: 160px;
  }
  .brand img {
    height: 58px;
  }
  .mobile-toggle {
    display: inline-flex;
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
  .footer-top > :first-child {
    grid-column: 1 / -1;
  }
  .footer h2 {
    font-size: 36px;
  }
  .footer-bottom {
    gap: 20px;
    line-height: 1.7;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Cinematic scenes (home) ---------- */
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--cinematic-foreground);
  background: var(--cinematic);
  clip-path: inset(0 0 0 0);
  transition:
    clip-path 1.1s cubic-bezier(0.77, 0, 0.18, 1),
    opacity 1.1s ease;
}
.intro-screen::after,
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--cinematic) 55%, transparent),
    color-mix(in oklab, var(--cinematic) 35%, transparent) 45%,
    color-mix(in oklab, var(--cinematic) 80%, transparent)
  );
  pointer-events: none;
}
.intro-screen.is-leaving {
  clip-path: inset(0 0 100% 0);
}
.intro-screen.is-leaving .intro-content {
  opacity: 0;
  transform: translateY(-40px);
}
.intro-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.1rem;
  transition:
    opacity 0.6s ease,
    transform 0.8s ease;
}
.intro-logo {
  width: min(280px, 70%);
  height: auto;
  animation: intro-logo 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.intro-line {
  width: 120px;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  animation: intro-line 1.2s 0.9s both;
}
.intro-caption {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  opacity: 0.75;
  animation: intro-up 1s 1.2s both;
}
.intro-explore {
  margin-top: 1.5rem;
  animation: intro-up 1s 1.6s both;
}
@keyframes intro-logo {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-12deg);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@keyframes intro-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes intro-line {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.scene {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  color: var(--cinematic-foreground);
  background: var(--cinematic);
}
.scene-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
  opacity: 0.35;
  transition:
    transform 2.4s cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 1.4s ease;
}
.intro-screen .scene-video {
  transform: none;
  opacity: 1;
}
.scene.is-active .scene-video {
  transform: scale(1);
  opacity: 1;
}
.scene-content {
  position: relative;
  z-index: 1;
  width: min(1200px, 100% - 3rem);
  margin: 0 auto;
  padding-bottom: clamp(4rem, 12vh, 8rem);
}
.scene-line {
  display: block;
  opacity: 0;
  transform: translateY(48px);
  clip-path: inset(0 0 100% 0);
  transition:
    opacity 0.9s ease,
    transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1),
    clip-path 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.scene.is-active .scene-line {
  opacity: 1;
  transform: none;
  clip-path: inset(-20% 0 -20% 0);
}
.scene.is-active .scene-line:nth-child(1) {
  transition-delay: 0.25s;
}
.scene.is-active .scene-heading .scene-line:nth-child(1) {
  transition-delay: 0.4s;
}
.scene.is-active .scene-heading .scene-line:nth-child(2) {
  transition-delay: 0.55s;
}
.scene.is-active .scene-text {
  transition-delay: 0.75s;
}
.scene.is-active .scene-content > div.scene-line {
  transition-delay: 0.9s;
}
.scene-label {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  opacity: 0.8;
  margin-bottom: 1.2rem;
}
.scene-heading {
  font-family: var(--font-editorial, serif);
  font-size: clamp(2.6rem, 6.5vw, 6rem);
  line-height: 1.02;
  font-weight: 400;
  margin-bottom: 1.4rem;
}
.scene-heading em {
  font-style: italic;
  opacity: 0.85;
}
.scene-text {
  max-width: 34rem;
  font-size: 1.05rem;
  opacity: 0.85;
  margin-bottom: 2rem;
}
.scene .scroll-cue {
  position: absolute;
  z-index: 2;
  bottom: 2rem;
  right: 2rem;
}
.scene-counter {
  position: fixed;
  pointer-events: none;
  z-index: 40;
  left: 2rem;
  bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--cinematic-foreground);
  mix-blend-mode: difference;
}
.scene-counter strong {
  font-size: 1.1rem;
  font-weight: 400;
}
.scene-counter span {
  width: 40px;
  height: 1px;
  background: currentColor;
}
@media (max-width: 800px) {
  .scene-counter {
    display: none;
  }
  .scene-video {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .scene-line,
  .scene-video,
  .intro-screen,
  .intro-content * {
    transition: none !important;
    animation: none !important;
    opacity: 1;
    transform: none;
    clip-path: none;
  }
}
@media (max-width: 800px) {
  .section-dots {
    right: max(3px, env(safe-area-inset-right));
  }
  .scene-content {
    width: auto;
    margin-inline: 1.5rem 2rem;
  }
  .scene .scroll-cue {
    display: none;
  }
}

/* Intro and open mobile menu hold the page still. */
.scroll-locked body {
  overflow: hidden;
}

/* ---------- Phones & touch screens: one swipe = one scene ----------
 * The page scrolls inside .page instead of the document, so the browser's
 * address bar never collapses mid-scroll: every scene (and its film) is exactly
 * one visible screen tall, and mandatory snapping stops on each scene.
 * Keep this query in sync with SNAP_QUERY in script.js. */
@media (max-width: 800px), (hover: none) and (pointer: coarse) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }
  .page {
    position: relative;
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  .scroll-locked .page {
    overflow-y: hidden;
  }
  .scene {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  .footer {
    scroll-snap-align: end;
    scroll-snap-stop: always;
  }
  .mobile-menu {
    overscroll-behavior: contain;
  }
  /* Short screens (phones in landscape): keep the copy inside the frame. */
  @media (max-height: 520px) {
    .scene-counter {
      display: none;
    }
    .scene-content {
      padding-bottom: 1.75rem;
    }
    .scene-label {
      margin-bottom: 0.6rem;
    }
    .scene-heading {
      font-size: clamp(2rem, 11vh, 6rem);
      margin-bottom: 0.8rem;
    }
    .scene-text {
      margin-bottom: 1rem;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .page {
    scroll-behavior: auto;
  }
}
