/* ==========================================================================
   MINKA LAB — SWISS MINIMALIST LIGHT DESIGN SYSTEM
   Aligned with boliviaremote.work visual language
   Full-width desktop grid · Tight vertical rhythm · Mobile-first clarity
   ========================================================================== */

:root {
  --bg-page: #fafafa;
  --bg-card: #ffffff;
  --bg-well: #f4f4f5;
  --bg-well-hover: #e4e4e7;
  --text-main: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --border-hairline: rgba(24, 24, 27, 0.08);
  --border-control: rgba(24, 24, 27, 0.14);
  --border-strong: rgba(24, 24, 27, 0.24);
  --accent-primary: #18181b;
  --accent-hover: #27272a;
  --accent-fg: #ffffff;
  --link-color: #18181b;
  --link-hover: #52525b;
  --bolivia-red: #dc2626;
  --bolivia-yellow: #eab308;
  --bolivia-green: #16a34a;
  --apply-bg: #ecfdf5;
  --apply-border: #10b981;
  --apply-text: #065f46;
  --possible-bg: #fffbeb;
  --possible-border: #f59e0b;
  --possible-text: #92400e;
  --skip-bg: #f4f4f5;
  --skip-border: #a1a1aa;
  --skip-text: #52525b;
  --geo-bg: #fef2f2;
  --geo-border: #ef4444;
  --geo-text: #991b1b;
  --font-head: "Bahnschrift", "Segoe UI Variable Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Segoe UI Variable Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Consolas", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  --radius-card: 10px;
  --radius-well: 8px;
  --radius-btn: 7px;
  --gutter-x: clamp(12px, 1.8vw, 24px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  padding: 0;
  color: var(--text-main);
  background-color: var(--bg-page);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: clip;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, p, span, a, li, label, blockquote, figcaption, .card, .panel-card, footer {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.24;
  margin: 0;
}

p {
  margin: 0;
  color: var(--text-secondary);
}

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

button, a, label, input, select {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-hairline);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ==========================================================================
   STICKY SWISS NAVBAR (FULL-WIDTH)
   ========================================================================== */
#navbar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  border-bottom: 1px solid var(--border-hairline);
  background: rgba(255, 255, 255, 0.94);
  z-index: 1000;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom-color: var(--border-hairline);
}

.navbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  padding: 10px var(--gutter-x);
}

.brand-link {
  font-family: var(--font-head);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-main);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.brand-link:hover {
  opacity: 0.8;
}

.brand-link::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 8px;
  flex-shrink: 0;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='8' viewBox='0 0 24 8'%3E%3Ccircle cx='3.5' cy='4' r='2.8' fill='%23dc2626'/%3E%3Ccircle cx='12' cy='4' r='2.8' fill='%23eab308'/%3E%3Ccircle cx='20.5' cy='4' r='2.8' fill='%2316a34a'/%3E%3C/svg%3E");
}

.navbar-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 6px 13px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-btn);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-btn:hover {
  background: var(--bg-well);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.nav-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--accent-fg);
}

.nav-btn.active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.nav-btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}

.nav-btn-ghost:hover {
  background: var(--bg-well);
  border-color: transparent;
  color: var(--text-main);
}

/* ==========================================================================
   FULL-WIDTH MAIN CONTAINER & TIGHT VERTICAL RHYTHM
   ========================================================================== */
#main-doc {
  width: 100%;
  max-width: 100%;
  flex: 1 0 auto;
  padding: 12px var(--gutter-x) 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   SURFACES & CARDS
   ========================================================================== */
.panel-card,
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  box-shadow: none;
  min-width: 0;
  width: 100%;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.card:hover {
  border-color: var(--border-control);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.035);
}

/* ==========================================================================
   HERO BANNER (SWISS TOP CARD)
   ========================================================================== */
.hero-card {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-card h1 {
  font-size: clamp(1.32rem, 2.15vw, 1.82rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: clamp(0.94rem, 1.15vw, 1.02rem);
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.48;
}

.hero-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.56;
}

.cta-group {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

/* ==========================================================================
   SECTION HEADER & TALLERES 3-COLUMN GRID
   ========================================================================== */
.section-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-header-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 0 2px;
}

.section-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-main);
  line-height: 1.25;
}

.section-sep {
  color: var(--text-muted);
  opacity: 0.55;
  user-select: none;
}

.section-desc {
  font-size: 0.89rem;
  color: var(--text-secondary);
  line-height: 1.48;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  align-items: stretch;
}

.taller-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.taller-card p {
  font-size: 0.89rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ==========================================================================
   IMPACTO Y HERRAMIENTAS — 2-COLUMN TOP-ALIGNED GRID
   ========================================================================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  align-items: stretch;
}

.grid-2.align-top {
  align-items: start;
}

.grid-2 > *,
.grid-3 > * {
  min-width: 0;
}

.feature-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-card-intro {
  font-size: 0.9rem;
  line-height: 1.54;
  color: var(--text-secondary);
}

.feature-title {
  font-family: var(--font-head);
  font-size: clamp(1.06rem, 1.35vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--text-main);
}

.feature-body {
  font-size: 0.9rem;
  line-height: 1.56;
  color: var(--text-secondary);
}

.feature-body strong {
  color: var(--text-main);
  font-weight: 600;
}

/* ==========================================================================
   SWISS PILLS & TAGS (DOT-INDEXED LIKE BOLIVIAREMOTE.WORK)
   ========================================================================== */
.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  max-width: 100%;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-well);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  line-height: 1.35;
  margin: 0;
}

.card-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--skip-border);
}

.card-tag.dot-emerald::before { background: var(--apply-border); }
.card-tag.dot-amber::before { background: var(--possible-border); }
.card-tag.dot-ink::before { background: var(--accent-primary); }

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--apply-bg);
  color: var(--apply-text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
}

.meta-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--apply-border);
}

/* ==========================================================================
   MEDIA FIGURE, QUOTE CALLOUT & RECESSED WELL LISTS
   ========================================================================== */
.media-figure {
  margin: 0;
  border-radius: var(--radius-well);
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background: var(--bg-well);
}

.media-figure img {
  width: 100%;
  height: clamp(210px, 16vw, 260px);
  object-fit: cover;
  object-position: center 24%;
  display: block;
}

.media-figure figcaption {
  font-size: 0.77rem;
  line-height: 1.4;
  padding: 7px 11px;
  background: var(--bg-well);
  color: var(--text-muted);
  border-top: 1px solid var(--border-hairline);
}

.swiss-quote {
  margin: 0;
  padding: 10px 13px;
  background: var(--bg-well);
  border-left: 3px solid var(--accent-primary);
  border-radius: 6px;
  font-size: 0.87rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.swiss-quote strong,
.swiss-quote cite {
  color: var(--text-main);
  font-style: normal;
  font-weight: 600;
}

.well-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.well-list li {
  background: var(--bg-well);
  border-radius: var(--radius-well);
  padding: 10px 13px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.well-list li strong {
  color: var(--text-main);
  font-weight: 600;
}

.well-list .well-detail {
  display: block;
  margin-top: 5px;
}

.well-list .well-layers {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}

/* ==========================================================================
   BUTTONS (EXACT BOLIVIAREMOTE.WORK SWISS CONTROLS)
   ========================================================================== */
.action-group {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  max-width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--accent-fg);
  border-color: var(--accent-primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-fg);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-control);
}

.btn-secondary:hover {
  background: var(--bg-well);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   FORMS & ALERTS (SUMATE.HTML)
   ========================================================================== */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-required {
  color: var(--bolivia-red);
}

.form-control {
  width: 100%;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--bg-card);
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.10);
}

.alert {
  padding: 10px 13px;
  border-radius: var(--radius-well);
  margin-bottom: 10px;
  font-size: 0.86rem;
  line-height: 1.5;
}

.alert a {
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.alert-success {
  background: var(--apply-bg);
  color: var(--apply-text);
  border: 1px solid rgba(16, 185, 129, 0.30);
}

.alert-success a {
  color: var(--apply-text);
}

.alert-error {
  background: var(--geo-bg);
  color: var(--geo-text);
  border: 1px solid rgba(239, 68, 68, 0.30);
}

.alert-error a {
  color: var(--geo-text);
}

/* ==========================================================================
   LIGHT SWISS HAIRLINE FOOTER
   ========================================================================== */
footer {
  width: 100%;
  margin-top: auto;
  padding: 16px var(--gutter-x) 20px;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-page);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.footer-inner {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
}

.footer-primary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 460px;
}

.footer-primary p {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.footer-primary strong {
  color: var(--text-main);
  font-weight: 600;
}

.footer-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex: 0 1 auto;
}

footer a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

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

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (TABLET & MOBILE)
   ========================================================================== */
@media only screen and (max-width: 960px) {
  .cta-group {
    display: flex;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .section-header-inline {
    flex-direction: column;
    gap: 2px;
  }

  .section-sep {
    display: none;
  }

  .media-figure img {
    height: 230px;
  }
}

@media only screen and (max-width: 680px) {
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media only screen and (max-width: 640px) {
  body {
    font-size: 14.5px;
  }

  .navbar-header {
    padding: 9px 12px;
    gap: 8px;
  }

  .brand-link {
    font-size: 1.04rem;
    gap: 8px;
  }

  .nav-btn {
    height: 32px;
    padding: 5px 10px;
    font-size: 0.79rem;
  }

  #main-doc {
    padding: 10px 12px 18px;
    gap: 10px;
  }

  .panel-card,
  .card,
  .hero-card,
  .taller-card,
  .feature-card {
    padding: 13px 14px;
  }

  .card-tag,
  .meta-pill {
    border-radius: 7px;
    font-size: 0.72rem;
    padding: 4px 9px;
  }

  .media-figure img {
    height: 190px;
  }

  .cta-group .btn,
  .action-group .btn {
    width: 100%;
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    gap: 6px;
  }

  .footer-primary {
    flex: 1 1 auto;
  }
}

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