/* Rayfield — shared styles */

:root {
  --bg: #ffffff;
  --bg-elev: #f5f5f7;
  --bg-elev-2: #ececee;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --border: #d2d2d7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-contrast: #ffffff;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 980px;
  --nav-h: 52px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elev: #1d1d1f;
    --bg-elev-2: #2a2a2d;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --border: #38383c;
    --accent: #2997ff;
    --accent-hover: #47a7ff;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  }
}

/* Manual theme override */
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #f5f5f7;
  --bg-elev-2: #ececee;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --border: #d2d2d7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-elev: #1d1d1f;
  --bg-elev-2: #2a2a2d;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --border: #38383c;
  --accent: #2997ff;
  --accent-hover: #47a7ff;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  letter-spacing: -0.02em;
  line-height: 1.08;
  font-weight: 600;
}

p {
  color: var(--text-secondary);
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.nav-brand:hover {
  text-decoration: none;
}

/* ---------- Brand logo ---------- */
.brand-mark {
  display: inline-block;
  flex: none;
  background: center / contain no-repeat;
  /* default = light background (matches :root light theme) */
  background-image: url("assets/rayfield-mark-light.png");
}

.nav-brand .brand-mark {
  width: 38px;
  height: 27px;
}

.brand-word {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.13em;
  color: var(--text);
}

/* Logo swaps with the theme. Dark is the default for dark-OS visitors. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .brand-mark {
    background-image: url("assets/rayfield-mark-dark.png");
  }
}
:root[data-theme="dark"] .brand-mark {
  background-image: url("assets/rayfield-mark-dark.png");
}
:root[data-theme="light"] .brand-mark {
  background-image: url("assets/rayfield-mark-light.png");
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text);
  font-size: 14px;
  opacity: 0.85;
}

.nav-links a:hover {
  opacity: 1;
  text-decoration: none;
}

.nav-links a.active {
  opacity: 1;
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px;
  height: 30px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.theme-toggle:hover {
  background: var(--bg-elev);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 980px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-elev);
}

/* ---------- Sections ---------- */
section {
  padding: 84px 0;
}

.section-tight {
  padding: 56px 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 14px;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 16px;
  color: var(--text);
}

.lead {
  font-size: 19px;
  max-width: 640px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 56px 0 96px;
  background: radial-gradient(
    120% 120% at 50% 0%,
    var(--bg-elev) 0%,
    var(--bg) 60%
  );
}

.hero-logo {
  width: clamp(120px, 17.6vw, 168px);
  height: clamp(83px, 12.2vw, 117px);
  margin: 0 auto 30px;
}

.hero h1 {
  font-size: clamp(48px, 9vw, 88px);
  margin: 0 0 18px;
  color: var(--text);
}

.hero .subtitle {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 500;
  color: var(--text);
  margin: 0 auto 18px;
  max-width: 720px;
}

.hero .desc {
  font-size: 18px;
  max-width: 640px;
  margin: 0 auto 34px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.page-head {
  padding: 96px 0 40px;
  text-align: center;
}

.page-head h1 {
  font-size: clamp(36px, 6vw, 56px);
  margin: 0 0 14px;
  color: var(--text);
}

.page-head p {
  font-size: 19px;
  max-width: 620px;
  margin: 0 auto;
}

/* ---------- Cards / grid ---------- */
.grid {
  display: grid;
  gap: 22px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  color: var(--text);
}

.card p {
  margin: 0;
  font-size: 15px;
}

/* ---------- Workflow ---------- */
.workflow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 520px;
  margin: 0 auto;
}

.workflow-step {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  text-align: center;
}

.workflow-step h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--text);
}

.workflow-step p {
  margin: 0;
  font-size: 14px;
}

.workflow-arrow {
  color: var(--text-secondary);
  font-size: 22px;
  padding: 12px 0;
  line-height: 1;
}

/* ---------- Validation stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 36px;
}

.stat-num {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.05;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.results-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 28px;
  max-width: 640px;
}

@media (max-width: 760px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Technology diagram ---------- */
.tech-figure {
  margin: 0;
}

.tech-diagram {
  display: block;
  width: 100%;
  height: auto;
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.tech-figure figcaption {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ---------- Placeholders ---------- */
.placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  padding: 24px;
}

.placeholder-diagram {
  min-height: 180px;
}

.placeholder-video {
  aspect-ratio: 16 / 9;
  font-size: 16px;
}

.demo-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: contain;
}

/* ---------- Forms ---------- */
.form {
  max-width: 560px;
}

.form-row {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}

.form-row label {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
}

.form-row input,
.form-row textarea {
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-note {
  font-size: 13px;
  margin-top: 6px;
}

/* ---------- About ---------- */
.about {
  background: var(--bg-elev);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 44px 0;
  background: var(--bg);
}

.footer-cols {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 28px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
}

.footer-brand .brand-mark {
  width: 34px;
  height: 24px;
}

.footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 14px;
}

.disclaimer {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 22px;
}

.disclaimer strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 22px 16px;
    transform: translateY(-150%);
    transition: transform 0.25s ease;
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-links a {
    width: 100%;
    padding: 12px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  section {
    padding: 60px 0;
  }
}
