/* ============================================================
   Digital Lighting Solutions — v3
   Clean, light, native. The site looks like the software:
   system typeface, white + Apple-grey, one blue accent,
   App Store icons carry the colour.
   ============================================================ */

:root {
  --bg:            #ffffff;
  --bg-2:          #f5f5f7;   /* Apple alt-section grey */
  --bg-3:          #ececef;
  --surface:       #ffffff;
  --ink:           #1d1d1f;   /* primary text / near-black */
  --ink-2:         #515257;   /* secondary text — ~7:1 on white */
  --ink-3:         #86868b;   /* tertiary / labels */
  --line:          rgba(0,0,0,0.10);
  --line-strong:   rgba(0,0,0,0.16);
  --accent:        #0067e0;   /* single blue: links, focus, small marks */
  --accent-ink:    #0052b8;   /* accent hover */
  --danger:        #c8322a;
  --success:       #1a7f45;

  --text:     var(--ink);       /* legacy aliases kept for shared pages */
  --text-dim: var(--ink-2);
  --muted:    var(--ink-3);
  --border:        var(--line);
  --border-strong: var(--line-strong);
  --accent-2:      var(--accent);

  --radius:    16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.05), 0 1px 3px rgba(16,24,40,0.06);
  --shadow-md: 0 6px 16px -6px rgba(16,24,40,0.12), 0 18px 40px -20px rgba(16,24,40,0.18);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --easing: cubic-bezier(0.22, 0.61, 0.36, 1);
  --maxw: 1140px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}
::selection { background: rgba(0,103,224,0.16); }

a { color: var(--accent); }

/* ---------- Layout ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

.accent-word { color: var(--accent); }

/* ---------- Nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.78);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-weight: 600; font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  flex-shrink: 0;
}
.brand-mark.sm { width: 26px; height: 26px; border-radius: 7px; }
.brand-name { white-space: nowrap; }

.nav-links { display: flex; align-items: center; gap: 26px; font-size: 15px; }
.nav-links a {
  color: var(--ink-2); text-decoration: none;
  transition: color .15s ease;
}
.nav-links a:not(.btn):hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 500; font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s var(--easing), background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.btn .arrow { transition: transform .2s var(--easing); }
.btn:hover .arrow { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: #000; box-shadow: var(--shadow-md); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--ink-3); }

.btn-danger {
  background: #fff;
  color: var(--danger);
  border-color: rgba(200,50,42,0.4);
}
.btn-danger:hover { background: rgba(200,50,42,0.06); }

.btn-mini { padding: 8px 15px; font-size: 14px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- Hero ---------- */
.hero { padding: 104px 0 72px; text-align: center; }
.hero-inner { max-width: 900px; }
.hero-kicker {
  font-size: 14px; font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.01em;
  margin: 0 0 22px;
}
h1.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(42px, 6.4vw, 82px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
  color: var(--ink);
  text-wrap: balance;
}
.lede {
  font-size: clamp(18px, 1.8vw, 21px);
  color: var(--ink-2);
  max-width: 620px;
  margin: 0 auto 34px;
  line-height: 1.5;
  text-wrap: pretty;
}
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Protocol strip (static, replaces marquee) ---------- */
.protocols {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.protocol-list {
  list-style: none; margin: 0; padding: 20px 32px;
  max-width: var(--maxw);
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: 14px 30px;
}
.protocol-list li {
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  position: relative;
}
.protocol-list li:not(:last-child)::after {
  content: ""; position: absolute; right: -16px; top: 50%;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--line-strong); transform: translateY(-50%);
}

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.apps { padding-top: 88px; }

.section-head {
  display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 48px;
  max-width: 640px;
}
.section-eyebrow {  /* kept for shared pages; understated */
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
}
h2.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 4.2vw, 48px);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
.section-sub {
  color: var(--ink-2);
  font-size: 18px;
  max-width: 560px;
  line-height: 1.55;
  margin: 0;
}

/* ---------- Cards / app grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--easing), box-shadow .25s var(--easing), transform .25s var(--easing);
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.app-card { display: flex; flex-direction: column; gap: 20px; }
.app-body { display: flex; flex-direction: column; }
.app-card.is-next { background: var(--bg-2); box-shadow: none; }
.app-card.is-next:hover { box-shadow: var(--shadow-sm); }

.app-icon {
  width: 64px; height: 64px;
  border-radius: 15px;
  overflow: hidden;
  flex-shrink: 0;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-icon.has-img { box-shadow: 0 2px 6px rgba(16,24,40,0.14), inset 0 0 0 1px rgba(0,0,0,0.06); }
.app-icon.mark {
  display: grid; place-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 26px; font-weight: 600;
  line-height: 1;
}

.card-tag {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  color: var(--ink);
}
.card-text { color: var(--ink-2); font-size: 15px; margin: 0; line-height: 1.55; }
.card-link {
  margin-top: 16px;
  font-size: 14px; font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.card-link:hover { color: var(--accent-ink); }
.card-link.is-soon { color: var(--ink-3); font-weight: 500; }

/* ---------- Closer ---------- */
.closer { background: var(--bg-2); border-top: 1px solid var(--line); text-align: center; }
.closer-inner { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; }
.closer .section-title { margin-bottom: 18px; }
.closer .section-sub { margin: 0 auto 30px; }

/* ---------- Prose (legal pages) ---------- */
.prose { max-width: 720px; margin: 0 auto; }
.prose p, .prose li { color: var(--ink-2); font-size: 17px; line-height: 1.7; }
.prose h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin: 0 0 14px;
  color: var(--ink);
}
.prose h1 .serif, .prose h1 .accent-word { color: var(--accent); }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 44px 0 12px;
  color: var(--ink);
}
.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(0,103,224,0.35); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose ul { padding-left: 22px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 44px 0 24px; }
.legal-meta { color: var(--ink-3); font-size: 14px; margin-bottom: 36px; }

/* legacy emphasis span used across pages — now a quiet accent word, no serif/gradient */
.serif { color: var(--accent); font-style: normal; font-weight: inherit; }

/* ---------- Forms ---------- */
form.styled { display: flex; flex-direction: column; gap: 18px; margin-top: 4px; }
form.styled label {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--ink);
}
form.styled input[type=text],
form.styled input[type=email],
form.styled input[type=password],
form.styled textarea {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 13px 15px;
  font: 16px/1.4 var(--font-sans);
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
form.styled input::placeholder, form.styled textarea::placeholder { color: var(--ink-3); }
form.styled input:focus, form.styled textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0,103,224,0.14);
}
form.styled textarea { resize: vertical; min-height: 170px; }
form.styled .checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px; font-weight: 400;
  color: var(--ink-2);
  line-height: 1.55;
}
form.styled .checkbox input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
form.styled .checkbox a { color: var(--accent); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Flashes */
.flash {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 15px;
  border: 1px solid;
}
.flash.error   { background: rgba(200,50,42,0.06); border-color: rgba(200,50,42,0.3); color: var(--danger); }
.flash.success { background: rgba(26,127,69,0.07); border-color: rgba(26,127,69,0.3); color: var(--success); }

/* Contact split */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 24px;
  align-items: start;
}
.contact-info { display: flex; flex-direction: column; gap: 24px; }
.info-item { display: flex; flex-direction: column; gap: 5px; }
.info-label {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-3);
}
.info-value { color: var(--ink); font-size: 16px; line-height: 1.5; }
.info-value a { color: var(--accent); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 40px;
  background: var(--bg);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap;
}
.footer-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500; color: var(--ink);
}
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--ink-2); text-decoration: none; font-size: 15px; }
.footer-links a:hover { color: var(--ink); }
.footer-legal {
  margin-top: 24px; padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-3);
}
/* legacy footer wordmark (still on contact.html) — restrained, no gradient */
.footer-mega {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 32px;
  color: var(--ink);
}
.footer-mega .serif { color: var(--accent); }

/* ---------- Admin tables ---------- */
table.admin {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin-top: 16px; font-size: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.admin th, table.admin td {
  text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top;
}
table.admin tr:last-child td { border-bottom: 0; }
table.admin th {
  color: var(--ink-3); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--bg-2);
}
table.admin tbody tr:hover td { background: var(--bg-2); }
table.admin td.message { max-width: 380px; white-space: pre-wrap; word-wrap: break-word; }
.pager { display: flex; gap: 6px; margin-top: 22px; flex-wrap: wrap; }
.pager a, .pager strong {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 12px;
  border-radius: 9px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-2);
  text-decoration: none; font-size: 14px;
}
.pager strong { background: var(--ink); color: #fff; border-color: transparent; }
.pager a:hover { color: var(--ink); border-color: var(--ink-3); }

/* ---------- Auth ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 40px 20px;
  background: var(--bg-2);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px; padding: 40px;
  box-shadow: var(--shadow-md);
}
.auth-card h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 26px; letter-spacing: -0.02em;
  margin: 12px 0 6px; color: var(--ink);
}
.auth-card .meta { color: var(--ink-3); font-size: 14px; margin: 0 0 26px; }

/* ---------- Motion: one gentle authored fade-up ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--easing), transform .7s var(--easing); }
.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.rise { animation: rise .7s var(--easing) both; }
.rise.d1 { animation-delay: .06s; }
.rise.d2 { animation-delay: .12s; }
.rise.d3 { animation-delay: .18s; }
.rise.d4 { animation-delay: .24s; }
.rise.d5 { animation-delay: .30s; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .container { padding: 0 22px; }
  .topnav-inner { padding: 12px 22px; }
  .nav-links { gap: 16px; font-size: 14px; }
  section { padding: 72px 0; }
  .hero { padding: 72px 0 52px; }
  .contact-grid { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 560px) {
  .card { padding: 22px; }
  /* keep Contact reachable: hide plain links, keep the button */
  .nav-links a:not(.btn) { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
