/* ===========================================================================
   RG Loomis LLC — rgloomis.com
   Light, clean studio aesthetic. One blue accent. No dark backgrounds.
   Contrast checked: text #0f172a on white = 16.1:1; white on #2563eb = 6.3:1.
   =========================================================================== */

:root {
  --blue:        #2563eb;
  --blue-dark:   #1d4ed8;
  --blue-darker: #1e40af;
  --ink:         #0f172a;   /* slate-900 */
  --body:        #334155;   /* slate-700 */
  --muted:       #64748b;   /* slate-500 */
  --line:        #e2e8f0;   /* slate-200 */
  --bg:          #ffffff;
  --bg-alt:      #f8fafc;   /* slate-50 */
  --bg-tint:     #eff4ff;   /* very light blue */
  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --shadow-lg:   0 2px 4px rgba(15,23,42,.05), 0 18px 40px rgba(15,23,42,.10);
  --container:   1120px;
  --font:        'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

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

h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 1rem; line-height: 1;
  padding: 14px 24px; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.28); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: #cbd5e1; background: var(--bg-alt); }
.btn-lg { font-size: 1.15rem; padding: 18px 34px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; }
.wordmark:hover { text-decoration: none; }
.wordmark-text { font-size: 1.15rem; letter-spacing: -0.02em; }
.monogram {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--blue); color: #fff; font-weight: 800; font-size: .82rem; letter-spacing: .02em;
}

.nav { display: flex; align-items: center; }
.nav-menu { display: flex; align-items: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.nav-menu a { color: var(--body); font-weight: 500; padding: 9px 14px; border-radius: 8px; }
.nav-menu a:hover { color: var(--ink); background: var(--bg-alt); text-decoration: none; }
.nav-cta { background: var(--blue); color: #fff !important; }
.nav-cta:hover { background: var(--blue-dark) !important; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px;
  background: none; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(64px, 9vw, 120px) 0 clamp(48px, 6vw, 84px);
  background:
    radial-gradient(900px 380px at 80% -10%, var(--bg-tint), transparent 70%),
    linear-gradient(180deg, #fff 0%, var(--bg-alt) 100%);
}
.eyebrow {
  display: inline-block; color: var(--blue-dark); font-weight: 600; font-size: .9rem;
  letter-spacing: .02em; margin-bottom: 18px;
  background: var(--bg-tint); padding: 6px 14px; border-radius: 999px;
}
.hero-title { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 800; max-width: 16ch; }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--body); max-width: 60ch; margin-top: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  list-style: none; margin: 56px 0 0; padding: 0;
}
.hero-stats li {
  border-left: 3px solid var(--blue); padding-left: 16px;
}
.hero-stats strong { display: block; color: var(--ink); font-size: 1.05rem; font-weight: 700; }
.hero-stats span { color: var(--muted); font-size: .9rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 100px) 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 60ch; margin-bottom: 48px; }
.section-eyebrow { color: var(--blue-dark); font-weight: 600; font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 12px; }
.section-title { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 800; }
.section-lead { font-size: 1.1rem; color: var(--body); margin-top: 16px; }

/* ---------- Work cards ---------- */
.card-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.card {
  display: flex; flex-direction: column; gap: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #cdd9ef; }
.card-flagship { border-color: #bfd0f7; box-shadow: 0 2px 4px rgba(37,99,235,.06), 0 18px 40px rgba(37,99,235,.12); }
.card-top { display: flex; flex-direction: column; gap: 10px; }
.card-badge {
  align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--blue-dark); background: var(--bg-tint); padding: 5px 11px; border-radius: 999px;
}
.card-badge-muted { color: var(--muted); background: var(--bg-alt); border: 1px solid var(--line); }
.card-title { font-size: 1.4rem; font-weight: 700; }
.card-tagline { color: var(--body); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; margin-top: auto; }
.tag-row li {
  font-size: .78rem; font-weight: 500; color: var(--muted);
  background: var(--bg-alt); border: 1px solid var(--line); padding: 4px 10px; border-radius: 6px;
}
.card-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.card-link { font-weight: 600; color: var(--blue-dark); }
.store-soon { font-size: .82rem; color: var(--muted); }

/* ---------- Services ---------- */
.services-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.service {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 24px; box-shadow: var(--shadow);
}
.service h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.service p { color: var(--body); font-size: .98rem; }
.services-cta { margin-top: 40px; }

/* ---------- About ---------- */
.about-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.about-text p { color: var(--body); margin-top: 16px; }
.about-text .section-title { margin-bottom: 4px; }
.about-facts { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.about-facts li { padding-left: 26px; position: relative; color: var(--body); }
.about-facts li::before {
  content: ""; position: absolute; left: 0; top: 9px; width: 12px; height: 12px;
  border-radius: 3px; background: var(--blue);
}
.about-card {
  background: var(--bg-tint); border: 1px solid #d6e0fb; border-radius: var(--radius); padding: 28px;
}
.about-card h3 { font-size: 1.1rem; margin-bottom: 16px; }
.capability-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.capability-list li { color: var(--ink); font-weight: 500; padding-left: 24px; position: relative; }
.capability-list li::before {
  content: "›"; position: absolute; left: 4px; top: -1px; color: var(--blue); font-weight: 800;
}

/* ---------- Contact ---------- */
.section-contact { text-align: center; background: var(--bg-alt); border-top: 1px solid var(--line); }
.contact-inner { max-width: 640px; margin: 0 auto; }
.contact-inner .section-eyebrow { text-align: center; }
.contact-lead { font-size: 1.1rem; color: var(--body); margin: 16px 0 32px; }
.contact-fine { color: var(--muted); font-size: .9rem; margin-top: 20px; }

/* Contact form */
.contact-form { max-width: 560px; margin: 28px auto 0; text-align: left; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: .9rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.field textarea { resize: vertical; min-height: 120px; }
.contact-form .btn { width: 100%; margin-top: 4px; }
.contact-form .contact-fine { text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-error {
  max-width: 560px; margin: 0 auto; padding: 12px 16px; border-radius: var(--radius-sm);
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: .95rem; font-weight: 500;
}
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--line); padding-top: 56px; }
.footer-inner { display: grid; grid-template-columns: 1.3fr 2fr; gap: 40px; padding-bottom: 40px; }
.footer-brand { display: flex; gap: 14px; align-items: flex-start; }
.footer-name { font-weight: 800; color: var(--ink); }
.footer-meta { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col-title { font-weight: 700; color: var(--ink); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.footer-col a { color: var(--body); font-size: .95rem; }
.footer-col a:hover { color: var(--blue-dark); }
.footer-bottom { border-top: 1px solid var(--line); padding: 22px 0; }
.footer-bottom p { color: var(--muted); font-size: .88rem; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 14px 22px 22px; box-shadow: var(--shadow);
    display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 12px 14px; }
  .nav-cta { text-align: center; margin-top: 6px; }

  .about-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 560px) {
  .hero-stats { grid-template-columns: 1fr; gap: 14px; }
  .footer-nav { grid-template-columns: 1fr 1fr; }
  .btn { width: 100%; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ---------- Legal / content pages ---------- */
.page-hero {
  padding: clamp(48px, 7vw, 88px) 0 clamp(28px, 4vw, 44px);
  background: linear-gradient(180deg, #fff 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow { margin-bottom: 14px; }
.page-hero h1 { font-size: clamp(1.9rem, 4.4vw, 2.8rem); font-weight: 800; }
.page-hero .page-updated { color: var(--muted); font-size: .9rem; margin-top: 14px; }

.prose { max-width: 760px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) 0; }
.prose h2 { font-size: 1.4rem; font-weight: 700; margin: 40px 0 12px; }
.prose h3 { font-size: 1.1rem; font-weight: 700; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--body); }
.prose p { margin-top: 14px; }
.prose ul { margin: 14px 0; padding-left: 22px; }
.prose li { margin-top: 8px; }
.prose a { color: var(--blue-dark); font-weight: 500; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; }

.legal-note {
  background: var(--bg-tint); border: 1px solid #d6e0fb; border-radius: var(--radius-sm);
  padding: 18px 22px; margin: 28px 0; color: var(--ink); font-size: .95rem;
}
.legal-note strong { color: var(--ink); }

.support-cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 8px; }
.support-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 24px; box-shadow: var(--shadow);
}
.support-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.support-card p { color: var(--body); font-size: .95rem; }
.support-card a { font-weight: 600; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--blue-dark); }
.breadcrumb span { margin: 0 8px; color: #cbd5e1; }

/* ---------- Article / product pages ---------- */
.page-hero .dek { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--body); max-width: 62ch; margin-top: 16px; }

.facts-box {
  background: var(--bg-tint); border: 1px solid #d6e0fb; border-radius: var(--radius);
  padding: 24px 26px; margin: 8px 0 32px;
}
.facts-box h2 { font-size: 1.05rem; margin: 0 0 14px; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 28px; }
.fact dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.fact dd { margin: 4px 0 0; color: var(--ink); font-weight: 500; }
.fact dd a { font-weight: 600; }

.article-cta {
  margin-top: 48px; padding: 36px; text-align: center;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
}
.article-cta h2 { font-size: 1.5rem; margin-bottom: 8px; }
.article-cta p { color: var(--body); margin-bottom: 22px; }

/* ---------- Product index hub ---------- */
.product-meta { font-size: .85rem; color: var(--muted); margin-top: auto; }
.card-cta-link { font-weight: 600; color: var(--blue-dark); }
.work-more { margin-top: 40px; }

/* Card cover media (flush to card edges).
   A wrapping element owns the aspect-ratio — an <img> as a direct flex item
   sizes unreliably (falls back to intrinsic height), so we wrap it. */
.card-media {
  display: block; width: calc(100% + 56px); margin: -28px -28px 6px -28px;
  aspect-ratio: 1200 / 630; overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line);
}
.card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Case-study cover banner */
.article-cover {
  display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 28px;
}

/* Screenshot figure */
.figure { margin: 28px 0; }
.figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.figure figcaption { margin-top: 10px; font-size: .88rem; color: var(--muted); text-align: center; }
