/* Illustrious Labs. Violet leads in dark mode; canary leads in light mode.
   Slate is dark gray. Readers can switch modes; with no choice saved, the system setting applies. */

/* Self-hosted fonts under the SIL Open Font License (texts in assets/fonts/). */
@font-face {
  font-family: 'Iceland';
  src: url('assets/fonts/Iceland-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Sans';
  src: url('assets/fonts/InstrumentSans-Variable.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Color tokens. Dark is the default. */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #2A0A66;
  --ink: #FFEF00;
  --panel: #2B2F36;
  --panel-ink: #FFEF00;
  --bubble-a: #FFEF00;
  --bubble-b: #7B2CFF;
  --btn-bg: #FFEF00;
  --btn-ink: #2B2F36;
  --field-bg: #2B2F36;
  --field-ink: #FFEF00;
  --field-border: #FFEF00;
  --field-error-bg: #FFEF00;
  --field-error-ink: #2B2F36;
  --field-error-border: #FFEF00;
}

/* Light applies only when no explicit choice is saved. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #FFEF00;
    --ink: #2B2F36;
    --panel: #2A0A66;
    --panel-ink: #FFEF00;
    --bubble-a: #2B2F36;
    --bubble-b: #7B2CFF;
    --btn-bg: #2A0A66;
    --btn-ink: #FFEF00;
    --field-bg: #2A0A66;
    --field-ink: #FFEF00;
    --field-border: #FFEF00;
    --field-error-bg: #FFEF00;
    --field-error-ink: #2B2F36;
    --field-error-border: #2B2F36;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FFEF00;
  --ink: #2B2F36;
  --panel: #2A0A66;
  --panel-ink: #FFEF00;
  --bubble-a: #2B2F36;
  --bubble-b: #7B2CFF;
  --btn-bg: #2A0A66;
  --btn-ink: #FFEF00;
  --field-bg: #2A0A66;
  --field-ink: #FFEF00;
  --field-border: #FFEF00;
  --field-error-bg: #FFEF00;
  --field-error-ink: #2B2F36;
  --field-error-border: #2B2F36;
}

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

html {
  background: var(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  position: relative;
  z-index: 0;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

::selection {
  background: var(--ink);
  color: var(--bg);
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--btn-bg);
  color: var(--btn-ink);
}

.skip:focus {
  top: 16px;
}

/* Bubbles: free-floating, behind the content, never clipped by a frame. */

.bubble-field {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.ball {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform;
}

.ball--a {
  background: var(--bubble-a);
}

.ball--b {
  background: var(--bubble-b);
}

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 24px clamp(20px, 5vw, 64px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  color: var(--ink);
  font-family: 'Iceland', sans-serif;
  font-size: 34px;
  line-height: 1;
  text-decoration: none;
}

.mark {
  display: block;
  width: auto;
  height: 56px;
  color: var(--ink);
  overflow: visible;
}

.header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

.site-header nav a:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.theme-toggle {
  display: none;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 3px var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.js .theme-toggle {
  display: inline-flex;
}

.theme-toggle:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* Hero */

.hero {
  padding: clamp(40px, 8vw, 112px) clamp(20px, 5vw, 64px) 0;
}

.hero h1,
.section h2 {
  text-wrap: balance;
}

.hero h1 {
  margin: 0;
  font-family: 'Iceland', sans-serif;
  font-weight: 400;
  font-size: clamp(72px, 13vw, 200px);
  line-height: 0.85;
}

.lede {
  max-width: 560px;
  margin: 40px 0 0;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.45;
}

.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 44px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.btn:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 3px var(--ink);
}

/* Sections */

.section {
  padding: clamp(64px, 10vw, 128px) clamp(20px, 5vw, 64px) 0;
}

.section h2 {
  margin: 0;
  font-family: 'Iceland', sans-serif;
  font-weight: 400;
  font-size: clamp(56px, 8vw, 120px);
  line-height: 0.9;
}

.section > p {
  max-width: 680px;
  margin: 24px 0 0;
  font-size: 22px;
  line-height: 1.5;
}

.section h3 {
  margin: 48px 0 0;
  font-family: 'Iceland', sans-serif;
  font-weight: 400;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 220px;
  padding: 28px;
  background: var(--panel);
  color: var(--panel-ink);
}

.card h3 {
  margin: 0;
  font-family: 'Iceland', sans-serif;
  font-weight: 400;
  font-size: 48px;
  line-height: 1;
}

.card p {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

/* Contact form */

.contact-form {
  display: grid;
  gap: 24px;
  max-width: 680px;
  margin-top: 48px;
}

.form-note {
  margin: 0;
  font-size: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 18px;
  font-weight: 600;
}

/* Every field has the same border width in every state. */
.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 3px solid var(--field-border);
  border-radius: 0;
  background: var(--field-bg);
  color: var(--field-ink);
  font: inherit;
  font-size: 18px;
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

/* An error is shown by inverting the field's colors, never by changing its border width. */
.field.is-invalid input,
.field.is-invalid textarea {
  background: var(--field-error-bg);
  color: var(--field-error-ink);
  border-color: var(--field-error-border);
}

/* Browser autofill would paint these fields pale. Keep them in the palette. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--field-ink);
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg) inset;
  box-shadow: 0 0 0 1000px var(--field-bg) inset;
  caret-color: var(--field-ink);
}

.field-error {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.field-error::before {
  content: '! ';
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form button {
  justify-self: start;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.contact-form button:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.contact-form button:disabled {
  cursor: progress;
}

.form-status {
  min-height: 1.5em;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

/* Shown while the server has the inquiry form switched off. */
.form-paused {
  margin: 0;
  padding: 16px 20px;
  border: 3px solid var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

.form-paused[hidden] {
  display: none;
}

.field :disabled {
  cursor: not-allowed;
}

/* Footer */

.site-footer {
  padding: 96px clamp(20px, 5vw, 64px) 48px;
  font-size: 16px;
}

.site-footer p {
  margin: 0;
}
