/* ============================================================
   WORK PAGE — PREMIUM EDITION (RESPONSIVE + DARK/LIGHT)
   ============================================================ */

/* ============================================================
   0) GLOBAL BACKGROUND — Full-page background with brand tokens
   ============================================================ */

   body.work {
    background:
      radial-gradient(1200px 800px at 80% -10%,
        color-mix(in oklab, var(--brand-2) 20%, transparent),
        transparent 60%
      ),
      radial-gradient(900px 700px at 0% 120%,
        color-mix(in oklab, var(--brand) 20%, transparent),
        transparent 60%
      ),
      linear-gradient(180deg, var(--bg), var(--bg-2));
    background-attachment: fixed;
    overflow-x: hidden;
  }
  
  :root.light body.work {
    background:
      radial-gradient(1200px 800px at 80% -10%,
        color-mix(in oklab, var(--brand-2) 18%, transparent),
        transparent 60%
      ),
      radial-gradient(900px 700px at 0% 120%,
        color-mix(in oklab, var(--brand) 16%, transparent),
        transparent 60%
      ),
      linear-gradient(180deg, var(--bg), var(--bg-2));
  }
  
  /* ============================================================
     1) WRAPPERS
     ============================================================ */
  
  .wk-section {
    position: relative;
    padding-block: clamp(2.5rem, 6vw, 5rem);
  }
  
  @media (min-width: 1280px) {
    .wk-section {
      padding-block: clamp(3.5rem, 4vw, 6rem);
    }
  }
  
  .wk-container {
    width: min(100%, 1280px);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 3rem);
  }
  
  @media (min-width: 1400px) {
    .wk-container {
      width: min(90vw, 1280px);
    }
  }
  
  /* Mobile portrait — garante que nada cole demais no lado direito */
  @media (max-width: 640px) {
    .wk-container {
      padding-left: 0.75rem !important;
      padding-right: 0.75rem !important;
      width: 100% !important;
      max-width: 100% !important;
    }
  }
  
  /* Unifica ds-container + wk-container só na página WORK */
  body.work .ds-container,
  body.work .wk-container {
    width: 100% !important;
    max-width: 1280px !important;
    margin-inline: auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  
  /* ============================================================
     2) SECTION HEADER
     ============================================================ */
  
  .wk-header {
    max-width: 52rem;
    margin-inline: auto;
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 3rem);
  }
  
  .wk-eyebrow {
    text-transform: uppercase;
    font-size: var(--ds-font-xs);
    letter-spacing: 0.18em;
    color: var(--ds-color-muted);
    margin-bottom: var(--ds-space-1);
  }
  
  .wk-title {
    font-family: var(--ds-font-display);
    font-size: clamp(1.9rem, 1.5rem + 1.1vw, 2.5rem);
    background: linear-gradient(110deg, var(--ds-color-brand), var(--ds-color-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  
  .wk-kicker {
    font-size: var(--ds-font-md);
    color: var(--ds-color-muted);
  }
  
  /* ============================================================
     3) GRIDS
     ============================================================ */
  
  .wk-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .wk-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 4vw, 2.5rem);
    align-items: stretch;
  }
  
  @media (min-width: 768px) {
    .wk-grid-2 {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @media (min-width: 1280px) {
    .wk-grid-2 {
      gap: 3rem;
    }
  }
  
  /* ============================================================
     4) OUTER CARD
     ============================================================ */
  
  .wk-card {
    border-radius: var(--ds-radius-xl);
    padding: var(--ds-space-4);
    position: relative;
    overflow: hidden;
    transition: all .3s ease;
    backdrop-filter: blur(30px);
    display: flex;
    flex-direction: column;
  }
  
  :root.light .wk-card {
    background:
      radial-gradient(circle at 30% -20%, rgba(255,255,255,0.7), transparent 70%),
      linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));
    border: 1px solid rgba(0,0,0,0.10);
    box-shadow: 0 20px 40px rgba(0,0,0,.12);
  }
  
  :root:not(.light) .wk-card {
    background: linear-gradient(180deg, rgba(14,16,22,0.88), rgba(10,12,18,0.82));
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 18px 44px rgba(0,0,0,0.55);
  }
  
  .wk-card:hover {
    border-color: color-mix(in oklab, var(--brand) 50%, transparent);
    box-shadow: 0 28px 60px rgba(0,0,0,.28);
  }
  
  .wk-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
      600px 260px at var(--mx, 50%) var(--my, 0%),
      color-mix(in oklab, var(--ds-color-accent) 40%, transparent),
      transparent 70%
    );
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
  }
  
  .wk-card:hover::after {
    opacity: 1;
  }
  
  /* ============================================================
     5) INNER CARD
     ============================================================ */
  
  .wk-inner {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-3);
    flex: 1;
  }
  
  .wk-inner-card {
    background: rgba(0,0,0,.50);
    border-radius: var(--ds-radius-lg);
    padding: 1.4rem 1.6rem;
    box-shadow: inset 0 0 22px rgba(0,0,0,.35);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.06);
    color: white;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  
  :root.light .wk-inner-card {
    background: rgba(255,255,255,.65);
    color: var(--ds-color-text);
    box-shadow: inset 0 0 22px rgba(0,0,0,.08);
  }
  
  :root:not(.light) .wk-inner-card {
    background: rgba(0,0,0,0.45);
    box-shadow: inset 0 0 26px rgba(0,0,0,0.45);
  }
  
  .wk-inner-card .wk-card-title {
    font-size: 1.35rem;
    margin: 0;
  }
  
  .wk-inner-card .wk-card-desc {
    margin-top: .35rem;
    color: var(--ds-color-muted);
    line-height: 1.55;
    flex: 1;
  }
  
  /* ============================================================
     6) TAGS
     ============================================================ */
  
  .wk-inner-card .wk-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin: .35rem 0 .9rem;
  }
  
  .wk-tag {
    padding: .28rem .75rem;
    font-size: .73rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
  }
  
  :root.light .wk-tag {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.15);
  }
  
  /* ============================================================
     7) THUMBNAILS
     ============================================================ */
  
  .wk-thumb {
    width: min(100%, 520px);
    aspect-ratio: 4 / 3;
    object-fit: contain;
    object-position: center;
    display: block;
    margin-inline: auto;
  }
  
  /* ============================================================
     8) WIDE CARD (featured / talkroom / playground)
     ============================================================ */
  
  .wk-card--wide {
    /* display: grid;
    grid-template-columns: 1fr;
    gap: var(--ds-space-5);
    align-items: center;
    max-width: 1280px;
    margin-inline: auto; */
    /* width: 100%; */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    margin-inline: auto !important;
  }
  
  .wk-card--wide .wk-thumb {

    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    overflow: hidden !important;
    /* width: 100%;
    max-width: 420px;
    height: auto;
    object-fit: contain;
    margin-inline: auto;
    aspect-ratio: 16 / 9; */
  }
  
  @media (min-width: 640px) {
    .wk-card--wide {
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 2.2rem;
    }
  
    .wk-card--wide .wk-thumb {
      margin-inline: 0;
    }
  }
  
  @media (min-width: 1024px) {
    .wk-card--wide {
      grid-template-columns: 36% 1fr;
    }
  }
  
  /* Mobile wide card */
  @media (max-width: 640px) {
    .wk-card--wide {
      grid-template-columns: 1fr;
      max-width: 100%;
      margin-inline: auto;
    }
  
    .wk-card--wide .wk-thumb {
      max-width: 100%;
      aspect-ratio: 4 / 3;
      margin-inline: auto;
    }
  }
  
  /* ============================================================
     9) BUTTONS
     ============================================================ */
  
  .wk-btn {
    display: inline-flex;
    padding: 0.65rem 1.25rem;
    border-radius: .6rem;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .25s ease;
    white-space: nowrap;
    align-self: flex-start;
    justify-content: center;
    text-align: center;
    margin-top: auto;       /* cola no fundo do inner-card */
    width: 100%;            /* alinha melhor em mobile */
  }
  
  @media (min-width: 520px) {
    .wk-btn {
      width: auto;
    }
  }
  
  .wk-btn--primary {
    background: linear-gradient(115deg, var(--brand), var(--accent));
    color: white;
    box-shadow: 0 3px 10px rgba(0,0,0,.12);
  }
  
  .wk-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.16);
  }
  
  /* Botões dos cards pequenos centralizados */
  body.work .wk-inner-card .wk-btn {
    align-self: center !important;
    width: auto !important;
  }
  
  /* ============================================================
     10) SMALLER SPLIT CARDS — COMMUNICATION SECTION
     ============================================================ */
  
  #wk-communication .wk-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ds-space-4);
    min-height: 220px;
  }
  
  #wk-communication .wk-inner {
    min-height: 100%;
  }
  
  @media (min-width: 640px) {
    #wk-communication .wk-card {
      grid-template-columns: 200px 1fr;
    }
  
    #wk-communication .wk-thumb {
      margin-inline: 0;
      width: 100%;
      max-width: none;
    }
  }
  
  @media (min-width: 1024px) {
    #wk-communication .wk-card {
      grid-template-columns: 220px 1fr;
    }
  }
  
  /* ============================================================
     11) MOBILE TUNING — PORTRAIT
     ============================================================ */
  
  @media (max-width: 640px) {
  
    .wk-section {
      padding-block: 2.4rem;
    }
  
    .wk-card {
      padding: 1.2rem !important;
      border-radius: 18px !important;
    }
  
    .wk-inner-card {
      padding: 1.1rem 1.2rem !important;
    }
  
    .wk-card-title {
      font-size: 1.1rem !important;
    }
  
    .wk-card-desc {
      font-size: .9rem !important;
      line-height: 1.45 !important;
    }
  
    .wk-grid-2 {
      grid-template-columns: 1fr !important;
      gap: 1.2rem !important;
    }
  
    .wk-thumb {
      width: min(100%, 420px);
      aspect-ratio: 3 / 2;
    }
  }
  
  /* ============================================================
     12) BACKGROUND AURORA ANIMATION
     ============================================================ */
  
  .work-bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
  
    background:
      radial-gradient(800px 600px at 20% 30%,
        color-mix(in oklab, var(--brand) 35%, transparent),
        transparent 70%
      ),
      radial-gradient(900px 700px at 80% 75%,
        color-mix(in oklab, var(--brand-2) 35%, transparent),
        transparent 70%
      ),
      radial-gradient(700px 500px at 50% 90%,
        color-mix(in oklab, var(--accent) 35%, transparent),
        transparent 75%
      );
  
    animation: auroraFloat 18s ease-in-out infinite alternate;
    filter: blur(65px) saturate(1.25);
  }
  
  @keyframes auroraFloat {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-4%, -2%, 0) scale(1.05); }
    100% { transform: translate3d(3%, 4%, 0) scale(1.08); }
  }
  
  /* ============================================================
     13) SEVI GLOBAL — NÃO MEXE NO LAYOUT DA PÁGINA
     ============================================================ */
  
  .sevi-global {
    max-width: calc(100vw - 1rem) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    transform-box: border-box !important;
  }
  
  /* Mobile Landscape: só encosta o SEVI no canto, sem afetar hero/cards */
  @media (max-width: 900px) and (orientation: landscape) {
    .sevi-global {
      right: 6px !important;
      bottom: 6px !important;
      transform: scale(0.75) !important;
      max-width: calc(100vw - 0.5rem) !important;
    }
  }
  
  /* ============================================================
     14) MOBILE LANDSCAPE FIX — iPhone/Android deitados (WORK ONLY)
     ============================================================ */
  
  @media (orientation: landscape) and (max-height: 500px) {
  
    /* Container da página WORK apenas */
    body.work .wk-container,
    body.work .ds-container {
      padding-inline: .8rem !important;
      max-width: 100% !important;
      width: 100% !important;
      overflow-x: hidden !important;
    }
  
    /* HERO da página WORK (coluna única, centralizado) */
    body.work .work-hero-grid {
      grid-template-columns: 1fr !important;
      gap: 1.4rem !important;
      text-align: center !important;
    }
  
    body.work .work-hero-text {
      max-width: 90% !important;
      margin-inline: auto !important;
    }
  
    body.work .work-hero-visual {
      justify-content: center !important;
      display: flex !important;
    }
  
    body.work .work-hero-mockup {
      max-width: 75% !important;
      height: auto !important;
    }
  
    /* GRID dos cards */
    body.work .wk-grid-2,
    body.work .wk-grid-1 {
      grid-template-columns: 1fr !important;
      gap: 1.2rem !important;
    }
  
    body.work .wk-card--wide {
      width: 100% !important;
      max-width: 1280px !important;
      margin-inline: auto !important;
      grid-template-columns: 1fr !important;
      gap: 1.4rem !important;
    }
  
    body.work .wk-card--wide .wk-thumb {
      margin-inline: auto !important;
      display: block !important;
      max-width: 450px !important;
    }
  
    body.work {
      overflow-x: hidden !important;
    }
  }
  
  /* ============================================================
     15) RESTORE + EQUALIZE — small cards layout (desktop)
     ============================================================ */
  
  /* Desktop/tablet — cards menores com layout horizontal e mesma altura */
  @media (min-width: 641px) {
    body.work .wk-grid-2 .wk-card:not(.wk-card--wide) {
      display: grid !important;
      grid-template-columns: 180px 1fr !important;
      align-items: stretch !important;
      gap: 1.5rem !important;
      height: 100% !important;
    }
  
    body.work .wk-grid-2 .wk-card:not(.wk-card--wide) .wk-thumb {
      max-width: 100% !important;
      width: 100% !important;
      margin: 0 !important;
      object-fit: contain;
      justify-self: center;
    }
  
    /* Faz os inner-card ocuparem a mesma altura e empurra o botão pro fim */
    body.work .wk-grid-2 .wk-card:not(.wk-card--wide) .wk-inner-card {
      height: 100% !important;
      display: flex !important;
      flex-direction: column !important;
      justify-content: space-between !important;
    }
  }
  
  /* ============================================================
   FINAL FIX — scroll dos cards + alturas iguais (WORK ONLY)
   ============================================================ */

/* 1) Nunca deixar a section dos cards gerar scroll lateral */
body.work,
body.work .wk-section,
body.work .wk-container {
  overflow-x: hidden !important;
}

/* 2) Desktop/tablet: grid dos cards pequenos com alturas iguais */
/* ============================================================
   FIX — Equalize small card heights (desktop only)
   ============================================================ */
   @media (min-width: 768px) {
    .wk-grid-2 .wk-card:not(.wk-card--wide) {
      height: 100% !important;
      display: grid !important;
      grid-template-columns: 180px 1fr !important;
      align-items: stretch !important;
    }
  
    .wk-grid-2 .wk-card:not(.wk-card--wide) .wk-inner-card {
      height: 100% !important;
      display: flex !important;
      flex-direction: column !important;
      justify-content: space-between !important;
    }
  }
  

/* ============================================================
   FIX FINAL — SEM SCROLL NOS CARDS PEQUENOS (ABSOLUTO)
   ============================================================ */

   body.work .wk-grid-2 {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  
  body.work .wk-grid-2 .wk-card:not(.wk-card--wide) {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  body.work .wk-grid-2 .wk-card:not(.wk-card--wide) .wk-thumb,
  body.work .wk-grid-2 .wk-card:not(.wk-card--wide) img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    overflow: hidden !important;
  }
  
  body.work .wk-grid-2 .wk-card:not(.wk-card--wide) .wk-inner-card {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  
  body.work .wk-grid-2 .wk-card .wk-btn {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Mobile: mantém vertical (já controlado pelo @media max-width: 640px) */
  
  @media (orientation: landscape) and (max-height: 500px) {
    .wk-card--wide {
      grid-template-columns: 1fr !important;
      max-width: 100% !important;
      padding-inline: 0.8rem !important;
    }
  
    .wk-card--wide .wk-thumb {
      margin-inline: auto !important;
      max-width: 420px !important;
    }
  }

  /* ============================================================
   RESTORE — WIDE CARD ORIGINAL (Home + Work)
   ============================================================ */

.wk-card--wide {
  display: grid !important;
  /* grid-template-columns: 1fr 1fr !important; */
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  border-radius: 20px;
  background: var(--surface-1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
  overflow: hidden;
}

.wk-card--wide .wk-thumb {
  width: 100% !important;
  height: auto !important;
  object-fit: contain;
  border-radius: 16px;
}

@media (max-width: 900px) {
  .wk-card--wide {
    grid-template-columns: 1fr !important;
    padding: 1.6rem;
  }

  .wk-card--wide .wk-thumb {
    margin-bottom: 1rem;
  }
}
