/* ==========================================================================
   Enerji Portföy — ziyaretçi sayfası (v4)
   Portalın gerçek "studio" temasından türetilmiş açık/yeşil görünüm.
   Kaynak: apps/bess-portal-web/src/studio/studio.css + src/theme/tokens.css
   Zemin  #eef2ee (canvas) · panel #ffffff · çizgi #dbe3de
   Vurgu  koyu yeşil #0a6f5d / #075346 (studio-green / studio-green-dark)
   Grafik serileri (açık zemin): gerçekleşen = turuncu #d17d12 ·
   tahmin/median = yeşil #0a6f5d · yardımcı = mavi #2f6fb3 · mor #70549a
   Durum tonları studio-status: yeşil / amber / mavi / kırmızı.
   Tipografi: sistem sans + monospace (harici font YOK).
   ========================================================================== */

:root {
  color-scheme: light;

  /* zemin / yüzey (studio-canvas / soft / panel) */
  --bg-0: #eef2ee;
  --bg-1: #f3f6f3;
  --bg-2: #f8faf8;
  --panel: #ffffff;
  --panel-2: #f9fbf9;

  /* çizgi / kenar (studio-line / line-strong) */
  --line: #dbe3de;
  --line-strong: #c7d2cc;
  --line-soft: #e7ece8;

  /* metin (studio-ink / muted; faint AA için koyulaştırıldı) */
  --ink: #10251f;
  --muted: #4f5f59;
  --faint: #5f6d67;

  /* vurgu (studio-green / studio-green-dark) */
  --accent: #0a6f5d;
  --accent-bright: #075346;
  --gold: #8b590c;

  /* durum tonları (studio-status karşılığı) */
  --ok: #08614f;
  --ok-soft: #e6f4ef;
  --ok-border: #82c7b4;
  --warn: #8b590c;
  --warn-soft: #fff4df;
  --warn-border: #e5bd79;
  --info: #245e9d;
  --info-soft: #edf4fc;
  --info-border: #98b9dc;
  --danger: #933b3b;
  --danger-soft: #fbecec;
  --danger-border: #e4a2a2;

  /* grafik serileri (açık zemin) */
  --s-green: #0a6f5d;
  --s-blue: #2f6fb3;
  --s-amber: #d17d12;
  --s-purple: #70549a;

  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", "Roboto Mono", Consolas, monospace;

  --maxw: 1200px;
  --radius: 12px;
  --shadow: 0 4px 18px rgba(7, 28, 23, 0.08);
  --shadow-lg: 0 14px 40px rgba(7, 28, 23, 0.10);

  font-family: var(--font-sans);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg-0);
  overflow-x: clip;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  padding: 10px 16px; background: var(--accent); color: #ffffff;
  font-weight: 700; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ==========================================================================
   Sabit üst bar
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 11px 24px;
  display: flex; align-items: center; gap: 26px;
}
.brand { display: inline-flex; align-items: center; }
.brand img { width: 164px; height: auto; }
.main-nav { display: flex; gap: 24px; margin-left: 6px; font-size: 14px; color: var(--muted); }
.main-nav a {
  padding: 6px 2px; border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.main-nav a:hover, .main-nav a:focus-visible { color: var(--ink); border-bottom-color: var(--accent); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* live-dot — portal topbar canlı göstergesi */
.live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #12a57f; box-shadow: 0 0 0 3px rgba(18, 165, 127, 0.16);
}

/* ==========================================================================
   Butonlar (portal studio-button karşılığı)
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 20px; border-radius: 8px;
  font-family: inherit; font-weight: 700; font-size: 14.5px; letter-spacing: 0.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.btn-lg { min-height: 50px; padding: 0 26px; font-size: 15.5px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--accent-bright); border-color: var(--accent-bright); transform: translateY(-1px); }
.btn-ghost { background: #ffffff; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--accent); color: var(--accent-bright); background: var(--ok-soft); }

/* ==========================================================================
   Ortak: eyebrow / rozet / durum pilleri
   ========================================================================== */
.eyebrow {
  margin: 0 0 16px; color: var(--accent-bright);
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
}

/* portal studio-status pilleri */
.status {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: #f2f5f3; padding: 3px 9px;
  color: var(--muted); font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap;
}
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--fresh { border-color: var(--ok-border); background: var(--ok-soft); color: var(--ok); }
.status--gate  { border-color: var(--info-border); background: var(--info-soft); color: var(--info); }
.status--watch { border-color: var(--warn-border); background: var(--warn-soft); color: var(--warn); }

/* portal .tag (panel-meta rozeti) */
.tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  color: var(--ok); background: var(--ok-soft);
  border: 1px solid var(--ok-border);
}
.tag-dim { color: var(--faint); background: transparent; border-color: var(--line-strong); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  background:
    radial-gradient(1100px 520px at 80% -12%, rgba(10, 111, 93, 0.10), transparent 60%),
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff, var(--bg-0));
  background-size: auto, 44px 44px, 44px 44px, auto;
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 84px 24px 80px;
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 52px; align-items: center;
}
h1 {
  margin: 0; font-size: clamp(38px, 5vw, 62px);
  font-weight: 800; line-height: 1.05; letter-spacing: -0.035em;
}
h1 span { color: var(--accent-bright); }
.lead { max-width: 520px; margin: 22px 0 0; color: var(--muted); font-size: 18px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin: 16px 0 0; color: var(--faint); font-size: 13px; }

/* hero güven şeridi */
.hero-trust { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 24px 0 0; }

/* ==========================================================================
   Panel (portal studio-panel karşılığı)
   ========================================================================== */
.panel {
  margin: 0; min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.panel-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.panel-meta { display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 14px 16px 16px; min-width: 0; }

/* hero panelinin grafik gövdesi */
.hero-chart svg { width: 100%; padding: 14px 14px 2px; }

.grid line { stroke: var(--line-soft); stroke-width: 1; }
text.axis-text, .axis-text text {
  fill: var(--muted); font-family: var(--font-mono); font-size: 11px;
}
.band { stroke: none; }
.p50 { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.realized { fill: none; stroke: var(--s-amber); stroke-width: 2; stroke-dasharray: 5 6; stroke-linecap: round; }
.now-line { stroke: rgba(16, 37, 31, 0.28); stroke-width: 1; stroke-dasharray: 2 5; }
.peak-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.peak-label { fill: var(--muted); }
.demo-note-svg { fill: var(--faint); font-family: var(--font-mono); font-size: 10px; opacity: 0.9; }

.chart-legend {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  padding: 8px 16px 14px; color: var(--muted); font-size: 12.5px;
}
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; width: 18px; height: 10px; border-radius: 2px; }
.sw-band { background: rgba(10, 111, 93, 0.16); border: 1px solid rgba(10, 111, 93, 0.42); }
.sw-line { height: 3px; border-radius: 2px; background: var(--accent); }
.sw-dash { height: 0; border-radius: 0; border-top: 2px dashed var(--s-amber); background: transparent; }

/* provenance şeridi (portal studio-provenance) */
.provenance {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding: 9px 16px;
  background: var(--panel-2);
}
.provenance dl { display: flex; align-items: center; gap: 16px; margin: 0; flex-wrap: wrap; }
.provenance dl > div { display: flex; align-items: baseline; gap: 5px; }
.provenance dt { color: var(--faint); font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; }
.provenance dd { margin: 0; color: var(--ink); font-family: var(--font-mono); font-size: 10px; }

/* ==========================================================================
   KPI şeridi (portal studio-kpi karşılığı)
   ========================================================================== */
.kpi-band { border-bottom: 1px solid var(--line); background: var(--bg-1); }
.kpi-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 24px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.kpi {
  min-width: 0; min-height: 104px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 15px 16px;
}
.kpi-label { display: block; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.03em; }
.kpi strong {
  display: block; margin-top: 9px; color: var(--ink);
  font-family: var(--font-mono); font-size: clamp(21px, 2vw, 27px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.1;
}
.kpi strong small {
  margin-left: 5px; color: var(--faint); font-family: var(--font-sans);
  font-size: 11px; font-weight: 600; letter-spacing: 0;
}
.kpi-delta { display: block; margin-top: 8px; font-size: 11px; color: var(--faint); }
.kpi-delta.pos { color: var(--ok); }

/* ==========================================================================
   Bölüm iskeleti
   ========================================================================== */
.section { padding: 92px 24px; }
.section-alt { background: var(--bg-1); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-inner { max-width: var(--maxw); margin: 0 auto; }
h2 {
  max-width: 780px; margin: 0;
  font-size: clamp(29px, 3.6vw, 42px); font-weight: 800;
  line-height: 1.13; letter-spacing: -0.03em;
}
.section-lead { max-width: 660px; margin: 20px 0 0; color: var(--muted); font-size: 16.5px; line-height: 1.7; }

/* ==========================================================================
   Modül vitrini — portal-panel görünümlü kartlar
   ========================================================================== */
.modules {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px; margin-top: 52px;
}
.mod {
  display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.mod:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.mod-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 15px; border-bottom: 1px solid var(--line);
}
.mod-route {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase; color: var(--muted);
}
.mod-route .dot { color: var(--accent); }
.mod-body { padding: 15px 16px 8px; }
.mod-body h3 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.mod-body p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

/* mini KPI ikilisi kart içinde */
.mod-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 14px 0 4px; }
.mod-kpi {
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-2); padding: 9px 11px;
}
.mod-kpi span { display: block; color: var(--faint); font-size: 10px; letter-spacing: 0.02em; }
.mod-kpi strong {
  display: block; margin-top: 4px; color: var(--ink);
  font-family: var(--font-mono); font-size: 16px; font-weight: 700; letter-spacing: -0.02em;
}
.mod-kpi strong small { color: var(--faint); font-family: var(--font-sans); font-size: 10px; font-weight: 600; margin-left: 3px; }
.mod-kpi.teal strong { color: var(--accent-bright); }
.mod-kpi.amber strong { color: var(--gold); }

/* mini grafik yüzeyi */
.mini {
  position: relative; margin: 14px 0 0; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-2); overflow: hidden;
}
.mini svg { width: 100%; }
.mini-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.mini-bandstroke {
  fill: none; stroke: var(--s-green); stroke-opacity: 0.26;
  stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.baseline { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.soc-line { fill: none; stroke: var(--s-amber); stroke-width: 2; stroke-linecap: round; }
.mini-caption { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.mini-legend text { fill: var(--faint); font-family: var(--font-mono); font-size: 10px; }
.mini-mono text { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.version-ticks line { stroke: var(--line-strong); stroke-width: 1; }
.demo-tag {
  position: absolute; right: 8px; bottom: 6px;
  color: var(--faint); font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.08em; opacity: 0.95; pointer-events: none;
}

/* haber / duyuru mini liste (MMS) */
.mod-feed { margin: 14px 0 4px; display: grid; gap: 8px; }
.mod-feed-row {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
  border: 1px solid var(--line); border-left-width: 3px; border-radius: 7px;
  background: var(--bg-2); padding: 9px 11px;
}
.mod-feed-row.crit { border-left-color: var(--danger); }
.mod-feed-row.warn { border-left-color: var(--s-amber); }
.mod-feed-row.info { border-left-color: var(--s-blue); }
.mod-feed-src {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px;
  padding: 2px 6px; white-space: nowrap; text-transform: uppercase;
}
.mod-feed-row strong { display: block; font-size: 12px; font-weight: 600; color: var(--ink); }
.mod-feed-row small { display: block; margin-top: 2px; color: var(--faint); font-size: 10px; }

/* fırsat matrisi mini ısı-ızgarası */
.heat { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin: 14px 0 4px; }
.heat i { aspect-ratio: 1 / 1; border-radius: 3px; background: #e7ece8; }
.heat i.l1 { background: rgba(10, 111, 93, 0.24); }
.heat i.l2 { background: rgba(10, 111, 93, 0.46); }
.heat i.l3 { background: rgba(47, 111, 179, 0.55); }
.heat i.l4 { background: rgba(10, 111, 93, 0.82); }
.heat-axis {
  display: flex; justify-content: space-between; margin-top: 6px;
  color: var(--faint); font-family: var(--font-mono); font-size: 9.5px;
}

/* ==========================================================================
   Yöntem / güven bölümü
   ========================================================================== */
.method {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 52px;
  margin-top: 50px; border-top: 1px solid var(--line);
}
.method article { padding: 24px 0 28px; border-bottom: 1px solid var(--line); }
.method .m-tag {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-bright);
}
.method h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.method p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.7; }
.method code {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--accent-bright);
  background: var(--ok-soft); border: 1px solid var(--ok-border);
  padding: 1px 6px; border-radius: 5px;
}

/* pipeline kalp atışı zaman çizgisi */
.heartbeat {
  margin-top: 50px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.heartbeat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.heartbeat-head strong { font-size: 15px; font-weight: 700; }
.heartbeat-stages {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 0;
}
.heartbeat-stages li { position: relative; padding: 0 8px; text-align: center; }
.heartbeat-stages li::before {
  content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px;
  background: var(--line-strong);
}
.heartbeat-stages li:first-child::before { display: none; }
.heartbeat-stages .node {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 32px; height: 32px; margin: 0 auto 10px; border-radius: 50%;
  border: 1px solid var(--ok-border); background: var(--ok-soft);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--accent-bright);
}
.heartbeat-stages .name {
  display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; color: var(--ink);
}
.heartbeat-stages .desc { display: block; margin-top: 3px; color: var(--faint); font-size: 10.5px; }

/* ==========================================================================
   Erişim CTA
   ========================================================================== */
.access {
  background:
    radial-gradient(760px 380px at 50% 0%, rgba(10, 111, 93, 0.10), transparent 65%),
    var(--bg-1);
  border-top: 1px solid var(--line);
  text-align: center;
}
.access-inner { display: grid; justify-items: center; }
.access h2 { max-width: 640px; }
.access-lead { max-width: 640px; margin-left: auto; margin-right: auto; }
.access-actions { justify-content: center; }

/* ==========================================================================
   Footer
   ========================================================================== */
footer { border-top: 1px solid var(--line); background: var(--panel); }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 26px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px;
  color: var(--faint); font-size: 12.5px;
}
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--ink); }
.footer-cta { color: var(--accent-bright); font-weight: 700; }
.footer-inner a.footer-cta { color: var(--accent-bright); }

/* ==========================================================================
   Duyarlılık
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; padding-top: 60px; }
  .hero-copy { max-width: 640px; }
  .kpi-inner { grid-template-columns: repeat(2, 1fr); }
  .method { grid-template-columns: 1fr; gap: 0; }
  .heartbeat-stages { grid-template-columns: repeat(3, 1fr); row-gap: 24px; }
  .heartbeat-stages li:nth-child(4)::before { display: none; }
}
@media (max-width: 860px) {
  .main-nav { display: none; }
  .modules { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .section { padding: 68px 20px; }
  .hero-inner { padding: 52px 20px 60px; }
}
@media (max-width: 480px) {
  .header-inner { padding: 10px 14px; gap: 12px; }
  .brand img { width: 132px; }
  .btn { min-height: 38px; padding: 0 13px; font-size: 13.5px; }
  .btn-lg { min-height: 46px; padding: 0 18px; font-size: 14.5px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .kpi-inner { grid-template-columns: 1fr; }
  .heartbeat-stages { grid-template-columns: repeat(2, 1fr); }
  .heartbeat-stages li::before { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

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