:root {
  color-scheme: dark;
  --ink: #f4f7f5;
  --muted: #a5b1ac;
  --green: #31f59a;
  --green-soft: rgba(49, 245, 154, 0.13);
  --line: rgba(222, 255, 240, 0.16);
  --panel: rgba(10, 17, 18, 0.86);
  --phone-w: min(100vw, 430px);
  --phone-h: min(100svh, 932px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #030405;
}

body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--ink);
}

button,
input,
textarea { font: inherit; }

a { color: inherit; }

#phone {
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  max-height: 100svh;
  overflow: hidden;
  background: #07100f;
  isolation: isolate;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 30px 90px rgba(0,0,0,.65);
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  touch-action: none;
}

#mobile-home-scene {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
}

#phone::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(1, 7, 7, .30) 0%, rgba(2, 8, 8, .55) 33%, #07100f 76%),
    linear-gradient(90deg, transparent 49.75%, rgba(49,245,154,.06) 50%, transparent 50.25%);
}

.screen {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.screen::-webkit-scrollbar {
  display: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 86px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 9, 10, .82);
  backdrop-filter: blur(18px) saturate(125%);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(49,245,154,.17));
}

.brand-copy { display: grid; gap: 2px; }
.brand strong { font-size: 1.06rem; letter-spacing: .05em; }
.brand small { color: var(--green); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }

.menu-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255,255,255,.035);
  cursor: pointer;
}

.menu-button span:not(.sr-only) {
  display: block;
  width: 17px;
  height: 1px;
  background: currentColor;
  transition: transform .25s ease, opacity .25s ease;
}

.menu-button[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-button[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-button[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

#site-nav {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .32s ease, opacity .2s ease, padding .3s ease;
}

#site-nav.open { max-height: 180px; opacity: 1; padding-top: 8px; }

#site-nav a {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

#site-nav a.active,
#site-nav a:hover,
#site-nav a:focus-visible {
  color: #06100d;
  background: var(--green);
  outline: none;
}

.route-indicator {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 34px 20px 0;
  color: var(--green);
  font: 600 .68rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .16em;
}

.route-line { height: 1px; background: linear-gradient(90deg, var(--green), transparent); }

#page-content {
  min-height: 590px;
  padding: 26px 20px 48px;
  outline: none;
  animation: page-in .42s ease both;
}

#phone[data-route="home"] .route-indicator {
  margin-top: 360px;
}

#page-content.typing::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -.12em;
  background: var(--green);
  box-shadow: 0 0 8px rgba(49, 245, 154, .65);
  animation: cursor-blink .42s steps(1, end) infinite;
}

@keyframes cursor-blink {
  50% { opacity: 0; }
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

#page-content > section {
  margin: 0 0 18px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: inset 3px 0 0 rgba(49,245,154,.7), 0 18px 45px rgba(0,0,0,.25);
  backdrop-filter: blur(14px);
}

#page-content > section:first-child { padding-top: 26px; }
#page-content .text-and-image,
#page-content .text-double { display: block; }
#page-content .text-content,
#page-content .text-double-left,
#page-content .text-double-right,
#page-content .image-container { width: 100%; }

h1, h2, h3, h4 { margin: 0 0 14px; line-height: 1.08; }

#page-content h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(1.55rem, 8vw, 2.2rem);
  font-weight: 580;
  letter-spacing: -.045em;
}

#page-content h2::before {
  content: "// ";
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .62em;
  letter-spacing: 0;
}

#page-content h3 { margin-top: 30px; color: var(--green); font-size: 1.1rem; letter-spacing: .02em; }
#page-content h4 { margin-top: -5px; color: var(--muted); font-size: .84rem; line-height: 1.4; }

#page-content p,
#page-content li,
#page-content td,
#page-content th,
#page-content label,
#page-content legend {
  font-size: 1rem;
  line-height: 1.68;
}

#page-content p { margin: 0 0 17px; color: #e7ece9; }
#page-content ul { margin: 12px 0 24px; padding-left: 20px; }
#page-content li { margin: 0 0 9px; color: #d5deda; }
#page-content li::marker { color: var(--green); }

#page-content a { color: var(--green); text-underline-offset: 3px; }
#page-content strong { color: #fff; }

#page-content img {
  width: 100%;
  max-height: 260px;
  margin: 12px 0 6px;
  object-fit: cover;
  border: 1px solid var(--line);
  filter: saturate(.72) contrast(1.08);
}

#page-content .image-container img { max-height: 390px; object-position: center 18%; }

#page-content sub { font-size: inherit; vertical-align: baseline; }

.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 560px; border-collapse: collapse; border: 0 !important; }
th, td { padding: 12px; text-align: left; border: 1px solid var(--line); }
th { color: var(--white); background: rgba(36,51,43,.08); }

@media (max-width: 600px) {
  .table-scroll {
    overflow-x: visible;
  }

  table {
    min-width: 0;
    width: 100%;
  }

  table tbody,
  table tr,
  table td {
    display: block;
    width: 100%;
  }

  table th {
    display: block;
    width: 100%;
  }

  table td {
    border-top: 0;
  }

  table tr:first-child td:first-child {
    border-top: 1px solid var(--line);
  }

  table td:empty {
    display: none;
  }
}

.form-container { margin-top: 4px; }
form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.row1,
.row2 { flex: 0 0 auto; }
.row2 {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.row1 input,
.row2 input {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
}
.row2 input {
  flex: 1 1 0;
  width: calc(50% - 6px);
}
input,
textarea {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  background: rgba(0,0,0,.28);
  outline: none;
}
textarea { min-height: 160px; resize: vertical; }
input:focus,
textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.preferred-contact { display: grid; gap: 6px; margin: 6px 0; padding: 12px; border: 1px solid var(--line); }
.preferred-contact label { display: flex; align-items: center; gap: 8px; }
.preferred-contact input { width: auto; accent-color: var(--green); }
.submit-row { display: grid; gap: 12px; }
button[type="submit"] {
  min-height: 48px;
  border: 0;
  border-radius: 2px;
  color: #03100a;
  background: var(--green);
  font-weight: 750;
  cursor: pointer;
}

.tooltip { position: relative; color: var(--green); text-decoration: underline dotted; }
.tooltiptext {
  display: none;
  position: absolute;
  z-index: 20;
  left: 0;
  bottom: calc(100% + 8px);
  width: min(280px, 72vw);
  padding: 10px;
  color: var(--ink);
  background: #111a19;
  border: 1px solid var(--green);
  font-size: .8rem;
}
.tooltip:hover .tooltiptext,
.tooltip:focus .tooltiptext { display: block; }

.status-message {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 24px;
  width: calc(100% - 40px);
  transform: translateX(-50%);
  padding: 14px;
  border: 1px solid var(--green);
  color: var(--ink);
  background: #0b1412;
  text-align: center;
}

/* Standard text tooltips, including privacy.html */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip .tooltiptext {
  visibility: hidden;
  position: absolute;
  z-index: 1000;
  top: 100%;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);

  box-sizing: border-box;
  width: 280px;
  max-width: 90vw;
  padding: 10px;
  background: #222;
  color: #fff;
  border-radius: 6px;
  white-space: normal;
  text-align: left;
}

.tooltip:hover .tooltiptext,
.tooltip:focus-within .tooltiptext {
  visibility: visible;
}

/* Examples buttons and centred, scrollable native popovers. */
.examples-button {
  padding: 4px 10px;
  border: 1px solid var(--green);
  border-radius: 4px;
  background: transparent;
  color: var(--green);
  font: inherit;
  cursor: pointer;
}

.examples-popup {
  position: fixed;
  inset: 0;
  margin: auto;
  box-sizing: border-box;
  width: 720px;
  height: fit-content;
  min-width: 0;
  min-height: 0;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 10px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: #222;
  color: #fff;
}

.examples-content {
  position: relative;
  min-width: 0;
}

/* Disable any old transparent close-button overlay. */
.examples-popup .examples-close {
  display: none;
}

.examples-popup table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.examples-popup th,
.examples-popup td {
  padding: 8px;
  border: 1px solid #777;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.examples-popup th {
  text-align: center;
}

@media (max-width: 600px) {
  .examples-popup table,
  .examples-popup thead,
  .examples-popup tbody,
  .examples-popup tr,
  .examples-popup th,
  .examples-popup td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
}

.routine-rate {
  margin-bottom: 17px;
}

#page-content .routine-rate > p {
  display: inline;
  margin: 0;
}

.loading { padding: 30px 0; color: var(--muted); }

footer {
  padding: 22px 24px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(3,7,8,.72);
}

footer p { margin: 0; font-size: .72rem; line-height: 1.65; }
footer a { color: var(--green); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 431px) {
  #phone { border-radius: 28px; }
}

@media (max-width: 899px) {
  #scene { display: block; }
  #mobile-home-scene { display: none; }
  #phone[data-route="home"] .route-indicator { margin-top: 260px; }
  .screen { scroll-behavior: auto; }

  .site-header,
  #page-content > section {
    backdrop-filter: none;
  }
}

@media (min-width: 900px) {
  :root {
    --phone-w: min(100vw, 1440px);
    --phone-h: min(100svh, 900px);
  }

  #phone { border-radius: 20px; }

  .site-header {
    min-height: 92px;
    grid-template-columns: minmax(280px, 1fr) auto;
    padding: 16px 34px;
  }

  .brand img { width: 58px; height: 58px; }
  .brand strong { font-size: 1.18rem; }
  .brand small { font-size: .72rem; }
  .menu-button { display: none; }

  #site-nav {
    grid-column: auto;
    display: flex;
    max-height: none;
    opacity: 1;
    overflow: visible;
    padding: 0;
  }

  #site-nav a { padding: 12px 16px; }

  .route-indicator {
    max-width: 1180px;
    margin: 46px auto 0;
    padding: 0 32px;
  }

  #phone[data-route="home"] .route-indicator { margin-top: 320px; }

  #page-content {
    max-width: 1180px;
    min-height: 560px;
    margin: 0 auto;
    padding: 30px 32px 72px;
  }

  #page-content > section {
    margin-bottom: 20px;
    padding: 34px 36px;
    background: rgba(8, 15, 16, .82);
  }

  #page-content h2 { font-size: clamp(2rem, 3.4vw, 3.15rem); }
  #page-content h3 { font-size: 1.28rem; }

  #page-content[data-route="about"],
  #page-content[data-route="contact"] { max-width: 980px; }

  #page-content .text-double {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px;
  }

  #page-content[data-route="contact"] > section:nth-child(2) {
    width: min(100%, 760px);
    margin-inline: auto;
  }

  #page-content[data-route="contact"] .form-container {
    width: min(100%, 680px);
    margin-inline: auto;
  }

  footer { padding-inline: max(34px, calc((100% - 1116px) / 2)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
