/* The showroom for the sample business sites, at the root of this site; the samples sit in food/, trades/ and care/.
   alimicious.com's family: a deep blue hero that steps down in big pixels into a dark grey page. */

:root {
  --navy: #02075e;          /* the hero, and the darkest dot of its halftone (sites.js) */
  --paper: #0f0f11;         /* the page under the hero; the pixel fade (sites.js) ends on it */
  --paper-2: #1a1a1e;       /* a step up, for surfaces on the page (the bento tiles, the steps) */
  --ink: #ededf0;
  --ink-soft: #9b9ca6;      /* secondary text */
  --rule: rgba(255, 255, 255, 0.08);
  --accent: #8fa4ff;
  --on-accent: var(--navy);
  --shot-edge: rgba(255, 255, 255, 0.12);
  color-scheme: dark;

  --font: "Bricolage Grotesque", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --step-small: 0.9375rem;
  --step-body: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);
  --step-lead: clamp(1.375rem, 1.1rem + 0.8vw, 1.875rem);
  --step-head: clamp(2.25rem, 1.4rem + 3.2vw, 4.25rem);
  --step-display: clamp(3rem, 0.8rem + 7vw, 8.5rem);

  --margin: clamp(1rem, 4vw, 4rem);
  --section: clamp(6rem, 12vw, 11rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3, p, ul, ol { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-weight: 700; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { padding-left: var(--margin); padding-right: var(--margin); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: 0 1.6rem; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 1.0625rem; text-decoration: none; white-space: nowrap; transition: background-color 180ms ease, color 180ms ease, transform 140ms var(--ease-out); }
.button:hover { background: var(--accent); color: var(--on-accent); }
.button:active { transform: scale(0.97); }
.button-small { min-height: 2.75rem; padding: 0 1.2rem; font-size: 1rem; }
.text-link { font-weight: 600; text-underline-offset: 0.25em; text-decoration-thickness: 2px; }
.text-link:hover { color: var(--accent); }

.lead { font-size: var(--step-lead); font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; max-width: 32ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; }

/* ---------- the blue hero ---------- */
/* one deep blue in both themes, with the main site's clouds printed over it as a halftone */
.hero { position: relative; height: 100svh; min-height: 34rem; overflow: hidden; background: var(--navy); color: #fff; isolation: isolate; }
.halftone { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; display: block; }
/* without WebGL: the same clouds, just blurred, under a fine dot screen */
.halftone-still { position: absolute; inset: 0; z-index: -2; display: none; }
.no-gl .halftone-still { display: block; }
.halftone-still img { position: absolute; width: 60%; filter: blur(28px); opacity: 0.85; }
.halftone-still img:first-child { left: -8%; top: -10%; }
.halftone-still img:last-child { right: -10%; bottom: -14%; transform: scaleX(-1); }
.halftone-still::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, transparent 0 1.2px, var(--navy) 1.9px) 0 0 / 5px 5px; }

/* a canvas doesn't stretch between top and bottom like a box does, so it gets its height outright */
.scene { position: absolute; z-index: 0; top: 8%; right: var(--margin); width: min(54%, 840px); height: 64%; }
/* the one thing at the top: a "Get a quote" button, centred */
.pill { position: absolute; z-index: 2; top: 1.25rem; left: 50%; translate: -50% 0; }
.pill-cta { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1.4rem; border-radius: 999px; background: #fff; color: var(--navy); font-size: 1rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color 180ms ease, transform 140ms var(--ease-out); }
.pill-cta:hover { background: #c9d4ff; }
.pill-cta:active { transform: scale(0.96); }

.hero-foot { position: absolute; z-index: 1; left: 0; right: 0; bottom: clamp(1.75rem, 5vh, 3.5rem); display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: end; gap: 2rem clamp(2rem, 6vw, 7rem); }
.hero h1 { font-size: clamp(2.5rem, 0.9rem + 4.2vw, 5.75rem); font-weight: 600; line-height: 1; letter-spacing: -0.04em; padding-bottom: clamp(1.25rem, 2.5vw, 2rem); border-bottom: 1px solid rgba(255, 255, 255, 0.45); text-wrap: balance; }
.hero-side { display: grid; gap: 1rem; justify-items: start; max-width: 30rem; font-size: var(--step-small); line-height: 1.5; color: rgba(255, 255, 255, 0.82); padding-bottom: calc(clamp(1.25rem, 2.5vw, 2rem) + 1px); }
.hero-link { color: #fff; font-weight: 600; text-underline-offset: 0.3em; text-decoration-thickness: 1px; }
.hero-link:hover { text-decoration-thickness: 2px; }

/* ---------- the opening deck ---------- */
.deck { display: none; }
.intro .deck { display: block; position: fixed; z-index: 20; left: 50%; top: 50%; width: var(--card-w); height: var(--card-h); translate: -50% -50%; pointer-events: none; }
.deck img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 6px; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.45); }
.deck img:nth-child(1) { rotate: -3deg; }
.deck img:nth-child(2) { rotate: 4deg; }
.deck img:nth-child(3) { rotate: -1deg; }
.intro { overflow: hidden; }
.intro .hero-ui { opacity: 0; }
.hero-ui { transition: opacity 700ms var(--ease-out), translate 900ms var(--ease-out); }
.intro .hero-foot { translate: 0 1.5rem; }

/* ---------- the three samples ---------- */
/* the pixel steps between the blue hero and the grey page; the canvas is drawn one pixel per square, then scaled up */
.pixel-fade { height: clamp(140px, 18vw, 280px); overflow: hidden; background: var(--paper); }
.pixel-fade canvas { display: block; image-rendering: pixelated; }

.samples { display: grid; gap: clamp(4rem, 8vw, 8rem); padding-top: clamp(3rem, 7vw, 7rem); }

/* each sample as a bento of tiles: its title on a tile in the sample's own colour, the desktop screenshot under it at
   its own 16:10, the phone screenshot tall beside them, and what's on it in the corners that are left, a tile each.
   Every other sample mirrors. */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: auto minmax(9rem, auto) minmax(9rem, auto); gap: 0.75rem;
  grid-template-areas: "title title phone f1" "desk desk phone f2" "desk desk f3 f4"; }
.sample:nth-child(odd of .sample) .bento { grid-template-areas: "f1 phone title title" "f2 phone desk desk" "f3 f4 desk desk"; }
.feats { display: contents; }
.tile { border-radius: 22px; background: var(--paper-2); overflow: hidden; }
.tile-title { grid-area: title; display: grid; align-content: space-between; justify-items: start; gap: 1.25rem; padding: clamp(1.5rem, 2.6vw, 2.5rem); background: var(--brand); color: var(--brand-ink); }
.tile-title h3 { font-size: clamp(2rem, 1.1rem + 1.9vw, 3.1rem); line-height: 0.98; letter-spacing: -0.035em; }
.sample-name { font-size: clamp(1.0625rem, 0.95rem + 0.45vw, 1.375rem); font-weight: 500; line-height: 1.3; opacity: 0.8; max-width: 26ch; }
.tile-title .button { background: var(--brand-ink); color: var(--brand); }
.tile-title .button:hover { background: var(--brand-ink); color: var(--brand); transform: translateY(-2px); }
/* the screenshot fills its slot across, and its 16:10 height comes from the padding below (a percentage of the width),
   which every browser sizes the same; aspect-ratio here made Safari size the tile from its height and leave gaps */
.tile-desk { grid-area: desk; position: relative; display: block; }
.tile-desk::before { content: ""; display: block; padding-top: 62.5%; }
.tile-desk img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left top; transition: transform 600ms var(--ease-out); }
/* the phone shot is pinned inside its tile, so the screenshot's own size never stretches the rows */
.tile-phone { grid-area: phone; position: relative; display: block; min-height: 22rem; background: var(--tint); }
.tile-phone img { position: absolute; top: 1.5rem; bottom: 1.5rem; left: 50%; translate: -50% 0; width: auto; height: calc(100% - 3rem); aspect-ratio: 390 / 844; object-fit: cover; object-position: top; border-radius: 16px; outline: 1px solid var(--shot-edge); outline-offset: -1px; transition: transform 600ms var(--ease-out); }
.tile-desk:hover img { transform: scale(1.03); }
.tile-phone:hover img { transform: translateY(-6px); }
.tile-feat { display: grid; align-content: end; gap: 0.9rem; padding: 1.4rem 1.5rem; font-size: 1.125rem; font-weight: 500; line-height: 1.3; }
.tile-feat::before { content: ""; width: 1rem; height: 0.55rem; margin: 0 0 0.3rem 0.1rem; border-left: 3px solid var(--tick); border-bottom: 3px solid var(--tick); transform: rotate(-45deg); }
.feats li:nth-child(1) { grid-area: f1; }
.feats li:nth-child(2) { grid-area: f2; }
.feats li:nth-child(3) { grid-area: f3; }
.feats li:nth-child(4) { grid-area: f4; }

.ticks { padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.ticks li { position: relative; padding-left: 1.75rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.9rem; height: 0.5rem; border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg); }

/* ---------- how it works ---------- */
.how { padding-top: var(--section); display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
.how h2, .included h2 { font-size: var(--step-head); line-height: 0.98; letter-spacing: -0.035em; }
.steps { padding: 0; list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.steps li { counter-increment: step; background: var(--paper-2); border-radius: 18px; padding: 1.75rem 1.5rem 2rem; display: grid; align-content: start; gap: 0.75rem; }
.steps li::before { content: counter(step); font-size: 3.5rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--accent); }
.steps h3 { font-size: 1.375rem; line-height: 1.15; letter-spacing: -0.015em; }

/* ---------- included ---------- */
/* the list gets most of the width, so each item stays at one or two lines */
.included { padding-top: var(--section); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.ticks-grid { grid-template-columns: 1fr 1fr; gap: 1rem 2.5rem; font-size: clamp(1rem, 0.85rem + 0.6vw, 1.375rem); font-weight: 500; line-height: 1.3; }
.ticks-grid li::before { top: 0.4em; }

/* ---------- the close: the email in a glowing box, as on alimicious.com ---------- */
.contact { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); padding-top: var(--section); padding-bottom: clamp(4rem, 8vw, 7rem); }
.contact h2 { font-size: var(--step-head); line-height: 0.98; letter-spacing: -0.035em; }

/* a light that runs round the edge, and a soft glow of it behind */
@property --beam-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.beam { position: relative; isolation: isolate; }
.beam::before, .beam::after { content: ""; position: absolute; inset: -1.5px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--beam-angle), transparent 0deg 250deg, var(--beam-colors), transparent 360deg); }
.beam::before { z-index: 2; padding: 1.5px; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.beam::after { z-index: -1; filter: blur(18px); opacity: 0.5; }
@media (prefers-reduced-motion: no-preference) {
  .beam::before, .beam::after { animation: beam 7s linear infinite; }
}
@keyframes beam { to { --beam-angle: 360deg; } }

/* the hero's blues in the beam */
.mail-box { --beam-colors: #0a1aa8 290deg, #2340ff 312deg, #6f86ff 332deg, #c9d4ff 352deg; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; border-radius: 26px; padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2.75rem); background: #151518; box-shadow: inset 0 0 0 1px var(--rule); }
.mail { font-size: clamp(2.4rem, 0.5rem + 8vw, 9.5rem); font-weight: 700; line-height: 0.95; letter-spacing: -0.05em; text-decoration: none; overflow-wrap: anywhere; transition: color 200ms ease; }
.mail:hover { color: var(--accent); }
/* copying the address flashes the box's glow */
.mail-box::after { transition: opacity 700ms ease; }
.mail-box.is-copied::after { opacity: 1; transition-duration: 120ms; }
.mail-copy { display: inline-flex; align-items: center; gap: 0.45rem; margin-left: auto; min-height: 2.75rem; padding: 0 1rem 0 0.85rem; border-radius: 999px; background: var(--paper-2); color: var(--ink-soft); font-size: var(--step-small); font-weight: 600; box-shadow: inset 0 0 0 1px var(--rule); transition: color 160ms ease, background-color 160ms ease, scale 140ms var(--ease-out); }
.mail-copy:hover { color: var(--ink); }
.mail-copy:active { scale: 0.96; }
.mail-copy.is-done { background: #2340ff; color: #fff; box-shadow: none; }

.foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; padding-top: 2rem; padding-bottom: 2.5rem; color: var(--ink-soft); font-size: var(--step-small); }
.foot-name { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }

/* ---------- smaller screens ---------- */
@media (max-width: 1439px) {
  .included { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .ticks-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  /* a tablet: the title, the desktop shot across, then the phone shot tall beside two tiles, and two more below */
  .bento, .sample:nth-child(odd of .sample) .bento { grid-template-columns: 1fr 1fr; grid-template-rows: auto; grid-auto-rows: minmax(8rem, auto);
    grid-template-areas: "title title" "desk desk" "phone f1" "phone f2" "f3 f4"; }
  .tile-phone { min-height: 26rem; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .hero-foot { grid-template-columns: 1fr; }
  .hero h1 { padding-bottom: 0; border-bottom: 0; }
  .hero-side { padding: 1.25rem 0 0; border-top: 1px solid rgba(255, 255, 255, 0.45); max-width: none; }
  /* on a phone the scene takes the space between the pill and the words */
  .scene { top: 4.5rem; left: 0; right: 0; width: 100%; height: calc(56% - 4.5rem); }
  .mail { font-size: 12.5vw; }
  /* on a phone the same order as a tablet, a little tighter */
  .tile-title { min-height: 15rem; }
  .tile-phone { min-height: 22rem; }
  .tile-phone img { top: 1rem; bottom: 1rem; height: calc(100% - 2rem); }
  .tile-feat { padding: 1.1rem 1.15rem; font-size: 1rem; }
  .steps { grid-template-columns: 1fr; }
}

/* ---------- entrances: content shows without script; with it, parts rise in as they arrive ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* the transition sits on the arriving state only, so hiding them at load doesn't fade anything out first */
  .js [data-rise] { opacity: 0; transform: translateY(24px); }
  .js [data-rise].in { opacity: 1; transform: none; transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: var(--d, 0ms); }
}
