/* ============================================================
   Modern Auto Tech — full design composition
   ============================================================ */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #e8e6e3;
  background: #0a0a0a;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* --- Grain overlay --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 9999;
}

/* --- Terminal chrome --- */
.terminal-chrome {
  max-width: 900px;
  margin: 2rem auto;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  overflow: hidden;
  background: #0d0d0d;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  position: relative;
  z-index: 1;
}

.title-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: #1a1a1a;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.window-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.window-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  margin-left: 0.25rem;
}

/* --- Tab strip --- */
.tab-strip {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: #111;
  overflow-x: auto;
}

.tab {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.tab:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.03); }
.tab.active {
  color: #f4ff33;
  background: rgba(244,255,51,0.06);
  border-bottom: 2px solid #f4ff33;
}

/* --- Terminal body --- */
.terminal-body {
  padding: 0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* --- Section backgrounds (rotating palette) --- */
.section-1 { background: #0a0a0a; }
.section-2 { background: #e10600; }
.section-3 { background: #003c8a; }
.section-4 { background: #f4ff33; }

/* Section text colour inverts per section */
.section-1 { color: #e8e6e3; }
.section-2 { color: #fff5f0; }
.section-3 { color: #e0edff; }
.section-4 { color: #1a1a0a; }

/* Section-4 link colour */
.section-4 a { color: #003c8a; text-decoration: underline; }
.section-4 a:hover { color: #002060; }

/* --- Section inner --- */
.section-inner {
  padding: 3rem 2rem 3.5rem;
}

/* --- Typography --- */
h1, h2 {
  font-family: 'Fraunces', 'Cormorant Garamond', serif;
  font-weight: 600;
  margin: 0 0 0.25rem;
  line-height: 1.15;
}

h1 {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.subhead {
  font-size: 1.1rem;
  opacity: 0.8;
  margin: 0.5rem 0 2rem;
  max-width: 60ch;
}

.rating-line {
  font-size: 1.05rem;
  margin: 0.25rem 0 2rem;
  opacity: 0.85;
}

/* --- Prompt lines --- */
.prompt-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.3);
  margin: 0 0 1rem;
  padding: 0;
}

.section-4 .prompt-line {
  color: rgba(0,0,0,0.4);
}

.prompt {
  color: #27c93f;
  font-weight: 500;
}

.section-2 .prompt { color: #ffbd2e; }
.section-3 .prompt { color: #4fc3f7; }
.section-4 .prompt { color: #003c8a; }

.cmd {
  color: rgba(255,255,255,0.5);
}

.section-4 .cmd { color: rgba(0,0,0,0.5); }

/* --- Accordion (expandable index) --- */
.accordion {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin: 0;
}

.accordion:last-of-type {
  border-bottom: none;
}

.accordion summary {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  padding: 0.9rem 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: opacity 0.2s;
  user-select: none;
}

.accordion summary::-webkit-details-marker { display: none; }

.accordion summary:hover {
  opacity: 0.8;
}

.accordion summary .prompt {
  font-size: 0.85rem;
}

.accordion summary .cmd {
  font-size: 0.85rem;
}

.accordion-body {
  padding: 0 0 1.2rem 1.4rem;
  max-width: 68ch;
}

.accordion-body p {
  margin: 0 0 0.75rem;
}

.accordion-body p:last-child {
  margin-bottom: 0;
}

/* --- Hours table --- */
.hours-table {
  width: 100%;
  max-width: 320px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.hours-table td {
  padding: 0.3rem 0.5rem;
}

.hours-table td:first-child {
  font-weight: 500;
  width: 100px;
}

.closed {
  color: rgba(255,255,255,0.4);
}

.section-4 .closed { color: rgba(0,0,0,0.4); }

.hours-note {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-top: 0.75rem;
}

/* --- Blockquote --- */
blockquote {
  margin: 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid currentColor;
  opacity: 0.9;
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.6;
}

cite {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-style: normal;
  opacity: 0.7;
}

/* --- Contact grid --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

@media (max-width: 640px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.phone-link {
  text-decoration: none;
  font-weight: 600;
}

.big-phone {
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

/* --- Contact form --- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-prompt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: rgba(0,0,0,0.4);
  margin: 0 0 0.5rem;
}

.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: rgba(0,0,0,0.6);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  background: rgba(255,255,255,0.85);
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 0.95rem;
  color: #1a1a0a;
  transition: border-color 0.2s, background 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #003c8a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,60,138,0.15);
}

.submit-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  padding: 0.7rem 1.5rem;
  background: #003c8a;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  align-self: flex-start;
}

.submit-btn:hover {
  background: #002a60;
}

.form-status {
  font-size: 0.85rem;
  margin: 0;
  color: rgba(0,0,0,0.6);
}

/* --- Terminal footer --- */
.terminal-footer {
  padding: 0.6rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: #111;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.3);
}

.blinking-cursor {
  animation: blink 1s step-end infinite;
  color: #27c93f;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* --- Scroll-driven line reveals --- */
@keyframes riseIn {
  from {
    opacity: 0;
    translate: 0 20px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.reveal-line {
  animation: riseIn linear both;
  animation-timeline: view();
  animation-range: entry 0% cover 40%;
}

/* --- Attribution footer --- */
.attribution {
  position: fixed;
  bottom: 0.5rem;
  right: 0.75rem;
  font-size: 0.7rem;
  opacity: 0.35;
  font-family: 'DM Sans', system-ui, sans-serif;
  z-index: 10000;
}

.attribution a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
}

.attribution a:hover {
  color: rgba(255,255,255,0.8);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .terminal-chrome {
    margin: 0.5rem;
    border-radius: 8px;
  }

  .section-inner {
    padding: 2rem 1.25rem 2.5rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }

  .tab {
    padding: 0.5rem 0.9rem;
    font-size: 0.72rem;
  }

  .accordion summary {
    font-size: 0.78rem;
  }

  .accordion-body {
    padding-left: 0.8rem;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal-line {
    animation: none;
    opacity: 1;
    translate: 0;
  }

  .blinking-cursor {
    animation: none;
    opacity: 1;
  }
}
