/* =========================================================
   MINTAREX API • FUTURISTIC REDESIGN (FINAL RESTORED BRAND)
   ========================================================= */

/* === Bento Grid === */
.api-bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: clamp(160px, 22vw, 220px);
  gap: clamp(14px, 2vw, 24px);
  margin: clamp(40px, 8vh, 80px) auto;
  max-width: 1200px;
  padding-inline: var(--pad-x);
}
.bento-tile {
  background: var(--glass-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(18px, 3vw, 32px);
  position: relative;
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease;
}
.bento-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -15px rgba(32,141,122,.25);
  border-color: rgba(162,235,204,.5);
}
.bento-tile.large-tile { grid-column: span 2; }
.tile-content h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: clamp(1.1rem, 1.4vw, 1.6rem);
}
.tile-content p {
  color: var(--muted);
  line-height: 1.6;
  font-size: clamp(.85rem, 1vw, 1rem);
  max-width: 36ch;
}
.tile-icon {
  position: absolute;
  bottom: clamp(12px, 2vw, 24px);
  right: clamp(12px, 2vw, 24px);
  width: clamp(32px, 4vw, 56px);
  height: clamp(32px, 4vw, 56px);
  color: var(--accent-base);
  opacity: .3;
  transition: opacity .3s;
}
.bento-tile:hover .tile-icon { opacity: .75; }
#tile-data .live-data-value {
  font-family: 'Space Mono', monospace;
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  color: var(--accent-base);
  margin-top: 10px;
  letter-spacing: -0.03em;
}
#tile-data .tile-bg-viz {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 100%, rgba(162,235,204,.15), transparent 40%);
  animation: pulse-bg 5s ease-in-out infinite;
}
@keyframes pulse-bg { 50% { opacity: .5; transform: scale(1.2); } }

/* === Scroll Journey === */
#api-core-journey {
  min-height: 250vh;
  position: relative;
  margin: clamp(80px, 15vh, 200px) 0;
  padding-inline: var(--pad-x);
}
.core-sticky-container {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
#api-core-visual {
  width: clamp(160px, 25vw, 260px);
  height: clamp(160px, 25vw, 260px);
  position: relative;
  display: grid;
  place-items: center;
  transform: scale(.8);
  transition: transform .5s ease;
}
.core-center {
  width: clamp(30px, 6vw, 50px);
  height: clamp(30px, 6vw, 50px);
  border-radius: 50%;
  background: var(--accent-base);
  box-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow) inset;
  animation: core-pulse 2s infinite;
}
.core-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(162,235,204,.3);
  border-radius: 50%;
  animation: core-spin 10s linear infinite;
}
#ring2 { animation-duration: 15s; animation-direction: reverse; }
#ring3 { animation-duration: 20s; }
#api-core-visual.is-viewing { transform: scale(1); }
#api-core-visual.is-viewing[data-active-step="websocket"] .core-center { background: #81e6d9; }
#api-core-visual.is-viewing[data-active-step="fix"] .core-center { background: #faf089; }
@keyframes core-pulse { 50% { transform: scale(1.1); } }
@keyframes core-spin { to { transform: rotate(360deg); } }

.core-scroll-content {
  position: relative;
  z-index: 10;
  max-width: min(92%, 800px);
  margin-inline: auto;
}
.core-step {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: .25;
  transition: opacity .4s;
}
.core-step.is-active { opacity: 1; }
.core-step:nth-child(even) { margin-left: auto; text-align: right; }
.core-step h2 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--ink);
  line-height: 1.25;
}
.core-step p {
  font-size: clamp(.95rem, 1.1vw, 1.2rem);
  line-height: 1.7;
  padding: clamp(14px, 2vw, 24px);
  border-radius: 12px;
}

/* === Terminal === */
.terminal-window {
  background: #0D1117;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: clamp(40px, 8vh, 80px) auto;
  max-width: min(90%, 900px);
  font-family: 'Space Mono', monospace;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  overflow: hidden;
}
.terminal-header {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  background: rgba(255,255,255,.05);
  border-bottom: 1px solid var(--line);
}
.term-dots { display: flex; gap: 8px; }
.term-dots span { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #ff5f56; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #27c93f; }
.term-title { color: var(--muted); margin: 0 auto; font-size: 13px; }
.terminal-tabs {
  display: flex;
  background: #010409;
  overflow-x: auto;
}
.term-tab {
  background: none;
  border: none;
  color: var(--muted);
  padding: 12px 18px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
  transition: color .2s ease, border-color .2s ease;
}
.term-tab.is-active { color: white; border-bottom-color: var(--accent-base); }
.terminal-body {
  padding: clamp(16px, 3vw, 32px);
  min-height: 300px;
  color: #c9d1d9;
  font-size: clamp(.85rem, 1vw, 1rem);
  line-height: 1.8;
}
.terminal-body pre { white-space: pre-wrap; }

/* === Centered Sections (API + Waitlist) === */
#interactive-terminal,
.coming-soon-section {
  text-align: center;
  padding-block: clamp(60px, 8vh, 100px);
}
#interactive-terminal .section-title,
.coming-soon-section .section-title {
  margin-bottom: 0.5rem;
  color: var(--ink);
}
#interactive-terminal .section-subtitle,
.coming-soon-section .form-hint {
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: clamp(.9rem, 1vw, 1.05rem);
}

/* === API Waitlist Form — desktop + mobile perfect centering === */
.notify-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto; /* input | button */
  column-gap:12px;
  row-gap:0;
  width:100%;
  max-width:480px;
  margin:0 auto;            /* <— center the whole block in the section */
  align-items:start;         /* keep button pinned to top of input */
  justify-items:stretch;     /* input fills its column */
}

/* stack input + below-field message */
.notify-form .input-wrap{
  grid-column:1;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.notify-form input{
  width:100%;
  height:48px;               /* <— match the button’s height exactly */
  padding:0 20px;            /* keep pill look while fixing total height */
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--glass-bg);
  font-family:'Inter',sans-serif;
  font-size:1rem;
  transition:border-color .2s, box-shadow .2s;
  box-sizing:border-box;
}

.notify-form input:focus{
  outline:none;
  border-color:var(--accent-base);
  box-shadow:0 0 0 3px var(--accent-glow);
}

/* button column */
.notify-form .btn{
  grid-column:2;
  align-self:start;          /* stay aligned with the top of the input */
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  height:48px;               /* matches input height */
  padding:0 18px;
  white-space:nowrap;
}

/* below-field status message (sits under the input) */
.mx-form .form-status{
  margin-top:.6rem;
  font-size:.95rem;
  line-height:1.3;
  min-height:1.1em;          /* reserve space so layout doesn’t jump */
  text-align:center;
}

.mx-form .form-status[data-tone="success"]{ color:#1f9d55; }
.mx-form .form-status[data-tone="error"]  { color:#c53030; }
.mx-form .form-status[data-tone="info"]   { color:#4a5568; }
.mx-form button.is-loading{ opacity:.7; pointer-events:none; }

/* Turnstile is invisible; keep it from affecting layout */
.cf-turnstile{ width:0; height:0; overflow:hidden; }

/* === Mobile (≤576px): stack and center button under field === */
@media (max-width:576px){
  .notify-form{
    grid-template-columns:1fr;
    row-gap:10px;
    justify-items:center;    /* center the children horizontally */
  }
  .notify-form .input-wrap{ width:100%; }
  .notify-form .btn{
    grid-column:1;
    justify-self:center;     /* center the button */
    align-self:start;
    width:auto;              /* intrinsic pill width */
    min-width:160px;
    padding:0 24px;
    height:48px;
  }
}

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */
@media (max-width: 960px) {
  .api-bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(160px, auto);
  }
  .bento-tile.large-tile { grid-column: span 2; }
}
@media (max-width: 600px) {
  .api-bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    padding-inline: 12px;
  }
  .bento-tile.large-tile { grid-column: span 1; }
  #api-core-journey {
    display: block;
    min-height: auto;
    text-align: center;
    padding: 80px 20px;
  }
  .core-sticky-container, .core-scroll-content { display: none; }
  #api-core-journey::before {
    content: "Mintarex API Core: REST • WebSocket • FIX";
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.5rem;
  }
  #api-core-journey::after {
    content: "Built for reliability, speed, and global access.";
    display: block;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.5;
  }
  .terminal-body { font-size: .9rem; }
  .notify-form {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
  }
  .notify-form input { width: 100%; }
}
@media (max-width: 360px) {
  .bento-tile { padding: 16px; }
  .tile-content h3 { font-size: 1rem; }
  .tile-content p { font-size: .85rem; }
  .tile-icon { width: 32px; height: 32px; }
  .live-data-value { font-size: 1.8rem; }
  .terminal-body { font-size: .8rem; }
}
@media (min-width: 1024px) {
  .api-bento-grid { gap: 2.5rem; }
  .bento-tile.large-tile { grid-column: span 2; }
}
@media (min-width: 1440px) {
  .api-bento-grid { max-width: 1400px; gap: 3rem; }
  #api-core-visual { width: 260px; height: 260px; }
}
@media (min-width: 2560px) {
  .api-bento-grid { max-width: 1800px; gap: 3.5rem; }
  #api-core-visual { width: 320px; height: 320px; }
  .terminal-window { max-width: 1100px; }
  .notify-form input, .notify-form button { font-size: 1.1rem; }
}
