/* K&K Performance — modernized theme (red/charcoal, from the original Turbify "Spark" palette) */

:root {
  --accent: #fd4238;
  --bg: #ececec;
  --surface: #ffffff;
  --text: #252525;
  --muted: #5c6160;
  --link: #c2281f;
  --border: #d7d7d7;
  --header-top: #575c5b;
  --header-bottom: #252525;
  --nav-bg: #2e3130;
  --shadow: 0 1px 3px rgb(0 0 0 / 12%);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #161717;
  --surface: #222424;
  --text: #e9e9e7;
  --muted: #a3a8a6;
  --link: #ff7a70;
  --border: #3a3d3c;
  --shadow: 0 1px 3px rgb(0 0 0 / 50%);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161717;
    --surface: #222424;
    --text: #e9e9e7;
    --muted: #a3a8a6;
    --link: #ff7a70;
    --border: #3a3d3c;
    --shadow: 0 1px 3px rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1rem;
}

a { color: var(--link); }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header {
  background: linear-gradient(var(--header-top), var(--header-bottom));
  border-top: 6px solid var(--accent);
  color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.brand {
  margin: 0;
  font-family: "Calisto MT", Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.15;
}
.brand a { color: #fff; text-decoration: none; }

.header-side { display: flex; align-items: center; gap: 0.75rem; }

.header-phone {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.header-phone:hover { color: var(--accent); }

.theme-toggle {
  background: transparent;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 50%;
  color: #fff;
  width: 2.1rem;
  height: 2.1rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Navigation */
.site-nav { background: var(--nav-bg); }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

.site-nav a {
  display: block;
  padding: 0.7rem 0.9rem;
  color: #f0f0ee;
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: #fff; border-bottom-color: var(--accent); }
.site-nav a[aria-current="page"] {
  color: #fff;
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: #f0f0ee;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.7rem 0;
  cursor: pointer;
  align-items: center;
  gap: 0.5rem;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: currentColor;
  position: relative;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

@media (max-width: 47rem) {
  .nav-toggle { display: flex; }
  .site-nav ul { display: none; flex-direction: column; padding-bottom: 0.5rem; }
  .site-nav ul.open { display: flex; }
  .site-nav a { border-bottom: 0; border-left: 3px solid transparent; }
  .site-nav a:hover, .site-nav a[aria-current="page"] { border-left-color: var(--accent); }
}

/* Main content */
main { padding: 1.75rem 1rem 2.5rem; }

h1 {
  font-family: "Calisto MT", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  line-height: 1.2;
  margin: 0 0 1.25rem;
}

h1.tagline { text-align: center; font-style: italic; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.card h2 {
  font-size: 1.3rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.35rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.25rem;
  align-items: start;
}
.card-grid .card { margin-bottom: 0; }

.lede { font-size: 1.15rem; color: var(--muted); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
}
.btn:hover { background: #d92f26; color: #fff; }

.checklist { padding-left: 1.25rem; }
.checklist li { margin-bottom: 0.35rem; }

/* Portfolio gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.gallery a { display: block; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }

.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.gallery a:hover img { transform: scale(1.04); }

dialog.lightbox {
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: #111;
  max-width: min(92vw, 70rem);
}
dialog.lightbox::backdrop { background: rgb(0 0 0 / 75%); }
dialog.lightbox img { display: block; max-width: 100%; max-height: 85vh; }
dialog.lightbox .lightbox-close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: rgb(0 0 0 / 60%);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Contact page */
.map-embed {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.notice {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
}

/* Footer */
.site-footer {
  background: var(--header-bottom);
  color: #d9d9d7;
  border-top: 4px solid var(--accent);
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding-top: 1.75rem;
  padding-bottom: 1rem;
}

.footer-org {
  font-family: "Calisto MT", Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
  color: #fff;
}

.site-footer address { font-style: normal; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--accent); }

.footer-links { display: flex; gap: 1.5rem; align-items: start; }

.footer-copy {
  border-top: 1px solid rgb(255 255 255 / 15%);
  padding-top: 0.75rem;
  padding-bottom: 1rem;
  font-size: 0.85rem;
  color: #a8a8a6;
}
.footer-copy p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .gallery img { transition: none; }
}
