/*
 * MingTag — mingtag.com
 *
 * One stylesheet, no build step, no CDN. The site is five static pages on
 * shared hosting; anything that needs compiling or a third-party request
 * is a liability there, not a convenience.
 *
 * The palette is lifted from the app's own theme tokens
 * (apps/mobile/src/theme/colors.ts) so the site and the thing it is
 * advertising are visibly the same product.
 */

:root {
  --primary: #38bdf8;
  --primary-dark: #0284c7;
  --accent: #0ea5e9;

  --ink: #1e293b;
  --ink-2: #64748b;
  --ink-3: #94a3b8;

  --bg: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;

  --radius: 16px;
  --radius-lg: 28px;

  /* One measure for reading text, used everywhere prose appears. */
  --measure: 68ch;
  --page: 1120px;
  /*
   * One gutter, named, because two places have to agree on it: an
   * ordinary section subtracts it from --page via padding, and a
   * full-bleed tinted one has to subtract it by hand. They drifted by
   * exactly this much until it had a name.
   */
  --gutter: 24px;
}

* { box-sizing: border-box; }

/*
 * A visible focus ring for keyboard users, and only for them.
 * The browser default disappears against this palette, and there was
 * nothing in its place — the whole site was unusable without a mouse.
 */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

/* The first stop for a keyboard, hidden until it has focus. */
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 12px 18px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip:focus { top: 12px; }

/*
 * Hidden to the eye, not to a screen reader. `display: none` would hide
 * it from both, which is the whole difference: the menu button's only
 * text lives in here.
 */
.u-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--primary-dark); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }

/* ------------------------------------------------------------------ */
/*  Top bar                                                            */
/* ------------------------------------------------------------------ */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 16px;
  /*
   * Wraps as a whole, which only matters WITHOUT JavaScript: the menu
   * puts the nav behind a button on a phone, so it never has to wrap.
   * With scripting off the links stay in the bar, and at 320px the brand
   * plus three of them do not fit on one line — this is what lets the nav
   * drop cleanly to its own row instead of breaking into two ragged ones
   * beside the brand.
   */
  flex-wrap: wrap;
  padding: 14px var(--gutter);
  max-width: var(--page);
  margin: 0 auto;
  /* Translucent rather than solid so the hero wash reads through it. */
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.bar__brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  /* A logo is still a link, and a link still has to be thumb-sized. */
  min-height: 44px;
  /*
   * Never shrink. The bar is a flex row, and at 320px the nav's three
   * links took the space out of the logo instead — 94px wide became 55px
   * at an unchanged 32px tall, so the wordmark was squashed rather than
   * scaled. Whatever else has to give, it is not the logo.
   */
  flex: none;
}

/*
 * The lockup, sized by HEIGHT with the width left to follow.
 *
 * 38px is where the wordmark stays properly sharp; the tagline under it
 * reads as a soft second line rather than words, which is what a tagline
 * does at this size on any brand's site. Constraining the width instead
 * would let a tall viewport stretch it.
 *
 * No border-radius: the icon inside the artwork already has its own, and
 * a radius on the box would clip the corner of the "g".
 */
.brand__logo {
  height: 38px;
  width: auto;
  display: block;
}

.bar__nav {
  display: flex;
  gap: 22px;
  /*
   * Grows into a whole row once it has wrapped onto one, so the links sit
   * across from the brand above rather than huddling at the left. Also
   * the no-JS path: see .bar's flex-wrap.
   */
  flex: 1 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bar__nav a {
  white-space: nowrap;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 550;
  /*
   * The text is 23px tall on its own, which is a small thing to hit with
   * a thumb. Padding rather than a height so the row does not grow: the
   * link box reaches 44px, the bar does not.
   */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.bar__nav a:hover { color: var(--ink); }

/*
 * The menu button. Nothing above 640px, where the links are in the bar.
 */
.bar__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.bar__toggle:hover { background: rgba(15, 23, 42, 0.05); }

/*
 * Three lines from one element: the middle is the span, the other two are
 * its pseudo-elements. They fold into a cross when the menu opens, which
 * is the only way the button says anything about state to somebody who is
 * looking rather than listening.
 */
.bar__burger,
.bar__burger::before,
.bar__burger::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.bar__burger { position: relative; }
.bar__burger::before { content: ""; position: absolute; top: -7px; }
.bar__burger::after { content: ""; position: absolute; top: 7px; }

.bar__toggle[aria-expanded="true"] .bar__burger { background: transparent; }

.bar__toggle[aria-expanded="true"] .bar__burger::before {
  transform: translateY(7px) rotate(45deg);
}

.bar__toggle[aria-expanded="true"] .bar__burger::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* ------------------------------------------------------------------ */
/*  Hero                                                               */
/* ------------------------------------------------------------------ */

.hero {
  position: relative;
  overflow: hidden;
  padding: 88px var(--gutter) 96px;
  text-align: center;
}

/*
 * The wash behind the hero, echoing the icon's blue-to-green gradient.
 * Kept as a wide, very soft ellipse so it reads as light in the room
 * rather than as a coloured band with an edge.
 */
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 620px;
  background:
    radial-gradient(60% 60% at 30% 40%, rgba(56, 189, 248, 0.22), transparent 70%),
    radial-gradient(50% 50% at 75% 35%, rgba(52, 211, 153, 0.18), transparent 70%);
  pointer-events: none;
}

.hero__inner { position: relative; max-width: 780px; margin: 0 auto; }

.hero h1 {
  font-size: clamp(38px, 6.4vw, 62px);
  font-weight: 800;
  margin-bottom: 18px;
}

.hero__lede {
  font-size: clamp(18px, 2.4vw, 21px);
  color: var(--ink-2);
  max-width: 34em;
  margin: 0 auto 34px;
}

.hero__note {
  margin-top: 22px;
  font-size: 14px;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------ */
/*  The floor illustration                                             */
/* ------------------------------------------------------------------ */

.floor {
  margin: 56px auto 0;
  max-width: 660px;
}

.floor svg { width: 100%; height: auto; display: block; }

.floor__label {
  font: 600 13px/1 ui-sans-serif, system-ui, sans-serif;
  fill: var(--ink-2);
  text-anchor: middle;
}

/* On the brand pill, so it inverts rather than taking the brand colour. */
.floor__label--you { fill: #fff; }

.floor__free {
  font: 500 12px/1 ui-sans-serif, system-ui, sans-serif;
  fill: var(--ink-3);
  text-anchor: middle;
}

/*
 * The request, travelling.
 *
 * A dashed line says "not a solid connection"; a dashed line that MOVES
 * says "on its way", which is what a request is — sent, not yet accepted.
 * Animating the offset rather than anything positional means the browser
 * only repaints the stroke.
 */
.floor__link { animation: floor-dash 1.4s linear infinite; }

@keyframes floor-dash {
  to { stroke-dashoffset: -16; }
}

/* A slow breath around your own table, so the eye starts there. */
.floor__halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: floor-halo 3s ease-in-out infinite;
}

@keyframes floor-halo {
  0%, 100% { opacity: .35; transform: scale(1); }
  50%      { opacity: 0;   transform: scale(1.18); }
}

/* ------------------------------------------------------------------ */
/*  Buttons                                                            */
/* ------------------------------------------------------------------ */

.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 12px 26px -10px rgba(2, 132, 199, 0.65);
}

.btn--ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--border);
}

.btn--ghost:hover { border-color: var(--ink-3); }

/* The store badges used to be dimmed <span>s. They are placeholder links
   now, waiting on the real listing URLs, and nothing on the site sets
   aria-disabled any more — the rule went with them. */

/* ------------------------------------------------------------------ */
/*  Sections                                                           */
/* ------------------------------------------------------------------ */

.section { padding: 84px var(--gutter); max-width: var(--page); margin: 0 auto; }

.section--tint {
  background: var(--surface);
  max-width: none;
  border-block: 1px solid var(--border);
}

/*
 * A tinted section bleeds to the window edge, so its children cannot use
 * --page directly: an ordinary section's CONTENT is --page minus its two
 * gutters, and matching that is what makes the cards line up with the
 * section above and with the brand in the header.
 */
.section--tint > * {
  max-width: calc(var(--page) - var(--gutter) * 2);
  margin-inline: auto;
}

.section__head { text-align: center; max-width: 46em; margin: 0 auto 52px; }

/*
 * A small label above a heading. Letter-spaced because it is set in caps
 * at 13px, where the default tracking closes up and reads as a smudge.
 */
.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.section__head h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 780;
  margin-bottom: 14px;
}

.section__head p { color: var(--ink-2); margin: 0; font-size: 18px; }

.grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
}

.card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-weight: 750;
  font-size: 17px;
  color: var(--primary-dark);
  background: rgba(56, 189, 248, 0.14);
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  margin-bottom: 18px;
  color: var(--primary-dark);
  background: rgba(56, 189, 248, 0.13);
}

.card__icon svg { width: 21px; height: 21px; }

.card h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }

.card p { margin: 0; color: var(--ink-2); font-size: 16px; }

/* ------------------------------------------------------------------ */
/*  Two-up panel                                                       */
/* ------------------------------------------------------------------ */

.panel {
  display: grid;
  gap: 44px;
  align-items: center;
  grid-template-columns: 1.15fr 1fr;
  padding: 52px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(52, 211, 153, 0.12), transparent 60%),
    radial-gradient(70% 120% at 0% 100%, rgba(56, 189, 248, 0.14), transparent 60%),
    #fff;
}

.panel__text .eyebrow { text-align: left; }

.panel__text h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 780;
  margin-bottom: 14px;
}

.panel__text p { color: var(--ink-2); margin: 0 0 18px; }

.panel__cta { margin: 26px 0 0; }

.panel__list { margin: 0; padding: 0; list-style: none; }

.panel__list li {
  position: relative;
  padding: 0 0 0 32px;
  margin-bottom: 16px;
  color: var(--ink-2);
}

/* A tick drawn in CSS rather than six more SVG nodes for one shape. */
.panel__list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 7px;
  height: 12px;
  border: solid var(--primary-dark);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

@media (max-width: 820px) {
  .panel { grid-template-columns: 1fr; gap: 30px; padding: 34px 26px; }
}

/* ------------------------------------------------------------------ */
/*  Long-form documents                                                */
/* ------------------------------------------------------------------ */

.doc {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 64px var(--gutter) 96px;
}

.doc h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 800; }

.doc__sub { color: var(--ink-2); font-size: 18px; margin: 14px 0 6px; }

.doc__meta { color: var(--ink-3); font-size: 14px; margin: 0 0 44px; }

.doc__section { margin-bottom: 38px; }

.doc__section h2 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 12px;
  /* Anchored headings need room when jumped to from the contents. */
  scroll-margin-top: 84px;
}

.doc__section p { margin: 0 0 14px; color: var(--ink-2); }

.doc__section ul { margin: 0 0 14px; padding-left: 22px; color: var(--ink-2); }

.doc__section li { margin-bottom: 7px; }

.doc__contact {
  border-top: 1px solid var(--border);
  padding-top: 34px;
}

/*
 * The contact address is the one thing anybody actually presses on a
 * legal page, so it gets a real target rather than inheriting the size
 * of inline prose. Links INSIDE paragraphs are left alone — padding
 * there would break the line box it sits in.
 */
.doc__contact a,
/*
 * ...and any link that is ALONE in its paragraph, which is what a
 * standalone address is. The support page put support@mingtag.com in a
 * paragraph of its own outside .doc__contact, so it stayed a 22px target
 * — on the page the App Store links people to when they need help.
 *
 * :only-child is what keeps this safe. A link in the middle of a sentence
 * still gets left alone: giving it a height would inflate the line box it
 * sits in and push the sentence apart.
 */
.doc__section p > a:only-child {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}

.doc__address { color: var(--ink-3); font-size: 15px; }

/* ------------------------------------------------------------------ */
/*  Callouts                                                           */
/* ------------------------------------------------------------------ */

.note {
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  background: var(--surface);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 26px 0;
}

.note p:last-child { margin-bottom: 0; }

.steps { counter-reset: step; padding-left: 0; list-style: none; margin: 0; }

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  margin-bottom: 20px;
  color: var(--ink-2);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--primary-dark);
  background: rgba(56, 189, 248, 0.14);
}

.steps strong { color: var(--ink); }

/* ------------------------------------------------------------------ */
/*  Footer                                                             */
/* ------------------------------------------------------------------ */

.foot {
  border-top: 1px solid var(--border);
  padding: 36px var(--gutter) 52px;
  max-width: var(--page);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--ink-3);
  font-size: 15px;
}

.foot__brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
}

.foot__brand .brand__logo { height: 34px; }

.foot__copy { margin: 0; }

.foot nav { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }

.foot a {
  color: var(--ink-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.foot a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ */
/*  Small screens                                                      */
/* ------------------------------------------------------------------ */

@media (max-width: 640px) {
  :root { --gutter: 20px; }

  body { font-size: 16px; }
  .bar { padding: 12px var(--gutter); }

  /*
   * Smaller, because the lockup is nearly 3x as wide as it is tall and
   * the bar still has to hold the button beside it at 320px.
   */
  .brand__logo { height: 32px; }
  .foot__brand .brand__logo { height: 30px; }

  /*
   * The menu.
   *
   * What used to be here was `.bar__nav a[href^="#"] { display: none }` —
   * the in-page links were simply deleted on a phone because four of them
   * plus the brand would not fit. That is most of the navigation gone on
   * the devices most people arrive on: "How it works", "Safety" and "For
   * cafés" were unreachable, and the sections they point at are the page.
   *
   * Everything is in the panel now, at a size worth aiming a thumb at.
   *
   * Guarded on `.js` so that with scripting off the links stay visible in
   * their own row rather than behind a button that cannot open.
   */
  .js .bar__toggle { display: inline-flex; }

  .js .bar__nav {
    /* Its own full-width row under the brand, and closed to begin with. */
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    gap: 0;
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    /* A tall menu on a short phone scrolls rather than running off. */
    max-height: min(60vh, 380px);
    overflow-y: auto;
  }

  .js .bar__nav.is-open { display: flex; }

  .js .bar__nav a {
    justify-content: flex-start;
    min-height: 48px;
    font-size: 16px;
    color: var(--ink);
  }

  .js .bar__nav a + a { border-top: 1px solid var(--border); }
  .hero { padding: 56px var(--gutter) 68px; }
  /* Narrower gutter on a phone, in the one place it is defined. */
  .section { padding: 60px var(--gutter); }
  .doc { padding: 44px var(--gutter) 72px; }
  .foot { justify-content: center; text-align: center; }
}

/* Respect a request for less movement — there is nothing here worth
   overriding it for. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }

  /* The floor is the only thing that loops, and a loop is the kind of
     movement this setting is actually asking about. Stopped, not hidden:
     the dashes and the halo still read at rest. */
  .floor__link, .floor__halo { animation: none !important; }
}
