/* The one stylesheet for ucrypto.co. Colours, type, corners and buttons come only from the
   tokens in :root, which are the UQG brand's tokens in docs/design/brand.md (UX-001, D55).
   Every text colour here is checked for contrast by tests/integration/web/site.test.ts (UX-002). */

/* Outfit for text and Geist Mono for figures, both served from the site itself. */
@font-face {
  font-family: 'Outfit';
  src: url('fonts/Outfit-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --color-deep-teal: #273b3d;
  --color-teal-800: #1b3436;
  --color-teal-600: #2e4547;
  --color-soft-heading: #4e7275;
  --color-mint: #9fe7df;
  --color-aqua: #8ae0e5;
  --color-ink: #0f1416;
  --color-text: #1d2a2b;
  --color-text-soft: #4f5d5e;
  --color-caption: #546f71;
  --color-on-dark: #b4c8ca;
  --color-paper: #f7f8f8;
  --color-white: #ffffff;
  --color-line: #e4eaea;
  --color-critical: #b3261e;
  --color-warning: #8a5a00;
  --font-sans: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --radius-pill: 999px;
  --radius-card: 16px;
  --radius-panel: 28px;
  --label-spacing: 0.08em;
  --wordmark-spacing: 0.2em;
  --heading-spacing: -0.01em;
  /* The hero's glow and dots: mint and aqua at this strength over the dark ground. The site
     test checks hero text against all of them stacked at once. */
  --glow-strength: 8%;
  --glow-mint: color-mix(in srgb, var(--color-mint) var(--glow-strength), transparent);
  --glow-aqua: color-mix(in srgb, var(--color-aqua) var(--glow-strength), transparent);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: var(--weight-light);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-paper);
}

a {
  color: var(--color-teal-600);
}

a:focus-visible {
  outline: 2px solid var(--color-teal-600);
  outline-offset: 2px;
}

code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  color: var(--color-white);
  background-color: var(--color-deep-teal);
}

.site-header,
.site-footer,
main {
  padding: 1rem 4rem;
}

/* The navigation is a floating pill bar, as on uqualify.co. */
.site-header {
  position: sticky;
  top: 0.75rem;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 0.75rem 1.5rem;
  padding: 0.4rem 0.5rem 0.4rem 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background-color: var(--color-white);
  box-shadow: 0 0.5rem 1.5rem color-mix(in srgb, var(--color-ink) 8%, transparent);
}

/* The UQ mark beside the name, set as UCRYPTO in spaced Outfit capitals (docs/design/brand.md). */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: var(--weight-regular);
  font-size: 1rem;
  letter-spacing: var(--wordmark-spacing);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-deep-teal);
}

.brand-mark {
  display: inline-block;
  width: 2.1rem;
  height: 1.4rem;
  background-color: var(--color-deep-teal);
  -webkit-mask: url('brand/uq-mark.svg') center / contain no-repeat;
  mask: url('brand/uq-mark.svg') center / contain no-repeat;
}

/* The seven items of the version 2 frame (scripts/web-frame.mjs): five links and two pills. They
   wrap onto a second line on a phone, from 360 px up, and sit on one line on a wide screen. */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  margin-left: auto;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  text-decoration: none;
  color: var(--color-text-soft);
}

.site-nav a[aria-current='page']:not(.button-primary) {
  color: var(--color-text);
  text-decoration: underline;
}

/* Buttons are pills: the main one mint with ink text, the second a thin deep teal outline. */

.button-primary,
.site-nav .button-primary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-pill);
  font-weight: var(--weight-medium);
  text-decoration: none;
  color: var(--color-ink);
  background-color: var(--color-mint);
}

.button-primary:hover {
  color: var(--color-white);
  background-color: var(--color-teal-600);
}

.button-secondary,
.site-nav .button-secondary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--color-deep-teal);
  border-radius: var(--radius-pill);
  font-weight: var(--weight-medium);
  text-decoration: none;
  color: var(--color-deep-teal);
  background-color: var(--color-white);
}

main {
  min-height: 60vh;
  padding-top: 3rem;
  padding-bottom: 3rem;
  background-color: var(--color-white);
}

h1,
h2,
h3 {
  font-weight: var(--weight-regular);
  line-height: 1.15;
}

h1,
h3 {
  color: var(--color-deep-teal);
}

h1 {
  font-weight: var(--weight-light);
  letter-spacing: var(--heading-spacing);
}

h2 {
  color: var(--color-soft-heading);
  letter-spacing: var(--heading-spacing);
}

.lede {
  max-width: 40rem;
  font-size: 1.1rem;
  color: var(--color-text-soft);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
  background-color: var(--color-paper);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--color-text-soft);
}

.site-footer small {
  margin-left: auto;
  color: var(--color-caption);
}

/* The four footer columns (Product, Trust, Company, Legal): one under another on a phone, from
   360 px up, and side by side on a wide screen. */
.footer-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  width: 100%;
}

.site-footer .footer-columns nav {
  flex-direction: column;
  gap: 0;
}

.footer-heading {
  margin: 0;
  font-size: 0.75rem;
  font-weight: var(--weight-regular);
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--color-caption);
}

@media (min-width: 48rem) {
  .footer-columns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* "Also from UQG": the group's other brands, on every page's footer. */
.site-footer .group-links {
  align-items: center;
  gap: 1rem;
}

.group-label {
  font-size: 0.75rem;
  font-weight: var(--weight-regular);
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--color-caption);
}

/* The home page (SCR-WEB-01). */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  gap: 3rem;
  align-items: center;
}

.hero h1 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(2.5rem, 6vw, 4rem);
}

.hero h1 span {
  display: block;
}

/* The home page's dark hero: deep teal to near-black, with a soft dot-matrix glow in mint and
   aqua drawn in CSS. The glow breathes slowly, and stays still for reduced motion (below). */

.hero-dark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 4rem 3rem;
  border-radius: var(--radius-panel);
  color: var(--color-white);
  background-color: var(--color-ink);
  background-image: linear-gradient(160deg, var(--color-deep-teal), var(--color-ink));
}

.hero-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 85% 15%, var(--glow-mint), transparent 45%),
    radial-gradient(circle at 10% 90%, var(--glow-aqua), transparent 40%),
    radial-gradient(var(--glow-mint) 1px, transparent 1.5px);
  background-size:
    auto,
    auto,
    1.25rem 1.25rem;
  animation: glow-breathe 12s ease-in-out infinite alternate;
}

@keyframes glow-breathe {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 1;
  }
}

/* These outweigh the light-page rules for the same text (such as `.preview figcaption`), which
   come later in this file. The site test works out each hero text's colour to make sure. */
.hero-dark h1,
.hero-dark .lede,
.hero-dark .preview figcaption {
  color: var(--color-white);
}

.hero-dark .eyebrow {
  color: var(--color-mint);
}

.hero-dark a:focus-visible,
.band-dark a:focus-visible {
  outline-color: var(--color-mint);
}

/* Small labels and kickers are capitals with wide letter spacing. */

.eyebrow {
  display: inline-block;
  margin: 0;
  font-size: 0.85rem;
  font-weight: var(--weight-regular);
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--color-teal-600);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.preview {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.preview-card {
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  color: var(--color-text-soft);
  background-color: var(--color-white);
}

.preview-card p {
  margin: 0 0 0.5rem;
}

.preview-checkout {
  margin-right: 4rem;
}

.preview-label {
  font-size: 0.75rem;
  font-weight: var(--weight-regular);
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--color-caption);
}

.preview-card .preview-amount {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  color: var(--color-ink);
}

.badge {
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: var(--color-ink);
  background-color: var(--color-mint);
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.preview-table caption {
  text-align: left;
  font-size: 0.8rem;
  color: var(--color-caption);
}

.preview-table th {
  padding: 0.4rem 0;
  text-align: left;
  font-weight: var(--weight-light);
  border-top: 1px solid var(--color-line);
}

.preview-table td {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--color-line);
  color: var(--color-ink);
}

.preview figcaption {
  font-size: 0.8rem;
  color: var(--color-caption);
}

.steps,
.next {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-line);
}

.steps ol,
.next ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: '0' counter(step);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-teal-600);
}

.steps h3 {
  margin: 0.5rem 0;
  color: var(--color-text);
}

.steps p,
.next p {
  margin: 0.25rem 0 0;
  color: var(--color-text-soft);
}

.next a {
  font-weight: var(--weight-medium);
}

/* A deep teal band carrying thin maze lines, drawn by the inline SVG in the page. */

.band-dark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 3rem;
  border-top: 0;
  border-radius: var(--radius-panel);
  color: var(--color-on-dark);
  background-color: var(--color-deep-teal);
}

.maze {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.maze path {
  fill: none;
  stroke: var(--color-teal-600);
  stroke-width: 1.5;
}

.band-dark h2,
.band-dark h3 {
  color: var(--color-white);
}

.band-dark p {
  color: var(--color-on-dark);
}

.band-dark li::before {
  color: var(--color-mint);
}

.band-dark .band-link {
  color: var(--color-mint);
}

/* The home page's version 2 modules (docs/design/website-v2.md): the proof strip, the three
   doors with their bullets, and the checkpoint card's figures in Geist Mono. */

.proof-strip {
  margin-top: 3rem;
}

.proof-strip ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.proof-strip strong {
  display: block;
  font-weight: var(--weight-medium);
  color: var(--color-deep-teal);
}

.doors li ul {
  display: block;
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.25rem;
  list-style: disc;
  color: var(--color-text-soft);
}

.checkpoint .preview-table td {
  overflow-wrap: anywhere;
}

/* The merchant page (SCR-WEB-02). */

.code-sample {
  margin: 0;
}

.code-sample pre {
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
  border-radius: var(--radius-card);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--color-mint);
  background-color: var(--color-deep-teal);
}

.code-sample figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-caption);
}

.features {
  margin-top: 3rem;
}

.features ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  color: var(--color-text-soft);
  background-color: var(--color-white);
}

.features h3 {
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.features p {
  margin: 0;
}

/* The three layers of currency (D87), written by scripts/build-web.mjs from config. */
.features [data-currency-layer] + [data-currency-layer] {
  margin-top: 0.5rem;
}

/* The pricing page (SCR-WEB-03), written by scripts/build-web.mjs. */

.pricing h1 {
  margin: 0.75rem 0 1rem;
  font-size: clamp(2rem, 5vw, 3rem);
}

.draft-notice {
  max-width: 40rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--color-warning);
  color: var(--color-warning);
  background-color: var(--color-paper);
}

.fee-table {
  width: 100%;
  max-width: 44rem;
  margin: 2rem 0;
  border-collapse: collapse;
  background-color: var(--color-white);
}

.fee-table caption {
  padding-bottom: 0.5rem;
  text-align: left;
  font-size: 0.85rem;
  color: var(--color-caption);
}

.fee-table th,
.fee-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-top: 1px solid var(--color-line);
}

.fee-table thead th {
  font-size: 0.85rem;
  font-weight: var(--weight-regular);
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--color-caption);
}

.fee-table thead th:nth-child(2) {
  text-align: right;
}

.fee-table tbody th {
  font-weight: var(--weight-light);
  color: var(--color-text);
}

.fee-table .fee {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.placeholder {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--color-caption);
}

/* The become a merchant page (SCR-WEB-04). */

.needs {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background-color: var(--color-white);
}

.needs h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--color-text);
}

.needs ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
}

.needs li {
  padding: 0.75rem 1rem;
  color: var(--color-text);
}

.needs li + li {
  border-top: 1px solid var(--color-line);
}

.note {
  font-size: 0.9rem;
  color: var(--color-text-soft);
}

/* The legal pages (SCR-WEB-06) and the cookie choice notice (WEB-009). */

.legal h2,
.legal p,
.legal ul,
.legal ol {
  max-width: 44rem;
}

.legal h2 {
  margin-top: 2rem;
}

.consent {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  max-width: 44rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-deep-teal);
  border-radius: var(--radius-card);
  color: var(--color-text);
  background-color: var(--color-white);
}

.consent p {
  flex: 1 1 18rem;
  margin: 0;
}

.consent button {
  min-height: 44px;
  min-width: 44px;
  font: inherit;
  cursor: pointer;
}

/* The pre-launch notice under the header on every page. */
.prelaunch {
  margin: 0;
  padding: 0.6rem 4rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-text);
  background-color: var(--color-paper);
}

pre {
  max-width: 100%;
  overflow-x: auto;
}

@media (max-width: 48rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .fee-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .prelaunch {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .preview-checkout {
    margin-right: 0;
  }

  .site-header,
  .site-footer,
  main {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .site-nav {
    margin-left: 0;
  }

  .site-header {
    position: static;
    margin: 0.5rem;
    border-radius: var(--radius-panel);
  }

  .hero-dark,
  .band-dark {
    padding: 2rem 1.25rem;
  }
}

/* Nothing moves for people who ask for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .hero-dark::before {
    animation: none;
  }
}
