/* ==========================================================================
   Luis Federici: main stylesheet
   Mobile-first. Breakpoints: 700px and 1000px.
   ========================================================================== */

/* ---------- 0. Fonts ---------- */
/* Served from this site (SIL Open Font License, see fonts/OFL-*.txt), so visitors' browsers
   never contact Google. File names carry a content hash, so they're cached for a year. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 100 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin.056e4e2459.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 100 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext.ae1d854fef.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 400 900; font-display: swap; src: url(/fonts/schibsted-grotesk-latin.e3b56e9051.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 400 900; font-display: swap; src: url(/fonts/schibsted-grotesk-latin-ext.f5df746dbc.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- 1. Tokens ---------- */
:root {
  /* Paper and ink */
  --bg:       #f6f3ee;
  --bg-raise: #ece8e1;
  --line:     #dcd6cc;
  --text:     #16181d;
  --muted:    #55524c;
  --faint:    #6b655f;

  /* Main accent: cobalt */
  --accent:    #2446c4;
  --accent-hi: #1b3799;
  --accent-bright: #3a6df0; /* cobalt lifted for use on the dark ink sections */
  --on-accent: #ffffff;

  /* Supporting colours */
  --sun:        #ffd23f;
  --sun-hi:     #f4c417;
  --live:       #36c46a;

  /* Dark sections */
  --ink:          #16181d;
  --ink-raise:    #21252d;
  --ink-line:     #323741;
  --on-ink:       #f3f1ec;
  --on-ink-muted: #a2a7b1;

  --danger: #b42318;

  --display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --sans:    "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter:    1.25rem;
  --container: 76rem;
  --section-y: clamp(4rem, 9vw, 7rem);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

p { text-wrap: pretty; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--on-accent); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: var(--bg);
  z-index: 30; /* above the sticky header */
}
.skip-link:focus { top: 1rem; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- 3. Links & buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.btn:hover { background: var(--accent-hi); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover { background: #2b2f38; }

.btn-sun { background: var(--sun); color: var(--ink); }
.btn-sun:hover { background: var(--sun-hi); }

.text-link,
.form-note a,
.site-footer a,
.contact-email {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: text-decoration-color 150ms ease;
}
.text-link:hover,
.form-note a:hover,
.site-footer a:hover,
.contact-email:hover { text-decoration-color: currentColor; }

.text-link { font-family: var(--display); font-weight: 600; }

/* ---------- 4. Header ---------- */
/* Sticks to the top; main.js hides it on scroll down and brings it back on scroll up */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  transition: transform 350ms cubic-bezier(0.2, 0.7, 0.1, 1), box-shadow 200ms ease;
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.site-header.is-hidden { transform: translateY(-100%); }

.header-inner {
  display: flex;
  flex-wrap: wrap; /* name and nav stack on very narrow phones */
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
}

.nav-list {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1.25rem;
  font-size: 0.9375rem;
}

.nav-list a {
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease;
}
.nav-list a:hover { color: var(--text); }

.nav-wide { display: none; }

/* ---------- 5. Hero ---------- */
.hero { padding-block: clamp(2.5rem, 8vw, 6rem) clamp(3rem, 6vw, 4.5rem); }

/* Limited-time offer tag */
.offer-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.4rem 0.75rem;
  background: var(--sun);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 3px;
}

.offer-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ink);
  animation: pulse 1.8s ease-in-out infinite;
}

/* Inside the h1, but looks like the body text line it used to be */
.hero h1 .hero-kicker {
  display: block;
  max-width: 34rem;
  margin-bottom: 1.25rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: normal;
  color: var(--muted);
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  max-width: 14ch;
}

.hero-bottom {
  display: grid;
  gap: 2rem;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
}

.lead {
  max-width: 34rem;
  font-size: 1.125rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}

.facts {
  display: grid;
  gap: 1.25rem;
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.facts dt { font-size: 0.875rem; color: var(--faint); }
.facts dd { margin-top: 0.15rem; font-weight: 500; }

/* Keeps the highlighted words and the full stop on one line */
.nowrap { white-space: nowrap; }

/* Highlighted words: a block of accent sweeps across like a text selection */
.hero h1 mark {
  color: var(--on-accent);
  background: linear-gradient(var(--accent), var(--accent)) no-repeat left center / 100% 100%;
  padding-inline: 0.04em;
  margin-inline: -0.04em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- 6. Hero phones ---------- */
.phones {
  display: flex;
  justify-content: center;
  align-items: flex-start; /* stretching would break the phone aspect ratio */
  gap: clamp(0.75rem, 2.5vw, 2rem);
  margin-top: clamp(1.5rem, 5vw, 3rem);
  padding-block: 2rem 3rem;
}

.phone {
  box-sizing: content-box; /* bezel sits outside the 390:844 screen, so nothing is cropped */
  flex: 0 1 clamp(6.5rem, 26vw, 14rem);
  aspect-ratio: 390 / 844;
  border: clamp(5px, 0.7vw, 9px) solid var(--ink);
  border-radius: clamp(1.25rem, 2.6vw, 2.25rem);
  overflow: hidden;
  background: var(--bg-raise);
  box-shadow: 0 24px 40px -24px rgba(22, 24, 29, 0.4);
  transform: translate3d(0, var(--y, 0px), 0);
  will-change: transform;
}

.phone:nth-child(even) { margin-top: 3.5rem; }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phone:nth-child(4) { display: none; }

/* ---------- 7. Sections ---------- */
.section { padding-block: var(--section-y); }
.section-rule { border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-head h2,
.split-label,
.included-title,
.process-title,
.contact-intro h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); }

.section-head p { color: var(--muted); }

/* Label column + content column */
.split { display: grid; gap: 2rem; }

/* ---------- 8. Work ---------- */
.work-expand { list-style: none; padding: 0; display: grid; gap: 3.5rem 2rem; }

.work-item-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-raise);
}

/* Shows the top of each full-page screenshot; the frame crops the rest */
.work-item-frame img { width: 100%; height: auto; }

.work-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.work-item-meta h3 { font-size: 1.5rem; }
.project-type { font-size: 0.875rem; color: var(--faint); }

.work-item-copy { margin-top: 1.25rem; }
.work-link { display: inline-block; margin-top: 0.75rem; }
.work-item-label { display: none; }

.project-desc {
  margin-top: 0.5rem;
  max-width: 34rem;
  color: var(--muted);
}

/* Desktop only: a filmstrip that expands the hovered or focused item,
   revealing the caption as an overlay. Below 1000px there's no reliable
   hover, so it stays the plain stacked layout above. */
@media (min-width: 1000px) {
  .work-expand {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    height: clamp(20rem, 26vw, 30rem);
    overflow: hidden;
  }

  .work-item {
    position: relative;
    flex: 1 1 0%;
    min-width: 3.5rem;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: flex-grow 700ms cubic-bezier(0.65, 0, 0.35, 1);
  }

  /* Outranks .js [data-reveal], whose transition would otherwise replace
     the flex-grow one and make the width jump instead of slide */
  .js .work-expand .work-item {
    transition:
      opacity 800ms ease var(--delay, 0ms),
      transform 900ms cubic-bezier(0.2, 0.7, 0.1, 1) var(--delay, 0ms),
      flex-grow 700ms cubic-bezier(0.65, 0, 0.35, 1);
  }

  .work-item:hover,
  .work-item:focus,
  .work-item:focus-within,
  .work-item.is-active { flex-grow: 5; }

  .work-item-frame {
    position: absolute;
    inset: 0;
    border: 0;
    border-radius: inherit;
    aspect-ratio: auto;
  }

  .work-item-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 1200ms cubic-bezier(0.2, 0.7, 0.1, 1), filter 450ms ease;
  }

  /* The open screenshot drifts in slightly */
  .work-item:hover .work-item-frame img,
  .work-item:focus .work-item-frame img,
  .work-item.is-active .work-item-frame img { transform: scale(1.06); }

  /* The rest step back while one is open */
  .work-expand:is(:hover, :focus-within, :has(.is-active)) .work-item:not(:hover, :focus, .is-active) .work-item-frame img {
    filter: brightness(0.7) saturate(0.75);
  }

  .work-item-copy {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin-top: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(22, 24, 29, 0.85), rgba(22, 24, 29, 0.15) 55%, transparent 75%);
    opacity: 0;
    transition: opacity 250ms ease;
  }

  .work-item:hover .work-item-copy,
  .work-item:focus .work-item-copy,
  .work-item:focus-within .work-item-copy,
  .work-item.is-active .work-item-copy {
    opacity: 1;
    transition-delay: 150ms;
  }

  /* Caption lines rise in one after another */
  .work-item-copy h3,
  .work-item-copy .project-type,
  .work-item-copy .project-desc {
    color: #fff;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 250ms ease, transform 250ms ease;
  }
  .work-item-copy .project-type { color: rgba(255, 255, 255, 0.75); }
  .work-item-copy .project-desc { color: rgba(255, 255, 255, 0.85); max-width: 26rem; }

  .work-item:is(:hover, :focus, .is-active) .work-item-copy :is(h3, .project-type, .project-desc) {
    opacity: 1;
    transform: none;
    transition: opacity 400ms ease, transform 600ms cubic-bezier(0.2, 0.7, 0.1, 1);
  }
  .work-item:is(:hover, :focus, .is-active) .work-item-copy h3 { transition-delay: 220ms; }
  .work-item:is(:hover, :focus, .is-active) .work-item-copy .project-type { transition-delay: 290ms; }
  .work-item:is(:hover, :focus, .is-active) .work-item-copy .project-desc { transition-delay: 360ms; }

  /* The link can't be clicked or tabbed to while its card is closed and invisible */
  .work-item-copy .work-link {
    color: #fff;
    text-decoration-color: rgba(255, 255, 255, 0.5);
    visibility: hidden;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 250ms ease, transform 250ms ease, visibility 0s linear 250ms;
  }
  .work-item:is(:hover, :focus, :focus-within, .is-active) .work-item-copy .work-link {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 400ms ease 430ms, transform 600ms cubic-bezier(0.2, 0.7, 0.1, 1) 430ms, visibility 0s;
  }
  .work-item:focus-within .work-item-copy :is(h3, .project-type, .project-desc) { opacity: 1; transform: none; }

  /* Name tag on the collapsed strips, so they stay identifiable */
  .work-item-label {
    display: block;
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    padding: 0.5rem 0.3rem;
    border-radius: 3px;
    background: rgba(22, 24, 29, 0.6);
    color: #fff;
    font-family: var(--display);
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1;
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: rotate(180deg) translateY(-8px);
    opacity: 0;
    transition: opacity 250ms ease, transform 400ms cubic-bezier(0.2, 0.7, 0.1, 1);
    pointer-events: none;
  }

  .work-expand:is(:hover, :focus-within, :has(.is-active)) .work-item:not(:hover, :focus, .is-active) .work-item-label {
    opacity: 1;
    transform: rotate(180deg);
    transition-delay: 200ms;
  }
}

/* ---------- 9. Moving band ---------- */
.band {
  overflow: hidden;
  background: var(--ink);
  color: var(--on-ink);
  padding-block: clamp(1.75rem, 4vw, 3rem);
}

.band-track {
  white-space: nowrap;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 7.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  transform: translate3d(var(--x, 0px), 0, 0);
  will-change: transform;
}

.band-track span { color: var(--sun); padding-inline: 0.2em; }

/* ---------- 10. Offer ---------- */
.offer {
  background: var(--sun);
  color: var(--ink);
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

.offer-inner { display: grid; gap: 1.5rem; }

.offer-kicker {
  font-family: var(--display);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.offer h2 {
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.offer-body p { font-size: 1.125rem; max-width: 32rem; }
.offer-body p + p { margin-top: 0.75rem; font-weight: 600; }
.offer-body .btn { margin-top: 1.75rem; }

/* ---------- 11. Services ---------- */
.row {
  padding-block: 1.75rem;
  border-top: 1px solid var(--line);
}
.row:first-child { padding-top: 0; border-top: 0; }

.row h3 { font-size: 1.625rem; margin-bottom: 0.625rem; }
.row p { color: var(--muted); max-width: 38rem; }

/* ---------- 12. Every site includes ---------- */
.included-title { margin-bottom: clamp(2rem, 4vw, 3rem); }

.included {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.included li {
  padding: 1.5rem;
  border-radius: 10px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
}

.included h3 { font-size: 1.3125rem; margin-bottom: 0.375rem; }
.included p { color: var(--muted); }
.included .included-note { margin-top: 0.75rem; font-size: 0.8125rem; color: var(--faint); }

/* ---------- 13. Process (dark) ---------- */
.process {
  background: var(--ink);
  color: var(--on-ink);
}

.process-title { margin-bottom: clamp(2rem, 5vw, 3.5rem); }

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 3rem 2rem;
}

.steps li { position: relative; }

.step-num {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--sun);
  margin-bottom: 0.375rem;
}

.steps h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.steps p { color: var(--on-ink-muted); }

/* Little illustrated UIs, one per step */
.ui {
  height: 9rem;
  margin-bottom: 1.5rem;
  padding: 0.875rem;
  border-radius: 10px;
  background: var(--ink-raise);
  border: 1px solid var(--ink-line);
  overflow: hidden;
}

/* 01: video call */
.ui-call { display: flex; flex-direction: column; gap: 0.625rem; }
.ui-tiles { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.ui-tile {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px transparent;
  transition: box-shadow 150ms ease;
}
/* Active-speaker outline, toggled by main.js */
.ui-tile.is-speaking { box-shadow: inset 0 0 0 2px var(--live); }
.tile-a { background: var(--accent-bright); }
.tile-b { background: #3a3f4a; }

.ui-initial {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1;
  color: #fff;
  transform: translateX(0.06em); /* the stem makes an L look left of centre */
}

.ui-name {
  position: absolute;
  left: 0.4rem;
  bottom: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
}

/* Profile circles, shared by the call and the chat */
.ui-avatar {
  position: relative;
  z-index: 1; /* sits above the chat bubble tails */
  flex: none;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1;
}
.ui-avatar-lg { width: 2.5rem; height: 2.5rem; font-size: 1.0625rem; }
.ui-avatar svg { width: 60%; height: 60%; }
.avatar-luis { background: var(--sun); color: var(--ink); }
.avatar-you { background: #4a505c; color: var(--on-ink-muted); }
.ui-controls { display: flex; justify-content: center; gap: 0.5rem; }
.ui-controls span { width: 1.375rem; height: 1.375rem; border-radius: 50%; background: #3a3f4a; }
.ui-controls .end { background: #e5484d; }

/* 02: code editor */
.ui-bar { display: flex; align-items: center; gap: 0.3rem; margin-bottom: 0.875rem; }
.ui-bar i { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; }
.ui-bar i:nth-child(1) { background: #ff5f57; }
.ui-bar i:nth-child(2) { background: #febc2e; }
.ui-bar i:nth-child(3) { background: #28c840; }
.ui-lines { display: grid; gap: 0.55rem; }
.ui-lines span {
  display: block;
  height: 0.5rem;
  width: var(--w);
  border-radius: 2px;
  transform-origin: left;
}
.ui-lines .c1 { background: var(--accent-bright); }
.ui-lines .c2 { background: var(--sun); }
.ui-lines .c3 { background: rgba(243, 241, 236, 0.35); }

/* 03: revision chat */
/* Shown from the client's phone: their message on the right, Luis on the left */
.ui-refine { display: flex; flex-direction: column; justify-content: center; gap: 0.625rem; }
.ui-row { display: flex; align-items: flex-end; gap: 0.5rem; }
.ui-row-me { justify-content: flex-end; padding-right: 0.3rem; }
.ui-slot { position: relative; min-width: 0; }

.ui-msg {
  position: relative;
  max-width: 85%;
  padding: 0.4rem 0.7rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  line-height: 1.3;
}
.ui-slot .ui-msg { max-width: none; }

/* Bubble tails: a curved nub, then a cutout in the card colour that shapes it */
.ui-msg::before,
.ui-msg::after {
  content: "";
  position: absolute;
  bottom: 0;
  height: 0.95rem;
}

.steps .ui-msg-me { background: var(--accent-bright); color: #fff; }
.ui-msg-me::before { right: -0.3rem; width: 0.8rem; background: var(--accent-bright); border-bottom-left-radius: 0.65rem 0.55rem; }
.ui-msg-me::after { right: -1rem; width: 1rem; background: var(--ink-raise); border-bottom-left-radius: 0.4rem; }

.steps .ui-msg-them { background: #3a3f4a; color: var(--on-ink); }
.ui-msg-them::before { left: -0.3rem; width: 0.8rem; background: #3a3f4a; border-bottom-right-radius: 0.65rem 0.55rem; }
.ui-msg-them::after { left: -1rem; width: 1rem; background: var(--ink-raise); border-bottom-right-radius: 0.4rem; }

/* "Luis is typing" bubble, shown in the reply's spot until the reply lands */
.ui-typing {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  gap: 0.2rem;
  padding: 0.55rem 0.7rem;
  border-radius: 1rem;
  background: #3a3f4a;
  opacity: 0;
}
.ui-typing i {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--on-ink-muted);
  animation: typing-dot 1s ease-in-out infinite;
}
.ui-typing i:nth-child(2) { animation-delay: 150ms; }
.ui-typing i:nth-child(3) { animation-delay: 300ms; }

@keyframes typing-dot {
  0%, 60%, 100% { transform: none; opacity: 0.5; }
  30%           { transform: translateY(-3px); opacity: 1; }
}

@keyframes typing-show {
  0%   { opacity: 0; transform: translateY(6px); }
  15%  { opacity: 1; transform: none; }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}

/* 04: launch */
.ui-launch { display: flex; flex-direction: column; justify-content: center; gap: 0.875rem; }
/* Address bar, shaped like a browser's */
.ui-url {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  background: #2c313b;
  font-size: 0.875rem;
  line-height: 1.2;
  color: var(--on-ink);
}
.ui-url svg { width: 0.85rem; height: 0.85rem; color: var(--live); flex: none; }
.ui-url .ui-reload { margin-left: auto; color: var(--on-ink-muted); }

.steps .ui-live {
  display: flex;
  align-items: center;
  gap: 0.6rem; /* set by eye: "Live" lines up under the domain */
  padding-left: 1rem; /* set by eye: dot sits under the lock */
  font-family: var(--display);
  font-weight: 600;
  line-height: 1;
  color: var(--live);
}
.steps .ui-live .live-dot { position: relative; top: 0.03em; /* optical: centred on the letters, not the line box */ }
.live-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.8); }
}

/* ---------- 14. About ---------- */
.about-body { max-width: 40rem; }

.about-lead {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.about-body p:not(.about-lead) { color: var(--muted); }
.about-body p:not(.about-lead) + p { margin-top: 1rem; }

/* ---------- 14b. FAQ ---------- */
.faq { border-bottom: 1px solid var(--line); }

.faq details { border-top: 1px solid var(--line); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.25rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }

.faq summary h3 { font-size: 1.1875rem; line-height: 1.3; }

/* Plus sign drawn from two bars; the vertical one folds away when open */
.faq summary::after {
  content: "";
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
  color: var(--muted);
  transition: background-size 250ms ease, color 150ms ease;
}
.faq details[open] summary::after {
  background-size: 100% 1.5px, 1.5px 0;
}
.faq summary:hover::after { color: var(--text); }

.faq details p {
  max-width: 38rem;
  padding-bottom: 1.5rem;
  color: var(--muted);
}

/* ---------- 15. Contact (cobalt) ---------- */
.contact {
  background: var(--accent);
  color: #fff;
}

.contact-grid { display: grid; gap: 3rem; }

.contact-intro p {
  margin-top: 1rem;
  max-width: 28rem;
  color: rgba(255, 255, 255, 0.8);
}

.contact-email {
  display: inline-block;
  margin-top: 1.75rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  text-decoration-color: rgba(255, 255, 255, 0.4);
}

.contact-form { display: grid; gap: 1.75rem; }
.field-pair { display: grid; gap: 1.75rem; }
.field { display: grid; gap: 0.25rem; }

.field label { font-size: 0.875rem; color: rgba(255, 255, 255, 0.8); }
.optional { color: rgba(255, 255, 255, 0.55); margin-left: 0.25rem; }

/* Underline-style inputs */
.field input,
.field textarea {
  width: 100%;
  padding: 0.5rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0;
  font-size: 1.0625rem;
  color: #fff;
  transition: border-color 150ms ease;
}

.field textarea { resize: vertical; min-height: 6.5rem; }
.field input::placeholder { color: rgba(255, 255, 255, 0.5); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: #fff;
}

.contact :focus-visible { outline-color: var(--sun); }

.field.has-error input,
.field.has-error textarea { border-bottom-color: var(--sun); }

.field-error { font-size: 0.8125rem; color: var(--sun); }
.field-error:empty { display: none; }

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  cursor: pointer;
}

.checkbox input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--sun);
}

/* Honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.form-status { font-size: 0.9375rem; }
.form-status:empty { display: none; }
.form-status.is-success { color: #fff; }
.form-status.is-error { color: var(--sun); }

.form-note { font-size: 0.875rem; color: rgba(255, 255, 255, 0.7); }
.form-note a { text-decoration-color: rgba(255, 255, 255, 0.4); }

/* ---------- 16. Footer (ink) ---------- */
.site-footer {
  background: var(--ink);
  color: var(--on-ink-muted);
  padding-block: 2rem 2.5rem;
  font-size: 0.875rem;
}

.site-footer a { text-decoration-color: var(--ink-line); }
.site-footer a:hover { color: var(--on-ink); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.footer-inner p:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* ---------- 17. Legal pages (privacy, EULA, DMCA) ---------- */
.legal {
  max-width: 44rem;
  padding-block: clamp(2rem, 6vw, 4rem) var(--section-y);
}

.legal h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); }
.legal h2 { font-size: 1.5rem; margin-top: 2.5rem; }
.legal h3 { font-size: 1.125rem; margin-top: 1.75rem; }
.legal p, .legal li { color: var(--muted); margin-top: 0.75rem; }
.legal ul { padding-left: 1.25rem; }
.legal a { color: var(--text); text-underline-offset: 0.25em; }
.legal .btn { color: var(--on-accent); text-decoration: none; }
.legal .updated { font-size: 0.875rem; color: var(--faint); }

/* ---------- 18. Scroll animations (only when JS is running) ---------- */

/* Headline: each word rises out of its own mask */
.js [data-split] .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.js [data-split] .w > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 900ms cubic-bezier(0.2, 0.7, 0.1, 1);
  transition-delay: calc(var(--i) * 55ms);
}

.js [data-split].is-visible .w > span { transform: none; }

/* Highlight sweeps in once the last word has landed */
.js .hero h1 mark {
  color: inherit;
  background-size: 0% 100%;
  transition:
    background-size 700ms cubic-bezier(0.7, 0, 0.2, 1),
    color 250ms ease;
  transition-delay: calc(var(--words, 9) * 55ms + 700ms), calc(var(--words, 9) * 55ms + 1000ms);
}

.js .hero h1.is-visible mark {
  color: var(--on-accent);
  background-size: 100% 100%;
}

/* Generic fade-up */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 800ms ease, transform 900ms cubic-bezier(0.2, 0.7, 0.1, 1);
  transition-delay: var(--delay, 0ms);
}

.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Screenshots: a cover in the page colour slides up and away */
.js [data-reveal="clip"] { opacity: 1; transform: none; }

.js [data-reveal="clip"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  transform-origin: top;
  transition: transform 1100ms cubic-bezier(0.7, 0, 0.2, 1) var(--delay, 0ms);
}

.js [data-reveal="clip"].is-visible::after { transform: scaleY(0); }

/* Service rules draw in from the left */
.js .row { border-top-color: transparent; position: relative; }
.js .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1200ms cubic-bezier(0.7, 0, 0.2, 1) 150ms;
}
.js .row:first-child::before { display: none; }
.js .row.is-visible::before { transform: scaleX(1); }

/* Step UIs play once their step comes into view */
.js .steps .ui-lines span {
  transform: scaleX(0);
  transition: transform 500ms cubic-bezier(0.2, 0.7, 0.1, 1);
  transition-delay: calc(var(--n) * 140ms + 350ms);
}
.js .steps li.is-visible .ui-lines span { transform: none; }

.js .steps .ui-msg {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 400ms ease, transform 400ms ease;
  transition-delay: 350ms;
}
.js .steps .ui-msg-them { transition-delay: 1900ms; }
.js .steps li.is-visible .ui-msg { opacity: 1; transform: none; }
.js .steps li.is-visible .ui-typing { animation: typing-show 1100ms ease 850ms both; }

/* ==========================================================================
   Breakpoints
   ========================================================================== */

@media (min-width: 700px) {
  :root { --gutter: 2rem; }

  .nav-list { gap: 2rem; }
  .nav-wide { display: list-item; }

  .facts { grid-template-columns: repeat(3, 1fr); gap: 2rem; }

  .phone:nth-child(4) { display: block; }
  .phone { flex-basis: clamp(8rem, 18vw, 14rem); }

  .work-expand { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .included { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .included .included-wide { grid-column: span 2; }

  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .field-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
}

@media (min-width: 1000px) {
  :root { --gutter: 3rem; }

  body { font-size: 1.0625rem; }
  .lead { font-size: 1.25rem; }

  /* Hero: copy on the left, overlapping phones on the right */
  .hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
  }

  .hero h1 { font-size: clamp(3.25rem, 4.8vw, 5.5rem); max-width: none; }

  /* Phones scale with the viewport so four overlapping ones always fit the column */
  .phones {
    min-width: 0;
    gap: 0;
    --pw: min(9.5rem, 9.5vw);
    margin-top: 0;
    justify-content: flex-end;
    padding-block: 1rem 4rem;
  }
  .phone { flex: 0 0 var(--pw); box-shadow: 0 30px 50px -22px rgba(22, 24, 29, 0.45); }
  .phone + .phone { margin-left: calc(var(--pw) * -0.35); }
  .phone:nth-child(even) { margin-top: 5rem; }

  .facts { margin-top: 3rem; }

  /* Offer: headline left, details right */
  .offer-inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: end;
    gap: 4rem;
  }

  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
    gap: 4rem;
  }

  /* Services: two columns of rows */
  .rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 3rem;
  }
  .row, .row:first-child { padding-block: 2rem 2.5rem; border-top: 1px solid var(--line); }
  .js .row, .js .row:first-child { border-top-color: transparent; }
  .js .row:first-child::before { display: block; }
  .row h3 { font-size: 1.75rem; }
  .row p { max-width: none; }

  .included { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .included li { padding: 1.75rem; min-height: 11rem; }

  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem; }

  /* About: large statement, then three short columns */
  .about-body {
    max-width: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 2.5rem;
  }
  .about-lead {
    grid-column: 1 / -1;
    font-size: clamp(2.25rem, 4.2vw, 3.75rem);
    line-height: 1.05;
    margin-bottom: 1.5rem;
  }
  .about-body p:not(.about-lead) + p { margin-top: 0; }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
  .faq summary::after { transition: none; }
  html { scroll-behavior: auto; }

  /* Show everything in its final state, no movement */
  .js [data-reveal],
  .js [data-split] .w > span { opacity: 1; transform: none; transition: none; }
  .js [data-reveal="clip"]::after { display: none; }
  .js .hero h1 mark { color: var(--on-accent); background-size: 100% 100%; transition: none; }
  .js .row::before { transform: none; transition: none; }
  .js .steps .ui-lines span,
  .js .steps .ui-msg { opacity: 1; transform: none; transition: none; }
  .ui-typing, .ui-typing i { animation: none !important; }
  .offer-dot, .live-dot { animation: none; }
  .phone, .band-track { transform: none !important; }
  .work-item,
  .js .work-expand .work-item { transition: none; }
  .work-item-copy,
  .work-item-copy :is(h3, .project-type, .project-desc, .work-link),
  .work-item-frame img,
  .work-item-label { transition: none !important; }
  .work-item-frame img { transform: none !important; }
}

/* ---------- 18. Case studies (/work/*) and industry pages ---------- */
.case { padding-block: clamp(1.5rem, 4vw, 2.5rem) var(--section-y); }

.crumbs { font-size: 0.875rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; list-style: none; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; }
.crumbs a { color: inherit; text-underline-offset: 0.25em; }

.case-head { max-width: 44rem; margin-top: clamp(1.5rem, 4vw, 2.5rem); }
.case-kicker { color: var(--muted); }
.case-head h1 {
  margin-top: 0.5rem;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}
.case-lead { margin-top: 1.25rem; font-size: 1.125rem; color: var(--muted); }
/* Says plainly whether the site is live */
.case-status { margin-top: 1.25rem; padding-left: 0.9rem; border-left: 3px solid var(--sun); color: var(--muted); }

/* Phone screenshot on small screens; computer and phone side by side on wider ones */
.case-shots { display: flex; justify-content: center; margin-top: clamp(2rem, 5vw, 3rem); }
.case-browser { display: none; }
.case-phone {
  box-sizing: content-box;
  width: min(15rem, 62vw);
  aspect-ratio: 440 / 952;
  border: 8px solid var(--ink);
  border-radius: 2rem;
  overflow: hidden;
  background: var(--bg-raise);
  box-shadow: 0 24px 40px -24px rgba(22, 24, 29, 0.4);
}
.case-phone img,
.case-browser img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.case-body { max-width: 44rem; }
.case-body h2 { margin-top: 2.5rem; font-size: 1.5rem; }
.case-body p,
.case-body li { margin-top: 0.75rem; color: var(--muted); }
.case-body ul { padding-left: 1.25rem; }
.case-example strong { color: var(--text); font-weight: 600; }

.case-cta {
  max-width: 44rem;
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-ink);
}
.case-cta h2 { font-size: 1.5rem; color: var(--on-ink); }
.case-cta p { margin-top: 0.5rem; color: var(--on-ink-muted); }
.case-cta .btn { margin-top: 1.25rem; }

.case-more { max-width: 44rem; margin-top: clamp(2.5rem, 6vw, 3.5rem); }
.case-more h2 { font-size: 1.5rem; }
.case-more ul { display: grid; gap: 0.75rem; margin-top: 1rem; list-style: none; padding: 0; }
.case-more a {
  display: block;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 150ms ease;
}
.case-more a:hover { border-color: var(--text); }
.case-more strong { display: block; font-family: var(--display); font-weight: 600; }
.case-more span { color: var(--muted); font-size: 0.9375rem; }

@media (min-width: 700px) {
  .case-shots {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: end;
  }
  .case-browser {
    display: block;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-raise);
    box-shadow: 0 24px 40px -24px rgba(22, 24, 29, 0.3);
  }
  .case-phone { width: clamp(9rem, 16vw, 13rem); border-width: 7px; border-radius: 1.6rem; }
}
