/* Layout: one full-viewport generative field. The name and the offer sit bottom-left;
   the field's focus sits upper-right. Everything else stays out of the way. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Colour. One deep ground per name, strands run from --far to --near. */
  --ground: #0c0f2e;
  --far: #4a5cf0;
  --near: #ffd2a8;
  --ink: #f3eee4;
  --quiet: color-mix(in srgb, var(--ink) 68%, var(--ground));
  --rule: color-mix(in srgb, var(--ink) 24%, var(--ground));
  --panel: color-mix(in srgb, var(--ground) 90%, var(--ink));
  --shade: color-mix(in srgb, var(--ground) 62%, black);

  /* Type. One family, two widths: expanded for the name, normal for everything else. */
  --face: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --size-name: clamp(2.75rem, 1.1rem + 6.4vw, 7.25rem);
  --size-lead: clamp(1.4rem, 1rem + 1.7vw, 2.6rem);
  --size-text: 1rem;
  --size-small: 0.9rem;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

:root[data-domain="simaturity.com"] {
  --ground: #0a1f1b;
  --far: #2f9c82;
  --near: #e6efb4;
  --ink: #f0f1e2;
}

:root[data-domain="sirulebook.com"] {
  --ground: #1d0f24;
  --far: #9a6bff;
  --near: #ffd0e2;
  --ink: #f6ecf2;
}

:root[data-domain="siforenterprise.com"] {
  --ground: #0b1b26;
  --far: #2b8fb3;
  --near: #c8f1ee;
  --ink: #edf2f1;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--face);
  font-size: var(--size-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Keeps the words readable where strands pass behind them. */
.veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top right,
    color-mix(in srgb, var(--shade) 92%, transparent) 0%,
    color-mix(in srgb, var(--shade) 58%, transparent) 30%,
    transparent 60%
  );
}

.stage {
  position: relative;
  min-height: 100%;
  padding-block: var(--gutter);
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem var(--gutter);
}

.lot {
  min-width: 0;
  display: grid;
  gap: 1.25rem;
  justify-items: start;
}

.lot h1 {
  margin: 0;
  max-width: 11em;
  font-size: var(--size-name);
  font-weight: 300;
  font-stretch: 125%;
  line-height: 0.96;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lot .slogan {
  margin: 0;
  max-width: 21em;
  font-size: var(--size-lead);
  font-weight: 300;
  font-stretch: 112%;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.act {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.4rem;
}

.terms {
  margin: 0;
  display: grid;
  gap: 0.1rem;
  font-size: var(--size-small);
  color: var(--quiet);
}

.terms strong {
  color: var(--ink);
  font-weight: 500;
  font-size: var(--size-text);
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--near);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.primary {
  appearance: none;
  border: 0;
  border-radius: 2px;
  padding: 0.85em 1.5em;
  background: var(--near);
  color: var(--ground);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.primary:hover {
  background: var(--ink);
}

.plain {
  appearance: none;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.85em 1.2em;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.plain:hover {
  border-color: var(--ink);
}

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

.others {
  display: grid;
  gap: 0.3rem;
  justify-items: end;
  text-align: right;
  font-size: var(--size-small);
}

.others p {
  margin: 0;
  color: var(--quiet);
}

/* Offer dialog */

dialog {
  width: min(30rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 1.75rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--panel);
  color: var(--ink);
}

dialog::backdrop {
  background: color-mix(in srgb, var(--ground) 72%, transparent);
  backdrop-filter: blur(6px);
}

dialog h2 {
  margin: 0 0 1.25rem;
  font-size: 1.3rem;
  font-weight: 500;
  font-stretch: 112%;
  line-height: 1.2;
  text-wrap: balance;
}

.fields {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.field label {
  font-size: var(--size-small);
  color: var(--quiet);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  padding: 0.65em 0.75em;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: color-mix(in srgb, var(--ground) 70%, transparent);
}

.field textarea {
  resize: vertical;
  min-height: 5.5em;
}

.amount {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.5rem;
  gap: 0.6rem;
}

.note {
  margin: 0;
  font-size: var(--size-small);
  color: var(--quiet);
}

.note strong {
  color: var(--ink);
  font-weight: 500;
  user-select: all;
}

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

#offer-result {
  margin: 0;
  font-size: var(--size-small);
}

@media (max-width: 720px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    align-content: end;
  }

  .others {
    justify-items: start;
    text-align: left;
  }

  .veil {
    background: linear-gradient(
      to top,
      color-mix(in srgb, var(--shade) 94%, transparent) 0%,
      color-mix(in srgb, var(--shade) 66%, transparent) 42%,
      transparent 72%
    );
  }
}

/* Opening: the words come into focus while the strands fall into place. */
@media (prefers-reduced-motion: no-preference) {
  .lot > *,
  .others {
    animation: focus-in 1.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .lot > h1 {
    animation-delay: 0.5s;
  }

  .lot > .slogan {
    animation-delay: 0.85s;
  }

  .lot > .act,
  .others {
    animation-delay: 1.25s;
  }

  @keyframes focus-in {
    from {
      opacity: 0;
      filter: blur(14px);
      letter-spacing: 0.04em;
    }
    to {
      opacity: 1;
      filter: blur(0);
    }
  }
}

/* Used only when a still image of the page is captured for link previews. */
:root.shot .act,
:root.shot .others {
  display: none;
}
