/* ==========================================================================
   Kraig's Tech Help — site styles
   Fonts are loaded via <link> in index.html (not @import) so they don't block rendering.
   ========================================================================== */

:root {
  --bg: #f5f5f7;
  --ink: #111;
  --muted: #6e6e73;
  --dark: #050505;
  --line: #d8d8dc;
  --accent: #0071e3;
  --eyebrow: #636366;
  --eyebrow-dark: #9a9aa0;
  --nav-h: 64px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 8px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 40;
  background: #111;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}
.skip:focus { top: 10px; }

/* ---------- Navigation ---------- */
.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  background: rgba(245, 245, 247, .78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav { background: rgba(245, 245, 247, .97); }
}
.brand { font-size: 17px; font-weight: 700; letter-spacing: -.03em; }
.nav nav { display: flex; gap: 28px; align-items: center; font-size: 13px; color: #444; }
.nav nav a:not(.nav-cta) { opacity: .8; transition: opacity .2s; }
.nav nav a:not(.nav-cta):hover { opacity: 1; }
.nav-cta { background: #111; color: #fff; padding: 9px 16px; border-radius: 999px; }

.menu {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-bars,
.menu-bars::before,
.menu-bars::after {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .25s, background .25s;
}
.menu-bars { position: relative; }
.menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
.menu-bars::before { top: -6px; }
.menu-bars::after { top: 6px; }
.menu[aria-expanded="true"] .menu-bars { background: transparent; }
.menu[aria-expanded="true"] .menu-bars::before { transform: translateY(6px) rotate(45deg); }
.menu[aria-expanded="true"] .menu-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Gradient text ---------- */
.grad { color: #444; }
.dark .grad { color: #c7c7cc; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .grad {
    background: linear-gradient(90deg, #111, #777);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
  .dark .grad { background-image: linear-gradient(90deg, #f5f5f7, #8e8e93); }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  padding: 120px 7vw 80px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 48%, #fff 0, #f5f5f7 42%, #ececf0 100%);
}
.hero-content { max-width: 980px; position: relative; z-index: 2; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--eyebrow); margin: 0 0 22px; }
.dark .eyebrow { color: var(--eyebrow-dark); }
.hero h1 { font-size: clamp(44px, 10vw, 142px); line-height: .88; letter-spacing: -.075em; margin: 0; font-weight: 800; }
.hero-copy { max-width: 690px; margin: 38px auto 0; font-size: 20px; line-height: 1.55; color: #5d5d63; }

.actions, .contact-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  min-height: 48px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  transition: transform .25s, background .25s;
}
.button:hover { transform: translateY(-2px); }
.primary { background: #111; color: #fff; }
.ghost { color: #111; }
.ghost:hover { background: rgba(0, 0, 0, .05); }
.outline { border: 1px solid #86868b; }
.outline:hover { background: rgba(0, 0, 0, .04); }
.light { background: #fff; color: #111; }
.big { padding: 17px 28px; }

.hero-orb { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .45; }
.orb-a { width: 280px; height: 280px; background: #b9d7ff; top: 14%; left: 8%; }
.orb-b { width: 300px; height: 300px; background: #e5c7ff; bottom: 8%; right: 6%; }

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #6e6e73;
  font-size: 11px;
  letter-spacing: .08em;
}
.scroll-cue span { margin-left: 8px; }

/* ---------- Dark sections ---------- */
.dark { background: var(--dark); color: #f5f5f7; }
.statement { padding: 180px 7vw; }
.wide { max-width: 1100px; margin: auto; }
.statement h2, .section-head h2, .feature h2, .contact h2 {
  font-size: clamp(44px, 7vw, 100px);
  line-height: .94;
  letter-spacing: -.065em;
  margin: 0;
  font-weight: 800;
}
.statement h2 em { font-style: normal; color: #8e8e93; }
.large-copy { font-size: clamp(21px, 2.4vw, 31px); line-height: 1.4; max-width: 800px; color: #aaa; margin-top: 45px; }

/* ---------- Services ---------- */
.services, .steps, .contact { padding: 150px 7vw; }
.section-head { max-width: 1050px; margin: 0 auto 65px; }
.service-grid { max-width: 1200px; margin: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.service-card {
  background: #fff;
  border-radius: 28px;
  padding: 35px;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
  transition: transform .35s, box-shadow .35s;
}
.service-card:hover { transform: translateY(-7px); box-shadow: 0 20px 50px rgba(0, 0, 0, .09); }
.icon { width: 48px; height: 48px; border-radius: 14px; background: #f1f1f4; display: grid; place-items: center; font-size: 22px; margin-bottom: 35px; }
.service-card h3 { font-size: 25px; letter-spacing: -.04em; margin: 0 0 12px; }
.service-card p { color: var(--muted); line-height: 1.55; margin: 0; }
.service-card a { color: var(--accent); font-size: 14px; font-weight: 600; margin-top: auto; padding-top: 25px; }
.service-card a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Feature ---------- */
.feature { padding: 160px 7vw; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.feature-copy { max-width: 620px; margin-left: auto; }
.feature-copy > p:not(.eyebrow) { color: #999; font-size: 20px; line-height: 1.6; margin: 35px 0; }
.tech-visual { display: grid; place-items: center; }
.glass-window {
  width: min(530px, 90vw);
  height: 350px;
  border-radius: 28px;
  background: linear-gradient(145deg, #252525, #090909);
  border: 1px solid #333;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .4);
  padding: 20px;
  transform: rotate(2deg);
}
.window-dots { color: #777; font-size: 10px; letter-spacing: 4px; }
.terminal { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #aaa; line-height: 2; margin: 55px 15px; }
.terminal span { color: #7eb4ff; }
.terminal b { color: #eee; font-weight: 500; }
.cursor { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Steps ---------- */
.step-row { max-width: 1200px; margin: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 60px; }
.step { border-top: 1px solid var(--line); padding-top: 25px; }
.step span { font-size: 12px; color: #6e6e73; }
.step h3 { font-size: 25px; letter-spacing: -.04em; margin: 35px 0 12px; }
.step p { color: #5d5d63; line-height: 1.55; max-width: 300px; }

/* ---------- About ---------- */
.about { padding: 170px 7vw; }
.about-card { max-width: 850px; margin: auto; }
.about h2 { font-size: clamp(40px, 6vw, 80px); line-height: 1; letter-spacing: -.06em; margin: 0 0 45px; }
.about p:not(.eyebrow) { font-size: 20px; line-height: 1.65; color: #aaa; max-width: 720px; }

/* ---------- Contact ---------- */
.contact { text-align: center; background: radial-gradient(circle at 50% 0, #fff 0, #f5f5f7 55%); }
.contact h2 { font-size: clamp(48px, 9vw, 120px); }
.contact > .contact-inner > p:not(.eyebrow):not(.contact-meta) { font-size: 20px; color: #5d5d63; }
.contact-meta { margin: 28px 0 0; font-size: 16px; font-weight: 500; color: #333; }
.contact small { display: block; color: #6e6e73; margin-top: 14px; }
.contact-meta a { border-bottom: 1px solid #aaa; }
.contact-meta a:hover { border-bottom-color: #111; }
.copy-row { margin: 14px 0 0; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.copy { font: inherit; font-size: 13px; font-weight: 600; color: var(--accent); background: none; border: 1px solid #c7c7cc; border-radius: 999px; padding: 8px 16px; min-height: 40px; cursor: pointer; }
.copy:hover { background: rgba(0, 113, 227, .06); }
.copy.done { color: #1d7a3a; border-color: #1d7a3a; }
.js .copy-row { display: flex; }
html:not(.js) .copy-row { display: none; }
.nextdoor { display: inline-block; margin-top: 22px; font-size: 14px; font-weight: 600; color: var(--accent); }
.nextdoor:hover { text-decoration: underline; text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

footer { display: flex; justify-content: space-between; gap: 12px; padding: 30px 7vw; background: #eee; font-size: 12px; color: #5d5d63; }

/* ---------- Scroll reveal (only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(35px); transition: opacity .9s ease, transform .9s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- Tablet ---------- */
@media (max-width: 1000px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .feature { gap: 50px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 800px) {
  .nav { padding: 0 22px; }

  /* With JS: collapsible dropdown. Without JS: just show the call-to-action. */
  .js .menu { display: inline-flex; }
  .js .nav nav {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 22px 22px;
    background: rgba(245, 245, 247, .97);
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    font-size: 17px;
  }
  .js .nav.open nav { display: flex; }
  .js .nav nav a { padding: 13px 0; opacity: 1; }
  .js .nav nav .nav-cta { margin-top: 10px; text-align: center; padding: 14px 16px; }
  html:not(.js) .nav nav a:not(.nav-cta) { display: none; }

  .hero { padding-left: 24px; padding-right: 24px; }
  .hero h1 { font-size: clamp(40px, 13.5vw, 90px); }
  .hero-copy { font-size: 17px; }
  .statement, .services, .steps, .contact, .about { padding: 100px 24px; }
  .service-grid, .step-row, .feature { grid-template-columns: 1fr; }
  .feature { padding: 100px 24px; gap: 55px; }
  .feature-copy { margin-left: 0; }
  .glass-window { height: 280px; }
  .terminal { margin-top: 35px; font-size: 12px; }
  .section-head { margin-bottom: 45px; }
  .service-card { min-height: 270px; }
  footer { padding: 25px 24px; flex-direction: column; gap: 8px; }
  .actions { flex-direction: column; }
  .actions .button, .contact-actions .button { justify-content: center; }
  .contact-actions { flex-direction: column; }
}

@media (max-height: 560px) {
  .scroll-cue { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; }
  .button, .service-card, .menu-bars, .menu-bars::before, .menu-bars::after { transition: none; }
  .button:hover, .service-card:hover { transform: none; }
}
