/* =========================================================
   Kartrix.AI Universal Stylesheet
   - Consolidates style4.css + investors inline styles
   - Homogeneous design language across pages
   ========================================================= */

/* ============ Design Tokens ============ */
:root {
  /* Core palette */
  --bg: #0b0f16;
  --bg2: #0e1420;

  --surface: rgba(255, 255, 255, 0.025);
  --surface-2: rgba(255, 255, 255, 0.035);

  --text: #e6eaf2;
  --muted: #a8b3c7;
  --muted2: #7f8aa3;

  --line: rgba(255, 255, 255, 0.09);
  --line2: rgba(255, 255, 255, 0.14);

  /* Accent */
  --accent: #67d4ff;
  --accent-strong: rgba(103, 212, 255, 0.35);
  --accent-soft: rgba(103, 212, 255, 0.1);

  --danger: rgba(255, 120, 120, 0.28);

  /* Layout */
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1120px;

  /* Sticky nav height (used for anchor offsets) */
  --nav-h: 76px;
}

/* ============ Base Reset ============ */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: linear-gradient(
    180deg,
    var(--bg) 0%,
    #0d1320 55%,
    var(--bg) 100%
  );
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 {
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.4rem, 2.3vw, 2rem);
  line-height: 1.15;
}

h3 {
  font-size: 1.1rem;
  line-height: 1.2;
}

.container {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============ Top Navigation (shared) ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 15, 22, 0.92);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
  position: relative; /* anchors mobile dropdown */
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background-image: url("/images/logo/kartrix.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: 1px solid var(--line2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a {
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: var(--text);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Hamburger button (works with _header.html snippet) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
  margin: 5px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Mobile menu open state (works with JS in header include) */
.nav.open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav.open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
.nav.open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  user-select: none;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

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

.btn-primary:hover {
  border-color: rgba(103, 212, 255, 0.5);
}

/* Optional: Google button (used in portal work) */
.btn-google {
  background: #fff;
  color: #444;
  border: 1px solid #ddd;
  padding: 0.75rem 1rem;
  display: inline-flex;
}

/* ============ Pills / Badges ============ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 999px;
  font-size: 0.85rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(103, 212, 255, 0.26);
  background: rgba(103, 212, 255, 0.07);
  color: #c9f2ff;
  font-size: 0.78rem;
  font-weight: 650;
  margin-bottom: 0.6rem;
  width: fit-content;
}

.tag {
  background: rgba(103, 212, 255, 0.1);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(103, 212, 255, 0.22);
}

/* ============ Sections / Layout ============ */
main > section,
section {
  padding: 2.3rem 0;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-title p {
  margin: 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Investors page uses .grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem;
}

.card.flex_vertical {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card strong {
  color: var(--text);
}

.subtle {
  color: var(--muted2);
  font-size: 0.92rem;
}

.tiny {
  font-size: 0.85rem;
  color: var(--muted2);
}

/* Utilities (to replace inline styles cleanly) */
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 2rem;
}
.mt-4 {
  margin-top: 4rem;
}

.link-accent {
  color: var(--accent);
}
.list {
  margin: 0.65rem 0 0;
  padding: 0 0 0 1.1rem;
  color: var(--muted);
}
.list li {
  margin: 0.25rem 0;
}
.list-muted {
  padding-left: 1.2rem;
  color: var(--muted);
}

.stick-bottom {
  margin-top: auto;
}

/* ============ HERO (Index) ============ */
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: start;
}

.hero-title {
  margin-top: 0.85rem;
}
.hero-lead {
  margin-top: 0.95rem;
  max-width: 70ch;
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
  /* flex-wrap: wrap; */
  margin-top: 1.25rem;
}
/* Opt-in bottom anchoring */
.hero-actions.stick-bottom {
  margin-top: auto;
}
/* Shared rules for split layouts */
.hero-actions.actions-2,
.hero-actions.actions-3 {
  width: 100%;
}

.hero-actions.actions-2 .btn,
.hero-actions.actions-3 .btn {
  text-align: center;
  justify-content: center;
}

/* Two-button layout */
.hero-actions.actions-2 .btn {
  flex: 1 1 50%;
}

/* Three-button layout */
.hero-actions.actions-3 .btn {
  flex: 1 1 33.333%;
}
@media (max-width: 640px) {
  .hero-actions.actions-2,
  .hero-actions.actions-3 {
    flex-direction: column;
  }

  .hero-actions.actions-2 .btn,
  .hero-actions.actions-3 .btn {
    flex: 1 1 auto;
  }
}
.hero-meta {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.hero-note {
  margin-top: 1rem;
}

/* Diagram (Index) */
.diagram {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  padding: 1rem;
  overflow: hidden;
  position: relative;
}

.diagram-inner {
  position: relative;
  padding: 0.35rem;
}

.pipeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.2rem;
}

.stage {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
}

.stage h3 {
  font-size: 0.98rem;
  margin-bottom: 0.25rem;
}

.kvs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.kv {
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}

.arrow {
  display: flex;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.1rem;
  line-height: 1;
}

/* ============ Products Section ============ */
.product {
  background: rgba(255, 255, 255, 0.01);
}

.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.spec {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.spec .k {
  font-size: 0.78rem;
  color: var(--muted2);
  margin-bottom: 0.15rem;
}

.spec .v {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 650;
}

.cta {
  display: flex;
  justify-content: center;
}

/* ============ Traction ============ */
.logos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.6rem;
}

.logo-pill {
  border: 1px dashed rgba(255, 255, 255, 0.14);
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.015);
}

.app-note {
  margin-top: 1rem;
}

/* ============ Contact Form (Index) ============ */
.contact {
  padding-bottom: 4rem;
}

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.65rem;
}

label {
  font-size: 0.86rem;
  color: var(--muted2);
  display: block;
  margin-bottom: 0.35rem;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.7rem 0.75rem;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(103, 212, 255, 0.35);
  box-shadow: 0 0 0 4px rgba(103, 212, 255, 0.08);
}

textarea {
  min-height: 120px;
  resize: vertical;
  grid-column: 1 / -1;
}

.form-row-wide {
  grid-column: 1 / -1;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.hint {
  color: var(--muted2);
  font-size: 0.86rem;
}

.status {
  margin-top: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  display: none;
}

.status.ok {
  border-color: rgba(103, 212, 255, 0.28);
  color: #c9f2ff;
}

.status.err {
  border-color: var(--danger);
  color: #ffd0d0;
}

/* Select dropdown refinements */
select {
  padding: 12px 14px;
  border-radius: 12px;
  background-color: rgba(14, 20, 32, 0.9);
  appearance: none;
  border: 1px solid var(--line2);
}

select option {
  background-color: #0e1420;
  color: #ffffff;
}

select option:checked,
select option:hover {
  background-color: #1b2a45;
  color: #ffffff;
}

/* ============ Footer (Index + shared) ============ */
footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.25rem;
  color: var(--muted2);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============ Investors Page Specific ============ */

/* Investors hero */
.hero-investor {
  background-image: url("/images/investor04.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center top;

  min-height: clamp(420px, 62vh, 720px);
  margin: 2rem 0;
  border-radius: var(--radius);

  position: relative;
  overflow: hidden;
}

/* Readability overlay */
.hero-investor::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.06) 45%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

.hero-investor-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 4vw, 56px);
}

.hero-investor-title {
  margin-top: clamp(10px, 6vh, 90px);
  max-width: min(520px, 92vw);
}

.hero-investor-subtitle {
  margin-top: auto;
  max-width: min(980px, 92vw);
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.4rem);
}

/* Investors roadmap table */
.roadmap-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
  background: var(--surface);
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.roadmap-table th,
.roadmap-table td {
  padding: 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.roadmap-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.roadmap-table tr:last-child td {
  border-bottom: 0;
}

/* Investors contact box */
.contact-box {
  text-align: center;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.03),
    rgba(0, 0, 0, 0.1)
  );
  padding: 3rem 1.5rem;
  border: 1px solid rgba(103, 212, 255, 0.35);
  border-radius: var(--radius);
  margin-top: 4rem;
}

/* Investors "hero-section" (if you keep it) */
.hero-section {
  text-align: center;
  margin-bottom: 5rem;
}

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }

  form {
    grid-template-columns: 1fr;
  }
  .specs {
    grid-template-columns: 1fr;
  }
}

/* Mobile nav dropdown */
@media (max-width: 960px) {
  .nav-toggle {
    display: block;
  }

  .nav-links,
  .nav-cta {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    background: rgba(11, 15, 22, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);

    display: none;
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
  }

  .nav-links a {
    font-size: 1.05rem;
  }

  .nav.open .nav-links,
  .nav.open .nav-cta {
    display: flex;
  }

  .nav-cta .btn {
    width: 100%;
    text-align: center;
  }
}

/* Investors page mobile refinements */
@media (max-width: 768px) {
  .hero-investor {
    margin: 1rem 0;
    border-radius: var(--radius-sm);
    min-height: clamp(360px, 72vh, 520px);
    background-position: 60% top;
  }

  .hero-investor-content {
    padding: 16px;
  }

  .hero-investor-title {
    font-size: clamp(1.6rem, 7vw, 2.4rem);
    max-width: 100%;
  }

  .hero-investor-subtitle {
    font-size: clamp(0.95rem, 4.2vw, 1.1rem);
  }

  .roadmap-table th,
  .roadmap-table td {
    padding: 0.9rem;
  }

  /* Allow wrapping to avoid overflow */
  .roadmap-table td:nth-child(2),
  .roadmap-table th:nth-child(2) {
    white-space: normal;
  }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* ============ Portal / Admin Utilities (shared) ============ */
.text-right {
  text-align: right;
}
.nowrap {
  white-space: nowrap;
}
.inline-form {
  display: inline;
  margin: 0;
}
.card-dashed {
  border-style: dashed;
  padding: 0.85rem;
}
.footer-tight {
  width: 100%;
  padding: 0;
}
