/* akillisehircilik.com — Teknik-CBS ana stili
   Koyu zemin · mono ikincil · harita çıktısı estetiği */

:root {
  --bg:           #061825;
  --bg-1:         #082234;
  --bg-2:         #0d2a3d;
  --bg-3:         #13344c;
  --border:       #173145;
  --border-1:     #1f3e56;
  --border-2:     #2e5270;
  --text:         #e8ecf2;
  --text-dim:     #8a9cb3;
  --text-faint:   #4e6480;
  --accent:       #DBAF54;
  --accent-soft:  #e8c276;
  --accent-fade:  rgba(219, 175, 84, 0.15);
  --accent-glow:  rgba(219, 175, 84, 0.35);
  --gold:         #DBAF54;
  --gold-fade:    rgba(219, 175, 84, 0.15);
  --info:         #3448FF;
  --info-soft:    #5065FF;
  --ok:           #4ec97a;
  --warn:         #E8A742;
  --bad:          #e85c3a;

  --mono: 'JetBrains Mono', ui-monospace, SF Mono, Menlo, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --serif: 'DM Serif Display', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--sans);
  font-feature-settings: 'ss01', 'ss02', 'cv11';
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

body { overflow-x: hidden; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Scrollbar — thin, elegant */
* { scrollbar-width: thin; scrollbar-color: var(--border-1) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* Text selection */
::selection { background: var(--accent-fade); color: var(--text); }

/* Utility */
.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.caps { letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; }

.hairline { border-bottom: 1px solid var(--border); }

/* Grid backdrop */
.grid-bg {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* MapLibre overrides */
.maplibregl-ctrl-attrib, .maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { display: none !important; }
.maplibregl-popup-content {
  background: var(--bg-1) !important; color: var(--text) !important;
  border: 1px solid var(--border-1); border-radius: 6px !important;
  font-family: var(--mono); font-size: 11px; padding: 10px 12px !important;
}
.maplibregl-popup-tip { border-top-color: var(--bg-1) !important; border-bottom-color: var(--bg-1) !important; }
.maplibregl-ctrl-group { background: var(--bg-1) !important; border: 1px solid var(--border-1) !important; }
.maplibregl-ctrl-group button { background-color: var(--bg-1) !important; }

/* Cesium overrides */
.cesium-viewer-bottom, .cesium-widget-credits { display: none !important; }
.cesium-viewer { background: var(--bg) !important; }

/* Reusable */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text);
  border: 1px solid var(--border-1);
  padding: 11px 18px; font-family: var(--mono); font-size: 12px;
  font-weight: 500; letter-spacing: 0.02em; border-radius: 6px;
  cursor: pointer; transition: all 0.15s ease;
}
.btn:hover { border-color: var(--border-2); background: var(--bg-1); }
.btn-primary { background: var(--accent); color: #042D44; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.btn-gold { background: var(--gold); color: #042D44; border-color: var(--gold); font-weight: 600; }
.btn-gold:hover { background: #e8c276; border-color: #e8c276; }

.card {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px;
}

.glow-accent { box-shadow: 0 0 24px var(--accent-glow); }

/* Reveal animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal { animation: fadeUp 0.5s ease both; }

/* Subtle scanline on hero for "live telemetry" feel */
@keyframes scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}
.scanline {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  animation: scan 8s linear infinite;
  pointer-events: none;
  opacity: 0.3;
}

/* Pulse */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.pulse { animation: pulse 2s ease infinite; }

/* Page-in */
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.page { animation: pageIn 0.25s ease; min-height: 100vh; }

/* Link row hover */
.row-link {
  display: block; padding: 16px 0;
  border-bottom: 1px solid var(--border);
  transition: padding 0.2s ease;
  cursor: pointer;
}
.row-link:hover { padding-left: 8px; background: linear-gradient(90deg, var(--accent-fade), transparent); }

/* ==============================================================
   RESPONSIVE — mobile-first overhaul
   ============================================================== */

/* Mobile map chip-row: hide scrollbar for clean horizontal-scroll look */
.mobile-map-chips { scrollbar-width: none; }
.mobile-map-chips::-webkit-scrollbar { display: none; }

/* Turkey state table: card layout on mobile (no horizontal scroll) */
@media (max-width: 900px) {
  .turkey-table-head { display: none !important; }
  .turkey-table-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 20px 18px !important;
  }
  .turkey-table-row .turkey-area { font-size: 16px !important; }
  .turkey-table-row .turkey-desc { font-size: 13.5px !important; line-height: 1.55 !important; }
  .turkey-table-row .turkey-examples { font-size: 10.5px !important; opacity: 0.9; }

  /* Verigo bridge: 2 cols on tablet, single col on phone */
  .verigo-bridge-heading { font-size: 24px !important; letter-spacing: -0.01em !important; line-height: 1.15 !important; }
  .verigo-bridge-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .verigo-bridge-grid > div {
    border-right: 1px solid var(--border) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 20px !important;
  }
  .verigo-bridge-grid > div:nth-child(2n) { border-right: none !important; }
  .verigo-bridge-grid > div:nth-last-child(-n+2) { border-bottom: none !important; }
}

@media (max-width: 520px) {
  .verigo-bridge-heading { font-size: 20px !important; }
  .verigo-bridge-grid { grid-template-columns: 1fr !important; }
  .verigo-bridge-grid > div {
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 18px !important;
  }
  .verigo-bridge-grid > div:last-child { border-bottom: none !important; }
}

/* Components grid: 5 cols on desktop, 3 on tablet, 2 on small tablet, 1 on mobile */
.components-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.components-grid > div {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.components-grid > div:nth-child(5n) { border-right: none; }
.components-grid > div:nth-last-child(-n+5) { border-bottom: none; }

@media (max-width: 1200px) {
  .components-grid { grid-template-columns: repeat(3, 1fr); }
  .components-grid > div { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .components-grid > div:nth-child(5n) { border-right: 1px solid var(--border); }
  .components-grid > div:nth-last-child(-n+5) { border-bottom: 1px solid var(--border); }
  .components-grid > div:nth-child(3n) { border-right: none; }
}
@media (max-width: 800px) {
  .components-grid { grid-template-columns: repeat(2, 1fr); }
  .components-grid > div:nth-child(3n) { border-right: 1px solid var(--border); }
  .components-grid > div:nth-child(2n) { border-right: none; }
}
@media (max-width: 520px) {
  .components-grid { grid-template-columns: 1fr; }
  .components-grid > div { border-right: none !important; }
  .components-grid > div:last-child { border-bottom: none !important; }
}

/* ----- Tablet (<=1100px) ----- */
@media (max-width: 1100px) {
  .wide-only { display: none !important; }
  .map-wrap { grid-template-columns: 260px 1fr 280px !important; }
}

/* ----- Tablet/small laptop (<=1000px) ----- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .hero-grid h1 { font-size: 48px !important; line-height: 1 !important; }
  .hero-grid h1 br { display: none !important; }
}

/* ============ GENERAL MOBILE OVERRIDES (<= 900px) ============ */
@media (max-width: 900px) {
  .hide-md { display: none !important; }

  /* Section padding: reduce horizontal + vertical on mobile */
  section { padding-left: 20px !important; padding-right: 20px !important; }
  .sec-padding { padding-left: 20px !important; padding-right: 20px !important; }

  /* Header */
  .site-header { padding: 10px 16px !important; gap: 10px !important; }
  .site-header-tag { display: none !important; }
  .site-header-nav { gap: 16px !important; font-size: 13px !important; }

  /* Hero */
  .hero-telemetry { grid-template-columns: repeat(2, 1fr) !important; }
  .hero-telemetry > div { padding: 14px 16px !important; }
  .hero-telemetry > div:nth-child(2) { border-right: none !important; }
  .hero-telemetry > div:nth-child(-n+2) { border-bottom: 1px solid var(--border) !important; }
  .hero-stats {
    flex-wrap: wrap !important;
    gap: 8px 16px !important;
    justify-content: flex-start !important;
    font-size: 10px !important;
  }

  /* Section header h2 scales */
  .section-header h2 { font-size: 28px !important; }

  /* Map wrap: stack all 3 columns */
  .map-wrap { grid-template-columns: 1fr !important; }
  .map-wrap > :first-child,
  .map-wrap > :last-child {
    height: auto !important; max-height: 340px; min-height: 240px;
    border-left: none !important; border-right: none !important;
    border-bottom: 1px solid var(--border);
  }

  /* Cases rows: collapse to card layout */
  .cases-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 20px 16px !important;
  }
  .cases-row > :first-child { font-size: 10px !important; }
  .cases-row h3 { font-size: 22px !important; }
  .cases-row > :nth-last-child(1),
  .cases-row > :nth-last-child(2) { text-align: left !important; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
  .footer-bottom { flex-direction: column !important; gap: 10px !important; text-align: center; align-items: center; }

  /* Vision */
  .vision-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .vision-grid h2 { font-size: 30px !important; }

  /* Turkey table */
  .turkey-verigo-grid { grid-template-columns: 1fr !important; }

  /* About-verigo (home snippet) */
  .about-verigo-grid { grid-template-columns: 1fr !important; gap: 28px !important; }

  /* About page grids */
  .about-facts { grid-template-columns: repeat(2, 1fr) !important; }
  .about-facts > div:nth-child(2) { border-right: none !important; }
  .about-facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .about-pillars { grid-template-columns: 1fr !important; }
  .about-pillars > div { border-right: none !important; border-bottom: 1px solid var(--border) !important; }
  .about-pillars > div:last-child { border-bottom: none !important; }
}

/* ============ PHONE OVERRIDES (<= 640px) ============ */
@media (max-width: 640px) {
  .hide-sm { display: none !important; }

  section { padding-left: 16px !important; padding-right: 16px !important; padding-top: 48px !important; padding-bottom: 48px !important; }
  .sec-padding { padding-left: 16px !important; padding-right: 16px !important; }

  /* Header nav → simpler, wrap if needed */
  .site-header { padding: 8px 14px !important; }
  .site-header-nav { gap: 14px !important; font-size: 12px !important; }

  /* Hero */
  .hero-grid h1 { font-size: 36px !important; line-height: 1.05 !important; letter-spacing: -0.02em !important; }
  .hero-grid p { font-size: 15px !important; }

  /* Section header h2 */
  .section-header h2 { font-size: 24px !important; letter-spacing: -0.02em !important; }
  .section-header p { font-size: 14px !important; }

  /* Vision */
  .vision-grid h2 { font-size: 26px !important; }

  /* Cases: h3 smaller */
  .cases-row h3 { font-size: 20px !important; }

  /* Map panels: even smaller max-height so not dominating */
  .map-wrap > :first-child,
  .map-wrap > :last-child { max-height: 280px; }
}

/* ============ SMALL PHONE (<= 480px) ============ */
@media (max-width: 480px) {
  section { padding-top: 40px !important; padding-bottom: 40px !important; padding-left: 14px !important; padding-right: 14px !important; }
  .sec-padding { padding-left: 14px !important; padding-right: 14px !important; }

  .hero-grid h1 { font-size: 30px !important; }
  .section-header h2 { font-size: 22px !important; }
  .vision-grid h2 { font-size: 22px !important; }
  .site-header { padding: 8px 12px !important; gap: 8px !important; }
  .site-header-nav { gap: 10px !important; font-size: 11px !important; }

  .hero-telemetry > div { padding: 12px 14px !important; }
  .hero-stats { gap: 6px 12px !important; font-size: 9.5px !important; }

  /* About facts: single column */
  .about-facts { grid-template-columns: 1fr !important; }
  .about-facts > div { border-right: none !important; border-bottom: 1px solid var(--border); }
  .about-facts > div:last-child { border-bottom: none; }

  /* Footer → single column */
  .footer-grid { grid-template-columns: 1fr !important; gap: 20px !important; }

  /* Components grid: single column */
  .components-grid { grid-template-columns: 1fr !important; }
  .components-grid > div { border-right: none !important; }
  .components-grid > div:last-child { border-bottom: none !important; }

  /* Logo size tweak in header */
  .site-header .mono { font-size: 12px !important; }
}

/* ============ Horizontal-scroll escape for any table-like wide content ============ */
@media (max-width: 900px) {
  .h-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .h-scroll > * { min-width: max-content; }
}

/* Component card (home grid → clickable) */
.component-card:hover { background: var(--bg-1) !important; }
.component-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Component detail page — responsive */
@media (max-width: 900px) {
  .cdp-grid { grid-template-columns: 1fr !important; gap: 36px !important; }
  .cdp-title { font-size: 32px !important; }
  .cdp-kpis { grid-template-columns: 1fr !important; }
  .cdp-kpis > div { border-right: none !important; border-bottom: 1px solid var(--border) !important; }
  .cdp-kpis > div:last-child { border-bottom: none !important; }
}
@media (max-width: 640px) {
  .cdp-title { font-size: 26px !important; }
  .cdp-nav { grid-template-columns: 1fr !important; }
  .cdp-nav > div { border-right: none !important; padding: 22px 0 !important; text-align: left !important; }
  .cdp-nav > div:first-child { border-bottom: 1px solid var(--border); }
}
@media (max-width: 480px) {
  .cdp-title { font-size: 23px !important; }
}

/* Map legend — never overflow short viewports; shrink on phones */
.map-legend {
  max-height: calc(100% - 24px);
  overflow-y: auto;
  overflow-x: hidden;
}
@media (max-width: 640px) {
  .map-legend {
    min-width: 150px !important;
    max-width: 60vw;
    padding: 8px 10px !important;
  }
}
@media (max-height: 460px) {
  /* Very short viewport (landscape phones): legend would cover the map */
  .map-legend { display: none !important; }
}

/* Map inspector/sidebar on tablet — comfortable, scrollable, not cramped */
@media (min-width: 901px) and (max-width: 1100px) {
  .map-wrap { grid-template-columns: 240px 1fr 260px !important; }
  .map-wrap > :first-child,
  .map-wrap > :last-child { font-size: 13px; }
}

/* Images never overflow */
img, svg, video, canvas { max-width: 100%; }

/* Prevent body from horizontal scroll */
html, body { max-width: 100vw; }
