/* ================================================================
   tablet.css
   Layered on top of home.css for the 760–1200px viewport range.
   home.css already drops a bunch of things at 1040px; this file
   tightens spacing, scales display type, and fixes a handful of
   desktop-only grids so the layout feels designed for tablet rather
   than just "stacked desktop".
   ================================================================ */

/* ---------------- Tablet landscape + small desktop (1024–1200) ---- */
@media (max-width: 1200px) {
  .wrap { padding-left: 32px; padding-right: 32px; }
  .hero-head { font-size: clamp(54px, 7vw, 88px); }
  .section { padding: 88px 0; }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- Tablet portrait (760–1040) ---------------------- */
@media (max-width: 1040px) and (min-width: 760px) {
  /* Global rhythm */
  .wrap { padding-left: 28px; padding-right: 28px; max-width: 960px; }
  .section { padding: 72px 0; }

  /* Nav: keep links visible on tablet (home.css hides them at 1040) */
  .nav-links { display: flex !important; gap: 18px; }
  .nav-links a { font-size: 12px; }

  /* Hero — two-column still works on tablet portrait */
  .hero { padding: 40px 0 72px; }
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr !important;
    gap: 36px !important;
    align-items: center;
  }
  .hero-head { font-size: clamp(44px, 6.6vw, 68px); line-height: 0.98; }
  .hero-sub { font-size: 15px; max-width: 46ch; }
  .hero-cta { flex-wrap: wrap; gap: 12px; }

  /* Stats — 4-up still works on tablet */
  .stats { grid-template-columns: repeat(4, 1fr) !important; }
  .stat:nth-child(2n) { border-right: 1px solid var(--line-1); }
  .stat:last-child { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 0 !important; }
  .stat .val { font-size: clamp(36px, 5vw, 56px); }

  /* Press ticker — tablet tune: slightly narrower gap + mid-speed. */
  .press .logos-track { gap: 40px; animation-duration: 26s; }
  .press .logos-track span { font-size: clamp(24px, 4vw, 36px); }

  /* Testimonials — 2x2 */
  .tests { grid-template-columns: repeat(2, 1fr) !important; gap: 18px; }
  .test { padding: 22px; }
  .test .quote { font-size: 15px; }

  /* Key features — 3 pillars become 1 column of tall cards,
     but keep image + body side-by-side for a richer tablet look. */
  .keyf { grid-template-columns: 1fr !important; gap: 20px; }
  .keyf-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    overflow: hidden;
  }
  .keyf-card .visual { aspect-ratio: auto; min-height: 340px; }
  .keyf-card .body { padding: 28px 28px; }

  /* Visual Studio shell — stack left/right panes under canvas */
  .vto-shell { grid-template-columns: 1fr !important; }
  .vto-left, .vto-right { border: 0; border-top: 1px solid var(--line-2); }
  .vto-canvas { min-height: 420px; }

  /* Workflow callouts */
  .workflow-callouts { grid-template-columns: repeat(3, 1fr) !important; gap: 20px; }

  /* Pricing: 2x2 on tablet */
  .pricing-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Tech pack, output strip, compare — single column reads better */
  .techpack-grid { grid-template-columns: 1fr !important; }
  .comp-table { font-size: 13px; }

  /* Footer — 2 columns */
  .footer-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 28px; }

  /* Mosaic: constrain height so hero doesn't balloon */
  .mosaic { max-height: 520px; }
  .mosaic-viewport { height: 520px; }
}

/* ---------------- Nav pill compaction (narrow viewports) ---------
   The pill nav uses auto/1fr/auto columns and can blow up when
   "OPUS DESIGNR" can't stay on one line and the Try-It button
   occupies half the bar. Compact below 960px, even tighter below
   640px.
   ---------------------------------------------------------------- */
@media (max-width: 960px) {
  .nav-wrap { padding: 0 14px; top: 12px; }
  .nav {
    padding: 8px 8px 8px 16px;
    gap: 10px;
    grid-template-columns: auto auto;
    justify-content: space-between;
  }
  .nav-brand {
    font-size: 14px;
    white-space: nowrap;
    letter-spacing: 0.02em;
  }
  .nav-links { display: none !important; }
  .nav-cta { gap: 8px; }
  .nav-cta .btn { padding: 9px 14px; font-size: 10.5px; letter-spacing: 0.14em; }
  .nav-cta .btn .arrow { margin-left: 2px; }
  /* Drop the secondary Login button when space is tight — it lives
     in the drawer instead. */
  .nav-cta .btn--ghost { display: none; }
}

/* ---------------- Hamburger + Drawer (narrow viewports only) ------
   index.html uses a desktop pill nav at ≥960px. Below that we need
   a mobile-style drawer and a hamburger toggle to open it. Styles
   mirror home-mobile.css so the drawer feels consistent between
   index.html and mobile.html.
   ---------------------------------------------------------------- */
.burger { display: none; }
.drawer { display: none; }
@media (max-width: 960px) {
  .burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(34px, 9vw, 42px);
    height: clamp(34px, 9vw, 42px);
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    color: var(--ink-1);
    border-radius: var(--r-sm, 6px);
    cursor: pointer;
    position: relative;
    padding: 0;
  }
  .burger i {
    display: block;
    width: 45%;
    height: 1.5px;
    background: var(--ink-1);
    position: absolute;
    left: 27.5%;
    transition: transform 240ms var(--ease), opacity 180ms var(--ease), top 240ms var(--ease);
  }
  .burger i:nth-child(1) { top: 32%; }
  .burger i:nth-child(2) { top: 50%; }
  .burger i:nth-child(3) { top: 68%; }
  .burger.open i:nth-child(1) { top: 50%; transform: rotate(45deg); }
  .burger.open i:nth-child(2) { opacity: 0; }
  .burger.open i:nth-child(3) { top: 50%; transform: rotate(-45deg); }

  .drawer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.98);
    z-index: 85;
    transform: translateY(-100%);
    transition: transform 320ms var(--ease);
    display: flex;
    flex-direction: column;
    padding: clamp(68px, 12vh, 96px) clamp(20px, 6vw, 36px) clamp(20px, 4vh, 32px);
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
  }
  .drawer.open {
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
  }

  /* Close (X) button in the drawer — always reachable, top-right. */
  .drawer-close {
    position: absolute;
    top: clamp(16px, 3vh, 24px);
    right: clamp(16px, 4vw, 28px);
    width: clamp(40px, 10vw, 52px);
    height: clamp(40px, 10vw, 52px);
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    color: var(--ink-1);
    font-family: var(--ff-display);
    font-size: clamp(22px, 5vw, 28px);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
  }
  .drawer-close span { display: block; margin-top: -2px; }
  .drawer-close:hover,
  .drawer-close:focus-visible {
    background: var(--acid);
    color: var(--on-acid-1, #0a0a0a);
    border-color: var(--acid);
    outline: none;
  }

  .drawer-links {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line-1);
  }
  .drawer-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(14px, 2.4vh, 22px) 0;
    font-family: var(--ff-display);
    font-size: clamp(20px, 6vw, 32px);
    letter-spacing: 0.02em;
    color: var(--ink-1);
    text-decoration: none;
    border-bottom: 1px solid var(--line-1);
    text-transform: uppercase;
    font-weight: 800;
  }
  .drawer-links a .num {
    font-family: var(--ff-mono);
    font-size: clamp(9px, 2.2vw, 12px);
    color: var(--ink-4);
    letter-spacing: 0.18em;
    font-weight: 400;
  }
  .drawer-links a:active,
  .drawer-links a.active { color: var(--acid); }
  .drawer-cta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.4vh, 14px);
  }
  .drawer-cta .btn {
    width: 100%;
    justify-content: center;
    padding: clamp(12px, 2vh, 18px) 20px;
    font-size: clamp(11px, 2.6vw, 13px);
    letter-spacing: 0.18em;
  }
  .drawer-meta {
    font-family: var(--ff-mono);
    font-size: clamp(9px, 2vw, 11px);
    letter-spacing: 0.18em;
    color: var(--ink-4);
    margin-top: clamp(16px, 3vh, 28px);
    padding-top: clamp(14px, 2.4vh, 22px);
    border-top: 1px solid var(--line-1);
    display: flex;
    justify-content: space-between;
  }
  .drawer-meta .dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--acid);
    margin-right: 6px;
    vertical-align: 1px;
    box-shadow: 0 0 6px rgba(200, 252, 11, 0.6);
  }

  /* Lock page scroll while drawer is open */
  body.drawer-open { overflow: hidden; }
}

/* Hide the close button outside the narrow-viewport drawer. */
.drawer-close { display: none; }
@media (max-width: 960px) {
  .drawer-close { display: flex; }
}

/* ================================================================
   TESTIMONIALS — header + card polish (all viewports)
   Runs outside media queries so it applies on index.html and
   mobile.html equally.
   ================================================================ */
.tests-head {
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  row-gap: 10px;
  margin-bottom: 28px;
}
.tests-head .eyebrow--bracket {
  grid-column: 1 / -1;
  display: inline-block;
  color: var(--acid);
  font-family: var(--ff-mono);
  font-size: clamp(10px, 2.2vw, 12px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin: 0;
}
.tests-head .tests-title {
  grid-column: 1 / 2;
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink-1);
  text-transform: uppercase;
  margin: 0;
}
.tests-head .tests-title .dot { color: var(--acid); }
.tests-head .tests-hint {
  grid-column: 2 / 3;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0;
  align-self: end;
}

/* Cards — compact, content-sized, no dead vertical space.
   Previous version stretched all cards to the tallest and pushed
   attribution to the bottom with margin-top:auto, producing an
   ugly 50% empty band in the middle of shorter quotes. Now each
   card sizes to its natural content; the row aligns to the top of
   the scroller, so shorter cards end earlier (that reads fine for
   a snap scroller and eliminates the gap). */
.tests {
  align-items: flex-start !important;
}
.tests-section .test,
section[data-screen-label="04 Testimonials"] .test {
  align-self: flex-start !important;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-md, 10px);
  padding: 18px 18px 16px !important;
  display: flex !important;
  flex-direction: column;
  gap: 14px;
  min-height: 0 !important;
  height: auto !important;
}

/* Top row: stars + index, tight. */
.tests-section .test-top,
section[data-screen-label="04 Testimonials"] .test-top {
  margin: 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.tests-section .test .stars,
section[data-screen-label="04 Testimonials"] .test .stars {
  font-size: clamp(10px, 2.4vw, 12px) !important;
  letter-spacing: 0.24em !important;
  line-height: 1 !important;
}
.tests-section .test .idx,
section[data-screen-label="04 Testimonials"] .test .idx {
  font-size: 10px !important;
  letter-spacing: 0.22em !important;
}

/* Quote: natural flow, compact line-height, mid-weight. */
.tests-section .test .quote,
section[data-screen-label="04 Testimonials"] .test .quote {
  flex: 0 1 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: clamp(13.5px, 2.8vw, 15.5px) !important;
  line-height: 1.45 !important;
  color: var(--ink-1) !important;
  font-weight: 450;
  letter-spacing: 0 !important;
}

/* Attribution: no auto-margin push. Sits right below quote with a
   thin divider. Name + role read as a typographic pair. */
.tests-section .test .attrib,
section[data-screen-label="04 Testimonials"] .test .attrib {
  margin: 0 !important;
  padding: 12px 0 0 !important;
  border-top: 1px solid var(--line-1) !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tests-section .test .attrib .name,
section[data-screen-label="04 Testimonials"] .test .attrib .name {
  font-size: 12.5px !important;
  font-weight: 700;
  color: var(--ink-1) !important;
  letter-spacing: 0 !important;
  margin: 0 !important;
}
.tests-section .test .attrib .role,
section[data-screen-label="04 Testimonials"] .test .attrib .role {
  font-family: var(--ff-mono) !important;
  font-size: 9.5px !important;
  letter-spacing: 0.14em !important;
  color: var(--ink-3) !important;
  text-transform: uppercase;
  margin: 0 !important;
}

/* Narrower-viewport snap scroll: slightly wider cards + gutter
   so the peek looks intentional instead of clipped text. */
@media (max-width: 960px) {
  .tests {
    scroll-padding-inline: 20px;
    padding: 4px 20px 24px !important;
    gap: 12px !important;
  }
  .tests-section .test,
  section[data-screen-label="04 Testimonials"] .test {
    flex: 0 0 84% !important;
    max-width: 340px;
    scroll-snap-align: start;
  }
  .tests-head { padding: 0 4px; }
}
@media (min-width: 961px) {
  /* On index.html wide views the tests are already a 4-col grid via
     home.css — just align the new header to the left consistently. */
  .tests-head { margin-bottom: 36px; }
}

/* ---------------- Sticky conversion bar (narrow viewports) -------
   Below 960px the floating pill becomes a full-width edge-to-edge
   bar pinned to the bottom of the viewport. Copy stays on a single
   line and font-size scales fluidly with the viewport so nothing
   ever wraps or clips.
   ---------------------------------------------------------------- */
@media (max-width: 960px) {
  .conv-bar {
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(110%);
    max-width: none;
    width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap !important; /* home.css sets wrap at 1040px */
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .conv-bar.show { transform: translateY(0); }

  .conv-bar .copy {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(10.5px, 2.4vw, 13px);
    letter-spacing: 0.02em;
    line-height: 1.2;
  }
  .conv-bar .btn {
    flex: 0 0 auto;
    padding: 9px clamp(12px, 2.6vw, 18px);
    font-size: clamp(10px, 2.2vw, 11.5px);
    letter-spacing: 0.18em;
  }
  .conv-bar .close {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
}
@media (max-width: 420px) {
  /* Very narrow: trim the sentence to what fits on one line. */
  .conv-bar .copy { font-size: 11px; }
  .conv-bar .btn { padding: 8px 12px; font-size: 10px; letter-spacing: 0.14em; }
}

/* ---------------- Mobile safety net (< 760) ----------------------
   Users on this page below 760px have JS disabled or blocked the
   redirect. Keep the desktop layout usable rather than broken.
   ---------------------------------------------------------------- */
@media (max-width: 760px) {
  .wrap { padding-left: 18px; padding-right: 18px; }
  .hero-head { font-size: clamp(36px, 11vw, 56px); }
  .hero-grid { grid-template-columns: 1fr !important; }
  .stats { grid-template-columns: repeat(2, 1fr) !important; }
  .tests { grid-template-columns: 1fr !important; }
  .keyf { grid-template-columns: 1fr !important; }
  .pricing-grid { grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr !important; }
  .section { padding: 56px 0; }
}
