/* ============================================================
   Table Rock Smart Home & Computer Solutions
   Senior-accessible stylesheet — WCAG 2.1 AA/AAA compliant
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --card: #121824;
  --muted: #9fb0c3;
  --text: #e9f0f7;
  --accent: #7dd3fc;       /* calm "lake" blue */
  --accent2: #a7f3d0;      /* gentle green */
  --danger: #fca5a5;
  --border: rgba(255,255,255,.12);
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius: 18px;
  --max: 1100px;
  --pad: clamp(16px, 3vw, 28px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* ---- RESET & BASE ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  background:
    radial-gradient(1200px 700px at 20% 0%, rgba(125,211,252,.18), transparent 60%),
    radial-gradient(900px 600px at 80% 10%, rgba(167,243,208,.12), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a { color: inherit; }

/* ---- ACCESSIBILITY UTILITIES ---- */
.skip-link {
  position: absolute; left: -999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  left: 16px; top: 16px; width: auto; height: auto;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 9999;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.visually-hidden:not(:focus):not(:active) {
  clip: rect(0,0,0,0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Global keyboard focus indicator */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* ---- TOPBAR / HEADER ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,15,20,.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px var(--pad);
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}

.brand {
  display: flex; gap: 12px; align-items: center;
}
.logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  object-fit: contain;
}
.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: .2px;
}
.brand p {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---- NAVIGATION ---- */
nav {
  display: flex; gap: 14px; align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
nav a {
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
nav a:hover,
nav a:focus-visible {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255,255,255,.04);
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  text-decoration: none;
  border-radius: 14px;
  padding: 14px 20px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-weight: 650;
  font-size: 18px;
  box-shadow: none;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
  min-height: 44px;
  cursor: pointer;
}
.btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.07);
  border-color: rgba(125,211,252,.45);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary {
  background: linear-gradient(135deg, rgba(125,211,252,.85), rgba(167,243,208,.70));
  color: #061019;
  border-color: rgba(255,255,255,.10);
  box-shadow: 0 16px 30px rgba(0,0,0,.25);
}
.btn-primary:hover { border-color: rgba(255,255,255,.18); }

/* ---- LAYOUT ---- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px var(--pad) 70px;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  align-items: stretch;
  margin-top: 16px;
}
.hero > section { margin-top: 0; }

/* ---- CARDS ---- */
.card {
  background: rgba(18,24,36,.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-pad { padding: clamp(18px, 3vw, 28px); }

/* ---- EYEBROW / PILL ---- */
.eyebrow {
  display: flex; gap: 8px; align-items: center;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: .25px;
}
.pill {
  display: inline-flex; align-items: center;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(125,211,252,.35);
  background: rgba(125,211,252,.08);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

/* ---- HERO CONTENT ---- */
.hero h2 {
  margin: 10px 0 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -.5px;
}
.hero p.lead {
  margin: 12px 0 0;
  font-size: clamp(18px, 1.8vw, 22px);
  color: var(--muted);
  max-width: 58ch;
}
.cta-row {
  margin-top: 18px;
  display: flex; gap: 12px; flex-wrap: wrap;
  align-items: center;
}
.form-actions {
  margin-top: 14px;
}

/* ---- TRUST BADGES ---- */
.trust {
  margin-top: 16px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start;
  color: var(--muted);
  font-size: 16px;
}
.trust span {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}

/* ---- SIDEBAR ---- */
.side h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: .2px;
}
.side p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 18px;
}
.side .kids,
.kids {
  margin-top: 14px;
  border-radius: 16px;
  border: 1px solid rgba(252,165,165,.30);
  background: rgba(252,165,165,.06);
  padding: 14px;
}
.side .kids strong,
.kids strong {
  display: block;
  font-size: 18px;
}
.side .kids p,
.kids p { margin-top: 6px; }
.side ul {
  margin: 12px 0 0 18px;
  color: var(--muted);
  padding: 0;
}

/* ---- SECTIONS ---- */
section {
  margin-top: 26px;
}
.section-title {
  display: block;
  margin-bottom: 14px;
}
.section-title h3 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
}
.section-title p {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
  font-size: 18px;
}

/* ---- GRID ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }

/* ---- SERVICE CARDS ---- */
.service h4 {
  margin: 0;
  font-size: 20px;
}
.service p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 18px;
}
.service ul {
  margin: 10px 0 0 18px;
  color: var(--muted);
  font-size: 18px;
  padding: 0;
}

/* ---- HOW IT WORKS ---- */
.how {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.step {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}
.step .num {
  width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(125,211,252,.14);
  border: 1px solid rgba(125,211,252,.25);
  color: var(--text);
  font-weight: 800;
  margin-bottom: 10px;
}
.step h4 { margin: 0; font-size: 18px; }
.step p { margin: 6px 0 0; color: var(--muted); font-size: 18px; }

/* ---- CONTACT SECTION ---- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.contact-heading {
  margin: 0 0 8px;
}
.contact-subtext {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}
.contact-methods {
  margin-top: 12px;
}
.contact-note {
  margin-top: 14px;
}

/* ---- FORMS ---- */
label {
  display: block;
  font-weight: 650;
  margin: 10px 0 6px;
}
input, textarea, select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  outline: none;
  font-size: 18px;
  min-height: 44px;
  font-family: var(--font);
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 0;
  border-color: rgba(125,211,252,.55);
  box-shadow: 0 0 0 4px rgba(125,211,252,.12);
}
textarea { min-height: 120px; resize: vertical; }
select option {
  background: #121824;
  color: #e9f0f7;
}

/* ---- FORM STATUS MESSAGES ---- */
.form-status-message {
  margin-top: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 600;
}
.form-status-success {
  background: rgba(167,243,208,.12);
  border: 1px solid rgba(167,243,208,.35);
  color: var(--accent2);
}
.form-status-error {
  background: rgba(252,165,165,.10);
  border: 1px solid rgba(252,165,165,.35);
  color: var(--danger);
}

/* ---- SMALL / HELPER TEXT ---- */
.small {
  color: var(--muted);
  font-size: 16px;
  margin-top: 8px;
}

/* ---- ABOUT SECTION ---- */
.about-text {
  margin-top: 0;
  color: var(--muted);
  font-size: 18px;
  max-width: 90ch;
}

/* ---- UTILITY CLASSES ---- */
.text-bright {
  color: var(--text);
}

/* ---- FOOTER ---- */
footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}
.fineprint {
  max-width: 80ch;
}
.footer-note {
  color: var(--muted);
}

/* ---- HAMBURGER BUTTON (hidden on desktop) ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .nav-toggle span { transition: none; }
}

/* ---- RESPONSIVE: TABLET ---- */
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
  .brand { min-width: auto; }
  .col-4, .col-6 { grid-column: span 12; }
  .how { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 1fr; }
}

/* ---- RESPONSIVE: MOBILE ---- */
@media (max-width: 700px) {
  /* Hamburger visible */
  .nav-toggle { display: flex; }

  /* Nav hidden by default, shown when open */
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(11,15,20,.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 8px var(--pad) 16px;
    gap: 4px;
  }
  nav.open { display: flex; }
  nav a {
    width: 100%;
    justify-content: center;
    padding: 14px;
  }

  /* Header layout */
  .topbar-inner {
    position: relative;
  }
  .brand {
    flex: 1;
    min-width: 0;
  }
  .brand h1 { font-size: 17px; }
  .brand-full { display: none; }
  .brand p { display: none; }

  /* How-it-works single column on phone */
  .how { grid-template-columns: 1fr; }

  /* Smaller section spacing */
  section { margin-top: 20px; }

  /* Footer stacks */
  footer {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }

  /* Buttons full-width on very small screens */
  .cta-row {
    flex-direction: column;
  }
  .cta-row .btn { width: 100%; }

  /* Trust badges wrap better */
  .trust { font-size: 14px; }
}
