/* =========================================================================
   Tap Tap Cats — landing page
   Tokens, then base, then sections. Mobile first; one breakpoint at 60rem.
   ========================================================================= */

:root {
  --paper:       #F1F4EA;
  --paper-2:     #E7EDDC;
  --ink:         #14342B;
  --ink-2:       #33544A;
  /* the accent is the mascot's own blonde coat, not an orange */
  --blonde:      #E4A85F;
  --blonde-lit:  #EFBE7F;
  --blonde-deep: #8F5C14;
  --rust:        #A63E15; /* errors only */
  --cream:       #FFF3E2;
  --note:        #FFFCF1;
  --on-dark:     #F3F7EC;

  --font-display: "Bricolage Grotesque", "Trebuchet MS", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: clamp(0.83rem, 0.81rem + 0.12vw, 0.9rem);
  --step-0:  clamp(1rem, 0.97rem + 0.16vw, 1.09rem);
  --step-1:  clamp(1.14rem, 1.07rem + 0.34vw, 1.32rem);
  --step-2:  clamp(1.45rem, 1.26rem + 0.86vw, 2rem);
  --step-3:  clamp(1.9rem, 1.42rem + 2.2vw, 2.8rem);

  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --radius: 22px;
}

/* ---------- base -------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--step-3); line-height: 1.06; letter-spacing: -0.03em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); letter-spacing: -0.015em; }

p { margin: 0; text-wrap: pretty; }

a { color: inherit; }

svg { display: block; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* for labels a screen reader needs but the card doesn't show */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.end__band :focus-visible { outline-color: var(--blonde-lit); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.7rem 1.1rem;
  background: var(--ink);
  color: var(--on-dark);
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus-visible { top: 1rem; }

/* ---------- header ------------------------------------------------------ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(1.1rem, 2.6vw, 1.75rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  display: block;
  width: auto;
  height: 2.75rem;
  flex: none;
}

.brand__name {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.15rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.pill:hover { background: var(--ink); color: var(--on-dark); }

/* ---------- hero -------------------------------------------------------- */

.hero {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: center;
  padding-block: clamp(1rem, 2vw, 2rem) clamp(3.25rem, 7vw, 5.5rem);
}

.hero__copy { max-width: 36rem; }

.lede {
  margin-top: clamp(1rem, 2vw, 1.4rem);
  max-width: 32rem;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
}

/* signup card */
.signup {
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
  padding: clamp(1.25rem, 3vw, 1.9rem);
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 24px 44px -34px rgba(20, 52, 43, 0.65);
}

.signup__title { font-size: var(--step-1); letter-spacing: -0.02em; }

.signup__lede {
  margin-top: 0.35rem;
  font-size: var(--step--1);
  color: var(--ink-2);
}

.signup__form { margin-top: clamp(1rem, 2vw, 1.3rem); }

.signup__label {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.signup__row {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

input[type="email"] {
  width: 100%;
  min-height: 3.25rem;
  padding: 0 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #74896B;
  border-radius: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="email"]::placeholder { color: #5F7468; }
input[type="email"]:hover { border-color: #4E6656; }
input[type="email"]:focus-visible {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(228, 168, 95, 0.5);
}
input[type="email"][aria-invalid="true"] {
  border-color: var(--rust);
  box-shadow: 0 0 0 4px rgba(166, 62, 21, 0.18);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0 1.35rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--blonde);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.12s ease;
}
.button:hover { background: var(--blonde-lit); }
.button:active { transform: translateY(1px); }
.button[disabled] { cursor: progress; opacity: 0.72; }

.button__paw {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
  opacity: 0.75;
}

.signup__hint,
.signup__status {
  font-size: var(--step--1);
  line-height: 1.45;
}
.signup__hint { margin-top: 0.65rem; color: var(--ink-2); }

.signup__status { margin-top: 0.5rem; font-weight: 600; color: var(--rust); }
.signup__status:empty { display: none; }

.signup__status.is-note { color: var(--ink-2); font-weight: 400; }
.signup__status a { color: inherit; }

/* success state */
.signup__done {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-top: clamp(1rem, 2vw, 1.3rem);
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 16px;
}
.signup__done[hidden] { display: none; }
.signup__done svg {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  margin-top: 0.15rem;
  fill: var(--blonde-deep);
}
.signup__done p { font-size: var(--step--1); line-height: 1.5; }
.signup__done strong { font-family: var(--font-display); font-size: 1rem; letter-spacing: -0.01em; }

/* ---------- mascot ------------------------------------------------------ */

.rig {
  margin: 0;
  width: 100%;
  max-width: 34rem;
  justify-self: start;
}
.rig__art { width: 100%; height: auto; display: block; }

/* the two paws lift off the keys and come back down */
.m-paw {
  transform-box: fill-box;
  transform-origin: 50% 92%;
}
.m-paw--a { animation: mascot-tap-a 6.4s ease-in-out infinite; }
.m-paw--b { animation: mascot-tap-b 6.4s ease-in-out infinite; }

/* "tap!" — three pops in a row, timed to the three paw taps.
   Each pop lands a little off the last, so the loop doesn't read as one stamp. */
.tap-label {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 55%;
  animation: mascot-word 6.4s ease-in-out infinite;
}
.tap-label__text {
  font-family: var(--font-display);
  font-size: 104px;
  font-weight: 800;
  letter-spacing: 0.005em;
  fill: var(--ink);
  stroke: var(--cream);
  stroke-width: 8px;
  stroke-linejoin: round;
  paint-order: stroke fill;
}

@keyframes mascot-tap-a {
  0%, 4%     { transform: translateY(0); }
  7%         { transform: translateY(-30px); }
  10%, 35%   { transform: translateY(0); }
  38%        { transform: translateY(-30px); }
  41%, 100%  { transform: translateY(0); }
}

@keyframes mascot-tap-b {
  0%, 19%    { transform: translateY(0); }
  22%        { transform: translateY(-30px); }
  25%, 100%  { transform: translateY(0); }
}

@keyframes mascot-word {
  /* 1st tap — dead centre of the keys */
  0%, 5%     { opacity: 0; transform: translate(0, 22px) scale(0.72) rotate(0deg); }
  6.5%       { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
  13%        { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
  /* 2nd tap — a touch higher and to the right, tilted the other way */
  17%, 21%   { opacity: 0; transform: translate(14px, -10px) scale(0.92) rotate(1.5deg); }
  24%        { opacity: 1; transform: translate(30px, -22px) scale(1.03) rotate(-2.5deg); }
  30%        { opacity: 1; transform: translate(30px, -22px) scale(1.03) rotate(-2.5deg); }
  /* 3rd tap — back down and to the left, a hair smaller */
  34%, 37%   { opacity: 0; transform: translate(2px, 10px) scale(0.92) rotate(-1deg); }
  40%        { opacity: 1; transform: translate(-26px, 16px) scale(0.97) rotate(2.5deg); }
  46%        { opacity: 1; transform: translate(-26px, 16px) scale(0.97) rotate(2.5deg); }
  50%, 100%  { opacity: 0; transform: translate(-34px, 4px) scale(0.92) rotate(1deg); }
}

/* ---------- what we're building ----------------------------------------- */

.build {
  padding-block: clamp(3rem, 6vw, 5rem);
  background: var(--paper-2);
}

.build h2 { max-width: 20ch; }

.build__intro { max-width: 42rem; }

.build__lede {
  margin-top: 0.9rem;
  max-width: 42rem;
  color: var(--ink-2);
}

.build__cards {
  display: grid;
  gap: 1.15rem;
  margin-top: clamp(1.7rem, 3.4vw, 2.6rem);
}

.build__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem 1.5rem 1.6rem;
  background: var(--note);
  border: 1.5px solid var(--ink);
  border-radius: 20px;
}

/* the live card is one big link: it lifts and grows a touch under the pointer */
.build__card--live {
  color: inherit;
  text-decoration: none;
  transform-origin: 50% 50%;
  box-shadow: 0 24px 40px -30px rgba(20, 52, 43, 0.75),
              0 0 0 6px rgba(228, 168, 95, 0.2);
  transition: transform 0.32s cubic-bezier(0.2, 0.75, 0.25, 1),
              box-shadow 0.32s ease;
}

.build__card--live:focus-visible {
  border-radius: 20px;
  outline-offset: 4px;
}

/* pointer devices only, so a tap can't leave the card stuck zoomed in */
@media (hover: hover) {
  .build__card--live:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 34px 54px -30px rgba(20, 52, 43, 0.82),
                0 0 0 6px rgba(228, 168, 95, 0.3);
  }
  .build__card--live:hover .build__cta-arrow { transform: translateX(4px); }
  .build__card--live:hover .build__cta-domain {
    color: var(--ink);
    text-decoration-color: var(--blonde-deep);
  }
}

/* the one still cooking: a dashed outline and a paler face, nothing pretending
   to be ready — but still a real card, not a hole in the page */
.build__card--soon {
  background: var(--paper);
  border-style: dashed;
  border-width: 2px;
  border-color: var(--ink-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.72rem 0.36rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.15;
  color: var(--ink);
}

.badge svg { width: 0.9rem; height: 0.9rem; fill: currentColor; }

.badge--live {
  background: var(--blonde);
  border: 1.5px solid var(--ink);
}

.badge--soon {
  background: transparent;
  border: 1.5px solid rgba(20, 52, 43, 0.26);
  color: var(--ink-2);
}

.build__card h3 {
  margin-top: 0.9rem;
  font-size: clamp(1.22rem, 1.14rem + 0.34vw, 1.5rem);
}

.build__card p {
  margin-top: 0.45rem;
  max-width: 42ch;
  color: var(--ink-2);
  font-size: clamp(0.95rem, 0.92rem + 0.12vw, 1.02rem);
}

.build__cta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.04rem, 1rem + 0.16vw, 1.12rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.build__cta-arrow {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  color: var(--blonde-deep);
  transition: transform 0.15s ease;
}

.build__cta-domain {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 0.87rem + 0.12vw, 0.98rem);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(20, 52, 43, 0.32);
  text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

/* keyboard focus gets the same tell-tale the pointer does */
.build__card--live:focus-visible .build__cta-arrow { transform: translateX(4px); }
.build__card--live:focus-visible .build__cta-domain {
  color: var(--ink);
  text-decoration-color: var(--blonde-deep);
}

.build__foot {
  margin-top: clamp(1.5rem, 3vw, 2rem);
  font-size: var(--step--1);
  color: var(--ink-2);
}
.build__foot a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--blonde-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}
.build__foot a:hover { text-decoration-color: var(--ink); }

/* ---------- contact + footer -------------------------------------------- */

.end { margin-top: 0; }

.roof { display: block; width: 100%; height: 13px; }

.end__band {
  background: var(--ink);
  color: var(--on-dark);
}

.end__inner { padding-block: clamp(2.4rem, 5vw, 4rem); }

.contact h2 { font-size: var(--step-2); color: var(--on-dark); }

.contact p {
  margin-top: 0.8rem;
  max-width: 32rem;
  color: rgba(243, 247, 236, 0.76);
}

.contact__email {
  display: inline-block;
  margin-top: clamp(1.1rem, 2.5vw, 1.6rem);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.6vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--blonde-lit);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact__email:hover {
  color: var(--cream);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 0.18em;
}

.end__base {
  display: grid;
  gap: 0.6rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: clamp(1.4rem, 3vw, 2rem);
  border-top: 1px solid rgba(243, 247, 236, 0.18);
}

.brand--footer { color: var(--on-dark); }
/* on the dark band the illustration needs its own light: the cream chip keeps the
   laptop's dark body and keys from disappearing into the footer */
.brand--footer .brand__mark {
  height: 2.6rem;
  padding: 3px;
  background: var(--cream);
  border-radius: 9px;
}

.end__line {
  font-size: var(--step--1);
  color: rgba(243, 247, 236, 0.66);
  max-width: 34rem;
}

.end__meta {
  font-size: var(--step--1);
  color: rgba(243, 247, 236, 0.68);
}

/* ---------- larger screens ---------------------------------------------- */

/* tablet: one column, centred so the 36rem blocks don't hug the left edge.
   The hero keeps this single column further up than the rest of the page: its
   h1 is a full sentence, and the clean three-line break needs the wider measure. */
@media (min-width: 44rem) and (max-width: 65.99rem) {
  .hero { justify-items: center; }
  .rig { justify-self: center; }
}

/* the hero splits into two columns only once there is room for it */
@media (min-width: 66rem) {
  .hero {
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
    gap: clamp(2rem, 4vw, 4rem);
    padding-block: clamp(1.5rem, 3vw, 3rem) clamp(4rem, 7vw, 6.5rem);
  }

  .rig { max-width: 36rem; justify-self: end; }
}

@media (min-width: 60rem) {
  .signup__row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  /* what we're building: the two cards side by side */
  .build__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.35rem;
  }
  .build__card { padding: 1.7rem 1.6rem 1.7rem; }

  .end__base {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
  }
  .end__line { justify-self: start; }
  .end__meta { justify-self: end; }
}

/* ---------- small screens ----------------------------------------------- */

@media (max-width: 24rem) {
  .brand__mark { height: 2.4rem; }
  .signup { padding: 1.1rem; }
  .build__card { padding: 1.15rem 1.15rem 1.25rem; }
}

/* ---------- motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .tap-label { display: none; }
  .build__card--live:hover,
  .build__card--live:focus-visible { transform: none; }
  .build__card--live:hover .build__cta-arrow,
  .build__card--live:focus-visible .build__cta-arrow { transform: none; }
}
