/* withaes.com: Aes's own look (src/app/globals.css, the Aes scheme in dark mode), for one public page. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  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: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/hanken-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/hanken-grotesk-latin.woff2") format("woff2");
  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;
}

:root {
  color-scheme: dark;
  /* Aes in dark mode: a breath cooler than neutral near-black. */
  --page: #0e0e11;
  --surface: #17171b;
  --surface-2: #212126;
  --surface-3: #2b2b31;
  --ink: #f3f3f4;
  --ink-2: #c7c7cc;
  --muted: #8c8c93;
  --line: color-mix(in srgb, var(--ink) 9%, transparent);
  --line-strong: color-mix(in srgb, var(--ink) 17%, transparent);
  --edge-light: color-mix(in srgb, var(--ink) 4%, transparent);
  --sheen: color-mix(in srgb, var(--ink) 2.5%, transparent);
  /* Its colour: a soft periwinkle, and the banner's blue, violet and peach around it. */
  --accent: #c9cdee;
  --on-accent: #1b1e33;
  --blue: color-mix(in oklab, #a9c6ec 72%, var(--accent));
  --violet: color-mix(in oklab, #c6bbea 75%, var(--accent));
  --peach: color-mix(in oklab, #ecc3ae 62%, var(--accent));
  --fill: linear-gradient(115deg, var(--blue), var(--violet) 55%, var(--peach));
  --fill-hover: linear-gradient(
    115deg,
    color-mix(in oklab, var(--blue) 82%, white),
    color-mix(in oklab, var(--violet) 82%, white) 55%,
    color-mix(in oklab, var(--peach) 82%, white)
  );
  --series-1: #519cce;
  --series-2: #cc7a54;
  --series-3: #9e84cd;
  /* Status lights: the banner's pastels. */
  --status-1: color-mix(in oklab, var(--series-1) 62%, white);
  --status-2: color-mix(in oklab, var(--series-3) 62%, white);
  --status-3: color-mix(in oklab, var(--series-2) 62%, white);
  /* Money: in is green (a small amount light, a bigger one deeper); out and owed run amber to red. */
  --good-soft: #b4e6c4;
  --good: #81d39f;
  --warning: #e9c67d;
  --focus: color-mix(in srgb, var(--accent) 70%, var(--ink));
  --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
  --font-text: "Hanken Grotesk", system-ui, sans-serif;
  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --width: 72rem;
}

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

html {
  background: var(--page);
  scrollbar-color: var(--surface-3) var(--page);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
  font-family: var(--font-text);
  /* The display face at its calm optical size, as in the app. */
  font-variation-settings: "opsz" 20;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--page);
  caret-color: var(--accent);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

h1,
h2,
h3,
p,
dl,
dd,
ul,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.defs {
  position: absolute;
  overflow: hidden;
}

/* ---- The banner glow, as on the Overview: three soft lights fading into the page ---- */

.glow {
  position: absolute;
  inset: 0 0 auto 0;
  height: clamp(38rem, 82vh, 50rem);
  pointer-events: none;
  background:
    radial-gradient(55% 90% at 12% 10%, color-mix(in srgb, var(--series-1) 30%, transparent), transparent 62%),
    radial-gradient(45% 80% at 58% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 60%),
    radial-gradient(40% 70% at 92% 35%, color-mix(in srgb, var(--series-2) 22%, transparent), transparent 60%);
  -webkit-mask-image: linear-gradient(to bottom, #000 38%, rgb(0 0 0 / 0.84) 55%, rgb(0 0 0 / 0.5) 70%, rgb(0 0 0 / 0.16) 85%, transparent);
  mask-image: linear-gradient(to bottom, #000 38%, rgb(0 0 0 / 0.84) 55%, rgb(0 0 0 / 0.5) 70%, rgb(0 0 0 / 0.16) 85%, transparent);
}

.glow-mark {
  position: absolute;
  top: -3rem;
  right: 4%;
  width: clamp(14rem, 26vw, 22rem);
  fill: var(--ink);
  opacity: 0.05;
}

.glow-stars {
  position: absolute;
  inset: 5.5rem 0 auto 0;
  height: 9rem;
}

.twinkle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--s) * 0.85);
  height: var(--s);
  fill: color-mix(in srgb, var(--tone) 38%, var(--ink));
  filter: drop-shadow(0 0 1.5px color-mix(in srgb, var(--tone) 55%, transparent)) drop-shadow(0 0 5px color-mix(in srgb, var(--tone) 40%, transparent));
  opacity: 0.7;
  animation:
    drift 28s ease-in-out var(--d) infinite alternate,
    twinkle 6s ease-in-out var(--d) infinite alternate;
}

@keyframes drift {
  to {
    transform: translate(10px, -6px) rotate(24deg) scale(1.12);
  }
}

@keyframes twinkle {
  to {
    opacity: 0.32;
  }
}

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

.top,
main,
.foot {
  position: relative;
  max-width: var(--width);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}

.brand {
  display: inline-flex;
  border-radius: 0.5rem;
}

.wordmark {
  display: block;
  height: 2.25rem;
  width: auto;
  aspect-ratio: 865 / 452;
  fill: var(--ink);
}

.building {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  font-size: 0.8125rem;
  line-height: 1.125rem;
  font-weight: 500;
  color: var(--ink-2);
}

/* A status light: Aes's three colours, lit. */
.light {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--status-1), var(--status-2), var(--status-3));
  box-shadow: 0 1px 6px color-mix(in srgb, var(--status-2) 55%, transparent);
}

/* ---- The opening: the words, and the Overview itself ---- */

.hero {
  display: grid;
  gap: 3rem;
  align-items: start;
  padding-block: clamp(2rem, 6vh, 4.5rem) 0;
}

@media (min-width: 60rem) {
  /* Level with the card's figure, not floating mid-card. */
  .hero-words {
    padding-top: clamp(2.5rem, 7vh, 4.5rem);
  }
}

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 25.5rem);
    gap: clamp(3rem, 6vw, 6rem);
  }
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.4rem + 4.4vw, 4.5rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 12ch;
}

.lede {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  margin-top: 2rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--fill);
  color: var(--on-accent);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.25rem;
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Under the pointer the blend lightens (the app's main buttons). */
.button::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: var(--fill-hover);
  opacity: 0;
  transition: opacity 220ms ease-out;
}

.button:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .button:hover::before {
    opacity: 1;
  }
}

.arrow {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) {
  .button:hover .arrow {
    transform: translateX(3px);
  }
}

/* A quieter one (the app's secondary): the blend only under the pointer. */
.button.quiet {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  transition:
    color 220ms ease-out,
    transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) {
  .button.quiet:hover {
    color: var(--on-accent);
  }
}

/* The Overview, at about the app's own size: example figures only. */
.preview {
  width: 100%;
  max-width: 25.5rem;
  justify-self: center;
}

@media (min-width: 60rem) {
  .preview {
    justify-self: end;
  }
}

.app {
  padding: 1.25rem 1.25rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background:
    linear-gradient(180deg, var(--sheen), transparent 45%),
    var(--surface);
  box-shadow:
    inset 0 1px 0 var(--edge-light),
    var(--shadow-lg);
}

.label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--ink-2);
}

/* These aren't anyone's figures: said on the card itself. */
.sample {
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.8125rem;
  line-height: 1.125rem;
  color: var(--ink-2);
}

.networth {
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variant-numeric: proportional-nums;
}

.change {
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  line-height: 1.125rem;
  color: var(--ink-2);
}

.up {
  font-weight: 500;
  color: var(--good-soft);
}

.app-block {
  margin-top: 1.5rem;
}

/* A heading: its words, then the star leading a hairline that fades out. */
.lead-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lead-line {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.375rem;
  min-width: 2rem;
}

.lead-line svg {
  flex: none;
  width: 0.75rem;
  height: 0.875rem;
  fill: var(--ink);
}

.lead-line span {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 34%, transparent), transparent);
}

.rows {
  margin-top: 0.5rem;
}

.row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
}

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

/* The account's status light: up to date, in the banner's pastels. */
.status {
  align-self: stretch;
  width: 2px;
  margin-block: 0.125rem;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--status-1), var(--status-2), var(--status-3));
  box-shadow: 1px 0 6px color-mix(in srgb, var(--status-2) 40%, transparent);
}

.row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.name {
  font-size: 0.9375rem;
  line-height: 1.375rem;
  font-weight: 500;
}

.sub {
  font-size: 0.8125rem;
  line-height: 1.125rem;
  color: var(--ink-2);
}

.amount {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  line-height: 1.375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.amount.owed,
.amount.out {
  color: var(--warning);
}

.amount.in {
  color: var(--good);
}

.date {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 2.5rem;
  padding: 0.25rem 0;
  border-radius: 0.5rem;
  background: var(--surface-2);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--ink-2);
}

.date b {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

/* ---- What's in it, how it's safe, where it's at ---- */

.section {
  padding-top: clamp(5rem, 12vh, 8rem);
}

.lead-title.big {
  font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  gap: 0.875rem;
}

.lead-title.big .lead-line svg {
  width: 0.9375rem;
  height: 1.125rem;
}

/* The app's own parts, as a ruled list (its side panel, read out). */
.parts {
  margin-top: 2.25rem;
  border-top: 1px solid var(--line);
}

.parts li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  column-gap: 1rem;
  row-gap: 0.25rem;
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--line);
}

.parts .icon {
  grid-row: 1 / span 2;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.125rem;
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.parts h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.parts p {
  font-size: 0.9375rem;
  line-height: 1.5rem;
  color: var(--ink-2);
  max-width: 40rem;
}

@media (min-width: 48rem) {
  .parts li {
    grid-template-columns: 1.5rem minmax(10rem, 14rem) minmax(0, 1fr);
    align-items: baseline;
  }

  .parts .icon {
    grid-row: auto;
    align-self: center;
    margin-top: 0;
  }
}

/* Three plain promises, set large: the quiet passage after the list. */
.facts {
  display: grid;
  gap: 2.5rem;
  margin-top: 2.5rem;
  max-width: 46rem;
}

.facts dt {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.15rem + 0.9vw, 1.875rem);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.facts dd {
  margin-top: 0.625rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 38rem;
}

/* On a computer: each promise on its own ruled line, its words beside it, across the page's width. */
@media (min-width: 60rem) {
  .facts {
    max-width: none;
    gap: 0;
    border-top: 1px solid var(--line);
  }

  .facts > div {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 3rem;
    align-items: baseline;
    padding-block: 1.75rem;
    border-bottom: 1px solid var(--line);
  }

  .facts dd {
    margin-top: 0;
  }
}

.close-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
  margin-top: 1.75rem;
}

.close-body p {
  max-width: 34rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.close-body .button {
  margin-top: 0;
}

/* ---- The end ---- */

.foot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: clamp(5rem, 12vh, 8rem);
  padding-block: 2rem 2.5rem;
  /* A hairline over the content's width (not the gutters). */
  background: linear-gradient(var(--line), var(--line)) no-repeat center top / calc(100% - 2 * var(--gutter)) 1px;
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.foot .mark {
  width: 1rem;
  height: 1rem;
  fill: var(--ink-2);
}

/* ---- Phones ---- */

@media (max-width: 40rem) {
  .wordmark {
    height: 2rem;
  }

  .glow-stars {
    inset-block-start: 4.5rem;
    height: 6rem;
  }

  .twinkle.wide {
    display: none;
  }

  .glow-mark {
    top: -2.5rem;
    left: -3rem;
    right: auto;
    width: 13rem;
  }

  .button:not(.quiet) {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .twinkle {
    animation: none;
  }

  .button,
  .button::before,
  .arrow {
    transition: none;
  }
}
