/* Tom Webb card — Mavisoft
   One family (Bricolage Grotesque, variable weight + width).
   The card is the one loud object; everything else stays quiet. */

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque-latin-wdth-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  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: "Bricolage";
  src: url("../fonts/bricolage-grotesque-latin-ext-wdth-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --field: #0758B4;
  --field-deep: #03336F;
  --paper: #F7F7F2;
  --ink: #0A1F44;
  --mist: rgba(247, 247, 242, .74);
  --faint: rgba(247, 247, 242, .5);
  --line: rgba(247, 247, 242, .2);

  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.625rem;
  --step-3: clamp(2.25rem, 6vw + 1rem, 4.25rem);

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .5, 1);
  --rx: 0deg;
  --ry: 0deg;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  font-family: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--step-0);
  line-height: 1.5;
  font-weight: 420;
  color: var(--paper);
  background: var(--field);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Field: flat ultramarine, a soft pool of light behind the card, and grain. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(70vmax 55vmax at 50% 8%, rgba(0, 157, 222, .42), transparent 60%),
    radial-gradient(60vmax 60vmax at 100% 100%, var(--field-deep), transparent 70%),
    var(--field);
}
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  padding: .6rem 1rem; border-radius: 999px;
  background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 600;
}
.skip:focus { top: 1rem; }

/* ---------- Layout ---------- */
.page {
  width: min(100%, 76rem);
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem calc(6.5rem + env(safe-area-inset-bottom));
}
.hero { display: grid; gap: 2rem; padding-top: .75rem; }
.hero__text { display: grid; gap: 1.75rem; }
.details { display: grid; gap: 3.5rem; margin-top: 4rem; }

@media (min-width: 60rem) {
  .page {
    display: grid;
    grid-template-columns: minmax(0, 27rem) minmax(0, 1fr);
    gap: 5rem;
    align-items: start;
    padding: 4rem 2.5rem 4rem;
  }
  .hero { position: sticky; top: 3rem; padding-top: 0; }
  .details { margin-top: 0; padding-top: .5rem; }
  .savebar { display: none !important; }
}

/* ---------- The card ---------- */
.stage {
  position: relative;
  perspective: 1400px;
  width: 100%;
  max-width: 27rem;
  margin-inline: auto;
  touch-action: pan-y;
  container-type: inline-size;
}
.card {
  position: relative;
  aspect-ratio: 85 / 55;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--flip, 0deg)));
  transition: transform .9s var(--ease-spring);
  cursor: pointer;
  border-radius: 1.1rem;
}
.stage.is-tracking .card { transition: transform .12s linear; }
.card.is-flipped { --flip: 180deg; }

.card__face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.card__front {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 6.5% 7.5% 6%;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 45%),
    var(--paper);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px rgba(10, 31, 68, .06),
    inset 0 -2px 0 rgba(10, 31, 68, .05);
}
.card__top { display: flex; justify-content: space-between; align-items: start; }

.card__logo { display: block; height: 6.6cqi; width: auto; }

/* The Mavisoft mark, scaled up behind the card like light through glass.
   It drifts against the card's tilt. */
.ghost {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 135cqi;
  z-index: -2;
  opacity: .22;
  mix-blend-mode: screen;
  pointer-events: none;
  transform: translate(calc(-50% + var(--gx, 0px)), calc(-56% + var(--gy, 0px)));
  transition: transform .9s var(--ease-spring);
}
.ghost svg { display: block; width: 100%; height: auto; }
.stage.is-tracking .ghost { transition: transform .2s linear; }

.card__name {
  align-self: end;
  margin: 2cqi 0 2cqi;
  font-size: 19cqi;
  font-weight: 800;
  font-stretch: 75%;
  line-height: .8;
  letter-spacing: -.035em;
  display: grid;
}
.card__bottom { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.card__role { margin: 0; font-size: 4.1cqi; line-height: 1.3; font-weight: 560; }
.card__role span { font-weight: 420; color: rgba(10, 31, 68, .6); }

.card__flip {
  flex: none;
  font: inherit;
  font-size: 3.5cqi;
  font-weight: 600;
  color: var(--ink);
  background: rgba(10, 31, 68, .07);
  border: 0;
  border-radius: 999px;
  padding: .45em .95em;
  cursor: pointer;
}
.card__flip:hover { background: rgba(10, 31, 68, .12); }

.card__sheen {
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .65) 48%, transparent 60%);
  transform: translateX(-120%);
  mix-blend-mode: soft-light;
}

.card__back {
  transform: rotateY(180deg);
  background:
    radial-gradient(120% 90% at 20% 0%, #14335F, transparent 60%),
    var(--ink);
  color: var(--paper);
  display: grid;
  grid-template-columns: 49cqi 1fr;
  grid-template-rows: 1fr auto;
  grid-template-areas: "qr text" "qr btn";
  column-gap: 6cqi;
  padding: 7.5cqi;
}
.card__qr { grid-area: qr; width: 49cqi; height: 49cqi; align-self: center; }
.card__qr svg { width: 100%; height: 100%; }
.card__scan { grid-area: text; align-self: start; margin: 0; font-size: 3.9cqi; line-height: 1.3; color: var(--mist); }
.card__scan strong { display: block; margin-top: 1.6cqi; color: var(--paper); font-weight: 650; font-size: 4.4cqi; line-height: 1.2; }
.card__flip--back {
  grid-area: btn;
  justify-self: start;
  color: var(--paper);
  background: rgba(247, 247, 242, .12);
}
.card__flip--back:hover { background: rgba(247, 247, 242, .2); }

.stage__shadow {
  position: absolute;
  left: 8%; right: 8%; bottom: -9%;
  height: 22%;
  border-radius: 50%;
  background: rgba(2, 24, 58, .55);
  filter: blur(22px);
  z-index: -1;
  transform: translateX(calc(var(--gx, 0px) * -.5));
  transition: transform .9s var(--ease-spring);
}

/* ---------- Intro + actions ---------- */
.intro {
  margin: 0;
  max-width: 30ch;
  font-size: var(--step-1);
  line-height: 1.35;
  font-weight: 460;
  text-wrap: pretty;
}
.actions { display: grid; gap: .75rem; }
.actions__row { display: flex; flex-wrap: wrap; gap: .75rem; }

.btn, .wallet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 3.5rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 620;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active, .wallet:active { transform: scale(.97); }
.btn svg, .wallet svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn--primary {
  width: 100%;
  min-height: 3.875rem;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--step-1);
  box-shadow: 0 10px 30px -10px rgba(2, 24, 58, .6);
}
.btn--primary:hover { background: #fff; }
.btn--ghost {
  background: rgba(247, 247, 242, .1);
  color: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  flex: 1 0 auto;
}
.btn--ghost:hover { background: rgba(247, 247, 242, .16); }

/* Wallet buttons: black, as both Apple and Google require. Swap in the
   official badge artwork before going wide (see README). */
.wallet {
  background: #000;
  color: #fff;
  padding: 0 1.25rem 0 1rem;
  flex: 1 0 auto;
  line-height: 1.05;
  text-align: left;
}
.wallet span { display: grid; font-size: 1rem; font-weight: 600; }
.wallet small { font-size: .72rem; font-weight: 450; opacity: .85; }
.wallet--apple svg { fill: currentColor; stroke: none; width: 1.5rem; height: 1.5rem; }
.wallet:hover { background: #16161a; }

/* Show only the wallet that matches the visitor's phone. */
[data-platform="ios"] .wallet--google,
[data-platform="android"] .wallet--apple { display: none; }

.inapp {
  margin: 0;
  padding: .85rem 1rem;
  border-radius: .9rem;
  background: rgba(2, 24, 58, .35);
  color: var(--mist);
  font-size: var(--step--1);
}

/* ---------- Detail blocks ---------- */
.block__title {
  margin: 0 0 .5rem;
  font-size: var(--step-1);
  font-weight: 560;
  color: var(--mist);
  letter-spacing: -.005em;
}
.lines, .projects { list-style: none; margin: 0; padding: 0; }

.line {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding: .9rem 0;
}
.line:last-child { border-bottom: 1px solid var(--line); }
.line__main {
  flex: 1;
  min-width: 0;
  display: grid;
  text-decoration: none;
}
.line__label { font-size: var(--step--1); color: var(--faint); }
.line__value {
  font-size: var(--step-2);
  font-weight: 600;
  font-stretch: 88%;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.line__acts { display: flex; gap: .5rem; }
.iconbtn {
  display: grid;
  place-items: center;
  width: 3rem; height: 3rem;
  border-radius: 50%;
  background: rgba(247, 247, 242, .1);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .2s, transform .2s var(--ease-out);
}
.iconbtn:hover { background: var(--paper); color: var(--ink); }
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
.iconbtn--line svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* Projects: the type itself is the interaction. Names widen on hover. */
.project {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name go" "meta go";
  align-items: center;
  column-gap: 1rem;
  padding: 1.1rem 0 1.2rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.projects li:last-child .project { border-bottom: 1px solid var(--line); }
.project__name {
  grid-area: name;
  font-size: var(--step-3);
  font-weight: 760;
  font-stretch: 76%;
  line-height: .95;
  letter-spacing: -.03em;
  transition: font-stretch .5s var(--ease-out), font-weight .5s var(--ease-out);
}
.project__meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  gap: .15rem 1rem;
  margin-top: .45rem;
  font-size: var(--step--1);
  color: var(--faint);
}
.project__desc { color: var(--mist); }
.project__go {
  grid-area: go;
  display: grid; place-items: center;
  width: 3rem; height: 3rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .3s, color .3s, transform .4s var(--ease-out);
}
.project__go svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.project:hover .project__name, .project:focus-visible .project__name { font-stretch: 100%; font-weight: 800; }
.project:hover .project__go, .project:focus-visible .project__go { background: var(--paper); color: var(--ink); transform: rotate(45deg); }

.foot { color: var(--faint); font-size: var(--step--1); }
.foot p { margin: 0; }

/* ---------- Sticky save bar (mobile) ---------- */
.savebar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  padding: .75rem 1.25rem calc(.75rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(3, 51, 111, .95) 40%, rgba(3, 51, 111, 0));
  transform: translateY(110%);
  transition: transform .45s var(--ease-out);
}
.savebar.is-visible { transform: none; }

.toast {
  position: fixed;
  left: 50%; bottom: calc(6rem + env(safe-area-inset-bottom));
  z-index: 30;
  transform: translate(-50%, 1rem);
  opacity: 0;
  padding: .7rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--step--1);
  font-weight: 560;
  pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease-out);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- The one orchestrated moment: the card is dealt onto the table ---------- */
@keyframes deal {
  0%   { transform: translateY(-38%) rotateX(58deg) rotateZ(-7deg) scale(.9); opacity: 0; }
  55%  { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes sheen { to { transform: translateX(120%); } }
@keyframes ghostin { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(.75rem); } }

.is-loading .stage, .is-loading .hero__text, .is-loading .details { opacity: 0; }
.is-ready .stage { animation: deal 1.15s var(--ease-out) both; transform-origin: 50% 100%; }
.is-ready .card__sheen { animation: sheen 1.3s .85s var(--ease-out) both; }
.is-ready .ghost { animation: ghostin 1.6s .3s var(--ease-out) both; }
.is-ready .hero__text { animation: rise .7s .75s var(--ease-out) both; }
.is-ready .details { animation: rise .7s .95s var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) {
  .is-ready .stage, .is-ready .card__sheen, .is-ready .ghost, .is-ready .hero__text, .is-ready .details { animation: none; }
  .is-loading .stage, .is-loading .hero__text, .is-loading .details { opacity: 1; }
  .card, .stage__shadow, .project__name, .savebar { transition: none; }
}

@media (max-width: 22rem) {
  .line__value { font-size: var(--step-1); }
}
