/* Sabine Agents: site styles */

:root {
  --bg: #050a1c;          /* deep navy, the page background */
  --text: #e8f0ff;        /* near-white with a blue cast */
  --text-soft: #9fb4dc;   /* secondary text */
  --accent: #6fa3ff;      /* links, focus */
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

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

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
}

/* Hero */

.hero {
  position: relative;
  min-height: max(100vh, 560px);
  min-height: max(100svh, 560px);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Fades the effect into the page at the bottom edge */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(120px, 20vh, 200px) 16px 0;
  pointer-events: none;
}

.hero-title,
.section-title {
  margin: 0;
  /* Cursive shape for the name; the canvas draws it in water characters. */
  font-family: "Pacifico", "Brush Script MT", cursive;
  font-weight: 400;
  font-size: clamp(3.5rem, 10vw, 8.75rem);
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--text);
  text-shadow: 0 0 40px rgba(5, 10, 28, 0.9), 0 0 18px rgba(5, 10, 28, 0.9);
}

/* When the script runs, the name is drawn on the canvas; the real heading
   stays in the page, invisible, for search engines and screen readers. */
.js-hero .hero-title { color: transparent; text-shadow: none; }

.hero-tagline {
  margin: 1.25rem 0 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-soft);
  text-shadow: 0 0 16px rgba(5, 10, 28, 1);
}

/* Sections below the pond */

.page-section {
  width: min(100%, 56rem);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding: clamp(32px, 6vw, 88px) clamp(16px, 4vw, 32px);
  display: grid;
  align-content: center;
  justify-items: center;
}

.section-heading {
  position: relative;
  width: 100%;
  padding-block: 24px;
  text-align: center;
}

.section-title-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.has-water-title .section-title { color: transparent; text-shadow: none; }

@media (prefers-reduced-motion: no-preference) {
  .section-heading.has-water-title { animation: section-title-enter 550ms ease-out both; }

  @keyframes section-title-enter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

.about-section {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 0;
  padding-block: clamp(40px, 5.5vw, 80px) clamp(62px, 8vw, 112px);
}

.about-section .section-heading { max-width: 52rem; }

.about-tagline {
  position: relative;
  width: min(100%, 42rem);
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: 0.35em;
  font: 600 clamp(0.875rem, 4vw, 1.375rem)/1.4 var(--font-mono);
  text-align: center;
}

.about-tagline-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.about-tagline.is-decoding > span { color: transparent; }

.about-copy {
  width: min(100%, 42rem);
  color: #d6e2f5;
  font: 400 clamp(1rem, 1.6vw, 1.1875rem)/1.7 system-ui, sans-serif;
  text-align: left;
}

.about-copy p { margin: 0; }
.about-copy p + p { margin-top: 1em; }

.about-copy .about-lead {
  color: var(--text);
  font-size: 1.1em;
  line-height: 1.6;
  text-align: center;
}

/* The bolded line sits on its own line, with a little space above and below. */
.about-lead strong {
  display: block;
  margin-block: 0.6em;
  font-weight: 650;
}

/* The ripple field fades toward the reading column. */
.about-ripples {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(to right,
    #000 max(0px, calc(50% - 28rem)),
    transparent max(0px, calc(50% - 22rem)),
    transparent min(100%, calc(50% + 22rem)),
    #000 min(100%, calc(50% + 28rem)));
}

/* Broken shorelines and wave crests share a monospace character grid. */
.about-ripple {
  --shoreline: "       .--~~---.      .      \A    .--'         '~-.         \A   (                     ..   \A    '-.__            __.-'    \A         --__~~---___         ";
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(clamp(7rem, 12vw, 18rem) * var(--size, 1));
  aspect-ratio: 2.65;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: max(0.375rem, calc(clamp(0.5rem, 0.72vw, 1.05rem) * var(--size, 1)));
  font-weight: 500;
  line-height: 1;
}

.about-ripple:nth-child(3n + 2) {
  --shoreline: "     .      .--~~--.         \A    ._--~---'        '-.      \A  ..                     )    \A    '-._       __       .'    \A         '--~~'  '--__--      ";
}

.about-ripple:nth-child(3n) {
  --shoreline: "      .--~--.        .       \A  (---'       '---~.          \A                        ).    \A   '-.___         __.--'      \A         --~~--__-            ";
}

.about-ripple::before,
.about-ripple::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: pre;
}

.about-ripple::before {
  content: "        .--~~--.             \A        (    .   )            \A         '-~~---'             ";
  color: #88bfff;
  opacity: 0.48;
}

.about-ripple::after {
  content: var(--shoreline);
  color: #5388cf;
  opacity: 0.55;
}

@media (max-width: 56rem) {
  .about-ripples {
    opacity: 0.62;
    mask-image: linear-gradient(to bottom, #000 9%, transparent 27%, transparent 83%, #000);
  }

  .about-ripple { top: var(--narrow-y, var(--y)); }
}

@media (prefers-reduced-motion: no-preference) {
  .about-ripple::before {
    animation: about-ripple-spread 10.8s linear var(--delay) infinite paused;
  }

  .about-ripples.is-visible .about-ripple::before { animation-play-state: running; }

  .about-ripples .about-ripple-drop::before {
    animation: about-ripple-spread 3.4s linear both;
  }

  @keyframes about-ripple-spread {
    from {
      content: "             .               ";
      opacity: 0;
    }
    12% {
      content: "            -~-              ";
      opacity: 0.52;
    }
    26% {
      content: "          .      .           \A          (~~---~~)           ";
      opacity: 0.72;
    }
    44% {
      content: "        .--~~---.            \A       (     .     )          \A         '--~~---'            ";
      opacity: 0.58;
    }
    62% {
      content: "     .---~~~---..            \A    (           -~    )       \A       '--__--~~---'          ";
      opacity: 0.4;
    }
    81.5%, to {
      content: "  .--~---.       .--~--.     \A  (                         ) \A     '-__---~~---__---'       ";
      opacity: 0;
    }
  }
}

.about-ripple-drop { width: clamp(7rem, 19vw, 16rem); }
.about-ripple-drop::after { content: none; }

/* Contact form */

.contact-section {
  position: relative;
  isolation: isolate;
  min-height: 0;
  padding-block: clamp(40px, 5.5vw, 80px) clamp(62px, 8vw, 112px);
}

.contact-bubbles {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  color: #88bfff;
}

/* Keep the bubble streams in the gutters beside the form. */
.contact-bubble-stream {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: max(1rem, calc((100% - 42rem) / 2));
  overflow: hidden;
}

.contact-bubble-stream + .contact-bubble-stream {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

.contact-bubble {
  position: absolute;
  top: var(--y);
  left: var(--x);
  transform: translateX(-50%);
  font: 500 var(--size)/1 var(--font-mono);
  opacity: 0.46;
}

/* On narrow screens, frame the heading where there is room beside it. */
@media (max-width: 47rem) {
  .contact-bubble-stream {
    inset-block: 0 auto;
    inline-size: clamp(2.75rem, 16vw, 6rem);
    block-size: clamp(8rem, 30vw, 10.5rem);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .contact-bubble {
    --drift: 0.5rem;
    animation: contact-bubble-rise var(--duration) linear var(--delay) infinite;
  }

  .contact-bubble:nth-child(even) { --drift: -0.5rem; }

  @keyframes contact-bubble-rise {
    0% { opacity: 0; }
    30%, 55% { opacity: 0.63; }
    100% {
      opacity: 0;
      transform: translate(calc(-50% + var(--drift)), -2.75rem);
    }
  }
}

.contact-form {
  width: min(100%, 42rem);
  margin-top: clamp(0.5rem, 2vw, 1.25rem);
  font: 400 1rem/1.55 system-ui, sans-serif;
}

.contact-fields {
  display: grid;
  gap: clamp(0.9rem, 2vw, 1.2rem);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.contact-field {
  display: grid;
  gap: 0.35rem;
}

.contact-field label { font-weight: 600; }

.contact-field label span {
  color: var(--text-soft);
  font-weight: 400;
}

.contact-status,
.contact-links {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9375rem;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #34496f;
  border-radius: 0.5rem;
  background: #0c152d;
  color: var(--text);
  color-scheme: dark;
  font: inherit;
}

.contact-field textarea { resize: vertical; }

.contact-form :is(input, textarea, button, a):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contact-actions {
  display: grid;
  gap: 0.65rem;
  margin-top: calc(1.25rem + 1lh);
}

.contact-submit {
  justify-self: end;
  min-height: 3rem;
  padding: 0.65rem 1.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: #c4dcff;
  color: var(--bg);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.contact-submit:hover:enabled { background: #deebff; }
.contact-submit:disabled { opacity: 0.7; cursor: default; }
.contact-status[data-state="success"] { color: #b5d9ff; }
.contact-status[data-state="error"] { color: #ffc3bc; }

.contact-links:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.contact-links a {
  color: var(--text-soft);
  overflow-wrap: anywhere;
  text-underline-offset: 0.2em;
}

/* Privacy policy and other plain text pages */

.legal-page {
  width: min(100%, 42rem);
  margin-inline: auto;
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 32px) clamp(62px, 8vw, 112px);
  color: #d6e2f5;
  font: 400 1rem/1.7 system-ui, sans-serif;
}

.legal-page a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

.legal-page a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.legal-back { margin: 0 0 clamp(1.5rem, 4vw, 2.5rem); }
.legal-back a { color: var(--text-soft); }

.legal-title {
  margin: 0;
  font-family: "Pacifico", "Brush Script MT", cursive;
  font-weight: 400;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1.35;
  color: var(--text);
}

.legal-updated {
  margin: 0.25rem 0 2rem;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.legal-copy h2 {
  margin: 2.25rem 0 0.5rem;
  color: var(--text);
  font: 600 1.0625rem/1.4 var(--font-mono);
}

.legal-copy p,
.legal-copy ul { margin: 0; }
.legal-copy :is(p, ul) + :is(p, ul) { margin-top: 0.85em; }
.legal-copy ul { padding-left: 1.25rem; }
.legal-copy li + li { margin-top: 0.3em; }
.legal-copy strong { color: var(--text); font-weight: 650; }
