/* ================================================================
   FAMA ELEKTRİK — TEMA
   Renkler ve yazı tipleri :root altındaki değişkenlerden yönetilir.
   ================================================================ */

:root {
  /* Renkler — logodaki marka renklerinden türetildi
     (fama: #B23A3A bordo, elektrik: #0E63A8 mavi)   */
  --ink:        #0E2A44;   /* marka mavisinden koyu lacivert zemin  */
  --ink-2:      #16395C;   /* koyu zemin üstü yüzey                 */
  --paper:      #F4F6F8;   /* soğuk teknik beyaz — açık zemin       */
  --card:       #FFFFFF;
  --brand:     #B23A3A;   /* marka bordosu — ana vurgu             */
  --brand-hi:  #E06E6E;   /* koyu zeminde bordo                    */
  --brand-deep:#9E3030;   /* açık zeminde metin/link bordosu       */
  --spark:      #4FA3E0;   /* akım darbesi — marka mavisinin parlağı */
  --blue:       #0E63A8;   /* marka mavisi                          */
  --steel:      #8DA2B8;   /* koyu zeminde ikincil metin            */
  --muted:      #545F6E;   /* açık zeminde ikincil metin            */
  --line:       #DCE1E8;
  --line-dark:  #24476B;

  /* Yazı */
  --f-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --f-body:    "Archivo", system-ui, sans-serif;
  --f-mono:    "IBM Plex Mono", Consolas, monospace;

  --container: 1160px;
}

/* ---------- Taban ---------- */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--brand-deep); text-decoration: none; }

a, button { touch-action: manipulation; }

ul { list-style: none; }

.mono {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
}

section[id] { scroll-margin-top: 104px; }

/* Klavye kullanıcıları için içeriğe atlama bağlantısı */
.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 13px 22px;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
}

.skip-link:focus { top: 0; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.header-in {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 96px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
}

.brand-logo {
  height: 76px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  gap: 26px;
  margin-inline: auto;
}

.site-nav a {
  color: #3A4756;
  font-size: 1.05rem;
  font-weight: 500;
  padding: 12px 2px;
  border-bottom: 2px solid transparent;
  transition: color .18s, border-color .18s;
}

.site-nav a:hover,
.site-nav a.active { color: var(--brand-deep); border-bottom-color: var(--brand); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.lang-switch button {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 0 14px;
  min-height: 42px;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
  font-weight: 500;
}

.header-phone { color: var(--brand-deep); padding: 14px 0; }

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  padding: 0 9px;
}

.menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: #3A4756;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
}

/* Arka plan: bakır iletken fotoğrafı (Pexels, ticari kullanım serbest),
   marka lacivertiyle iki yönlü degrade altında */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(14, 42, 68, 0.62) 0%,
      rgba(14, 42, 68, 0.72) 55%,
      rgba(14, 42, 68, 0.97) 82%),
    linear-gradient(100deg,
      rgba(14, 42, 68, 0.96) 0%,
      rgba(14, 42, 68, 0.82) 45%,
      rgba(14, 42, 68, 0.45) 100%),
    url("../assets/hero-bg.webp") center / cover no-repeat;
}

.hero > * { position: relative; }

.hero-in {
  padding-top: clamp(64px, 10vw, 110px);
}

.eyebrow {
  color: var(--brand-hi);
  margin-bottom: 22px;
}

.hero-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 9vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  margin-bottom: 26px;
}

.hero-title .acc { color: var(--brand-hi); }

/* Hero giriş sekansı: satırlar maske arkasından yükselir,
   diğer öğeler sırayla belirir */
.hero-title .line { display: block; overflow: hidden; }

.hero-title .line > span {
  display: inline-block;
  animation: hero-rise .75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-title .line:nth-child(2) > span { animation-delay: .12s; }

.eyebrow    { animation: hero-fade .5s ease-out both; }
.hero-lead  { animation: hero-fade .6s ease-out .28s both; }
.hero-cta   { animation: hero-fade .6s ease-out .4s both; }
.hero-note  { animation: hero-fade .6s ease-out .52s both; }

@keyframes hero-rise {
  from { transform: translateY(110%); }
}

@keyframes hero-fade {
  from { opacity: 0; transform: translateY(14px); }
}

.hero-lead {
  font-size: 1.13rem;
  color: #B9C3D1;
  max-width: 56ch;
  margin-bottom: 34px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.hero-note {
  margin-top: 26px;
  color: var(--steel);
}

/* Butonlar */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: 8px;
  transition: background .18s, border-color .18s, transform .12s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover { background: var(--brand-deep); }

.btn-ghost {
  border: 1px solid var(--line-dark);
  color: #E7ECF2;
  text-transform: none;
  letter-spacing: 0.04em;
}

.btn-ghost:hover { border-color: var(--brand-hi); color: var(--brand-hi); }

/* Tek hat şeması */

.hero-scheme {
  margin-top: clamp(36px, 6vw, 64px);
}

.hero-scheme svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Şema açılışta kendini çizer (pathLength=1 normalizasyonu) */
.trace {
  fill: none;
  stroke: #2F5478;
  stroke-width: 1.6;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-trace 1.3s ease-in-out .45s both;
}

@keyframes draw-trace {
  to { stroke-dashoffset: 0; }
}

.node {
  fill: var(--brand-hi);
  animation: node-in .4s ease-out 1.1s both;
}

@keyframes node-in {
  from { opacity: 0; }
}

/* Akım: hat boyunca süzülen parlak kuyruklu yıldız
   (dash deseni tüm hatta döşendiği için gecikme sırasında
   opacity ile gizlenir; animasyon boyunca görünür kalır) */
.flow {
  fill: none;
  stroke: var(--spark);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 0.07 0.93;
  opacity: 0;
  animation: flow-comet 4.2s linear 2s infinite;
  filter: drop-shadow(0 0 4px rgba(79, 163, 224, 0.9))
          drop-shadow(0 0 12px rgba(79, 163, 224, 0.45));
}

@keyframes flow-comet {
  0%   { opacity: 1; stroke-dashoffset: 0.07; }
  100% { opacity: 1; stroke-dashoffset: -1; }
}

/* Lamba, akım önünden geçerken yanar (flow ile aynı periyot/faz) */
.lamp {
  animation: draw-trace 1.3s ease-in-out .45s both,
             lamp-glow 4.2s linear 2s infinite;
}

/* Komet ucu lambaya (x=538/1080 ≈ %49.8) τ≈%47'de ulaşır */
@keyframes lamp-glow {
  0%, 42%, 57%, 100% {
    stroke: #2F5478;
    filter: none;
  }
  47%, 51% {
    stroke: var(--spark);
    filter: drop-shadow(0 0 5px rgba(79, 163, 224, 0.9))
            drop-shadow(0 0 14px rgba(79, 163, 224, 0.5));
  }
}

/* Sayılar şeridi */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-dark);
  padding: 30px 0 40px;
  gap: 18px;
}

.stats > div { padding-left: 16px; border-left: 2px solid var(--brand-hi); }

.stats dt {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 2.4rem;
  line-height: 1.1;
  color: #fff;
}

.stats dd {
  font-family: var(--f-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel);
}

/* ---------- Bölüm iskeleti ---------- */

.section { padding: clamp(64px, 9vw, 104px) 0; }

.section-alt { background: #EAEEF2; }

.section-dark {
  background: var(--ink);
  color: #fff;
}

/* Referanslar arka plan görseli (hero gibi) — assets/refs-bg.webp koyun.
   Dosya yoksa degradenin altında düz lacivert zemin kalır (kırık olmaz). */
#referanslar {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

#referanslar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom,
      rgba(14, 42, 68, 0.86) 0%,
      rgba(14, 42, 68, 0.90) 55%,
      rgba(14, 42, 68, 0.96) 100%),
    url("../assets/refs-bg.webp") center / cover no-repeat;
}

/* Bölüm başlığı: şemadaki düğüm noktası motifi */

.sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.sec-node {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2.5px solid var(--brand);
  flex: none;
}

.sec-label {
  color: var(--brand-deep);
  position: relative;
  padding-right: 68px;
}

.sec-label::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 56px;
  height: 1.5px;
  background: var(--brand);
  opacity: 0.5;
}

.section-dark .sec-label { color: var(--brand-hi); }

.section-dark .sec-node { border-color: var(--brand-hi); }

.sec-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.6vw, 3.3rem);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  margin-bottom: 16px;
  max-width: 24ch;
}

.sec-lead {
  color: var(--muted);
  max-width: 62ch;
  margin-bottom: 14px;
}

.section-dark .sec-lead { color: #B9C3D1; }

/* ---------- Hakkımızda ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.values { display: grid; gap: 4px; }

.values li {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  padding: 20px 22px;
}

.values li:first-child { border-radius: 10px 10px 0 0; }
.values li:last-child  { border-radius: 0 0 10px 10px; }

.values h3 {
  font-family: var(--f-display);
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.values p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Markalar ---------- */

.brand-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 34px;
}

.brand-grid li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 20px 18px;
  position: relative;
  transition: border-color .18s, transform .18s;
}

.brand-grid li:hover { border-color: var(--brand); transform: translateY(-3px); }

.brand-logo-wrap {
  height: 44px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.brand-logo-wrap img {
  max-height: 100%;
  max-width: 150px;
  width: auto;
  object-fit: contain;
}

/* Jüpiter logosu optik olarak küçük kaldığından biraz büyütülür */
.brand-logo-wrap img[alt="Jüpiter"] { transform: scale(1.28); }

.brand-name {
  font-family: var(--f-display);
  font-size: 1.45rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.05;
  margin-bottom: 10px;
}

.brand-cat {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Ürünler ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 34px;
}

.product-grid li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px 22px;
  transition: border-color .18s, transform .18s;
}

.product-grid li:hover { border-color: var(--brand); transform: translateY(-3px); }

.product-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  color: var(--brand-deep);
}

.product-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-grid h3 {
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.05;
  margin-bottom: 8px;
}

.product-grid p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Referanslar ---------- */

.ref-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 34px;
}

.ref-grid li {
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  min-height: 112px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity .8s ease-in-out,
              transform .8s ease-in-out;
}

.ref-grid li.ref-out { opacity: 0; transform: translateY(-8px) scale(0.985); }
.ref-grid li.ref-in { animation: ref-in .85s ease-in-out both; }

@keyframes ref-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.ref-name {
  font-family: var(--f-display);
  font-size: 1.35rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.12;
  color: #EAF0F6;
}

/* Logosu olan referans beyaz karta oturur (logo net görünsün) */
.ref-grid li.has-logo {
  background: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  padding: 12px 16px;
}

/* Logo, kartın tüm alanını kullanır; oran korunur (object-fit: contain).
   Geniş logolar genişliğe, kare/dikey logolar yüksekliğe göre sığar. */
.ref-logo {
  max-width: 100%;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.ref-more {
  margin-top: 26px;
  color: var(--steel);
}

/* ---------- İletişim ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(32px, 6vw, 64px);
  align-items: start;
}

.contact-list {
  margin: 26px 0 30px;
  display: grid;
  gap: 16px;
}

.contact-list dt {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-deep);
  margin-bottom: 2px;
}

.contact-list dd { font-size: 1.02rem; font-weight: 500; }

.contact-list dd a {
  color: var(--ink);
  display: inline-block;
  padding: 10px 0;
  margin: -10px 0;
}

.contact-list dd a:hover { color: var(--brand-deep); }

.map-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.map-wrap iframe {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: #B9C3D1;
  padding-top: 56px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 44px;
}

.footer-logo {
  background: var(--card);
  border-radius: 10px;
  padding: 10px 16px;
}

.footer-logo img {
  height: 46px;
  width: auto;
  display: block;
}

.footer-blurb {
  margin-top: 16px;
  font-size: 0.95rem;
  max-width: 34ch;
  color: var(--steel);
}

.site-footer .footer-head {
  font-size: 0.72rem;
  color: var(--brand-hi);
  margin-bottom: 8px;
}

.footer-grid nav { display: grid; align-content: start; }

.footer-grid nav a {
  color: #C9D2DE;
  font-size: 0.93rem;
  width: fit-content;
  padding: 9px 0;
}

.footer-grid nav a:hover { color: var(--brand-hi); }

.footer-contact {
  font-style: normal;
  font-size: 0.93rem;
  display: grid;
  gap: 6px;
  color: #C9D2DE;
}

.footer-contact a {
  color: var(--brand-hi);
  display: inline-block;
  padding: 8px 0;
  margin: -8px 0;
}

.footer-bottom {
  border-top: 1px solid var(--line-dark);
  padding-top: 20px;
  padding-bottom: 24px;
}

.footer-bottom p {
  font-size: 0.7rem;
  color: var(--steel);
  text-transform: none;
  letter-spacing: 0.05em;
}

/* ---------- Görünme animasyonu ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .45s ease-out, transform .45s ease-out;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* JavaScript çalışmıyorsa içerik gizli kalmaz */
.no-js .reveal { opacity: 1; transform: none; }

/* Dokunmatik cihazlarda "yapışan hover" olmasın: karta dokununca
   kart yukarı zıplayıp takılı kalmasın (mobilde garip duruyordu). */
@media (hover: none) {
  .brand-grid li:hover,
  .product-grid li:hover { transform: none; border-color: var(--line); }
}

/* ---------- Duyarlılık ---------- */

@media (max-width: 960px) {
  .brand-grid, .product-grid { grid-template-columns: repeat(2, 1fr); }
  .ref-grid { grid-template-columns: repeat(3, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .header-phone { display: none; }
}

/* Masaüstü menüsü 900px altında sığmıyor → hamburger menüye geç */
@media (max-width: 900px) {
  .menu-btn { display: flex; }

  .header-tools { margin-left: auto; }

  .brand-logo { height: 60px; }

  .site-nav {
    position: absolute;
    top: 96px;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(14, 42, 68, 0.08);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
    display: none;
  }

  .site-nav.open { display: flex; }

  .site-nav a { padding: 12px 0; border-bottom: 0; font-size: 1.05rem; }
}

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .header-in { gap: 16px; }
  .brand-logo { height: 50px; }
  .lang-switch button { padding: 0 10px; }
  .brand-grid, .product-grid { grid-template-columns: 1fr; }
  .ref-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ref-name { font-size: 0.95rem; }
  .map-wrap iframe { height: 320px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Hareket azaltma ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .eyebrow, .hero-title .line > span, .hero-lead, .hero-cta, .hero-note { animation: none; }
  .trace, .lamp, .node { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
  .flow { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .brand-grid li, .product-grid li { transition: none; }
}
