/* ===================================================================
   pages/home.css — home page only (index.html)
   Loaded after assets/css/style.css, which holds everything shared.

   CONTENTS
    1. Splash screen
    2. Hero
    3. Project scroller (cards that slide sideways)
    4. Services list
    5. Stats
    6. Responsive rules
   =================================================================== */

/* ---------- 1. Splash screen (first visit per session) ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
  transition: transform 1s var(--ease-out);
}
.splash.is-done {
  transform: translateY(-101%);
}
.splash-logo {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.splash-logo svg {
  width: min(70vw, 720px);
  height: auto;
  overflow: visible;
}
.splash-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.splash-count {
  font-size: clamp(4rem, 14vw, 10rem);
  font-weight: 200;
  line-height: 0.8;
  letter-spacing: -0.05em;
}
.splash-label {
  color: var(--muted);
}

/* Splash logo: every line and fill uses one colour (the exported SVG mixes #f1f2f2 and #d1d3d4) */
.splash {
  --logo-ink: #f1f2f2;
}
.splash .gw-2,
.splash .gw-3,
.splash .gw-6,
.splash .gw-7,
.splash .gw-8,
.splash .gw-9 {
  stroke: var(--logo-ink);
}
.splash .gw-12 {
  fill: var(--logo-ink);
}

/* Line-drawing animation. JS gives every shape pathLength="1" and a --i index for the stagger. */
.logo-draw :is(path,line,polyline,circle,rect,ellipse) {
  opacity: 0;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  animation: draw-line 2.2s var(--ease-out) forwards, fade-in 0.9s ease forwards;
  animation-delay: calc(var(--i) * 11ms), calc(var(--i) * 11ms);
}
@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes fade-in {
  to {
    opacity: 1;
  }
}

/* ---------- 2. Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7rem 2rem 2.5rem;
  position: relative;
  overflow: hidden;
}
.hero-top,
.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  z-index: 2;
  gap: 1.5rem;
}
.hero-top {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.5rem;
}

/* Availability pill. Set <html data-availability="open | busy | closed"> to switch state. */
.availability-pill {
  --status-color: var(--status-open);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 100%;
  border: 1px solid var(--line);
  padding: 0.5rem 1rem;
  border-radius: 99px;
  font: 0.72rem/1.3 var(--font-mono);
  text-transform: uppercase;
  background: rgba(0, 36, 59, 0.5);
}
.availability-pill i {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-color);
}
.availability-pill i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--status-color);
  animation: status-ping 1.8s ease-out infinite;
}
/* @keyframes status-ping {
  from {
    transform: scale(1);
    opacity: 0.6;
  }
  to {
    transform: scale(3);
    opacity: 0;
  }
} */
.availability-pill b {
  display: none;
  font-weight: 500;
}
.availability-pill .status-open {
  display: inline;
}
html[data-availability="busy"] .availability-pill {
  --status-color: var(--status-busy);
}
html[data-availability="closed"] .availability-pill {
  --status-color: var(--status-closed);
}
html[data-availability="busy"] .availability-pill .status-open,
html[data-availability="closed"] .availability-pill .status-open {
  display: none;
}
html[data-availability="busy"] .availability-pill .status-busy,
html[data-availability="closed"] .availability-pill .status-closed {
  display: inline;
}
html[data-availability="closed"] .availability-pill i::after {
  animation: none;
  opacity: 0;
}

/* Big name headline. Sized by width AND height so the intro line below always fits on screen. */
.headline {
  font-size: clamp(5.5rem, 25vw, 27rem);
  font-size: clamp(5.5rem, min(25vw, calc((100vh - 22rem) / 1.64)), 27rem);
  font-size: clamp(5.5rem, min(25vw, calc((100svh - 22rem) / 1.64)), 27rem);
  line-height: 0.82;
  letter-spacing: -0.035em;
  font-weight: 700;
  position: relative;
  z-index: 2;
  margin: 2rem 0;
  pointer-events: none;
}
.headline-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  padding: 0.1em 0.08em 0.16em;
  margin: -0.1em -0.08em -0.16em;
}
.letter-slot {
  display: inline-block;
}
.js .letter-slot {
  transform: translateY(115%);
  transition: transform 1.2s var(--ease-out);
}
.js.is-ready .letter-slot {
  transform: none;
}

/* Each letter is lifted and lightened by --amount (0 to 1), which JS sets from the mouse distance. */
.letter {
  position: relative;
  display: inline-block;
  isolation: isolate;
  will-change: transform;
  transform: translateY(calc(var(--amount, 0) * -0.15em));
  color: rgb(calc(18 + var(--amount, 0) * 84) calc(73 + var(--amount, 0) * 59) calc(107 + var(--amount, 0) * 44));
}
.letter::before {
  content: attr(data-char);
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  color: var(--white);
  -webkit-text-stroke: max(4px, 0.018em) var(--white);
  paint-order: stroke fill;
}
.lead {
  font-size: clamp(1.15rem, 2vw, 1.8rem);
  line-height: 1.35;
  max-width: 30ch;
  letter-spacing: -0.01em;
  color: var(--grey);
}
.rotating-words {
  display: inline-block;
  position: relative;
  width: 6.6em;
  height: 1.36em;
  overflow: hidden;
  vertical-align: bottom;
  color: var(--white);
  font-weight: 600;
}
.rotating-words span {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(115%);
  visibility: hidden;
  will-change: transform;
}
.rotating-words .is-entering {
  visibility: visible;
  animation: word-in 0.8s var(--ease-out) forwards;
}
.rotating-words .is-leaving {
  visibility: visible;
  animation: word-out 0.8s var(--ease-out) forwards;
}
.rotating-words .is-static {
  visibility: visible;
  transform: none;
  animation: none;
}
@keyframes word-in {
  from {
    transform: translateY(115%);
  }
  to {
    transform: none;
  }
}
@keyframes word-out {
  from {
    transform: none;
  }
  to {
    transform: translateY(-115%);
  }
}

/* ---------- 3. Project scroller ---------- */

/* Tall section; the inner panel sticks while JS slides the cards sideways. JS sets the real height. */
.project-scroll {
  height: 380vh;
  position: relative;
}
.project-scroll-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.project-scroll-head {
  position: absolute;
  left: 2rem;
  top: 7rem;
  z-index: 2;
  max-width: 34vw;
}
.scroll-hint {
  margin-top: 1.5rem;
  color: var(--muted);
}
.project-scroll-track {
  display: flex;
  gap: 2rem;
  padding: 0 2rem 0 max(42vw, 420px);
  will-change: transform;
}
.project-card {
  flex: none;
  width: min(42vw, 560px);
  display: block;
  transition: transform 0.5s var(--ease-out);
}
.project-card .project-art {
  height: 60vh;
}
.project-card-meta {
  padding: 1.2rem 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 1rem;
}
.project-number {
  font: 0.75rem var(--font-mono);
  color: var(--muted);
  grid-row: 1/4;
  padding-top: 0.6rem;
}
.project-card-meta h3 {
  font-size: 2rem;
  letter-spacing: -0.03em;
}
.project-card-meta p {
  color: var(--grey);
}
.project-card-meta small {
  color: var(--muted);
}
.project-card--end {
  width: 28vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 2.2rem;
  font-weight: 700;
  border: 1px dashed var(--slate-light);
  border-radius: 20px;
  height: 60vh;
  transition: background 0.4s, color 0.4s;
}
.project-card--end:hover {
  background: var(--white);
  color: var(--navy);
}
.project-card--end svg {
  width: 56px;
}

/* ---------- 4. Services list ---------- */
.services {
  padding: 7rem 2rem;
}
.service-row {
  display: grid;
  grid-template-columns: 5rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.8rem 0;
  border-top: 1px solid var(--line);
  position: relative;
  isolation: isolate;
  transition: padding 0.6s var(--ease-out), color 0.4s;
}
.service-row:last-child {
  border-bottom: 1px solid var(--line);
}
.service-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--white);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.6s var(--ease-out);
  z-index: -1;
}
.service-row h3 {
  font-size: clamp(1.9rem, 5.5vw, 5rem);
  letter-spacing: -0.045em;
  line-height: 1;
  font-weight: 700;
}
.service-row p {
  color: var(--muted);
  max-width: 24ch;
  text-align: right;
}
.service-row .mono {
  color: var(--muted);
}
.service-row:hover {
  padding-inline: 1.6rem;
  color: var(--navy);
}
.service-row:hover::before {
  transform: scaleY(1);
}
.service-row:hover p,
.service-row:hover .mono {
  color: var(--slate);
}

/* ---------- 5. Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 0.85fr);
  gap: 2rem 3rem;
  align-items: end;
  padding: 3rem 2rem 7rem;
}
.stat b {
  font-size: clamp(4rem, 12vw, 11rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.05;
  display: block;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.stat b small {
  font-size: 0.5em;
  color: var(--slate-light);
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font-display);
  font-weight: 700;
}
.stat > span {
  font: 0.75rem var(--font-mono);
  text-transform: uppercase;
  color: var(--muted);
}
.stats-note {
  padding: 0 0 0.2rem 1.8rem;
  border-left: 1px solid var(--line);
  max-width: 36ch;
}
.stats-note p {
  color: var(--grey);
  font-size: clamp(1rem, 1.35vw, 1.3rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.stats-note a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.2rem;
  font: 0.75rem var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  border-bottom: 1px solid var(--white);
  padding-bottom: 0.25rem;
  transition: color 0.3s, border-color 0.3s;
}
.stats-note a:hover {
  color: var(--slate-light);
  border-color: var(--slate-light);
}

/* ---------- 6. Responsive rules ---------- */

/* Stats: the note drops under the two counters */
@media(max-width:1100px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-note {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 1.6rem 0 0;
    max-width: 46ch;
  }
}

/* Project scroller becomes a plain vertical list (also used for reduced motion) */
@media(max-width:800px),(prefers-reduced-motion:reduce) {
  .project-scroll {
    height: auto;
  }
  .project-scroll-sticky {
    position: static;
    height: auto;
    display: block;
    padding: 6rem 0 3rem;
  }
  .project-scroll-head {
    position: static;
    max-width: none;
    margin: 0 1.5rem 2rem;
  }
  .project-scroll-track {
    flex-direction: column;
    padding: 0 1.5rem;
    transform: none!important;
  }
  .project-card,
  .project-card--end {
    width: 100%;
  }
  .project-card .project-art,
  .project-card--end {
    height: 46vh;
  }
}

/* Phones */
@media(max-width:800px) {
  .hero,
  .stats {
    padding-inline: 1.2rem;
  }
  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .services {
    padding: 5rem 1.2rem;
  }
  .service-row {
    grid-template-columns: 2.5rem 1fr;
  }
  .service-row p {
    display: none;
  }
  .stats {
    grid-template-columns: 1fr;
  }
}
