/* ============================================================
   MotorTach.com — stylesheet
   Dark + orange theme, matched to the app UI.
   ============================================================ */

:root {
  /* Brand palette (pulled from the app UI) */
  --bg:            #0a0d14;   /* near-black navy */
  --bg-2:          #10151f;   /* raised panels */
  --bg-3:          #161d2b;   /* cards / inputs */
  --line:          #232c3d;   /* hairline borders */

  --orange:        #f5821f;   /* the "Tach" orange */
  --orange-bright: #ff8a00;
  --orange-soft:   rgba(245,130,31,0.12);
  --green:         #3ddc5b;   /* gauge green */
  --red:           #e5432f;   /* gauge red */

  --text:          #f2f5fa;   /* primary text */
  --text-dim:      #9aa6b8;   /* secondary text */
  --text-faint:    #64708250; /* faint */

  --radius:        14px;
  --radius-lg:     22px;
  --maxw:          1120px;
  --gutter:        clamp(20px, 5vw, 48px);

  --shadow:        0 18px 50px rgba(0,0,0,0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

/* subtle radial glow behind the page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1000px 600px at 78% -8%, rgba(245,130,31,0.10), transparent 60%),
    radial-gradient(900px 700px at 8% 4%, rgba(61,220,91,0.05), transparent 55%);
  pointer-events: none;
}

img { max-width: 100%; display: block; }

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-bright); }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.section { padding: clamp(56px, 9vw, 110px) 0; }
.section--tight { padding: clamp(40px, 6vw, 70px) 0; }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 1rem;
}

.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-dim); max-width: 60ch; }
.text-center { text-align: center; }
.center-block { margin-left: auto; margin-right: auto; }

/* ---------- Wordmark ---------- */
.wordmark { font-weight: 800; letter-spacing: -0.02em; }
.wordmark .m { color: var(--text); }
.wordmark .t { color: var(--orange); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-weight: 700;
  font-size: 1rem;
  padding: .85em 1.5em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--orange); color: #1a0f00; }
.btn--primary:hover { background: var(--orange-bright); color: #1a0f00; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--orange); color: var(--orange); }

/* App Store badge button */
.appstore {
  display: inline-flex;
  align-items: center;
  gap: .7em;
  background: #000;
  border: 1px solid #2b2b2b;
  color: #fff;
  padding: .6em 1.2em .6em 1.1em;
  border-radius: 12px;
  transition: transform .15s ease, border-color .2s ease;
}
.appstore:hover { transform: translateY(-2px); border-color: #555; color: #fff; }
/* inert "coming soon" variant — not yet a link */
.appstore--soon { cursor: default; opacity: .92; }
.appstore--soon:hover { transform: none; border-color: #2b2b2b; color: #fff; }
.appstore svg { width: 26px; height: 26px; flex: none; }
.appstore .small { font-size: .65rem; letter-spacing: .04em; opacity: .85; line-height: 1; display: block; }
.appstore .big { font-size: 1.15rem; font-weight: 600; line-height: 1.1; }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(12px);
  background: rgba(10,13,20,0.72);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.nav__brand { display: flex; align-items: center; gap: .6em; font-size: 1.25rem; }
.nav__brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a.link { color: var(--text-dim); font-weight: 600; font-size: .95rem; }
.nav__links a.link:hover, .nav__links a.link.active { color: var(--text); }
.nav__toggle {
  display: none;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.nav__toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: .25s; }

@media (max-width: 820px) {
  .nav__links {
    position: fixed;
    inset: 66px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    transform: translateY(-140%);
    transition: transform .3s ease;
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a.link { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav__links .btn, .nav__links .appstore { margin-top: 14px; justify-content: center; }
  .nav__toggle { display: block; }
  .nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle.open span:nth-child(2) { opacity: 0; }
  .nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; padding-top: clamp(40px, 7vw, 80px); }
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(30px, 5vw, 60px);
  align-items: center;
}
.hero h1 { margin-bottom: .35em; }
.hero h1 .accent { color: var(--orange); }
.hero__sub { font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--text-dim); margin-bottom: 1.6em; max-width: 34ch; }
.hero__cta { margin-bottom: 1.4em; }
.hero__note { font-size: .9rem; color: var(--text-dim); display: flex; align-items: center; gap: .5em; }
.hero__note .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.hero__demo { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero__phone {
  position: relative;
  width: 280px;
  max-width: 100%;
  aspect-ratio: 600 / 1298;  /* full screenshot ratio — show the whole screen */
  border-radius: 40px;
  border: 8px solid #1b2231;
  box-shadow: var(--shadow), 0 0 0 1px #000;
  overflow: hidden;
}
/* two stacked frames — settling underneath, locked cross-fades in ~3-4s later, loops */
.hero__phone .frame {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.hero__phone .frame--locked {
  opacity: 0;
  -webkit-animation: mtLock 8s ease-in-out infinite;
  animation: mtLock 8s ease-in-out infinite;
  will-change: opacity;
  -webkit-transform: translateZ(0);   /* promote to its own layer on iOS */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
@-webkit-keyframes mtLock {
  0%, 28%  { opacity: 0; }
  40%      { opacity: 1; }
  90%      { opacity: 1; }
  100%     { opacity: 0; }
}
@keyframes mtLock {
  0%, 28%  { opacity: 0; }   /* SETTLING / NO LOCK  (~2.4s) */
  40%      { opacity: 1; }   /* cross-fade to LOCKED (~1s)  */
  90%      { opacity: 1; }   /* hold LOCKED with values (~4s) */
  100%     { opacity: 0; }   /* fade back and repeat */
}
.hero__demo-caption { font-size: .85rem; color: var(--text-dim); margin: 0; display: flex; align-items: center; gap: .5em; }
.hero__demo-caption .dot--settling { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 10px var(--orange); }
/* Reduce Motion: keep the gentle cross-dissolve (a fade is not vestibular
   motion), just slow it down so it's extra calm. */
@media (prefers-reduced-motion: reduce) {
  .hero__phone .frame--locked { -webkit-animation-duration: 12s; animation-duration: 12s; }
}

@media (max-width: 820px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__sub, .hero h1 { max-width: none; }
  .hero__cta .btn-row, .hero__note { justify-content: center; }
  .hero__phone { max-width: 260px; }
}

/* ============================================================
   Steps ("how it works")
   ============================================================ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px; }
.step {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  position: relative;
}
.step__num {
  font-size: .8rem; font-weight: 800; letter-spacing: .1em;
  color: var(--orange); margin-bottom: 14px;
}
.step h3 { margin-bottom: .4em; }
.step p { color: var(--text-dim); margin: 0; font-size: .97rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ============================================================
   Feature cards
   ============================================================ */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 44px; }
.feature {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  transition: transform .2s ease, border-color .2s ease;
}
.feature:hover { transform: translateY(-4px); border-color: rgba(245,130,31,0.4); }
.feature__icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--orange-soft);
  color: var(--orange);
  margin-bottom: 18px;
}
.feature__icon svg { width: 24px; height: 24px; }
.feature h3 { margin-bottom: .4em; }
.feature p { color: var(--text-dim); margin: 0; font-size: .97rem; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

/* ============================================================
   Split / showcase
   ============================================================ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 64px); align-items: center; }
.split--reverse .split__media { order: 2; }
.split__media { display: grid; place-items: center; }
.split__phone {
  width: 280px;
  max-width: 100%;
  border-radius: 36px;
  border: 8px solid #1b2231;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.split__phone img { width: 100%; height: auto; display: block; }
.split ul { list-style: none; padding: 0; margin: 1.2em 0 0; }
.split ul li { position: relative; padding-left: 30px; margin-bottom: 14px; color: var(--text-dim); }
.split ul li::before {
  content: "";
  position: absolute; left: 0; top: .55em;
  width: 14px; height: 8px;
  border-left: 2px solid var(--green); border-bottom: 2px solid var(--green);
  transform: rotate(-45deg);
}
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split--reverse .split__media { order: 0; }
}

/* ============================================================
   Industries
   ============================================================ */
.industries { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 40px; }
.industry {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 30px;
  background: var(--bg-2);
}
.industry h3 { color: var(--text); }
.industry p { color: var(--text-dim); margin: 0; }
.industry .tag { color: var(--orange); font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 700px) { .industries { grid-template-columns: 1fr; } }

/* application grid + VFD note */
.appgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 44px; }
.app {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  transition: transform .2s ease, border-color .2s ease;
}
.app:hover { transform: translateY(-3px); border-color: rgba(245,130,31,0.35); }
.app h3 { font-size: 1.02rem; margin: 0 0 .35em; }
.app p { color: var(--text-dim); font-size: .88rem; margin: 0; line-height: 1.5; }
@media (max-width: 900px) { .appgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .appgrid { grid-template-columns: 1fr; } }

.note-callout {
  margin-top: 34px;
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--orange-soft);
  border: 1px solid rgba(245,130,31,0.28);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.note-callout svg { width: 22px; height: 22px; color: var(--orange); flex: none; margin-top: 2px; }
.note-callout p { margin: 0; color: #e7d9c8; font-size: .95rem; line-height: 1.55; }
.note-callout strong { color: var(--text); }

/* safety / no-electrical-exposure callout */
.safety-band {
  display: flex; gap: 26px; align-items: center;
  background: linear-gradient(120deg, #14100a, var(--bg-2));
  border: 1px solid rgba(245,130,31,0.25);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 4vw, 42px);
}
.safety-band__icon {
  width: 60px; height: 60px; border-radius: 16px; flex: none;
  display: grid; place-items: center;
  background: var(--orange-soft); color: var(--orange);
}
.safety-band__icon svg { width: 32px; height: 32px; }
.safety-band h3 { margin: 0 0 .45em; font-size: clamp(1.2rem, 2.4vw, 1.5rem); }
.safety-band p { margin: 0; color: var(--text-dim); }
.safety-band strong { color: var(--text); }
@media (max-width: 640px) { .safety-band { flex-direction: column; align-items: flex-start; } }

/* ============================================================
   Stats band
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; text-align: center; }
.stat__num { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; color: var(--orange); }
.stat__label { color: var(--text-dim); font-size: .95rem; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; gap: 26px; } }

/* ============================================================
   CTA band
   ============================================================ */
.cta-band {
  background: linear-gradient(120deg, #1a1207, var(--bg-2));
  border: 1px solid rgba(245,130,31,0.28);
  border-radius: var(--radius-lg);
  padding: clamp(36px, 6vw, 64px);
  text-align: center;
}
.cta-band h2 { margin-bottom: .4em; }
.cta-band p { color: var(--text-dim); max-width: 52ch; margin: 0 auto 1.6em; }
.cta-band .btn-row { justify-content: center; }

/* ============================================================
   About page
   ============================================================ */
.about-hero { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px,5vw,60px); align-items: center; }
.about-hero__photo {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-3);
  aspect-ratio: 4/5;
  overflow: hidden;
}
.about-hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.about-hero__photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: 40px 22px 16px;
  background: linear-gradient(to top, rgba(6,9,14,0.94) 20%, rgba(6,9,14,0));
}
.about-hero__photo figcaption strong { font-size: 1.05rem; color: var(--text); font-weight: 800; }
.about-hero__photo figcaption span { font-size: .84rem; color: var(--text-dim); }
.about-hero__photo figcaption small { font-size: .74rem; color: var(--orange); margin-top: 4px; }
.prose { max-width: 70ch; }
.prose p { color: #d4dbe6; }
.prose h2 { margin-top: 1.6em; }

/* From-the-archives video cards */
.archives { margin-top: 2.4em; }
.archives h2 { margin-bottom: .2em; }
.archives > p { color: var(--text-dim); margin-bottom: 0; }
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 1.4em; }
.video-card { display: block; color: var(--text); }
.video-card__thumb {
  position: relative; display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: #000;
}
.video-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease, opacity .2s ease; }
.video-card:hover .video-card__thumb img { transform: scale(1.05); opacity: .8; }
.video-card__play {
  position: absolute; inset: 0; margin: auto;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(245,130,31,0.94); color: #160c00;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  transition: transform .2s ease;
}
.video-card:hover .video-card__play { transform: scale(1.08); }
.video-card__play svg { width: 24px; height: 24px; margin-left: 2px; }
.video-card__cap { display: block; margin-top: .7em; font-size: .9rem; color: var(--text-dim); line-height: 1.45; }
@media (max-width: 640px) { .video-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .about-hero { grid-template-columns: 1fr; } }

/* ============================================================
   Contact page
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px,5vw,56px); align-items: start; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 7px; font-size: .93rem; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  font-size: .97rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft);
}
.field textarea { min-height: 140px; resize: vertical; }
.contact-info .info-item { display: flex; gap: 14px; margin-bottom: 24px; align-items: flex-start; }
.contact-info .info-item svg { width: 22px; height: 22px; color: var(--orange); flex: none; margin-top: 3px; }
.contact-info .info-item .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); }
.contact-info .info-item .value { font-weight: 600; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Placeholder markers — anything the owner still needs to fill in
   ============================================================ */
.ph {
  border-bottom: 2px dotted var(--orange);
  color: var(--orange-bright);
}
[data-placeholder] { position: relative; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 54px 0 30px;
  margin-top: 40px;
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; align-items: flex-start; }
.footer-brand { max-width: 300px; }
.footer-brand p { color: var(--text-dim); font-size: .93rem; margin-top: .8em; }
.footer-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-col h4 { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 14px; }
.footer-col a { display: block; color: var(--text); font-size: .95rem; margin-bottom: 10px; font-weight: 500; }
.footer-col a:hover { color: var(--orange); }
.footer-bottom {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  color: var(--text-dim); font-size: .85rem;
}

/* utilities */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
