/* ============================================================
   PARSIAN OIL REFINING CO. — style.css
   Variables, base styles, animations, utilities
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Lora:ital,wght@0,400;0,500;1,400&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --color-bg:        #0A0E1A;
  --color-bg-2:      #0D1220;
  --color-bg-3:      #111827;
  --color-gold:      #C8963E;
  --color-gold-light:#E0B060;
  --color-gold-dark: #A07020;
  --color-steel:     #1E3A5F;
  --color-steel-2:   #243B5A;
  --color-text:      #E8E4DC;
  --color-text-muted:#A09880;
  --color-separator: #2A3550;
  --color-green:     #2E7D5E;
  --color-green-2:   #3A9970;
  --color-white:     #FFFFFF;

  --font-display:    'Cormorant Garamond', Georgia, serif;
  --font-body:       'Lora', Georgia, serif;
  --font-mono:       'JetBrains Mono', 'Courier New', monospace;

  --nav-height:      72px;
  --transition-base: all 0.3s ease;
  --transition-slow: all 0.6s ease;
  --shadow-gold:     0 4px 24px rgba(200, 150, 62, 0.15);
  --shadow-card:     0 8px 32px rgba(0, 0, 0, 0.4);
  --border-radius:   4px;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-3);
}
::-webkit-scrollbar-thumb {
  background: var(--color-gold);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-light);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-text);
  line-height: 1.2;
  font-weight: 600;
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }

p {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: var(--transition-base);
}
a:hover { color: var(--color-gold-light); }

/* ── Blueprint / Grid Background Pattern ── */
.blueprint-bg {
  background-image:
    linear-gradient(var(--color-separator) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-separator) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: 0 0;
}

.blueprint-bg-subtle {
  background-image:
    linear-gradient(rgba(42, 53, 80, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 53, 80, 0.3) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ── Gold Decorative Line ── */
.gold-line {
  border-top: 3px solid var(--color-gold);
}

.gold-line-left {
  border-left: 3px solid var(--color-gold);
  padding-left: 1.25rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.section-divider {
  width: 60px;
  height: 3px;
  background: var(--color-gold);
  margin: 1rem 0 2rem 0;
}

.section-divider-center {
  width: 60px;
  height: 3px;
  background: var(--color-gold);
  margin: 1rem auto 2rem auto;
}

/* ── Fade-In Scroll Animation ── */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; }

/* ── Hero Sections ── */
.hero-fullscreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-page {
  min-height: 45vh;
  display: flex;
  align-items: flex-end;
  position: relative;
  padding-bottom: 3rem;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10, 14, 26, 0.92) 0%,
    rgba(30, 58, 95, 0.75) 50%,
    rgba(10, 14, 26, 0.88) 100%
  );
  z-index: 1;
}

.hero-overlay-dark {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 14, 26, 0.7) 0%,
    rgba(10, 14, 26, 0.85) 60%,
    rgba(10, 14, 26, 0.98) 100%
  );
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero-bg-parallax {
  will-change: transform;
}

.hero-content {
  position: relative;
  z-index: 2;
}

/* ── Counters (Statistics) ── */
.counter-number {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  color: var(--color-gold);
  display: block;
  line-height: 1;
}

.counter-unit {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--color-gold-light);
  margin-left: 0.25rem;
}

.counter-label {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

/* ── Stats Band ── */
.stats-band {
  background: var(--color-steel);
  border-top: 1px solid var(--color-separator);
  border-bottom: 1px solid var(--color-separator);
  padding: 3rem 0;
}

.stat-item {
  text-align: center;
  padding: 1rem 2rem;
  border-right: 1px solid rgba(200, 150, 62, 0.2);
}

.stat-item:last-child {
  border-right: none;
}

/* ── Animated Gold Line (horizontal) ── */
@keyframes goldLineExpand {
  from { width: 0; opacity: 0; }
  to   { width: 100%; opacity: 1; }
}

.gold-line-animated {
  height: 2px;
  background: linear-gradient(90deg, var(--color-gold), transparent);
  animation: goldLineExpand 1.2s ease forwards;
}

/* ── Navbar ── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  transition: var(--transition-base);
  background: transparent;
}

#navbar.scrolled {
  background: rgba(10, 14, 26, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--color-separator);
}

/* ── Progress Bars ── */
.progress-bar-track {
  background: var(--color-separator);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
  transition: width 1.5s ease;
  width: 0%;
}

.progress-bar-fill.green {
  background: linear-gradient(90deg, var(--color-green), var(--color-green-2));
}

.progress-bar-fill.animated {
  /* width set by JS */
}

/* ── Table Styling ── */
.table-porc {
  width: 100%;
  border-collapse: collapse;
}

.table-porc thead tr {
  background: var(--color-steel);
  border-bottom: 2px solid var(--color-gold);
}

.table-porc thead th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gold);
}

.table-porc tbody tr {
  border-bottom: 1px solid var(--color-separator);
  transition: var(--transition-base);
}

.table-porc tbody tr:hover {
  background: rgba(30, 58, 95, 0.3);
}

.table-porc tbody td {
  padding: 0.875rem 1.25rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.table-porc tbody td:first-child {
  color: var(--color-text);
  font-weight: 500;
}

/* ── Section Backgrounds ── */
.section-dark  { background: var(--color-bg); }
.section-dark2 { background: var(--color-bg-2); }
.section-dark3 { background: var(--color-bg-3); }
.section-steel { background: var(--color-steel); }
.section-separator { background: var(--color-separator); }

/* ── Breadcrumb ── */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb a {
  color: var(--color-text-muted);
}
.breadcrumb a:hover {
  color: var(--color-gold);
}

.breadcrumb .separator {
  color: var(--color-gold);
}

/* ── Flowchart (Opérations) ── */
.flow-step {
  background: var(--color-steel-2);
  border: 1px solid var(--color-separator);
  border-top: 3px solid var(--color-gold);
  padding: 1.5rem;
  text-align: center;
  position: relative;
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
  font-size: 1.5rem;
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-gold), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
  padding-left: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.4rem;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-gold);
  border: 2px solid var(--color-bg);
  box-shadow: 0 0 0 3px rgba(200, 150, 62, 0.2);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-gold);
  letter-spacing: 0.1em;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 0.25rem;
}

.timeline-text {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* ── Orgchart ── */
.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.org-level {
  display: flex;
  justify-content: center;
  gap: 1rem;
  position: relative;
  width: 100%;
}

.org-box {
  background: var(--color-steel-2);
  border: 1px solid var(--color-separator);
  border-top: 3px solid var(--color-gold);
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 160px;
  position: relative;
}

.org-box-top {
  border-top-color: var(--color-gold);
}

.org-connector {
  width: 2px;
  height: 40px;
  background: var(--color-gold);
  margin: 0 auto;
}

.org-h-line {
  height: 2px;
  background: var(--color-gold);
  margin-bottom: 0;
}

.org-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.org-role {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* ── Partner Sections ── */
.partner-badge {
  border: 2px solid var(--color-gold);
  padding: 0.5rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-gold);
  display: inline-block;
}

/* ── Utility Classes ── */
.text-gold { color: var(--color-gold); }
.text-steel { color: var(--color-steel); }
.text-muted { color: var(--color-text-muted); }
.text-mono { font-family: var(--font-mono); }
.text-display { font-family: var(--font-display); }
.bg-dark { background-color: var(--color-bg); }
.bg-dark2 { background-color: var(--color-bg-2); }
.border-gold { border-color: var(--color-gold); }

.container-porc {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-py { padding: 5rem 0; }
.section-py-sm { padding: 3rem 0; }

/* ── Responsive ── */
@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.8rem; }
  h3 { font-size: 1.5rem; }
  .section-py { padding: 3rem 0; }
  .stat-item { border-right: none; border-bottom: 1px solid rgba(200, 150, 62, 0.2); }
  .stat-item:last-child { border-bottom: none; }
}
