/* ==========================================================================
   ArchiFlow Hero Section (Same to same pixel-perfect HTML/CSS conversion)
   ========================================================================== */

/* ── Typography & CSS Custom Properties ─────────────────────────────────── */
:root {
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-tight: "Inter Tight", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-lato: Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --color-bg: #f5f5f2;
  --color-text-dark: #121212;
  --color-tick: rgba(0, 0, 0, 0.45);
  
  /* GridRail metrics - mobile defaults */
  --cell: 32px;
  --hatch-gap: 1.6px;
  --hatch-line: 0.55px;
  --lw: 0.444px;
  --tick: 5.333px;

  /* Building fade mask */
  --fade-start: 72%;
  --fade-mid: 88%;

  /* Animation */
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Breakpoint-specific GridRail variables */
@media (min-width: 768px) {
  :root {
    --cell: 52px;
    --hatch-gap: 2.6px;
    --hatch-line: 0.9px;
    --lw: 0.722px;
    --tick: 8.667px;
  }
}

@media (min-width: 1024px) {
  :root {
    --cell: 72px;
    --hatch-gap: 3.6px;
    --hatch-line: 1.24px;
    --lw: 1px;
    --tick: 12px;
  }
}

@media (min-width: 2000px) {
  :root {
    --fade-start: 48%;
    --fade-mid: 72%;
  }
}

/* ── CSS Reset & Base Rules ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  background-color: var(--color-bg);
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text-dark);
  font-family: var(--font-tight);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* ── Layout Wrapper ─────────────────────────────────────────────────────── */
.hero-main {
  position: relative;
  width: 100%;
  background-color: var(--color-bg);
  min-height: 100dvh;
  min-height: 100vh;
}

.hero-container {
  position: relative;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  min-height: 100dvh;
  min-height: 100vh;
  width: 100%;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

@media (min-width: 2000px) {
  .hero-container {
    max-width: 2000px;
  }
}

/* ── GridRail Columns ───────────────────────────────────────────────────── */
.grid-rail {
  pointer-events: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--cell);
  z-index: 1;
}

.grid-rail--left {
  left: 0;
}

.grid-rail--right {
  right: 0;
}

/* Diagonal hatch texture */
.grid-rail__hatch {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(2, 2, 2, 0.09) 0 var(--hatch-line),
    transparent var(--hatch-line) var(--hatch-gap)
  );
}

/* Dashed vertical rules on both edges of the rail */
.grid-rail__vertical-rules {
  position: absolute;
  inset: 0;
  background-image: 
    repeating-linear-gradient(to bottom, rgba(2, 2, 2, 0.28) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(to bottom, rgba(2, 2, 2, 0.28) 0 2px, transparent 2px 4px);
  background-size: var(--lw) 100%, var(--lw) 100%;
  background-position: 0 0, 100% 0;
  background-repeat: no-repeat, no-repeat;
}

/* Dashed horizontal rule at every cell boundary */
.grid-rail__horizontal-rules {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(2, 2, 2, 0.2) 0 var(--lw),
    transparent var(--lw) var(--cell)
  );
  mask-image: repeating-linear-gradient(to right, #000 0 2px, transparent 2px 4px);
  -webkit-mask-image: repeating-linear-gradient(to right, #000 0 2px, transparent 2px 4px);
}

/* Cross ticks at each cell corner */
.grid-rail__ticks {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to bottom, var(--color-tick) 0 var(--tick), transparent 0),
    linear-gradient(to bottom, var(--color-tick) 0 var(--tick), transparent 0),
    linear-gradient(to bottom, var(--color-tick) 0 var(--lw), transparent 0),
    linear-gradient(to bottom, var(--color-tick) 0 var(--lw), transparent 0);
  background-size:
    var(--lw) var(--cell),
    var(--lw) var(--cell),
    calc(var(--tick) / 2) var(--cell),
    calc(var(--tick) / 2) var(--cell);
  background-position:
    0 calc(var(--tick) / -2),
    100% calc(var(--tick) / -2),
    0 calc(var(--lw) / -2),
    100% calc(var(--lw) / -2);
  background-repeat: repeat-y;
}

/* ── Navigation Header ──────────────────────────────────────────────────── */
.hero-header {
  width: 100%;
  position: relative;
  z-index: 30;
}

.hero-nav {
  position: relative;
  z-index: 10;
  margin-left: 2rem;
  margin-right: 2rem;
  display: flex;
  height: 3.5rem; /* 56px / 14 */
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
}

@media (min-width: 768px) {
  .hero-nav {
    margin-left: 3.25rem; /* ipad:mx-13 = 52px */
    margin-right: 3.25rem;
    height: 74px;
    padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .hero-nav {
    margin-left: auto;
    margin-right: auto;
    margin-top: 18px;
    height: 50px;
    width: 100%;
    max-width: 752px;
    padding: 0;
  }
}

@media (min-width: 1920px) {
  .hero-nav {
    margin-top: 24px;
    height: 64px;
    max-width: 1000px;
  }
}

@media (min-width: 2000px) {
  .hero-nav {
    margin-top: 32px;
    height: 76px;
    max-width: 1240px;
  }
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 6.154px;
  transition: opacity 0.2s ease-out;
}

@media (hover: hover) {
  .nav-logo:hover {
    opacity: 0.7;
  }
}

@media (min-width: 768px) {
  .nav-logo {
    gap: 8px;
  }
}

.nav-logo__icon {
  height: 15.385px;
  width: 13.846px;
  object-fit: contain;
}

@media (min-width: 768px) {
  .nav-logo__icon {
    height: 20px;
    width: 18px;
  }
}

@media (min-width: 1920px) {
  .nav-logo__icon {
    height: 24px;
    width: 21px;
  }
}

@media (min-width: 2000px) {
  .nav-logo__icon {
    height: 28px;
    width: 25px;
  }
}

.nav-logo__text {
  font-family: var(--font-sans);
  font-size: 15.385px;
  line-height: 19.615px;
  font-weight: 600;
  letter-spacing: -0.3077px;
  color: var(--color-text-dark);
}

@media (min-width: 768px) {
  .nav-logo__text {
    font-size: 20px;
    line-height: 25.5px;
    letter-spacing: -0.4px;
  }
}

@media (min-width: 1920px) {
  .nav-logo__text {
    font-size: 24px;
    line-height: 30px;
    letter-spacing: -0.48px;
  }
}

@media (min-width: 2000px) {
  .nav-logo__text {
    font-size: 28px;
    line-height: 36px;
    letter-spacing: -0.56px;
  }
}

/* Desktop Links */
.nav-links {
  display: none;
  align-items: center;
  gap: 1.5rem; /* 24px */
  font-family: var(--font-tight);
  font-size: 17px;
  line-height: 25.5px;
  letter-spacing: -0.34px;
  color: #000;
}

@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }
}

@media (min-width: 1920px) {
  .nav-links {
    gap: 2rem;
    font-size: 19px;
  }
}

@media (min-width: 2000px) {
  .nav-links {
    gap: 2.5rem;
    font-size: 22px;
    line-height: 30px;
  }
}

.nav-link {
  position: relative;
  white-space: nowrap;
  color: rgba(0, 0, 0, 0.7);
  transition: color 0.2s ease-out;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 1px;
  width: 100%;
  background-color: currentColor;
  transform-origin: right;
  transform: scaleX(0);
  transition: transform 0.2s ease-out;
}

@media (hover: hover) {
  .nav-link:hover {
    color: #000;
  }
  .nav-link:hover::after {
    transform-origin: left;
    transform: scaleX(1);
  }
}

/* Desktop CTA button */
.btn-ghost-cta.nav-cta {
  display: none !important;
  padding: 14px 12px 14px 20px;
}

@media (min-width: 1024px) {
  .btn-ghost-cta.nav-cta {
    display: inline-flex !important;
  }
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  cursor: pointer;
  transition: opacity 0.2s ease-out;
}

@media (hover: hover) {
  .mobile-menu-btn:hover {
    opacity: 0.6;
  }
}

@media (min-width: 1024px) {
  .mobile-menu-btn {
    display: none;
  }
}

.menu-icon {
  width: 24px;
  height: 24px;
}

/* Mobile Drawer */
.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.3s ease;
}

.mobile-nav-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.mobile-nav-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-nav-drawer.is-open .mobile-nav-backdrop {
  opacity: 1;
}

.mobile-nav-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 82%;
  max-width: 320px;
  height: 100%;
  background-color: var(--color-bg);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
  padding: 1.5rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-drawer.is-open .mobile-nav-content {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px dashed rgba(2, 2, 2, 0.12);
}

.mobile-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  font-size: 28px;
  line-height: 1;
  color: var(--color-text-dark);
  border-radius: 8px;
  transition: background-color 0.2s ease-out;
}

.mobile-close-btn:active {
  background-color: rgba(0, 0, 0, 0.06);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-nav-link {
  font-family: var(--font-tight);
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text-dark);
}

.mobile-cta {
  display: flex;
  width: 100%;
  justify-content: space-between;
  margin-top: auto;
}

/* ── Ghost / CTA Button Shared Styles ───────────────────────────────────── */
.btn-ghost-cta {
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-color: rgba(0, 0, 0, 0.02);
  padding: 14px 14px 14px 24px;
  transition: border-color 0.2s ease-out, background-color 0.2s ease-out;
  text-decoration: none;
}



@media (hover: hover) {
  .btn-ghost-cta:hover {
    border-color: rgba(0, 0, 0, 0.2);
    background-color: rgba(0, 0, 0, 0.05);
  }
}

.btn-ghost-cta__label {
  font-family: var(--font-lato);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -0.42px;
  white-space: nowrap;
  color: var(--color-text-dark);
}

/* Arrow Icon and Hover Microinteraction */
.arrow-icon-wrapper {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.2s ease-out;
}

.btn-ghost-cta:hover .arrow-icon-wrapper,
.btn-primary-dark:hover .arrow-icon-wrapper {
  transform: translateX(3px);
}

.arrow-icon-inner {
  position: absolute;
  inset: 28.66% 35.71% 23.78% 35.72%;
  display: block;
}

.arrow-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

/* ── Primary Dark Button ("Explore AI") ─────────────────────────────────── */
.btn-primary-dark {
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px 14px 14px 24px;
  transition: transform 0.2s ease-out;
  box-shadow:
    0px 63px 18px 0px rgba(16, 16, 16, 0),
    0px 40px 16px 0px rgba(11, 11, 11, 0.01),
    0px 23px 14px 0px rgba(8, 8, 8, 0.05),
    0px 10px 10px 0px rgba(5, 5, 5, 0.09),
    0px 3px 6px 0px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

@media (hover: hover) {
  .btn-primary-dark:hover {
    transform: translateY(-2px);
  }
}

.btn-primary-dark__gradient {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2) 4.0988%, rgba(255, 255, 255, 0) 43.902%),
    linear-gradient(90deg, rgb(41, 41, 41) 0%, rgb(41, 41, 41) 100%);
}

.btn-primary-dark__inset-shadow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0px 1px 1px 0px rgba(255, 255, 255, 0.3);
}

.btn-primary-dark__text {
  position: relative;
  font-family: var(--font-lato);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -0.32px;
  white-space: nowrap;
  color: #ffffff;
  margin-right: 8px;
}

/* ── Hero Section Content ───────────────────────────────────────────────── */
.hero-section {
  position: relative;
  z-index: 10;
  margin-left: auto;
  margin-right: auto;
  margin-top: clamp(44px, 7vh, 88px);
  display: flex;
  width: 100%;
  max-width: 480px;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem; /* 28px */
  padding-left: calc(var(--cell) + 16px);
  padding-right: calc(var(--cell) + 16px);
}

@media (min-width: 768px) {
  .hero-section {
    margin-top: 126px;
    max-width: 745px;
    gap: 2rem; /* 32px */
    padding-left: 73px;
    padding-right: 73px;
  }
}

@media (min-width: 1024px) {
  .hero-section {
    margin-top: 95.5px;
    max-width: 599px;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (min-width: 1920px) {
  .hero-section {
    margin-top: 128px;
    max-width: 760px;
    gap: 2.5rem; /* 40px */
  }
}

@media (min-width: 2000px) {
  .hero-section {
    margin-top: 176px;
    max-width: 940px;
    gap: 3rem; /* 48px */
  }
}

.hero-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem; /* 20px */
}

/* ── Badge ──────────────────────────────────────────────────────────────── */
.hero-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7.222px;
  border: 0.722px dashed rgba(2, 2, 2, 0.1);
  padding: 12px 16px;
}

/* Corner Ticks around the badge */
.corner-tick {
  position: absolute;
  width: 8.667px;
  height: 8.667px;
  border: 0 solid rgba(0, 0, 0, 0.2);
  margin: -0.722px;
}

.corner-tick--tl {
  top: 0;
  left: 0;
  border-top-width: 0.722px;
  border-left-width: 0.722px;
}

.corner-tick--tr {
  top: 0;
  right: 0;
  border-top-width: 0.722px;
  border-right-width: 0.722px;
}

.corner-tick--bl {
  bottom: 0;
  left: 0;
  border-bottom-width: 0.722px;
  border-left-width: 0.722px;
}

.corner-tick--br {
  bottom: 0;
  right: 0;
  border-bottom-width: 0.722px;
  border-right-width: 0.722px;
}

/* Diagonal texture pattern inside badge */
.badge-diagonal-pattern {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 44px;
  width: calc(100% - 16px);
  max-width: 222px;
  transform: translate(-50%, -50%);
  opacity: 0.05;
  background-image: url("assets/diagonal-lines.png");
  background-size: 5.056px 5.056px;
  pointer-events: none;
}

.badge-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.badge-text {
  font-family: var(--font-lato);
  font-size: clamp(12px, 3.4vw, 14px);
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -0.42px;
  color: var(--color-text-dark);
}

/* ── Headings ───────────────────────────────────────────────────────────── */
.hero-headings {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem; /* 16px */
}

.hero-title {
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(36px, 10.5vw, 48px);
  line-height: 1.08;
  font-weight: 400;
  letter-spacing: -1.32px;
  color: var(--color-text-dark);
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 68px;
    line-height: 77px;
    letter-spacing: -2.04px;
  }
}

@media (min-width: 1920px) {
  .hero-title {
    font-size: 86px;
    line-height: 97px;
    letter-spacing: -2.58px;
  }
}

@media (min-width: 2000px) {
  .hero-title {
    font-size: 106px;
    line-height: 120px;
    letter-spacing: -3.18px;
  }
}

.hero-description {
  width: 100%;
  max-width: 316px;
  text-align: center;
  font-family: var(--font-tight);
  font-size: clamp(15px, 4vw, 16px);
  line-height: 1.65;
  letter-spacing: -0.32px;
  color: var(--color-text-dark);
  opacity: 0.6;
}

@media (min-width: 768px) {
  .hero-description {
    max-width: 415px;
    font-size: 18px;
    line-height: 27px;
    letter-spacing: -0.36px;
  }
}

@media (min-width: 1920px) {
  .hero-description {
    max-width: 520px;
    font-size: 21px;
    line-height: 32px;
    letter-spacing: -0.42px;
  }
}

@media (min-width: 2000px) {
  .hero-description {
    max-width: 640px;
    font-size: 25px;
    line-height: 38px;
    letter-spacing: -0.5px;
  }
}

/* ── Hero Actions ───────────────────────────────────────────────────────── */
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 290px;
  gap: 0.75rem; /* 12px */
}

.hero-actions .btn-primary-dark,
.hero-actions .btn-ghost-cta {
  width: 100%;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .hero-actions {
    flex-direction: row;
    align-items: center;
    width: auto;
    max-width: none;
    gap: 1rem; /* 16px */
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .hero-actions .btn-primary-dark,
  .hero-actions .btn-ghost-cta {
    width: auto;
  }
}

/* ── Building Render & Particle Canvas ──────────────────────────────────── */
.building-wrapper {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  aspect-ratio: 753 / 571;
  width: calc(100% - (var(--cell) * 2));
  min-height: 220px;
  pointer-events: auto;
  touch-action: pan-y;
  
  /* Mask gradient for smooth fade at bottom */
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 var(--fade-start),
    rgba(0, 0, 0, 0.55) var(--fade-mid),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 var(--fade-start),
    rgba(0, 0, 0, 0.55) var(--fade-mid),
    transparent 100%
  );
}

@media (min-width: 768px) {
  .building-wrapper {
    position: absolute;
    left: 50%;
    margin-top: 0;
    margin-bottom: 0;
    min-height: 0;
    pointer-events: none;
    aspect-ratio: 1383 / 942;
    top: 60%;
    width: calc(100% - 104px);
    transform: translate(-50%, 3rem);
  }
}

@media (min-width: 1024px) {
  .building-wrapper {
    top: 100px;
    transform: translate(-50%, 0);
    width: calc(100% - 144px);
  }
}

@media (min-width: 2000px) {
  .building-wrapper {
    top: 350px;
    max-width: calc(2000px - 144px);
  }
}

/* Mobile Still Image (hidden now that interactive particle canvas runs on all devices) */
.building-mobile-still {
  display: none;
}

/* Particle Canvas Stage (visible across mobile, tablet, and desktop) */
.building-particles-stage {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

#building-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Entrance Animations (Reveal System) ────────────────────────────────── */
.reveal-item {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(6px);
  transition:
    opacity 0.9s var(--ease-spring),
    transform 0.9s var(--ease-spring),
    filter 0.9s var(--ease-spring);
  transition-delay: var(--delay, 0s);
  will-change: opacity, transform, filter;
}

.reveal-item.is-revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0px);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-item {
    transition: opacity 0.2s ease-out;
    filter: none !important;
    transform: none !important;
  }
  .reveal-item.is-revealed {
    opacity: 1;
  }
}

/* ── Custom Interactive Cursor (Disabled to match exact video recording) ─ */
.custom-cursor {
  display: none !important;
}
