/* Rubicon Technologies — shared styles */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/montserrat-latin-wght.woff2') format('woff2');
}

@property --wipe { syntax: '<percentage>'; inherits: false; initial-value: 140%; }

:root {
  color-scheme: light dark;
  --paper-hi: #ffffff;
  --paper:    #f4f7fc;
  --paper-lo: #d2def0;
  --ink:      28, 66, 141;     /* river lines: logo blue, foot of the gradient */
  --ink-hi:   50, 100, 188;    /* river lines: logo blue, head of the gradient */
  --near: .46; --mid: .24; --far: .09;
  --text:     #0a1b3d;
  --text-2:   #4a5b7e;
  --accent:   #0447a1;
  --line:     #c9d6ea;
  --field:    #ffffff;
  --btn-hi:   #0b4fb0;
  --btn-lo:   #01388a;
  --on-btn:   #ffffff;
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* night water: the same navy as the contact card */
@media (prefers-color-scheme: dark) {
  :root {
    --paper-hi: #0d2a5c;
    --paper:    #081735;
    --paper-lo: #050e22;
    --ink:      134, 180, 255;
    --ink-hi:   176, 205, 255;
    --near: .42; --mid: .2; --far: .07;
    --text:     #eef3fc;
    --text-2:   #a9b8d6;
    --accent:   #86b4ff;
    --line:     #26406f;
    --field:    #0b1a38;
    --btn-hi:   #3f84ec;
    --btn-lo:   #2463cc;
    --on-btn:   #ffffff;
  }
}

/* subpages carry the river more quietly */
body.page { --near: .30; --mid: .16; --far: .07; }
@media (prefers-color-scheme: dark) { body.page { --near: .28; --mid: .14; --far: .06; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }

body {
  min-height: 100svh;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* the paper, and the river drawn on it */
.water {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1  0 0 0 0 .2  0 0 0 0 .45  .12 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 120% 105% at 50% 50%, var(--paper) 38%, var(--paper-lo) 100%);
}
.water canvas { position: absolute; top: 0; left: 0; width: 100%; display: block; }
.water .glow {
  position: absolute; top: 0; left: 0; width: 100%; height: 100svh;
  background: radial-gradient(ellipse 46vmax 26vmax at 50% 50%, var(--paper-hi) 0%, transparent 100%);
}

/* the current arrives once, on the home page */
body.home #lines {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--wipe) - 40%), transparent var(--wipe));
          mask-image: linear-gradient(90deg, #000 calc(var(--wipe) - 40%), transparent var(--wipe));
  animation: wipe 2.6s cubic-bezier(.3, .6, .2, 1) both;
}
#lines.arrived { -webkit-mask-image: none; mask-image: none; animation: none; }
body.home #pulses { animation: fade 1.8s 1.9s ease-out both; }
body.page #lines { animation: fade .9s ease-out both; }

/* navigation: two words, top right; the mark, top left, returns home */
.nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left));
}
.nav .mark { display: inline-flex; width: 40px; height: 40px; color: var(--accent); }
.nav .mark svg { width: 100%; height: 100%; }
.nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; margin-left: auto; }
.nav a {
  font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text); text-decoration: none; padding: 8px 0;
  border-bottom: 1.5px solid transparent;
}
.nav a:hover, .nav a:focus-visible { border-bottom-color: var(--accent); outline: none; }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }

main { position: relative; z-index: 1; }

/* home: the hero, then one screen of text */
.hero {
  min-height: 100svh;
  display: grid; place-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  position: relative;
}
.hero h1 { margin: 0; line-height: 0; }
#mark {
  display: block;
  width: min(64vw, 78svh, max(440px, 27vw), 520px);
  height: auto;
  animation: rise 1.4s .9s cubic-bezier(.2, .7, .2, 1) both;
  user-select: none; -webkit-user-drag: none;
}
.cue {
  position: absolute; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--text-2); opacity: 0; animation: fade 1s 2.4s ease-out both;
}
.cue svg { width: 22px; height: 22px; animation: nudge 2.4s 3.4s ease-in-out infinite; }

.intro { padding: 8vh 22px 14vh; }
.col {
  max-width: 660px; margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 60px 44px var(--paper);
}
.intro h2 {
  font-size: clamp(24px, 3.2vw, 34px); font-weight: 500; line-height: 1.22; letter-spacing: -.01em;
  margin: 0 0 22px;
}
.intro p { margin: 0 0 18px; }
.steps { display: grid; gap: 18px 32px; margin: 30px 0 26px; padding: 0; list-style: none; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { font-size: 15.5px; line-height: 1.55; color: var(--text-2); }
.steps b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.links { display: flex; gap: 26px; flex-wrap: wrap; }
a { color: var(--accent); }
.links a, .page-body a { text-decoration: none; border-bottom: 1.5px solid var(--accent); padding-bottom: 1px; }
.links a:hover, .page-body a:hover { border-bottom-width: 2px; }

/* about & contact: one column */
.page-body {
  max-width: 640px; margin: 0 auto;
  padding: calc(88px + env(safe-area-inset-top)) 22px 12vh;
}
.page-body .col { padding: 8px 0; }
.page-body h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 500; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 20px; }
.page-body h2 { font-size: 20px; font-weight: 600; margin: 36px 0 10px; }
.page-body p { margin: 0 0 16px; }
.page-body .lead { font-size: 19px; line-height: 1.55; }
.page-body ol { padding-left: 22px; margin: 0 0 16px; }
.page-body ol li { margin-bottom: 8px; }
.page-body ol b { font-weight: 600; }

/* form */
.form { margin: 26px 0 8px; }
.form fieldset { border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
.form legend { font-size: 19px; font-weight: 600; padding: 0; margin: 22px 0 12px; color: var(--text); }
.form label { display: block; font-size: 13.5px; font-weight: 500; color: var(--text-2); margin: 0 0 6px; }
.form input, .form textarea {
  display: block; width: 100%; font: inherit; color: var(--text);
  background: var(--field); border: 1px solid var(--line); border-radius: 6px;
  padding: 11px 13px; margin: 0 0 18px;
}
.form textarea { min-height: 96px; resize: vertical; }
.form #specs { min-height: 130px; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--ink-hi), .18); }
.form .hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form button {
  font: inherit; font-weight: 600; letter-spacing: .02em; color: var(--on-btn);
  background: linear-gradient(180deg, var(--btn-hi), var(--btn-lo));
  border: 0; border-radius: 8px; padding: 13px 26px; cursor: pointer;
}
.form button:hover { filter: brightness(1.06); }
.form button:focus-visible { outline: 3px solid rgba(var(--ink-hi), .45); outline-offset: 2px; }
.form button[disabled] { opacity: .6; cursor: default; }
.form .note { font-size: 14px; color: var(--text-2); margin-top: 14px; }
.form .error { color: #b3261e; margin: -8px 0 16px; font-size: 14.5px; }
@media (prefers-color-scheme: dark) { .form .error { color: #ff8a80; } }
.sent { padding: 22px 0; }
.sent h2 { margin-top: 0; }

footer {
  position: relative; z-index: 1;
  text-align: center; font-size: 12.5px; letter-spacing: .06em; color: var(--text-2);
  padding: 20px 22px max(28px, env(safe-area-inset-bottom));
}

@keyframes wipe { from { --wipe: 0%; } to { --wipe: 140%; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

@media (prefers-reduced-motion: reduce) {
  #lines, #pulses, #mark, .cue, .cue svg { animation: none; }
  .cue { opacity: 1; }
}
