/* ================= RESET ================= */
*{margin:0;padding:0;box-sizing:border-box}
html,body{height:100%}
html{scroll-behavior:smooth}

/* ================= CORE ================= */
body{
  background:#02030a;
  color:#e5e7eb;
  font-family:system-ui,-apple-system,Segoe UI,Roboto;
  overflow-x:hidden;
  font-size:1.05em;
  -webkit-tap-highlight-color:transparent;
}

/* ================= BACKGROUND ================= */
#bg,#particles{position:fixed;inset:0;z-index:-6}
.energy-grid{
  position:fixed;inset:0;z-index:-5;pointer-events:none;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px);
  background-size:64px 64px;
  opacity:.35;
}
.noise{
  position:fixed;inset:0;z-index:-4;pointer-events:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}
.cursor-light{
  position:fixed;
  width:520px;height:520px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(127,92,255,.28),transparent 72%);
  pointer-events:none;
  mix-blend-mode:screen;
  z-index:-3;
  transition:transform .08s linear;
}

/* ================= HUD ================= */
#hud{
  position:fixed;top:14px;right:14px;
  display:flex;gap:8px;z-index:6;font-size:.7rem;
}
.hud-item{
  padding:8px 14px;border-radius:999px;
  background:rgba(0,0,0,.65);
  border:1px solid rgba(255,255,255,.18);
  backdrop-filter:blur(8px);
}
.hud-item.ok{color:#9aff9a}

#boot{
  position:fixed;
  inset:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#000;
}

#boot.hidden{
  opacity:0;
  pointer-events:none;
  transition:opacity 1.2s ease;
}

.boot-core{text-align:center}

.boot-logo{
  font-size:2.6rem;
  letter-spacing:.35em;
  margin-top:12px;
}

.boot-status{
  margin-top:12px;
  font-size:.9rem;
  opacity:.85;
}

.boot-bar{
  margin:14px auto 0;
  width:320px;
  height:10px;
  background:#111;
  border-radius:8px;
  overflow:hidden;
}

.boot-bar span{
  display:block;
  height:100%;
  width:0;
  background:linear-gradient(90deg,#ffd86b,#2fffff);
}

/* ================= HERO ================= */
.hero{
  min-height:100vh;display:flex;align-items:center;justify-content:center;
  text-align:center;position:relative;
}
.hero::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(circle at top,rgba(127,92,255,.18),transparent 65%);
}
.hero-inner{max-width:960px;padding:36px}
.hero-logo{
  width:clamp(280px,55vw,420px);
  margin-bottom:18px;
  filter:drop-shadow(0 0 60px rgba(127,92,255,.45));
}
h1{font-size:clamp(3.3rem,7.5vw,5.1rem);line-height:1.05}
[data-glow]{text-shadow:0 0 24px rgba(127,92,255,.6),0 0 60px rgba(127,92,255,.35)}
.tagline{margin:6px 0 18px;font-size:1.32rem;color:#9ca3af}
.hero-explain{margin-top:12px;font-size:1.12rem;line-height:1.75}
.hero-actions{margin:26px 0 8px;display:flex;gap:22px;justify-content:center;flex-wrap:wrap}
.disclaimer{margin-top:10px;font-size:.85rem;opacity:.7}

/* ================= BUTTONS ================= */
.btn{
  padding:18px 44px;border-radius:999px;
  font-size:1.05rem;border:none;cursor:pointer;
  transition:box-shadow .3s ease,filter .3s ease;
}
.btn.primary{
  background:linear-gradient(90deg,#ffd86b,#2fffff);
  color:#000;
  box-shadow:0 0 60px rgba(255,216,107,.6);
}
.btn.ghost{
  background:none;border:1px solid rgba(255,255,255,.25);
  color:#e5e7eb;
}

/* ================= PANELS ================= */
.panel{padding:110px 20px;text-align:center}
.panel.dark{background:#0b0d18}
.panel h2{font-size:2.6rem;margin-bottom:26px}
.panel p,.panel li{
  max-width:880px;margin:16px auto;
  font-size:1.12rem;line-height:1.8;
}
.panel img{
  display:block;margin:56px auto;
  max-width:820px;width:100%;
}

/* ================= GRID / CARDS ================= */
.grid{
  display:grid;gap:36px;margin-top:64px;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
}
.card{
  background:linear-gradient(145deg,#12142a,#07080f);
  border-radius:26px;padding:44px;
  box-shadow:0 0 70px rgba(127,92,255,.3);
}

/* ================= FOOTER ================= */
footer{padding:64px;text-align:center;font-size:.95rem;opacity:.8}

/* ================= MODAL ================= */
#accessModal{
  position:fixed;inset:0;z-index:50;
  display:none;align-items:center;justify-content:center;
  background:rgba(0,0,0,.8);
}
#accessModal.active{display:flex}
.modal-card{
  width:92%;max-width:440px;padding:42px;
  background:linear-gradient(145deg,#12142a,#07080f);
  border-radius:26px;text-align:center;
  box-shadow:0 0 140px rgba(127,92,255,.55);
}

/* ================= MOBILE ================= */
@media (max-width:768px){
  .cursor-light{display:none}
  .hero-inner{padding:28px}
  .btn{width:100%;max-width:340px}
  .panel{padding:70px 18px}
  #hud{left:50%;right:auto;transform:translateX(-50%);bottom:14px;top:auto}
}

/* ================= CARD EFFECTS RESTORE ================= */
.card,
.card.glow-card{
  transition:transform .6s cubic-bezier(.2,.8,.2,1), box-shadow .6s ease;
  will-change: transform;
}
.card:hover,
.card.glow-card:hover{
  transform: translateY(-14px);
  box-shadow:0 0 120px rgba(127,92,255,.55), inset 0 0 24px rgba(255,255,255,.08);
}

/* ========================================================= */
/* ========== TABLESYNC BRAND FORMATTING =================== */
/* ========================================================= */

.terminal{
  max-width:1100px;
  margin:32px auto;
  padding:22px 26px;
  background:radial-gradient(circle at top left,#0a0c18,#05060d);
  border-radius:18px;
  box-shadow:0 0 60px rgba(127,92,255,.25), inset 0 0 18px rgba(255,255,255,.05);
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:.9rem;
  color:#9aff9a;
  overflow-x:auto;
  text-align:left;
}
.terminal pre{margin:0;white-space:pre}
.terminal code{color:#9aff9a}

.callout{
  max-width:1100px;
  margin:34px auto;
  padding:26px 30px;
  border-radius:20px;
  background:linear-gradient(145deg,#12142a,#07080f);
  box-shadow:0 0 80px rgba(127,92,255,.35), inset 0 0 22px rgba(255,255,255,.06);
  text-align:left;
}
.callout strong{
  display:block;
  margin-bottom:10px;
  letter-spacing:.08em;
  font-size:.75rem;
  color:#2fffff;
}
.callout p{margin:0;line-height:1.7}

.lines{
  max-width:1100px !important;
  text-align:left !important;
  padding-left:18px;
  border-left:2px solid rgba(127,92,255,.35);
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:.95rem;
  opacity:.95;
}

/* ========================================================= */
/* ========== REQUEST ACCESS FORM — PREMIUM INPUTS ========= */
/* ========================================================= */

.modal-card form label{
  font-size:.75rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#9ca3af;
}

.modal-card input{
  width:100%;
  margin-top:8px;
  padding:16px 18px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(circle at top left,#0f1224,#07080f);
  color:#e5e7eb;
  font-size:1rem;
  outline:none;
  transition:
    border-color .25s ease,
    box-shadow .25s ease,
    transform .2s ease;
  box-shadow:
    inset 0 0 18px rgba(255,255,255,.04),
    0 0 0 rgba(127,92,255,0);
}

.modal-card input::placeholder{
  color:#6b7280;
}

/* Focus = alive */
.modal-card input:focus{
  border-color:#2fffff;
  box-shadow:
    0 0 0 2px rgba(47,255,255,.25),
    0 0 40px rgba(127,92,255,.35),
    inset 0 0 22px rgba(255,255,255,.06);
  transform:translateY(-1px);
}

/* Submit button spacing fix */
.modal-card .btn{
  margin-top:10px;
}

/* ========================================================= */
/* ========== TERMINAL & CARD WRAP FIX ===================== */
/* ========================================================= */

/* Terminal: prevent early line breaks */
.terminal{
  box-sizing:border-box;
}

.terminal pre,
.terminal code{
  width:100%;
  box-sizing:border-box;
  white-space:pre-wrap;      /* allows wrapping */
  word-break:break-word;     /* no half-width overflow */
}

/* Card text: ensure full usable width */
.card,
.card.glow-card{
  box-sizing:border-box;
}

.card p,
.card h3{
  width:100%;
  max-width:100%;
}

/* Remove any accidental right padding illusion */
.card > *{
  box-sizing:border-box;
}


/* ========================================================= */
/* ========== TABLESYNC WIDE-READ FIX ====================== */
/* ========================================================= */

/* Make deep-dive content read wide, not boxed */
#tablesync-deep-dive{
  text-align: left;
}

/* Let paragraphs and terminals breathe horizontally */
#tablesync-deep-dive p,
#tablesync-deep-dive .terminal,
#tablesync-deep-dive .callout,
#tablesync-deep-dive .lines{
  max-width: 1240px;          /* wider than before */
  width: calc(100% - 48px);  /* fill container safely */
  margin-left: auto;
  margin-right: auto;
}

/* Ensure text actually uses the full width */
#tablesync-deep-dive p,
#tablesync-deep-dive .callout p{
  text-align: left;
}

/* Terminal blocks: no phantom right gap */
#tablesync-deep-dive .terminal pre,
#tablesync-deep-dive .terminal code{
  width: 100%;
  max-width: 100%;
}

/* Lines blocks: align like documentation */
#tablesync-deep-dive .lines{
  padding-left: 20px;
  border-left: 2px solid rgba(127,92,255,.4);
}

/* Mobile: slightly tighter, still clean */
@media (max-width:768px){
  #tablesync-deep-dive p,
  #tablesync-deep-dive .terminal,
  #tablesync-deep-dive .callout,
  #tablesync-deep-dive .lines{
    width: calc(100% - 32px);
    max-width: 100%;
  }
}

/* ========================================================= */
/* ========== RESTORE TITLE AUTHORITY (SAFE FIX) =========== */
/* ========================================================= */

/* Center section titles only */
#tablesync-deep-dive h2,
#tablesync-deep-dive h3{
  text-align: center;
}

/* Keep body content wide + readable */
#tablesync-deep-dive p,
#tablesync-deep-dive .terminal,
#tablesync-deep-dive .callout,
#tablesync-deep-dive .lines{
  text-align: left;
}

/* Visual balance: give titles breathing room */
#tablesync-deep-dive h2{
  margin-bottom: 42px;
}

#tablesync-deep-dive h3{
  margin-top: 64px;
  margin-bottom: 20px;
}

/* ========================================================= */
/* ========== ACCESS MODAL — FINAL STYLING ================= */
/* ========================================================= */

.modal-card h2{
  margin-bottom:8px;
}

.modal-intro{
  font-size:.85rem;
  opacity:.8;
  margin-bottom:22px;
  line-height:1.5;
}

/* FORM STRUCTURE */
.modal-card form{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.modal-card label{
  font-size:.75rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#9ca3af;
  text-align:left;
}

/* INPUTS */
.modal-card input{
  width:100%;
  margin-top:8px;
  padding:16px 18px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background:radial-gradient(circle at top left,#0f1224,#07080f);
  color:#e5e7eb;
  font-size:1rem;
  outline:none;
  box-sizing:border-box;
  transition:
    border-color .25s ease,
    box-shadow .25s ease,
    transform .2s ease;
  box-shadow:
    inset 0 0 18px rgba(255,255,255,.04);
}

.modal-card input::placeholder{
  color:#6b7280;
}

/* FOCUS STATE */
.modal-card input:focus{
  border-color:#2fffff;
  box-shadow:
    0 0 0 2px rgba(47,255,255,.25),
    0 0 40px rgba(127,92,255,.35),
    inset 0 0 22px rgba(255,255,255,.06);
  transform:translateY(-1px);
}

/* STATUS TEXT */
.form-status{
  min-height:20px;
  font-size:.82rem;
  opacity:.9;
}
.form-status.ok{color:#9aff9a}
.form-status.err{color:#ff8a8a}

/* CLOSE BUTTON */
.modal-close{
  margin-top:22px;
  background:none;
  border:none;
  color:#9ca3af;
  cursor:pointer;
  min-height:44px;
}

/* ================= CODE BLOCK: CENTER BLOCK, LEFT TEXT ================= */

/* Center the terminal block within cards */
.card .terminal{
  margin-left: auto;
  margin-right: auto;
  text-align: left;          /* block text alignment baseline */
}

/* Ensure code text stays left-aligned */
.terminal pre,
.terminal code{
  text-align: left;
}

/* ================= BOOT SEQUENCE — MOBILE FIX ================= */

@media (max-width: 768px){

  #boot{
    padding: 24px;
  }

  .boot-core{
    transform: none;
    max-width: 100%;
  }

  .boot-logo-graphic{
    width: 180px;
    max-width: 70vw;
    height: auto;
  }

  .boot-logo{
    font-size: 1.4rem;
    letter-spacing: 0.25em;
  }

  .boot-status{
    font-size: 0.85rem;
  }

  .boot-bar{
    width: 220px;
    height: 8px;
  }
}
