/* ==========================================================================
   doddo.bio hero. That is the whole page (the nav lives in nav.css).
   ========================================================================== */

/* Fills the viewport exactly: nav and copy take what they need, .stage
   absorbs whatever is left. Nothing scrolls. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  /* One flat colour. Deep green on mint is 5.7:1. */
  background: var(--hero-bg);
}

/* ==========================================================================
   Hero copy
   ========================================================================== */

.hero__copy {
  position: relative;
  z-index: 5;
  flex: none;
  text-align: center;
  padding-top: clamp(var(--sp-16), 2.4vw, var(--sp-32));
}

/* Sentence case. Lowercase has ascenders and descenders, so it needs a
   little more leading than caps do, and it carries tighter negative tracking
   without the letters colliding. */
.hero__title {
  font-size: var(--t-hero);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.024em;
}

/* Half the gap below it, so the sub groups with the headline rather than the
   field. The optical gap drifts a few px with the rotating word (descenders
   in "photographers" reach lower than "brands"), which is normal: the margin
   is set off the baseline, not the ink. */
.hero__sub {
  margin-top: var(--sp-16);
  font-size: var(--t-sub);
  font-weight: 500;
  line-height: 1.4;
  color: var(--on-grad-75);
}

/* --- Rotating word --------------------------------------------------------
   The rotator is a block on its own line, so it spans the full headline width
   and every word centres inside it. Nothing above it can be pushed sideways,
   which is why no width measuring is needed here. All words share one grid
   cell so the row is only ever one line tall. */
.hero__title .l1 {
  display: block;
  font-size: 1.2em;
}

.hero__title .rotator {
  display: grid;
  justify-items: center;
  /* 0.9 of the headline size, so it tracks the clamp at every width */
  font-size: 0.9em;
  /* lighter than the 700 above it, so the rotating word reads as the
     changing part rather than a second headline */
  font-weight: 500;
}

/* Words arrive small and soft, settle into focus, then drift out slightly
   larger and blur away. Slower and gentler than a slide, and the blur keeps
   the two words from reading as a hard cut while they cross over. */
.rotator__word {
  grid-area: 1 / 1;
  /* Keeps "and many more" on one line so the shared row never grows to two,
     which would take the whole headline with it. */
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.92);
  filter: blur(8px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* current word */
.rotator__word.is-on {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* leaving: drifts a touch larger as it softens */
.rotator__word.is-out {
  opacity: 0;
  transform: scale(1.08);
  filter: blur(8px);
}

@media (prefers-reduced-motion: reduce) {
  .rotator__word {
    transition: none;
  }
}

/* ==========================================================================
   Claim field, sitting where the reference puts its CTA button
   ========================================================================== */

/* Deliberately larger than the gap above the sub: the sub belongs to the
   headline, the field is the next unit down. */
.claim {
  margin-top: var(--sp-32);
}

/* --- Wired nodes ----------------------------------------------------------
   Six nodes feeding into the field. The layer is absolutely positioned and
   centred on the bar, so it adds no height and cannot move the status line
   or the aside below it.

   Geometry lives in one viewBox (1000x260). Nodes are placed with the same
   percentages, so the SVG can stretch with preserveAspectRatio="none" and the
   two stay in register. Line ends are tucked under the nodes and under the
   bar, both of which are opaque, so a few px of drift never shows. */
.claim__wrap {
  position: relative;
}

.wires {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1040px, 96vw);
  height: 260px;
  z-index: 0;
  pointer-events: none;
}

.wires__lines {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgba(3, 89, 77, 0.28);
  stroke-width: 1.5;
  /* the box stretches, the hairline should not */
  vector-effect: non-scaling-stroke;
}

.node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--r-pill);
  background: var(--green);
  box-shadow: 0 6px 18px rgba(3, 89, 77, 0.22);
  transform: translate(-50%, -50%);
}

/* The files in icons/ carry their own hardcoded fills (#000, #0F0F0F,
   #758CA3), so they are used as masks rather than images: the shape comes
   from the file, the colour from background-color on the element. Recolouring
   never needs the files edited.

   Paths live here rather than in a style attribute on purpose. A url() inside
   a custom property resolves against the stylesheet that *uses* it, not the
   one that declares it, so an inline --ico resolved to /css/icons/ and 404'd.
   Declared here, ../icons/ is unambiguous. */
.ico {
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.ico--instagram {
  -webkit-mask-image: url("../icons/instagram.svg");
  mask-image: url("../icons/instagram.svg");
}

.ico--tiktok {
  -webkit-mask-image: url("../icons/tiktok.svg");
  mask-image: url("../icons/tiktok.svg");
}

.ico--spotify {
  -webkit-mask-image: url("../icons/spotify.svg");
  mask-image: url("../icons/spotify.svg");
}

.ico--youtube {
  -webkit-mask-image: url("../icons/youtube.svg");
  mask-image: url("../icons/youtube.svg");
}

.ico--github {
  -webkit-mask-image: url("../icons/github.svg");
  mask-image: url("../icons/github.svg");
}

.ico--figma {
  -webkit-mask-image: url("../icons/figma.svg");
  mask-image: url("../icons/figma.svg");
}

.node__ico {
  width: 26px;
  height: 26px;
  background: var(--white);
}

/* Optical sizing: these two read small at a common box because their
   artwork does not fill its viewBox the way the others do. */
.node--r1 .node__ico {
  width: 30px;
}

.node--r3 .node__ico {
  height: 28px;
}

/* Optical sizing: these two read small at a common box because their
   artwork does not fill its viewBox the way the others do. */
.node--r1 .node__ico {
  width: 30px; /* youtube: wide, short glyph */
}

.node--r3 .node__ico {
  height: 28px; /* figma: tall, narrow glyph */
}

/* x: 40/1000 and 960/1000 · y: 38, 130, 222 of 260 */
.node--l1,
.node--l2,
.node--l3 {
  left: 4%;
}

.node--r1,
.node--r2,
.node--r3 {
  left: 96%;
}

.node--l1,
.node--r1 {
  top: 14.6%;
}

.node--l2,
.node--r2 {
  top: 50%;
}

.node--l3,
.node--r3 {
  top: 85.4%;
}

/* The bar sits above the wires so the line ends disappear beneath it. */
.claim__bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  width: min(100%, 624px);
  margin-inline: auto;
  padding: var(--sp-8) var(--sp-8) var(--sp-8) var(--sp-16);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: 0 10px 30px rgba(3, 89, 77, 0.16);
  transition: box-shadow 0.2s ease;
}

.claim__bar:focus-within {
  box-shadow: 0 10px 30px rgba(3, 89, 77, 0.22),
    0 0 0 4px rgba(3, 89, 77, 0.22);
}

.claim__prefix {
  font-size: var(--t-field);
  font-weight: 500;
  color: var(--ink-45);
  user-select: none;
  white-space: nowrap;
}

.claim__input {
  flex: 1;
  min-width: 0;
  height: var(--sp-48);
  padding: 0;
  border: 0;
  background: none;
  font-size: var(--t-field);
  font-weight: 600;
  color: var(--ink);
}

.claim__input::placeholder {
  font-weight: 500;
  color: var(--ink-25);
}

.claim__input:focus {
  outline: none;
}

.claim__btn {
  flex: none;
}

.claim__status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  /* Reserved so the message can appear without shifting the aside below it.
     24px fits one line of --t-sm at 1.5 leading. */
  min-height: var(--sp-24);
  margin-top: var(--sp-8);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--on-grad-75);
}

.claim__status[data-tone="ok"] {
  color: var(--green);
}

.claim__status[data-tone="ok"] b {
  font-weight: 700;
}

.claim__status[data-tone="bad"] {
  color: var(--alert);
}

.claim__status svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.claim__wait {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(3, 89, 77, 0.25);
  border-top-color: var(--green);
  border-radius: 50%;
  flex: none;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.claim__suggests {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-8);
  margin-top: var(--sp-8);
}

/* Empty it is 0px tall, but the margin would still stack. */
.claim__suggests:empty {
  margin-top: 0;
}

.claim__suggest {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
  padding: 0 var(--sp-16);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.66);
  color: var(--green);
  font-size: var(--t-xs);
  font-weight: 600;
  transition: background-color 0.18s ease;
}

.claim__suggest:hover {
  background: var(--white);
}

/* ==========================================================================
   Stage: deliberately empty, reserved for whatever comes next
   ========================================================================== */

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: clamp(var(--sp-96), 14vw, 200px);
  display: flex;
  align-items: center;
}

/* ==========================================================================
   Reel: looping profile strip with a phone reading whatever passes behind it
   ========================================================================== */

/* Card and gap are read by js/landing.js to work out which card is centred,
   so these two are the single source of truth for the geometry. */
.reel {
  --card-w: 132px;
  --card-h: 176px;
  --card-gap: 20px;

  position: relative;
  width: 100%;
  /* Only as tall as the cards. The phone is taller and is allowed to hang
     out of the strip, which is why the y axis stays visible; sizing the reel
     around the phone instead pushed the hero past 100svh on short screens.
     .hero's own overflow catches anything past the viewport. */
  height: var(--card-h);
  overflow-x: clip;
  overflow-y: visible;
}

.reel__track {
  position: absolute;
  top: 50%;
  left: 0;
  display: flex;
  gap: var(--card-gap);
  transform: translate3d(0, -50%, 0);
  will-change: transform;
}

.pcard {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 20px;
  background: var(--tint);
  color: var(--green);
  font-size: 3.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 24px rgba(3, 89, 77, 0.14);
}

/* --- The phone, parked over the middle of the strip -----------------------
   Positioned against .stage, not .reel, so `height: 100%` means the leftover
   hero space and the device can never be taller than the room it has.
   container-type lets everything inside size in cqw, so the whole UI scales
   with the device instead of needing a breakpoint per part. */
.phone {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  /* Anchored to the top of the stage, not centred: at 1.3x it is taller
     than the space left in the hero, and cropping the bottom keeps the whole
     status bar, avatar and name visible. .hero's overflow does the cropping. */
  top: 0;
  height: clamp(420px, 68vh, 640px);
  aspect-ratio: 250 / 516;
  /* px, not cqw: an element cannot query its own container, so cqw here
     would resolve against the viewport rather than the device. Only the
     descendants below can use cqw. */
  padding: 4px;
  border-radius: 42px;
  background: #0d0f0e;
  box-shadow: 0 22px 50px rgba(3, 89, 77, 0.32);
  container-type: inline-size;
}

.phone__island {
  position: absolute;
  left: 50%;
  top: 4.4cqw;
  transform: translateX(-50%);
  z-index: 2;
  width: 27cqw;
  height: 7.4cqw;
  border-radius: var(--r-pill);
  background: #0d0f0e;
}

.phone__screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 4.5cqw 5.5cqw 2.5cqw;
  border-radius: 12.5cqw;
  background: var(--green-deep);
  color: var(--white);
  overflow: hidden;
}

.phone__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 4.4cqw;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.phone__status svg {
  width: 17cqw;
  height: auto;
}

.phone__avatar {
  display: grid;
  place-items: center;
  width: 34cqw;
  height: 34cqw;
  margin-top: 6cqw;
  border-radius: var(--r-pill);
  background: var(--tint, var(--mint));
  color: var(--green);
  font-size: 13cqw;
  font-weight: 700;
  transition: background-color 0.3s ease;
}

.phone__name {
  margin-top: 4cqw;
  font-size: 9.4cqw;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-align: center;
}

.phone__bio {
  margin-top: 1.6cqw;
  font-size: 4.3cqw;
  line-height: 1.5;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
}

.phone__ctas {
  display: flex;
  gap: 2.6cqw;
  width: 100%;
  margin-top: 5cqw;
}

.phone__cta {
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  height: 14cqw;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 3.4cqw;
  font-size: 6cqw;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.phone__cta--alt {
  flex: 0 0 26cqw;
  border-color: transparent;
  background: var(--tint, var(--mint));
}

.phone__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2.6cqw;
  width: 100%;
  margin-top: 4cqw;
}

.phone__grid li {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 3.2cqw;
  background: var(--white);
}

.phone__grid i {
  width: 60%;
  height: 60%;
  background: var(--green);
}

.phone__home {
  width: 32cqw;
  height: 1.1cqw;
  margin-top: auto;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.55);
}

/* Content cross-fades when the card behind the phone changes. */
.phone__avatar,
.phone__name,
.phone__bio,
.phone__cta--alt {
  transition: opacity 0.18s ease, background-color 0.3s ease;
}

.phone.is-swapping .phone__avatar,
.phone.is-swapping .phone__name,
.phone.is-swapping .phone__bio {
  opacity: 0;
}

@media (max-width: 700px) {
  .reel {
    --card-w: 104px;
    --card-h: 138px;
    --card-gap: 14px;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Below this the nodes would crowd the field, and they are decorative. */
@media (max-width: 1023px) {
  .wires {
    display: none;
  }
}

@media (max-width: 620px) {
  .claim__bar {
    flex-wrap: wrap;
    padding: var(--sp-8);
  }

  .claim__prefix {
    padding-left: var(--sp-8);
  }

  .claim__input {
    flex: 1 1 100px;
  }

  .claim__btn {
    width: 100%;
    margin-top: var(--sp-8);
  }
}
