  :root {
    --crude: #883CF0;
    --crude-light: #7c3aed;
    --crude-dim: #b29dce;
    --dark: #191127;
    --surface: #1f1232;
    --surface2: #23133a;
    --surface3: #23133a;
    --border: #3a1c63;
    --border-bright: #5e309d;
    --text: #D4CFC8;
    --text-dim: #d6d6d6;
    --gas: #af62c8;
    --gas-dim: #a679b5;
    --alert: #6c3cbf;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  html { scroll-behavior: smooth; }

  body {
    background: var(--dark);
    color: var(--text);
    font-family: 'Barlow Condensed', sans-serif;
    overflow-x: hidden;
    cursor: crosshair;
  }

  /* ── SCANLINE OVERLAY ── */
  body::before {
    content: '';
    position: fixed; inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px);
    pointer-events: none; z-index: 9999;
  }

  /* ── AMBIENT OIL BLOBS ── */
  .blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    animation: drift 18s ease-in-out infinite alternate;
  }
  .blob-1 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(133, 10, 200, 0.12), transparent 70%); top: -100px; left: -100px; }
  .blob-2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(147, 29, 190, 0.08), transparent 70%); bottom: 10%; right: -80px; animation-delay: -7s; }
  .blob-3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(146, 10, 200, 0.07), transparent 70%); top: 40%; left: 40%; animation-delay: -12s; }

  @keyframes drift {
    from { transform: translate(0,0) scale(1); }
    to   { transform: translate(40px,30px) scale(1.1); }
  }

  /* ── HEADER ── */
  header {
    position: fixed; top: 0; width: 100%; z-index: 100;
    background: #180f26;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
    height: 58px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .logo {
    display: flex; align-items: center; gap: 10px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 3px;
    color: var(--crude-light);
  }
  .logo-icon {
    width: 32px; height: 32px;
    background: var(--crude);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; color: #000; font-weight: 700;
    animation: pulse-hex 3s ease-in-out infinite;
  }
  @keyframes pulse-hex {
    0%,100% { box-shadow: 0 0 0 0 rgba(114, 10, 200, 0.4); }
    50% { box-shadow: 0 0 20px 8px rgba(187, 10, 200, 0.2); }
  }
  .logo span { color: var(--text-dim); font-size: 0.75rem; letter-spacing: 1px; display: block; font-family: 'DM Mono'; margin-top: -4px; }
  nav { display: flex; gap: 4px; }
  nav a {
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-dim);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid transparent;
    transition: all 0.2s;
    letter-spacing: 1px;
    text-transform: uppercase;
  }
  nav a:hover, nav a.active {
    color: var(--crude-light);
    border-color: var(--border-bright);
    background: #23133a9f;
  }
  .header-live {
    display: flex; align-items: center; gap: 8px;
    font-family: 'DM Mono'; font-size: 0.7rem; color: var(--gas);
  }
  .live-dot { width: 7px; height: 7px; background: var(--gas); border-radius: 50%; animation: blink 1.4s infinite; }
  @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

  /* ── HERO ── */
  .hero {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; align-items: center;
    padding: 120px 80px 80px;
    overflow: hidden;
  }
  .hero-grid-bg {
    position: absolute; inset: 0; z-index: 0;
    background-image:
      linear-gradient(rgba(149, 10, 200, 0.078) 1px, transparent 1px),
      linear-gradient(90deg, rgba(181, 10, 200, 0.094) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: grid-shift 40s linear infinite;
  }
  @keyframes grid-shift { from{background-position:0 0} to{background-position:60px 60px} }

  .hero-content { position: relative; z-index: 2; max-width: 760px; }
  .hero-tag {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'DM Mono'; font-size: 0.68rem;
    color: var(--crude); letter-spacing: 2px;
    text-transform: uppercase;
    border: 1px solid #3a1c63;
    padding: 5px 14px;
    margin-bottom: 28px;
    animation: fade-up 0.8s ease both;
  }
  .hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(4rem, 9vw, 8rem);
    line-height: 0.92;
    letter-spacing: 2px;
    color: #fff;
    animation: fade-up 0.8s ease 0.1s both;
  }
  .hero-title em {
    font-style: normal;
    color: var(--crude-light);
    display: block;
  }
  .hero-sub {
    font-size: 1.15rem;
    font-weight: 300;
    color: var(--text-dim);
    max-width: 520px;
    line-height: 1.7;
    margin: 24px 0 40px;
    animation: fade-up 0.8s ease 0.2s both;
    letter-spacing: 0.5px;
  }
  .hero-ctas { display: flex; gap: 16px; animation: fade-up 0.8s ease 0.3s both; }
  .btn-primary {
    background: var(--crude);
    color: #000;
    font-family: 'DM Mono'; font-size: 0.8rem; font-weight: 500;
    padding: 14px 32px;
    letter-spacing: 1px;
    border: none; cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    transition: all 0.2s;
    text-transform: uppercase;
  }
  .btn-primary:hover { background: var(--crude-light); transform: translateY(-2px); }
  .btn-outline {
    background: transparent;
    color: var(--text);
    font-family: 'DM Mono'; font-size: 0.8rem;
    padding: 13px 32px;
    letter-spacing: 1px;
    border: 1px solid var(--border-bright); cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
  }
  .btn-outline:hover { background: var(--surface2); color: var(--crude-light); border-color: var(--crude); }

  .hero-stats {
    position: absolute; right: 80px; top: 50%;
    transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 2px;
    z-index: 2;
    animation: fade-up 0.8s ease 0.4s both;
  }
  .stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--crude);
    padding: 16px 24px;
    min-width: 200px;
    transition: all 0.3s;
    position: relative; overflow: hidden;
  }
  .stat-card::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--crude-light), transparent);
    animation: shimmer 3s ease-in-out infinite;
  }
  @keyframes shimmer { to { left: 100%; } }
  .stat-card:hover { border-left-color: var(--gas); transform: translateX(-4px); }
  .stat-label { font-family: 'DM Mono'; font-size: 0.62rem; color: var(--text-dim); letter-spacing: 1.5px; text-transform: uppercase; }
  .stat-val { font-family: 'Bebas Neue'; font-size: 2.2rem; color: var(--crude-light); letter-spacing: 1px; line-height: 1; margin: 2px 0; }
  .stat-val.gas { color: var(--gas); }
  .stat-delta { font-family: 'DM Mono'; font-size: 0.65rem; color: var(--gas); }
  .stat-delta.down { color: var(--alert); }

  @keyframes fade-up { from{opacity:0;transform:translateY(24px)} to{opacity:1;transform:translateY(0)} }

  /* ── TICKER ── */
  .ticker-wrap {
    position: relative; z-index: 10;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden; height: 38px;
    display: flex; align-items: center;
  }
  .ticker-label {
    background: var(--crude);
    color: #000;
    font-family: 'DM Mono'; font-size: 0.65rem; font-weight: 500;
    padding: 0 14px; height: 100%; display: flex; align-items: center;
    flex-shrink: 0; letter-spacing: 2px; z-index: 1;
  }
  .ticker-track {
    display: flex; gap: 0; white-space: nowrap;
    animation: ticker 30s linear infinite;
    padding-left: 30px;
  }
  .ticker-item {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'DM Mono'; font-size: 0.7rem;
    padding: 0 24px; border-right: 1px solid var(--border);
    color: var(--text);
  }
  .ticker-item .sym { color: var(--crude-light); font-weight: 500; }
  .ticker-item .up { color: var(--gas); }
  .ticker-item .dn { color: var(--alert); }
  @keyframes ticker { from{transform:translateX(0)} to{transform:translateX(-50%)} }

  /* ── SECTION WRAPPER ── */
  section { position: relative; z-index: 1; padding: 80px; }
  .sec-head {
    display: flex; align-items: baseline; gap: 16px;
    margin-bottom: 48px;
  }
  .sec-num { font-family: 'DM Mono'; font-size: 0.65rem; color: var(--crude); letter-spacing: 2px; }
  .sec-title { font-family: 'Bebas Neue'; font-size: 2.8rem; letter-spacing: 2px; color: #fff; }
  .sec-line { flex: 1; height: 1px; background: var(--border); }

  /* ── DASHBOARD SECTION ── */
  .dashboard-section { background: var(--surface); }

  .dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    grid-template-rows: auto auto;
    gap: 2px;
    background: var(--dark);
  }

  .dash-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 24px;
    position: relative; overflow: hidden;
    transition: border-color 0.3s;
  }
  .dash-panel:hover { border-color: var(--border-bright); }
  .dash-panel-title {
    font-family: 'DM Mono'; font-size: 0.65rem;
    color: var(--text-dim); text-transform: uppercase;
    letter-spacing: 2px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 8px;
  }
  .dash-panel-title::before { content: '//'; color: var(--crude); }

  /* Sparkline chart */
  .spark-wrap { width: 100%; height: 80px; position: relative; }
  canvas.spark { width: 100%; height: 100%; }

  /* Gauge */
  .gauge-wrap { display: flex; justify-content: center; padding: 10px 0; }
  .gauge {
    width: 130px; height: 65px;
    position: relative; overflow: hidden;
  }
  .gauge svg { width: 100%; height: 100%; }

  /* Well status grid */
  .well-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
  .well-dot {
    width: 100%; aspect-ratio: 1;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.2s;
  }
  .well-dot:hover { transform: scale(1.3); }
  .well-dot.active { background: var(--gas); }
  .well-dot.idle { background: var(--crude); }
  .well-dot.shut { background: var(--surface3); border: 1px solid var(--border); }
  .well-dot.drilling { background: var(--alert); animation: blink 1s infinite; }

  .well-legend { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
  .leg-item { display: flex; align-items: center; gap: 6px; font-family: 'DM Mono'; font-size: 0.62rem; color: var(--text-dim); }
  .leg-dot { width: 8px; height: 8px; border-radius: 2px; }

  /* ── MAP / BASIN SECTION ── */
  .basin-section { background: var(--dark); }
  .basin-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2px; }
  .basin-map {
    background: var(--surface);
    border: 1px solid var(--border);
    height: 460px;
    position: relative; overflow: hidden;
  }
  .basin-map canvas { width: 100%; height: 100%; }

  .basin-list { display: flex; flex-direction: column; gap: 2px; }
  .basin-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
  }
  .basin-item:hover, .basin-item.sel {
    border-left-color: var(--crude);
    background: var(--surface2);
  }
  .basin-name { font-size: 1rem; font-weight: 600; letter-spacing: 1px; color: #fff; margin-bottom: 6px; }
  .basin-meta { display: flex; justify-content: space-between; font-family: 'DM Mono'; font-size: 0.65rem; color: var(--text-dim); }
  .basin-meta span { color: var(--crude-light); }
  .basin-bar-wrap { height: 3px; background: var(--surface3); margin-top: 10px; border-radius: 1px; }
  .basin-bar { height: 100%; background: var(--crude); border-radius: 1px; transition: width 0.6s ease; }
  .basin-bar.gas { background: var(--gas); }

  /* ── DATA TYPES ── */
  .data-section { background: var(--surface); }
  .data-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
  .data-card {
    background: var(--dark);
    border: 1px solid var(--border);
    padding: 32px;
    position: relative; overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    /* group: true; */
  }
  .data-card::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #3928529f, transparent);
    opacity: 0; transition: opacity 0.3s;
  }
  .data-card:hover { transform: translateY(-4px); border-color: var(--crude); }
  .data-card:hover::after { opacity: 1; }
  .data-card-icon {
    width: 48px; height: 48px; margin-bottom: 20px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 1.2rem;
  }
  .data-card-title { font-size: 1.3rem; font-weight: 700; letter-spacing: 1px; color: #fff; margin-bottom: 8px; }
  .data-card-desc { font-size: 0.85rem; font-weight: 300; color: var(--text-dim); line-height: 1.6; }
  .data-card-count {
    position: absolute; top: 20px; right: 20px;
    font-family: 'DM Mono'; font-size: 0.65rem; color: var(--crude); letter-spacing: 1px;
  }

  /* ── SEARCH TERMINAL ── */
  .search-section { background: var(--dark); }
  .terminal {
    background: var(--surface);
    border: 1px solid var(--border);
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
  }
  .terminal-bar {
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex; align-items: center; gap: 8px;
    font-family: 'DM Mono'; font-size: 0.65rem; color: var(--text-dim);
  }
  .t-dot { width: 10px; height: 10px; border-radius: 50%; }
  .t-dot.r { background: #e84040; }
  .t-dot.y { background: #f5a623; }
  .t-dot.g { background: #1dbea1; }
  .terminal-body { padding: 24px; }
  .t-line { font-family: 'DM Mono'; font-size: 0.8rem; margin-bottom: 8px; display: flex; gap: 10px; }
  .t-prompt { color: var(--crude); flex-shrink: 0; }
  .t-cmd { color: var(--gas); }
  .t-out { color: var(--text-dim); }
  .t-val { color: #fff; }
  .t-tag { color: var(--crude-light); }

  .search-input-wrap {
    display: flex; gap: 0;
    border: 1px solid var(--border); margin-top: 20px;
  }
  .search-prefix {
    background: var(--surface2);
    border-right: 1px solid var(--border);
    padding: 12px 16px;
    font-family: 'DM Mono'; font-size: 0.8rem; color: var(--crude);
    flex-shrink: 0;
  }
  .search-inp {
    flex: 1; background: transparent; border: none; outline: none;
    color: #fff; font-family: 'DM Mono'; font-size: 0.8rem;
    padding: 12px 16px; caret-color: var(--crude-light);
  }
  .search-btn {
    background: var(--crude); border: none; cursor: pointer;
    font-family: 'DM Mono'; font-size: 0.75rem; font-weight: 500;
    color: #000; padding: 12px 24px; letter-spacing: 1px;
    text-transform: uppercase; transition: background 0.2s;
  }
  .search-btn:hover { background: var(--crude-light); }

  .search-results { margin-top: 16px; display: none; }
  .search-results.show { display: block; }
  .result-row {
    display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
    padding: 10px 0; border-bottom: 1px solid var(--border);
    font-family: 'DM Mono'; font-size: 0.72rem; color: var(--text);
    animation: fade-up 0.3s ease both;
  }
  .result-row:nth-child(1) { animation-delay: 0.05s; }
  .result-row:nth-child(2) { animation-delay: 0.1s; }
  .result-row:nth-child(3) { animation-delay: 0.15s; }
  .result-row.header { color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; font-size: 0.62rem; }
  .result-row .tag { color: var(--crude-light); }
  .result-row .ok { color: var(--gas); }
  .result-row .warn { color: var(--alert); }

  /* ── TABS ── */
  .tab-bar { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
  .tab {
    font-family: 'DM Mono'; font-size: 0.72rem; letter-spacing: 1px;
    text-transform: uppercase; color: var(--text-dim);
    padding: 12px 24px; cursor: pointer; border-bottom: 2px solid transparent;
    transition: all 0.2s; background: transparent; border-top:none; border-left:none; border-right:none;
  }
  .tab:hover { color: var(--text); }
  .tab.active { color: var(--crude-light); border-bottom-color: var(--crude); }
  .tab-panel { display: none; }
  .tab-panel.active { display: block; }

  /* ── PRODUCTION CHART ── */
  .prod-chart { position: relative; height: 220px; }
  .prod-canvas { width: 100%; height: 100%; }
  .chart-yaxis {
    position: absolute; left: 0; top: 0; bottom: 20px;
    display: flex; flex-direction: column-reverse; justify-content: space-between;
    font-family: 'DM Mono'; font-size: 0.6rem; color: var(--text-dim);
    padding-right: 8px;
  }

  /* ── FOOTER ── */
  footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 40px 80px;
    display: flex; justify-content: space-between; align-items: center;
    position: relative; z-index: 1;
  }
  .footer-logo { font-family: 'Bebas Neue'; font-size: 1.2rem; letter-spacing: 3px; color: var(--crude-dim); }
  .footer-meta { font-family: 'DM Mono'; font-size: 0.65rem; color: var(--text-dim); letter-spacing: 1px; }
  .footer-meta span { color: var(--crude); }

  /* ── TOOLTIP ── */
  .tooltip {
    position: fixed; pointer-events: none; z-index: 200;
    background: var(--surface2); border: 1px solid var(--border-bright);
    padding: 8px 14px; font-family: 'DM Mono'; font-size: 0.68rem; color: #fff;
    opacity: 0; transition: opacity 0.15s;
    white-space: nowrap;
  }
  .tooltip.show { opacity: 1; }

  /* scrollbar */
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: var(--dark); }
  ::-webkit-scrollbar-thumb { background: var(--crude-dim); border-radius: 3px; }

  @media (max-width: 900px) {
    header { padding: 0 20px; }
    nav { display: none; }
    .hero { padding: 100px 24px 60px; flex-direction: column; }
    .hero-stats { position: static; transform: none; margin-top: 40px; flex-direction: row; flex-wrap: wrap; }
    section { padding: 50px 24px; }
    .dash-grid, .basin-layout, .data-cards { grid-template-columns: 1fr; }
    footer { padding: 30px 24px; flex-direction: column; gap: 12px; text-align: center; }
  }