/* ============================================================
   SMARTWAYLABS PORTFOLIO - shared stylesheet
   Brand tokens live in :root below - change colors/fonts there
   and every page updates. Sections are ordered top-to-bottom
   as they appear on the pages.
============================================================ */

:root {
  --bg: #F2F7F9;            /* page background */
  --bg-deep: #e6eff2;       /* slightly deeper tint (chips, code-like bits) */
  --surface: #FFFFFF;       /* cards, header, footer */
  --ink: #23272e;           /* main text (site global-color-8) */
  --ink-soft: #454F5E;      /* secondary text (site global-color-3) */
  --line: #D8E2E8;          /* borders */
  --accent: #452574;        /* SmartWayLabs deep purple */
  --accent-hover: #7c2ec0;  /* bright purple for hovers */
  --accent-tint: #EEE7F8;   /* light purple fill for tags */
  --radius: 14px;
  --font-display: "Montserrat", sans-serif;        /* headings */
  --font-body: "Source Sans 3", "Source Sans Pro", sans-serif; /* body text */
  --font-ui: "DM Sans", sans-serif;                /* buttons, labels, tags */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Fix: elements with the hidden attribute must hide even when a class
   gives them display:flex/grid (used by the industry filter). */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 40px; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* Accessibility: hidden link that appears on keyboard Tab */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: #fff;
  font-family: var(--font-ui); font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 0 0 10px 10px;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }

/* Anchored headings don't hide under the sticky header */
h1, h2, h3 { scroll-margin-top: 80px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 80px;
}
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; font-size: 16px; color: #333333; }
.brand img { width: 59px; height: 50px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small {
  font-family: var(--font-body); font-weight: 400; font-size: 11px;
  color: var(--ink-soft); letter-spacing: .01em;
}
/* Menu copied from the main site's .ast-builder-menu-1:
   DM Sans 600, uppercase, 14px, .5px letter-spacing, 22px side padding,
   color #23272e, hover/current #454F5E with the zoom hover effect. */
.site-nav {
  display: flex; align-items: center; gap: 0;
  font-family: var(--font-ui); font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink);
}
.site-nav a {
  padding: 0 22px;
  transition: transform .3s ease, color .15s ease;
}
.site-nav a:hover { color: var(--ink-soft); transform: scale(1.2); }
.site-nav .is-active { color: var(--ink-soft); }
.nav-cta {
  font-family: var(--font-ui); font-weight: 700; font-size: 13px;
  letter-spacing: .04em; text-transform: uppercase;
  background: var(--accent); color: #fff !important;
  padding: 9px 18px; border-radius: 999px;
  transition: background .15s ease;
}
.nav-cta:hover { background: var(--accent-hover); }

/* ---------- Hero (index) ---------- */
.hero { padding: 88px 0 40px; }
.eyebrow {
  font-family: var(--font-ui); font-weight: 700; font-size: 13px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-hover); margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 6.2vw, 64px); line-height: 1.08; letter-spacing: -0.015em;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub { max-width: 520px; margin-top: 22px; color: var(--ink-soft); font-size: 18px; }

/* ---------- Filter bar (index) ---------- */
.cases { padding: 32px 0 80px; }
.filter-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 18px 0 30px; border-top: 1px solid var(--line);
}
.filter-label {
  font-family: var(--font-ui); font-weight: 700; font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft); margin-right: 6px;
}
.chip {
  font-family: var(--font-ui); font-size: 14px; font-weight: 500;
  padding: 7px 16px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  transition: all .15s ease;
}
.chip:hover { border-color: var(--accent-hover); color: var(--accent-hover); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Case cards (index) ---------- */
.case-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px;
}
.case-card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.case-card:hover {
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(69, 37, 116, .10);
}
.card-media { margin: -26px -26px 6px; }
.card-media img {
  width: 100%; aspect-ratio: 16 / 10; height: auto;
  object-fit: cover; object-position: top;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--line);
}
.card-top { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-ui); font-weight: 700; font-size: 11.5px; letter-spacing: .07em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 6px;
  background: var(--accent-tint); color: var(--accent);
}
.tag-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
/* Tags rendered as links (on case pages) light up on hover */
a.tag:hover { background: var(--accent); color: #fff; }
a.tag-ghost:hover { background: transparent; border-color: var(--accent-hover); color: var(--accent-hover); }
.card-metric { display: flex; flex-direction: column; padding: 6px 0 2px; }
.metric-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: 34px; color: var(--accent); line-height: 1.1;
}
.metric-label { font-size: 14px; color: var(--ink-soft); margin-top: 2px; }
.case-card h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.3;
}
.case-card p { color: var(--ink-soft); font-size: 15px; flex: 1; }
.card-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.card-stack span {
  font-family: var(--font-ui); font-weight: 500; font-size: 12.5px; color: var(--ink-soft);
  background: var(--bg-deep); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 6px;
}
.card-link { font-family: var(--font-ui); font-size: 14px; font-weight: 700; color: var(--accent); margin-top: 4px; }
.case-card:hover .card-link { color: var(--accent-hover); }
.empty-note { color: var(--ink-soft); padding: 30px 0; }

/* ---------- CTA band (all pages) ---------- */
.cta-band { background: var(--accent); color: #fff; padding: 64px 0; }
.cta-inner { text-align: center; }
.cta-inner h2 { font-family: var(--font-display); font-size: 32px; font-weight: 700; }
.cta-inner p { color: #D9CBEF; margin: 10px 0 26px; font-size: 17px; }
.btn {
  display: inline-block;
  font-family: var(--font-ui); font-weight: 700; font-size: 14px;
  letter-spacing: .05em; text-transform: uppercase;
  background: var(--accent-hover); color: #fff;
  padding: 14px 30px; border-radius: 999px;
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: #8f43d6; transform: translateY(-1px); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 26px 0; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; font-size: 14px; color: var(--ink-soft);
}
.footer-links { display: flex; gap: 18px; }
.footer-links a:hover { color: var(--accent-hover); }

/* ---------- Case detail pages ---------- */
.case-page { padding-top: 48px; }
.back-link {
  display: inline-block; font-family: var(--font-ui); font-size: 14px; font-weight: 500;
  color: var(--ink-soft); margin-bottom: 34px;
}
.back-link:hover { color: var(--accent-hover); }
.case-head h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 4.4vw, 44px); line-height: 1.16; letter-spacing: -0.01em;
  margin: 16px 0 18px; max-width: 820px;
}
.case-lede { color: var(--ink-soft); font-size: 18.5px; max-width: 680px; }

.spec-sheet {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin: 40px 0;
}
.spec { background: var(--surface); padding: 16px 20px; display: flex; flex-direction: column; gap: 3px; font-size: 15px; }
.spec-label {
  font-family: var(--font-ui); font-weight: 700; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-hover);
}

/* ---------- Screenshot frames ----------
   Every case screenshot gets the SAME presentation: a browser-style
   window (traffic-light dots), a uniform 16:10 viewport that crops
   from the top, and the caption inside the card. This is what keeps
   mixed screenshots (dashboards, sites, dark/light UIs) looking like
   one professional set. New images need no special preparation:
   drop in any screenshot and the frame normalizes it. */
.case-media { margin: 0 0 48px; }
.case-media, .media-grid figure {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(69, 37, 116, .08);
}
.case-media::before, .media-grid figure::before {
  content: ""; display: block; height: 34px; flex: none;
  background:
    radial-gradient(circle at 22px 17px, #E15B50 5px, transparent 5.8px),
    radial-gradient(circle at 42px 17px, #E8B93E 5px, transparent 5.8px),
    radial-gradient(circle at 62px 17px, #58B95E 5px, transparent 5.8px),
    #F2F4F7;
  border-bottom: 1px solid var(--line);
}
.case-media img, .media-grid img {
  width: 100%; aspect-ratio: 16 / 10;
  object-fit: cover; object-position: top;
  background: #fff; display: block;
}
.case-media figcaption, .media-grid figcaption {
  font-size: 14px; color: var(--ink-soft);
  padding: 12px 18px 14px; border-top: 1px solid var(--line);
}

.media-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin: 36px 0 8px;
}
.media-grid figure { display: flex; flex-direction: column; }
.media-grid figcaption { margin-top: auto; }

.case-body { max-width: 760px; padding-bottom: 72px; }
.case-body h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 24px;
  margin: 36px 0 12px;
}
.case-body p { color: var(--ink-soft); font-size: 17px; margin-bottom: 14px; }
.case-quote {
  margin-top: 44px; padding: 26px 28px;
  background: var(--surface); border-left: 3px solid var(--accent-hover);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.case-quote p { font-size: 17px; color: var(--ink); font-style: italic; margin: 0; }
.case-quote footer { margin-top: 12px; font-size: 14.5px; color: var(--ink-soft); }

/* ---------- Media carousel (3+ screenshots) ----------
   Same browser-frame look as single figures; slides snap-scroll.
   Use .media-grid for exactly 2 images, .media-carousel for 3+. */
.media-carousel {
  position: relative; margin: 36px 0 8px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(69, 37, 116, .08);
  overflow: hidden;
}
.media-carousel::before {
  content: ""; display: block; height: 34px;
  background:
    radial-gradient(circle at 22px 17px, #E15B50 5px, transparent 5.8px),
    radial-gradient(circle at 42px 17px, #E8B93E 5px, transparent 5.8px),
    radial-gradient(circle at 62px 17px, #58B95E 5px, transparent 5.8px),
    #F2F4F7;
  border-bottom: 1px solid var(--line);
}
.carousel-track {
  display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide {
  flex: 0 0 100%; scroll-snap-align: start;
  margin: 0; display: flex; flex-direction: column;
}
.carousel-slide img {
  width: 100%; aspect-ratio: 16 / 10;
  object-fit: cover; object-position: top;
  background: #fff; display: block;
}
.carousel-slide figcaption {
  font-size: 14px; color: var(--ink-soft);
  padding: 12px 76px 40px 18px; border-top: 1px solid var(--line);
}
.carousel-arrow {
  position: absolute; top: 42%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .92);
  color: var(--ink); font-size: 16px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .14);
  transition: background .15s ease, color .15s ease, opacity .15s ease;
  z-index: 2;
}
.carousel-arrow:hover { background: var(--accent); color: #fff; }
.carousel-arrow:disabled { opacity: .35; cursor: default; }
.carousel-arrow:disabled:hover { background: rgba(255, 255, 255, .92); color: var(--ink); }
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }
.carousel-dots {
  position: absolute; right: 16px; bottom: 12px;
  display: flex; gap: 7px;
}
.carousel-dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--line); transition: background .15s ease, transform .15s ease;
  padding: 0;
}
.carousel-dot.is-active { background: var(--accent); transform: scale(1.25); }
@media (max-width: 640px) {
  .carousel-arrow { display: none; } /* swipe on touch */
  .carousel-slide figcaption { padding: 12px 18px 36px; }
  .carousel-dots { left: 0; right: 0; justify-content: center; }
}

/* ---------- Lightbox: click screenshots to enlarge ---------- */
.is-zoomable { cursor: zoom-in; transition: opacity .15s ease; }
.is-zoomable:hover { opacity: .92; }
.lightbox {
  border: none; padding: 0; background: transparent;
  max-width: min(94vw, 1400px); max-height: 92vh;
  margin: auto; overflow: visible;
}
.lightbox::backdrop { background: rgba(15, 23, 42, .82); backdrop-filter: blur(3px); }
.lightbox img {
  max-width: min(94vw, 1400px); max-height: 84vh;
  width: auto; height: auto; margin: 0 auto;
  border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
  cursor: zoom-out;
}
.lightbox-caption {
  text-align: center; color: #DCE4F0; font-size: 14.5px; margin-top: 14px;
  font-family: var(--font-body);
}
.lightbox-close {
  position: absolute; top: -14px; right: -14px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--surface); color: var(--ink);
  font-size: 24px; line-height: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}
.lightbox-close:hover { background: var(--accent-hover); color: #fff; }
@media (max-width: 640px) {
  .lightbox-close { top: 6px; right: 6px; }
}

/* ---------- 404 page ---------- */
.error-page { min-height: 55vh; display: flex; align-items: center; padding: 64px 0; }
.error-page .eyebrow { margin-bottom: 12px; }
.error-page h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 5vw, 52px); margin-bottom: 14px; }
.error-page p { color: var(--ink-soft); max-width: 480px; margin-bottom: 26px; }

/* ---------- Mobile ---------- */
/* Social icons in the header: flat brand-colored squares, like the main site.
   To add Facebook/Instagram later: duplicate the .header-social link in the
   HTML with the right SVG and set its background via inline style or a class. */
.header-social {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  color: #fff; background: #0A66C2; /* LinkedIn brand blue */
  transition: opacity .15s ease, transform .15s ease;
  margin-left: 22px;
}
.header-social:hover { opacity: .85; transform: translateY(-1px); }
.header-social svg { width: 16px; height: 16px; }

/* Hamburger button: hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px;
  background: none; border: none; cursor: pointer; border-radius: 8px;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: var(--ink); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 720px) {
  .wrap { padding: 0 24px; }
  .nav-toggle { display: flex; order: 3; }
  .header-social { order: 2; margin-left: auto; margin-right: 6px; }
  .brand { font-size: 17px; gap: 10px; }
  .brand img { width: 42px; height: 36px; }
  .brand-text small { display: none; }

  /* The menu becomes a dropdown panel under the header, like the
     main site's mobile menu: all five links, stacked, tap to close. */
  .site-nav {
    display: none;
    position: absolute; top: 80px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 32px rgba(15, 23, 42, .10);
    padding: 6px 0 10px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    padding: 13px 24px; font-size: 13.5px;
    border-top: 1px solid var(--line);
    transition: none;
  }
  .site-nav a:hover { transform: none; }
  .site-nav a:first-child { border-top: none; }
  .site-nav .is-active { background: var(--accent-tint); }

  .hero { padding-top: 56px; }
  .media-grid { grid-template-columns: 1fr; }
}
