/* ==========================================================================
   HUE — homepage styles
   Built mobile-first: the base rules describe the phone layout, and the
   @media blocks further down add the wider layouts on top.
   ========================================================================== */

/* ---------- 1. Design tokens (from the Figma variables) ------------------ */
:root {
  /* Colour */
  --cream:        #fffbef;
  --neutral-900:  #121012;
  --neutral-800:  #232124;
  --ink:          #262626;
  --nav-ink:      #312e2e;
  --hot-pink:     #ff0159;
  --pink-600:     #f93b8a;
  --pink-200:     #fed6e7;
  --pink-100:     #feeff5;
  --pink-50:      #fff7fa;
  --purple-50:    #f5e7fc;
  --purple-900:   #340949;
  --red:          #fd4b23;
  --blue:         #00eaf9;
  --red-gradient:  linear-gradient(to bottom, #fd4b23, #ff5ea1);
  --blue-gradient: linear-gradient(to bottom, #00eaf9, #00a7e5);

  /* Type. clamp(min, preferred, max) lets a size grow with the window
     between a phone-friendly minimum and the exact Figma size. */
  --font: "Raleway", system-ui, sans-serif;
  --fs-hero:    clamp(2.75rem, 11vw, 5.625rem);      /* 90px in Figma */
  --fs-title:   clamp(2.5rem, 4.75vw, 5.125rem);     /* 82px */
  --fs-stay:    clamp(2.25rem, 3.76vw, 4.0625rem);   /* 65px */
  --fs-h3:      clamp(1.875rem, 2.43vw, 2.625rem);   /* 42px */
  --fs-body:    clamp(1.0625rem, 1.273vw, 1.375rem); /* 22px */
  --fs-link:    clamp(1.25rem, 1.5vw, 1.625rem);     /* 26px */

  /* Layout */
  --gutter: clamp(1.25rem, 4vw, 3rem);  /* side padding on small screens */
}

/* ---------- 2. Base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--neutral-800);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.364;            /* 30px on 22px */
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid #00a7e5; outline-offset: 4px; }

/* The hero bands run off the right edge of the page; clip them there
   instead of letting the page scroll sideways. */
main { overflow-x: clip; }

/* Shared: text link followed by the little arrow icon */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-link);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.174;
  color: var(--neutral-900);
}
/* The icon is an inline SVG with two shapes: a dot and a quarter-circle "tail".
   On hover both drift right over 0.2 seconds, easing in, and the tail travels
   4px further than the dot so the gap between them opens up slightly. */
.arrow-icon { flex: none; width: 31px; height: 14px; overflow: visible; }
.arrow-dot, .arrow-tail { transition: transform .2s ease-in; }
.arrow-link:hover .arrow-dot,  .arrow-link:focus-visible .arrow-dot  { transform: translateX(6px); }
.arrow-link:hover .arrow-tail, .arrow-link:focus-visible .arrow-tail { transform: translateX(10px); }

/* Shared: big centred section heading */
.section-title {
  font-size: var(--fs-title);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.174;
  text-align: center;
  color: var(--neutral-900);
}

/* ---------- 3. Header ----------------------------------------------------- */
.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1728px;
  margin-inline: auto;
  padding: 1.25rem var(--gutter);
}
.site-logo img { width: 72px; height: auto; }

/* "Let's talk" button: a red pill with a blue pill peeking out behind it.
   Both pills are drawn with pseudo-elements so the link itself stays simple. */
.btn-talk {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  width: 174px;
  height: 52px;
  margin: 0 10px 0 0;          /* room at the right for the blue pill's offset; none below,
                                  so the red pill itself lines up with the logo's centre */
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.btn-talk::before, .btn-talk::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 500px;
  transition: translate .3s ease;
}
.btn-talk::before { z-index: -2; background: var(--blue-gradient); translate: 10px 10px; }
.btn-talk::after  { z-index: -1; background: var(--red-gradient); }
.btn-talk:hover::before,
.btn-talk:focus-visible::before { translate: 0 0; }   /* tucks in behind the red pill */

/* ---------- 4. Hero ------------------------------------------------------- */
.hero {
  position: relative;
  padding: 2rem var(--gutter) 3rem;
}
.hero h1 {
  max-width: 9em;
  font-size: var(--fs-hero);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.174;
  color: var(--ink);
  margin-bottom: 1.375rem;
}
.hero h1 em { font-style: normal; color: var(--hot-pink); }

/* The "stage" holds the two diagonal bands and the four quote cards.
   container-type lets children size themselves from the stage's own width
   (the cqw unit = 1% of the stage width), so the artwork scales as one piece. */
.hero-stage {
  container-type: inline-size;
  position: relative;
  max-width: 560px;
  margin: 3rem auto 0;
  --px: 1px;                   /* one Figma pixel, for the cards */
  --band: 0.10718cqw;          /* one Figma pixel, for the bands (933px stage) */
}

/* On small screens the bands are trimmed to the stage so they stay behind
   the cards; on desktop (section 9) they are let loose to run off the page. */
.bands { position: absolute; inset: -1rem calc(-1 * var(--gutter)); overflow: hidden; }
.bands .pill { translate: var(--gutter) 1rem; }

.pill {
  position: absolute;
  z-index: 0;
  width: calc(271 * var(--band));
  border-radius: 500px;
  rotate: -43.12deg;
}
/* Each band slides up along its own length, like a tower rising. `transform`
   is applied after `rotate`, so translateY here moves along the slanted band. */
.pill { animation: band-rise 2.4s cubic-bezier(.16, .8, .24, 1) both; }
.pill--blue { animation-delay: .1s; }
.pill--red  { animation-delay: .45s; }
@keyframes band-rise {
  from { transform: translateY(105%); }
  to   { transform: none; }
}
.pill--red  { background: var(--red);  left: calc(472.5 * var(--band)); top: calc(213 * var(--band));    height: calc(1654 * var(--band)); }
.pill--blue { background: var(--blue); left: calc(627.5 * var(--band)); top: calc(-191.5 * var(--band)); height: calc(1691 * var(--band)); }

.quotes {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.quote {
  display: flex;
  align-items: center;
  width: min(calc(388 * var(--px)), 100%);
  min-height: calc(100 * var(--px));
  padding: calc(12 * var(--px)) calc(20 * var(--px)) calc(12 * var(--px)) calc(18 * var(--px));
  gap: calc(16 * var(--px));
  background: #fff;
  border-radius: calc(10 * var(--px));
  box-shadow: 0 calc(10 * var(--px)) calc(10 * var(--px)) rgba(0, 0, 0, .15);
  font-size: calc(18 * var(--px));
  letter-spacing: -0.02em;
  line-height: 1.174;
  color: #000;
}
.quote p { text-wrap: balance; }                   /* even out the two lines of text */

.quote-logo {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: calc(65 * var(--px));
  height: calc(65 * var(--px));
}
/* Client logos come from Craft in any shape. Each is fitted inside a fixed box;
   giving the box a real width and height matters for SVGs, which often carry
   no size of their own and would otherwise collapse to nothing. */
.quote-logo img { width: calc(53 * var(--px)); height: calc(49 * var(--px)); max-width: none; object-fit: contain; }

/* The quotes are a deck of cards at every screen size. All of them sit in the
   same grid cell, and script.js gives each a data-pos: 0 = front, 1 and 2 =
   peeking out behind. Any other card waits, invisible, at the back.

   Every 5 seconds:
     1. the front card lifts up and fades out, staying on top while it goes
        (.is-leaving), which uncovers the card beneath it;
     2. the cards behind each ease forward one place;
     3. the card that left is slipped in at the back without animating
        (.is-resetting) and fades in there.
   Without JavaScript the cards simply stack in a column. */
.js .quotes {
  display: grid;
  max-width: 420px;
  margin-inline: auto;
  padding-bottom: 20px;                    /* room for the cards peeking out below */
}
.js .quote {
  grid-area: 1 / 1;
  align-self: stretch;
  width: 100%;
  /* the resting state of a waiting card: invisible, at the very back */
  opacity: 0;
  transform: translateY(30px) scale(.85);
  pointer-events: none;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .6s ease;
  will-change: transform, opacity;
}
.js .quote[data-pos="0"] { z-index: 3; opacity: 1;  transform: none; pointer-events: auto; }
.js .quote[data-pos="1"] { z-index: 2; opacity: .7; transform: translateY(10px) scale(.95); }
.js .quote[data-pos="2"] { z-index: 1; opacity: .4; transform: translateY(20px) scale(.9); }

.js .quote.is-leaving {
  z-index: 4;                              /* stays above the card it is uncovering */
  opacity: 0;
  transform: translateY(-28px);
  pointer-events: none;
  transition: transform .45s ease-in, opacity .45s ease-in;
}
.js .quote.is-resetting {
  transition: none;
  opacity: 0;
  transform: translateY(30px) scale(.85);
}

/* Below the desktop layout, give the bands some room around the deck */
@media (max-width: 1199.98px) {
  .js .hero-stage { padding-block: 2rem 2.5rem; }
}

/* ---------- 5. Our process ------------------------------------------------ */
.process {
  position: relative;
  max-width: calc(1170px + 2 * var(--gutter));
  margin-inline: auto;
  padding: clamp(4rem, 13vw, 14rem) var(--gutter) clamp(4rem, 8.7vw, 9.375rem);
  display: flex;
  flex-direction: column;
  gap: clamp(4rem, 6.65vw, 7.1875rem);   /* 115px between rows in Figma */
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
.feature-copy { max-width: 633px; }
.feature-copy h3,
.project-copy h3 {
  font-size: var(--fs-h3);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.174;
  color: var(--neutral-800);
  margin-bottom: 1.0625rem;
}
.feature-copy p + p { margin-top: 1.364em; }

.feature-graphic { align-self: center; width: min(70%, 442px); }
.feature-graphic svg { display: block; width: 100%; height: auto; overflow: visible; }

/* "Realistic planning" graphic: a red block tucked behind a blue outline */
.bold-box { position: relative; aspect-ratio: 435 / 378; }
.bold-box::before, .bold-box::after { content: ""; position: absolute; }
.bold-box::before { left: 0; top: 0; width: 31.72%; height: 31.48%; background: var(--red); }
.bold-box::after  { left: 4.83%; top: 5.56%; right: 0; bottom: 0; border: 2px solid var(--blue); }

/* Scroll-triggered animations (each plays once). script.js adds .js to <html>
   and .is-inview to a graphic when it scrolls into view.
   Square: the red block simply fades into place. */
.js [data-animate="square"] .bold-box::before { opacity: 0; }
.js [data-animate="square"].is-inview .bold-box::before { animation: fade-in .8s ease-out .1s forwards; }
@keyframes fade-in { to { opacity: 1; } }

/* Circle: the red arc travels once around the blue line and settles back
   where it started. The origin is the centre of the blue circle. */
.circle-arc { transform-box: view-box; transform-origin: 214.5px 194.5px; }
[data-animate="circle"].is-inview .circle-arc { animation: orbit 1.6s cubic-bezier(.65, 0, .35, 1) .1s both; }
@keyframes orbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Ship: the red booster flickers continuously (one flicker every 0.4s).
   The origin is where the flame meets the hull, so it stretches downward. */
.rocket-booster { transform-box: view-box; transform-origin: 219px 284px; }
.rocket-booster { animation: boost .4s ease-in-out infinite; }
@keyframes boost {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(.95, 1.14); opacity: .88; }
}

/* ---------- 6. Recent projects -------------------------------------------- */
.projects {
  position: relative;
  overflow: clip;                         /* trims the big soft glows */
  background: var(--purple-900);
  color: var(--pink-200);
  padding: clamp(4rem, 7.35vw, 7.9375rem) var(--gutter) clamp(5rem, 13.5vw, 14.5rem);
}
.projects-intro {
  max-width: 995px;
  margin: 0 auto clamp(3rem, 4vw, 4.5rem);
  text-align: center;
  color: var(--pink-100);
}
.projects-intro .section-title { color: inherit; margin-bottom: 1.875rem; }

.project {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 1460px;
  margin-inline: auto;
}
.project + .project { margin-top: clamp(5rem, 9vw, 9.5rem); }

.project-copy { position: relative; z-index: 2; max-width: 633px; }
.project-copy h3 { color: var(--pink-600); margin-bottom: 1.25rem; }
.project-copy .arrow-link { margin-top: 1.25rem; color: var(--purple-50); }
.project--ring .project-copy p { color: var(--pink-50); }

/* Every project graphic is a box with a fixed shape (aspect-ratio). The pieces
   inside are placed with percentages of that box, so the whole composition
   shrinks and grows together. */
.project-graphic { position: relative; width: 100%; max-width: 795px; align-self: center; order: -1; }  /* order: -1 puts the graphic above the title on small screens */
.project-graphic > * { position: absolute; }
.project-graphic .shot { z-index: 2; max-width: none; object-fit: cover; }   /* photos from Craft are cropped to the designed shape */
.project-graphic .glow { z-index: 0; pointer-events: none; }
.project-graphic .glow img { position: absolute; max-width: none; width: 311.64%; left: -105.82%; }

/* The three outline shapes (ring, frame, triangle) turn very slightly as the
   page scrolls. script.js sets --p on each .spin element: -1 when it is at the
   bottom of the screen, 0 in the middle, 1 at the top. That becomes -5deg to
   +5deg here, so the whole sweep is 10 degrees and the shape sits exactly as
   designed when it is centred. --base is the shape's own designed rotation. */
.spin { rotate: calc(var(--base, 0deg) + var(--p, 0) * 5deg); }

/* Layout 1 (ring): screenshot overlapping a ring */
.project--ring .project-graphic { aspect-ratio: 795 / 668; }
.project--ring .glow { left: 15.6%; top: -3.44%; width: 47.55%; height: 88.47%; }
.project--ring .glow img { top: -67.68%; height: 235.36%; }
.project--ring .ring { z-index: 1; left: 15.97%; top: 0; width: 84.03%; max-width: none; }
.project--ring .shot { left: 0; top: 14.97%; width: 78.74%; aspect-ratio: 626 / 468; }

/* Layout 2 (frame): screenshot overlapping a blue outlined frame */
.project--frame .project-graphic { aspect-ratio: 795 / 564; }
.project--frame .glow { left: 34.72%; top: -22.16%; width: 47.55%; height: 112.41%; }
.project--frame .glow img { top: -63.09%; height: 226.18%; }
.project--frame .frame { z-index: 1; left: 0; top: 0; width: 79%; height: 100%; border: 2px solid var(--blue); }
.project--frame .shot { left: 21.26%; top: 8.87%; width: 78.74%; aspect-ratio: 626 / 459; }

/* Layout 3 (triangle): screenshot in front of a large outlined triangle */
.project--triangle .project-graphic { aspect-ratio: 626 / 468; max-width: 626px; }
.project--triangle .glow { left: 23.32%; top: -19.23%; width: 60.38%; height: 119.23%; }
.project--triangle .glow img { top: -71.68%; height: 243.36%; }
.project--triangle .triangle {
  z-index: 1;
  left: 7.67%;
  top: -60.04%;
  width: 161.34%;
  aspect-ratio: 1;
  --base: -90deg;              /* the Figma triangle points up; this turns it to point left */
}
.project--triangle .triangle img { position: absolute; left: 6.7%; top: 0; width: 86.6%; height: 75%; max-width: none; }
.project--triangle .shot { inset: 0; width: 100%; height: 100%; }

/* ---------- 7. Footer ----------------------------------------------------- */
.site-footer {
  padding: clamp(4rem, 7.3vw, 7.875rem) var(--gutter) clamp(2.5rem, 3.5vw, 3.75rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stay { max-width: 1023px; text-align: center; }
.stay h2 {
  font-size: var(--fs-stay);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.174;
  color: var(--neutral-900);
  margin-bottom: 1.875rem;
}
.stay-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2.75rem;
  margin-top: 1.25rem;
}
.stay-links .arrow-link { color: var(--neutral-800); }

.footer-rule { width: min(1157px, 100%); height: 1px; margin: clamp(3rem, 6.2vw, 6.6875rem) 0 clamp(2.5rem, 4vw, 4.3125rem); object-fit: cover; }

.reno { width: min(316px, 100%); height: auto; }   /* 60% of the 526px Figma size */
.copyright { margin-top: clamp(2.5rem, 3.8vw, 4.125rem); text-align: center; }

/* ==========================================================================
   8. Tablet and up: larger logo, side-by-side rows
   ========================================================================== */
@media (min-width: 760px) {
  .site-header { padding-block: 2rem; }
  .site-logo img { width: 102px; }
}

@media (min-width: 900px) {
  /* Process rows: copy and graphic side by side */
  .feature {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: clamp(2.5rem, 5vw, 5.5rem);
  }
  .feature-copy { flex: 0 1 633px; }
  .feature-graphic { flex: 0 1 auto; align-self: flex-start; width: auto; }
  .feature--flip { flex-direction: row-reverse; }
  .feature--circle { max-width: 1094px; }
  .feature--circle .feature-graphic { max-width: 409px; }
  .feature--box .feature-graphic { flex: 0 1 435px; }
  .feature--rocket .feature-graphic { max-width: 442px; margin-top: 2rem; }

  /* Project rows */
  .project {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1.5rem, 3.5vw, 3.75rem);
  }
  .project--flip { flex-direction: row-reverse; }
  .project-copy { flex: 0 1 633px; }
  .project--frame .project-copy { flex-basis: 596px; }
  .project-graphic { flex: 1 1 0; align-self: center; order: 0; }   /* back to its natural place beside the copy */
  .project--triangle { justify-content: flex-start; gap: 29px; }
  .project--triangle .project-graphic { flex: 0 1 626px; }
}

/* ==========================================================================
   9. Desktop (1200px+): the hero composition from the Figma frame
   --hu is 1/100 of the 1728px design width, so the hero scales in proportion
   with the window and stops growing at the design size.
   ========================================================================== */
@media (min-width: 1200px) {
  /* The header floats over the top of the hero, so the hero can use the whole
     first screen and centre its contents on it. */
  .site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 42px 36px 0 47px;
  }

  /* The hero is at least one full screen tall (100svh), and never so short
     that the cards would run into the header. align-items centres the
     headline block vertically on that screen. */
  .hero {
    --hu: min(1vw, 17.28px);
    display: flex;
    align-items: center;
    max-width: 1728px;
    margin-inline: auto;
    padding: 0;
    min-height: max(100svh, calc(160px + 40.1 * var(--hu)));
  }
  .hero-copy {
    padding: 0 0 0 calc(15.05 * var(--hu));
    width: calc(15.05 * var(--hu) + 34.6 * var(--hu));
  }
  .hero h1 { font-size: calc(5.208 * var(--hu)); max-width: none; }

  /* The stage is placed so that a point 20.06hu below its top (38% of its
     height) sits on the same centre line as the headline. The quote deck is
     centred on that point. */
  .hero-stage {
    position: absolute;
    left: calc(46.01 * var(--hu));
    top: calc(50% - 20.06 * var(--hu));
    width: calc(54 * var(--hu));
    height: calc(52.78 * var(--hu));
    max-width: none;
    margin: 0;
    --px: 0.10718cqw;          /* cards now scale with the stage too */
  }
  .bands { inset: 0; overflow: visible; }
  .bands .pill { translate: none; }
  /* The deck sits in the middle of the stage, over the bands. top: 38% is the
     stage's centre line (the same line the headline is centred on), and the
     translate pulls the deck back by half its own size so its middle lands
     exactly there. */
  .quotes,
  .js .quotes {
    position: absolute;
    --px: calc(0.10718cqw * 1.3);   /* cards are 1.3x their Figma size here; change the 1.3 to resize */
    left: 50%;
    top: 38%;
    translate: -50% -50%;
    width: calc(388 * var(--px));
    max-width: none;
    margin: 0;
    padding-bottom: 0;
  }
}

/* Respect the "reduce motion" accessibility setting: no movement at all */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-animate="square"] .bold-box::before { opacity: 1; }
  .spin { rotate: var(--base, 0deg); }
}
