/* ─── DESIGN TOKENS ─── */
:root {
  --white:        #ffffff;
  --cream:        #FDF8F2;
  --off-white:    #f7f9fc;
  --light-gray:   #eef1f7;
  --mid-gray:     #9099b0;
  --text:         #1e2240;
  --text-sub:     #555d7a;

  --blue-deep:    #245596;
  --blue-mid:     #3a72b8;
  --blue-light:   #70a5d5;
  --blue-pale:    #ddeaf7;
  --accent:       #83cfef;   /* nav hover / PCB accent */

  --orange:       #f27443;
  --orange-light: #f5a07a;
  --orange-pale:  #fde8dc;

  --nav-width:    315px;

  --radius:       14px;
  --radius-sm:    8px;
  --transition:   0.22s ease;
}

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* ─── FOCUS STYLES (keyboard navigation) ─── */
/* Use :focus-visible so mouse clicks don't show outlines */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
.nav-link:focus-visible {
  outline-offset: -3px; /* inset so it fits inside the nav item */
}
.btn-primary:focus-visible {
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(242, 116, 67, 0.25);
}
.carousel-btn:focus-visible,
.dot:focus-visible {
  outline-offset: 3px;
}

/* Respect reduced motion — disable smooth scroll and transitions */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ─── CIRCUIT CANVAS ─── */
#circuitCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ─── SIDENAV LOGO (slides in when hero logo scrolls out of view) ─── */
.nav-logo {
  /* In-flow flex item — sits above Home naturally */
  display: block;
  width: 100px;
  margin-left: 138px;
  margin-bottom: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              opacity   0.35s ease,
              visibility 0s linear 0.45s;
  pointer-events: none;
}

.nav-logo.nav-logo--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              opacity   0.35s ease,
              visibility 0s linear 0s;
  pointer-events: auto;
}

/* Hide on mobile (sidenav becomes a horizontal top bar) */
@media (max-width: 768px) {
  .nav-logo { display: none; }
}

/* ─── SIDENAV ─── */
:root {
  --trace-x: 128px;   /* x-center of the vertical backbone trace */
  --pad-d:   16px;   /* landing pad diameter */
  --stub-w:  26px;   /* horizontal stub length (right of pad center) */
}

.sidenav {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--nav-width);
  z-index: 100;
  background: rgba(253, 248, 242, 0.96);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

/* Vertical PCB backbone trace — static blue, full height */
.sidenav::before {
  content: '';
  position: absolute;
  left: calc(var(--trace-x) - 1.5px);
  top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.35;
  z-index: 0;
}

/* Animated orange glow — slides along the trace to the active nav item.
   Fades transparent → orange → transparent so the blue trace bleeds through,
   creating the orange-to-blue ombre the user sees. */
.sidenav::after {
  content: '';
  position: absolute;
  left: calc(var(--trace-x) - 1.5px);
  top: calc(var(--active-y, 200px) - 55px);
  width: 3px;
  height: 110px;
  background: linear-gradient(to bottom,
    transparent 0%,
    var(--orange) 50%,
    transparent 100%
  );
  transition: top 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  pointer-events: none;
}

.sidenav-links {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 2rem 0;
}

/* Each nav link — a PCB stub branching off the backbone */
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  /* text starts after: trace-x + half-pad + stub + gap = 128 + 8 + 26 + 4 = 166px */
  padding: 0.85rem 1.25rem 0.85rem 166px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-sub);
  transition: color var(--transition);
}

/* Landing pad — solid circle centered exactly on the backbone */
.nav-link::after {
  content: '';
  position: absolute;
  left: calc(var(--trace-x) - var(--pad-d) / 2);  /* = 40 - 8 = 32px */
  top: 50%;
  transform: translateY(-50%);
  width: var(--pad-d);
  height: var(--pad-d);
  border-radius: 50%;
  background: var(--accent);
  /* sits above the backbone trace, covering the line */
  z-index: 2;
  transition: background var(--transition), box-shadow var(--transition);
}

/* Horizontal stub — from right edge of pad to text */
.nav-link::before {
  content: '';
  position: absolute;
  left: calc(var(--trace-x) + var(--pad-d) / 2);  /* = 40 + 8 = 48px */
  top: 50%;
  transform: translateY(-50%);
  width: var(--stub-w);
  height: 3px;
  background: var(--accent);
  opacity: 0.45;
  z-index: 1;
  transition: background var(--transition), opacity var(--transition), box-shadow var(--transition);
}

/* Hover state */
.nav-link:hover { color: var(--text); }
.nav-link:hover::after {
  background: var(--orange);
  box-shadow: 0 0 12px rgba(242, 116, 67, 0.45);
}
.nav-link:hover::before {
  background: var(--orange);
  opacity: 0.7;
}

/* Active state (current section) */
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  background: var(--orange);
  box-shadow: 0 0 12px rgba(242, 116, 67, 0.4);
}
.nav-link.active::before {
  background: var(--orange);
  opacity: 0.7;
}

/* ─── MAIN CONTENT ─── */
.main-content {
  margin-left: var(--nav-width);
  position: relative;
  z-index: 1;
}

/* ─── HERO ─── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  text-align: center;
  background: rgba(253, 248, 242, 0.93);
}

.hero-content { max-width: 864px; }

.hero-logo {
  width: min(504px, 70vw);
  margin: 0 auto 2.7rem;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.1rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1.2rem;
}

.hero-title span {
  background: linear-gradient(90deg, var(--blue-deep) 0%, var(--orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 2.4vw, 1.38rem);
  color: var(--text-sub);
  max-width: 624px;
  margin: 0 auto 3rem;
}

.hero .btn-primary {
  padding: 0.96rem 2.64rem;
  font-size: 1.2rem;
}

/* ─── BUTTONS ─── */
.btn-primary {
  display: inline-block;
  padding: 0.8rem 2.2rem;
  background: linear-gradient(135deg, var(--orange) 0%, #e05e2a 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(242,116,67,0.3);
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(242,116,67,0.45);
}
.btn-large  { padding: 1rem 2.8rem; font-size: 1.1rem; }
.btn-small  { padding: 0.5rem 1.25rem; font-size: 0.78rem; }

/* ─── SECTIONS ─── */
.section {
  padding: 6rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.7rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-sub);
  max-width: 520px;
  margin-bottom: 3rem;
}

/* ─── GALLERY ─── */
.gallery-section {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
  background: var(--off-white);
}

.gallery-section .section-label,
.gallery-section .section-title,
.gallery-section .section-sub {
  padding-left: 2rem;
  margin-left: auto;
  margin-right: auto;
}

.carousel-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem;
}

.carousel-track-container {
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius);
}

.carousel-track {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 0.5rem 0;
}

.carousel-item {
  flex: 0 0 calc(33.333% - 1rem);
  min-width: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--light-gray);
  box-shadow: 0 4px 20px rgba(36,85,150,0.07);
  transition: transform var(--transition), box-shadow var(--transition);
}
.carousel-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(36,85,150,0.13);
}
.carousel-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.carousel-item .item-label {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-sub);
  font-weight: 600;
}

.carousel-placeholder {
  flex: 0 0 calc(33.333% - 1rem);
  min-width: 260px;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  background: var(--white);
  border: 2px dashed rgba(112,165,213,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--mid-gray);
}
.carousel-placeholder .ph-icon { font-size: 2.4rem; opacity: 0.4; }
.carousel-placeholder .ph-text { font-size: 0.82rem; opacity: 0.6; }

.carousel-btn {
  flex-shrink: 0;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid var(--light-gray);
  background: var(--white);
  color: var(--blue-deep);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(36,85,150,0.08);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.carousel-btn:hover { background: var(--orange); border-color: var(--orange); color: #fff; }
.carousel-btn:disabled { opacity: 0.25; cursor: default; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding-bottom: 0.5rem;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue-pale);
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.dot.active { background: var(--orange); transform: scale(1.35); }

/* ─── HOURS ─── */
.hours-section { text-align: center; }

.hours-card {
  max-width: 500px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-top: 3px solid var(--orange);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(36,85,150,0.07);
}

.hours-coming-soon {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid-gray);
  background: var(--light-gray);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  margin-bottom: 1.25rem;
}

.hours-grid { display: flex; flex-direction: column; gap: 0.9rem; }

.hours-dimmed { opacity: 0.35; pointer-events: none; user-select: none; }

.hours-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.day {
  text-align: right;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--text);
}

.divider {
  height: 1px;
  min-width: 32px;
  background: var(--light-gray);
}

.time {
  text-align: left;
  font-size: 0.93rem;
  color: var(--text-sub);
}
.time.closed { color: #c0392b; font-style: italic; }

.hours-note {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--light-gray);
  font-size: 0.84rem;
  color: var(--mid-gray);
  font-style: italic;
}

/* ─── ORDER CTA ─── */
.order-section {
  max-width: 100%;
  padding: 7rem 2rem;
  text-align: center;
  background: linear-gradient(160deg, var(--blue-pale) 0%, var(--orange-pale) 100%);
}

.order-inner { max-width: 620px; margin: 0 auto; }
.order-inner .section-sub { margin-left: auto; margin-right: auto; }

.order-note { margin-top: 1.25rem; font-size: 0.88rem; color: var(--text-sub); }
.inline-link { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; }
.inline-link:hover { color: var(--orange); }

/* ─── MISSION (inside order section) ─── */
.mission-divider {
  width: 48px;
  height: 1px;
  background: rgba(255,255,255,0.25);
  margin: 4rem auto 2rem;
}

.mission-statement {
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text);
  max-width: 420px;
  margin: 0 auto 1.25rem;
}

.mission-statement span {
  background: linear-gradient(90deg, #f27443 0%, #1a4fd6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ─── FOOTER ─── */
.footer {
  background: var(--cream);
  padding: 3rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.footer-logo {
  width: 150px;
  margin: 0 auto;
}

.footer-copy { font-size: 0.82rem; color: var(--text-sub); }
.footer-copy strong { color: var(--text); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  :root { --nav-width: 0px; }

  .sidenav {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    border: none;
    background: rgba(253, 248, 242, 0.97);
    z-index: 100;
  }

  /* Hide both trace and glow on mobile */
  .sidenav::before,
  .sidenav::after { display: none; }

  .sidenav-links {
    flex-direction: row;
    flex-wrap: nowrap;          /* single line, no wrapping */
    padding: 0.6rem 1rem;
    gap: 0;
    justify-content: space-around;
    width: 100%;
    overflow-x: auto;           /* scroll if screen is very narrow */
    scrollbar-width: none;
  }
  .sidenav-links::-webkit-scrollbar { display: none; }

  /* Strip all PCB decoration; tap highlight = blue text only */
  .nav-link,
  .nav-link.active {
    padding: 0.5rem 0.6rem;
    font-size: 0.72rem;
    color: var(--text-sub);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    outline: none;
  }
  .nav-link:hover,
  .nav-link:focus,
  .nav-link:active { color: var(--accent); background: none; }
  .nav-link.active  { color: var(--accent); }
  .nav-link::before,
  .nav-link::after,
  .nav-link.active::before,
  .nav-link.active::after { display: none; }

  .main-content { margin-left: 0; }

  .carousel-item,
  .carousel-placeholder {
    flex: 0 0 calc(86% - 0.5rem);
    min-width: unset;
  }
}
