/* ==========================================================================
   LANDING PAGES & WEB DESIGN
   Extends design-system.css. Tokens only: no new palette, type or radii.
   Prefix: lbw-  (web showcase). Loaded by landing-pages.html and projects.html.
   ========================================================================== */

/* ── Work-type switch (Product Design cases | Landing pages & web) ───────── */
.lbw-switch {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  border-radius: var(--r-pill);
  background: rgba(37, 26, 121, 0.05);
  border: var(--border-soft);
  margin-bottom: clamp(1rem, 2.6vh, 1.75rem);
}

.lbw-switch a {
  font-size: var(--fs-caption);
  font-weight: 600;
  line-height: 1;
  padding: 0.55rem 1rem;
  border-radius: var(--r-pill);
  color: var(--text-subtle);
  text-decoration: none;
  transition: color var(--d-fast) var(--ease-out), background var(--d-base) var(--ease-out);
}

.lbw-switch a[aria-current="page"] {
  background: var(--surface-white);
  color: var(--text-strong);
  box-shadow: var(--sh-xs);
}

.lbw-switch a:hover:not([aria-current]) { color: var(--text-strong); }
.lbw-switch a:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* Mobile: full-width segmented control, two equal halves, comfortable tap size */
@media (max-width: 640px) {
  .lbw-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 22rem;
    padding: 4px;
    gap: 4px;
  }
  .lbw-switch a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0 0.75rem;
    font-size: 0.9375rem;
    text-align: center;
    white-space: nowrap;
  }
}

/* ── Hero: published-project chips ───────────────────────────────────────── */
.lbw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.lbw-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-strong);
  text-decoration: none;
  padding: 0.55rem 0.95rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.72);
  border: var(--border-soft);
  box-shadow: var(--sh-xs);
  transition: transform var(--d-base) var(--ease-out), box-shadow var(--d-base) var(--ease-out);
}

.lbw-chip:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.lbw-chip:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

.lbw-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--positive);
  flex: none;
  box-shadow: 0 0 0 0 rgba(23, 164, 127, 0.45);
  animation: lbwPulse 2.8s ease-out infinite;
}

@keyframes lbwPulse {
  0% { box-shadow: 0 0 0 0 rgba(23, 164, 127, 0.45); }
  70%, 100% { box-shadow: 0 0 0 0.45rem rgba(23, 164, 127, 0); }
}

/* ── Project block ───────────────────────────────────────────────────────── */
.lbw-project {
  padding-block: clamp(2.75rem, 7vw, 5.5rem);
  border-top: 0;
  scroll-margin-top: 6rem;
}

.lbw-project:last-child { border-bottom: 0; }

/* Media gets the wide column (7fr). The text column is the narrow one. */
.lbw-project .lb-split { align-items: center; gap: clamp(2rem, 5vw, 4.5rem); }

.lbw-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.9rem;
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-subtle);
  margin-bottom: 0.75rem;
}

.lbw-live { display: inline-flex; align-items: center; gap: 0.4rem; color: #0E7A5D; }

.lbw-name { margin: 0 0 0.35rem; }
.lbw-cat { margin: 0 0 1.1rem; font-weight: 600; color: var(--accent); font-size: var(--fs-small); }
.lbw-desc { max-width: 34rem; margin-bottom: 1.25rem; }
.lbw-note { max-width: 34rem; margin: -0.25rem 0 1.25rem; color: var(--text-muted); }
.lbw-tags { margin-bottom: 1.75rem; }

.lbw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.25rem; }
.lbw-ext { width: 1em; height: 1em; flex: none; transition: transform var(--d-base) var(--ease-out); }
.lbw-actions .lb-btn:hover .lbw-ext { transform: translate(2px, -2px); }

/* ── Stage: gradient panel holding the desktop and mobile views ──────────── */
.lbw-stage {
  display: grid;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: clamp(0.9rem, 2.6vw, 1.75rem);
  background: var(--g-aurora);
}

.lbw-stage--b { background: var(--g-blush); }
.lbw-stage--c { background: linear-gradient(135deg, var(--surface-100) 0%, var(--co-200) 100%); }

.lbw-view {
  grid-area: 1 / 1;
  min-width: 0;
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--ease-out), visibility 0.35s;
}

.lbw-view--mobile {
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.98);
}

[data-view="mobile"] .lbw-view--desktop { opacity: 0; visibility: hidden; transform: translateY(-10px) scale(0.98); }
[data-view="mobile"] .lbw-view--mobile { opacity: 1; visibility: visible; transform: none; }

/* Browser mockup */
.lbw-browser {
  display: block;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-white);
  box-shadow: var(--sh-lg);
  text-decoration: none;
  transition: transform var(--d-slow) var(--ease-out), box-shadow var(--d-slow) var(--ease-out);
}

.lbw-stage:hover .lbw-browser { transform: translateY(-4px); box-shadow: var(--sh-xl); }

.lbw-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: var(--surface-050);
  border-bottom: var(--border-soft);
}

.lbw-lights { display: flex; gap: 0.35rem; flex: none; }
.lbw-lights i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ink-100); }

.lbw-url {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-pill);
  background: var(--surface-white);
  border: var(--border-soft);
  font-size: var(--fs-micro);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Screen: real screenshot on top, designed placeholder underneath */
.lbw-screen {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-050);
}

.lbw-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.9s var(--ease-out);
}

.lbw-stage:hover .lbw-screen img { transform: scale(1.025); }

/* A missing screenshot is hidden by JS so the designed placeholder shows instead of broken-image alt text */
.lbw-screen img[hidden],
.lbw-phone img[hidden] { display: none; }

.lbw-ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.35rem;
  text-align: center;
  padding: 1rem;
  background:
    radial-gradient(60% 70% at 20% 10%, rgba(176, 184, 249, 0.55), transparent 70%),
    radial-gradient(50% 60% at 90% 90%, rgba(255, 221, 205, 0.7), transparent 70%),
    var(--surface-050);
}

.lbw-ph strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 3.4vw, 2.25rem);
  letter-spacing: var(--tracking-display);
  color: var(--text-strong);
}

.lbw-ph span {
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-subtle);
}

/* Phone mockup */
.lbw-phone {
  position: relative;
  height: 100%;
  max-height: 34rem;
  aspect-ratio: 390 / 844;
  border-radius: clamp(1.4rem, 3vw, 2rem);
  border: clamp(0.3rem, 0.7vw, 0.45rem) solid var(--ink-900);
  background: var(--surface-050);
  overflow: hidden;
  box-shadow: var(--sh-xl);
}

.lbw-phone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.lbw-phone .lbw-ph strong { font-size: clamp(1rem, 2.4vw, 1.4rem); }

/* View toggle */
.lbw-toggle {
  display: inline-flex;
  margin-top: 1rem;
  padding: 3px;
  border-radius: var(--r-pill);
  background: rgba(37, 26, 121, 0.05);
  border: var(--border-soft);
}

.lbw-toggle button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-pill);
  transition: color var(--d-fast) var(--ease-out), background var(--d-base) var(--ease-out);
}

.lbw-toggle button[aria-pressed="true"] { background: var(--surface-white); color: var(--text-strong); box-shadow: var(--sh-xs); }
.lbw-toggle button:hover:not([aria-pressed="true"]) { color: var(--text-strong); }
.lbw-toggle button:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* ── Principles ──────────────────────────────────────────────────────────── */
.lbw-principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
}

.lbw-principle { padding: 1.5rem 0 1.75rem; border-top: var(--border-hairline); }

.lbw-principle__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-caption);
  letter-spacing: var(--tracking-label);
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.lbw-principle h3 { margin: 0 0 0.5rem; }
.lbw-principle p { margin: 0; max-width: 28rem; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .lbw-principles { grid-template-columns: 1fr; }
  .lbw-phone { max-height: 28rem; }
  .lbw-project .lbw-media { order: -1; } /* image first on mobile, whatever the desktop order */
}

@media (max-width: 520px) {
  .lbw-url { font-size: 0.625rem; }
}

/* ── Motion preferences ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lbw-dot { animation: none; }
  .lbw-view,
  .lbw-browser,
  .lbw-screen img,
  .lbw-chip,
  .lbw-ext { transition: none; }
  .lbw-stage:hover .lbw-browser,
  .lbw-stage:hover .lbw-screen img,
  .lbw-chip:hover,
  .lbw-actions .lb-btn:hover .lbw-ext { transform: none; }
  [data-view="mobile"] .lbw-view--desktop,
  .lbw-view--mobile { transform: none; }
}

/* ── Short variants (only used on phones) ────────────────────────────────── */
.lbw-short, .lbw-lbl-short { display: none; }
.lbw-ainote {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  max-width: 40rem;
  margin: 1.1rem 0 0;
  font-size: var(--fs-caption);
  line-height: 1.55;
  color: var(--text-muted);
}
.lbw-ainote::before {
  content: '';
  flex: none;
  width: 0.9rem;
  height: 0.9rem;
  margin-top: 0.2rem;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c0 7 5 12 12 12-7 0-12 5-12 12 0-7-5-12-12-12 7 0 12-5 12-12z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c0 7 5 12 12 12-7 0-12 5-12 12 0-7-5-12-12-12 7 0 12-5 12-12z'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 640px) {
  /* phones: web (browser) preview only, no desktop/mobile toggle */
  .lbw-toggle { display: none; }
  .lbw-stage .lbw-view--mobile { display: none; }
  .lbw-stage .lbw-view--desktop { opacity: 1; visibility: visible; transform: none; }
  /* shorter copy */
  .lbw-long, .lbw-note, .lbw-tag--extra { display: none; }
  .lbw-short { display: inline; }
  .lbw-tags { margin-bottom: 1.25rem; }
  /* both buttons side by side */
  .lbw-actions { display: flex; flex-wrap: nowrap; gap: 0.6rem; }
  .lbw-actions .lb-btn { flex: 1 1 0; min-width: 0; justify-content: center; padding-inline: 0.75rem; }
  .lbw-lbl-long { display: none; }
  .lbw-lbl-short { display: inline; }
}

/* Tighter gap before "Mais do que interfaces bonitas" */
.lbw-project:last-child { padding-bottom: 0; }
[aria-labelledby="lbwWorkTitle"] { padding-bottom: var(--section-y-tight); }
