/* ============================================================
   bahadirtuncay.com V2 — Bento Grid & Glassmorphism Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=IBM+Plex+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Dark Theme variables (default) */
  --bg: #07090e;
  --bg-gradient: radial-gradient(circle at 50% 0%, #0f1626 0%, #07090e 70%);
  --panel: rgba(13, 20, 35, 0.7);
  --panel-hover: rgba(20, 30, 50, 0.8);
  --panel-border: rgba(255, 255, 255, 0.07);
  --panel-border-hover: rgba(16, 185, 129, 0.3);
  --panel-glow: rgba(16, 185, 129, 0.04);
  --panel-glow-hover: rgba(16, 185, 129, 0.1);
  --ink: #f8fafc;
  --ink-muted: #94a3b8;
  --ink-dim: #64748b;
  --accent: #10b981; /* Premium Emerald */
  --accent-rgb: 16, 185, 129;
  --accent-secondary: #0ea5e9; /* Cyber Cyan */
  --accent-secondary-rgb: 14, 165, 233;
  --btn-text: #050b09;
  --grid-line: rgba(255, 255, 255, 0.02);

  --font-display: "Outfit", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --r: 20px;
  --r-sm: 12px;
  --max-w: 1200px;
  --transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-theme="light"] {
  /* Light Theme variables */
  --bg: #f1f5f9;
  --bg-gradient: radial-gradient(circle at 50% 0%, #e2e8f0 0%, #f1f5f9 70%);
  --panel: rgba(255, 255, 255, 0.8);
  --panel-hover: rgba(255, 255, 255, 0.95);
  --panel-border: rgba(15, 23, 42, 0.09);
  --panel-border-hover: rgba(4, 120, 87, 0.3);
  --panel-glow: rgba(4, 120, 87, 0.02);
  --panel-glow-hover: rgba(4, 120, 87, 0.06);
  --ink: #0f172a;
  --ink-muted: #475569;
  --ink-dim: #94a3b8;
  --accent: #059669; /* Darkened Emerald for contrast */
  --accent-rgb: 5, 150, 105;
  --accent-secondary: #0284c7; /* Darkened Cyan for contrast */
  --accent-secondary-rgb: 2, 132, 199;
  --btn-text: #ffffff;
  --grid-line: rgba(15, 23, 42, 0.015);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background blueprint effect */
.grid-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(circle at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 40%, transparent 100%);
}

.glow-orb {
  position: absolute; width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.08) 0%, transparent 70%);
  top: -100px; left: calc(50% - 200px); pointer-events: none; z-index: 0;
}

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

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* Navigation */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--panel-border);
  padding: 16px 0;
  transition: var(--transition);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.brand-mark {
  background: var(--accent); color: var(--btn-text);
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; font-size: 16px;
}
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-muted);
  padding: 8px 16px; border-radius: 8px; transition: var(--transition);
}
.nav-links a:hover { color: var(--ink); background: var(--panel-border); }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.btn-toggle {
  background: var(--panel); border: 1px solid var(--panel-border);
  color: var(--ink-muted); width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer; transition: var(--transition);
}
.btn-toggle:hover { color: var(--accent); border-color: var(--accent); }

.lang-selector {
  display: flex; border: 1px solid var(--panel-border); border-radius: 8px; overflow: hidden;
  background: var(--panel);
}
.lang-selector a {
  padding: 6px 12px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted);
  transition: var(--transition);
}
.lang-selector a.active { background: var(--accent); color: var(--btn-text); font-weight: 600; }

.burger { display: none; background: transparent; border: none; color: var(--ink); cursor: pointer; }

/* Bento Container */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 120px 0 60px;
}

/* Bento Card base style */
.bento-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--r);
  padding: 30px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: var(--transition);
}
.bento-card:hover {
  transform: translateY(-4px);
  border-color: var(--panel-border-hover);
  box-shadow: 0 10px 40px rgba(var(--accent-rgb), 0.05);
  background: var(--panel-hover);
}
.bento-card::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--r);
  background: radial-gradient(800px circle at var(--x, 0px) var(--y, 0px), var(--panel-glow-hover) 0%, transparent 50%);
  opacity: 0; transition: opacity 0.5s; pointer-events: none; z-index: 1;
}
.bento-card:hover::before { opacity: 1; }

.card-title {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  color: var(--ink-muted); letter-spacing: 0.03em; text-transform: uppercase;
  margin-bottom: 20px; display: flex; align-items: center; gap: 8px;
}
.card-title svg { color: var(--accent); }

/* Bento spans */
.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.row-span-2 { grid-row: span 2; }
.row-span-3 { grid-row: span 3; }

/* 1. Hero Card */
.card-hero {
  grid-column: span 3;
  grid-row: span 2;
  justify-content: center;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-border); border: 1px solid var(--panel-border);
  padding: 6px 14px; border-radius: 99px;
  font-family: var(--font-mono); font-size: 13px; color: var(--accent);
  width: fit-content; margin-bottom: 24px;
}
.hero-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; }
.hero-tag .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--accent); animation: pulse 2s infinite;
}
@keyframes pulse { 0% { transform: scale(0.8); opacity: 0.8; } 100% { transform: scale(2); opacity: 0; } }

.card-hero h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 54px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.card-hero .subtitle {
  font-family: var(--font-mono); font-size: 16px; color: var(--ink-muted); margin-top: 12px;
}
.card-hero p { font-size: 18px; color: var(--ink-muted); margin-top: 24px; max-width: 50ch; font-weight: 300; }

.cta-group { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
  border-radius: 10px; font-family: var(--font-display); font-weight: 500; font-size: 14px;
  cursor: pointer; transition: var(--transition); z-index: 2;
}
.btn-primary { background: var(--accent); color: var(--btn-text); border: 1px solid var(--accent); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary { background: var(--panel-border); border: 1px solid var(--panel-border); color: var(--ink); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* 2. Photo / Monogram Card */
.card-photo { grid-column: span 1; grid-row: span 2; display: flex; flex-direction: column; justify-content: space-between; }
.portrait-container { width: 100%; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--panel-border); border: 1px solid var(--panel-border); }
.portrait-container img { width: 100%; height: 100%; object-fit: cover; }
.portrait-fallback {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(var(--accent-rgb), 0.15) 0%, transparent 60%); gap: 12px;
}
.portrait-fallback .pf-symbol {
  font-family: var(--font-display); font-weight: 700; font-size: 40px; color: var(--accent);
  width: 80px; height: 80px; border-radius: 20px; border: 2px dashed rgba(var(--accent-rgb), 0.3);
  display: grid; place-items: center;
}
.portrait-fallback .pf-text { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); }
.photo-meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); margin-top: 16px; display: flex; justify-content: space-between; }

/* 3. The OT-IT Bridge Card */
.card-bridge { grid-column: span 4; }
.bridge-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 40px; align-items: center; margin-top: 10px; }
.bridge-side { background: rgba(var(--accent-rgb), 0.02); border: 1px solid var(--panel-border); border-radius: var(--r-sm); padding: 24px; }
.bridge-side h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.bridge-side h3 .badge {
  font-family: var(--font-mono); font-size: 10px; padding: 2px 8px; border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.1); border: 1px solid rgba(var(--accent-rgb), 0.2); color: var(--accent);
}
.bridge-side.it h3 .badge {
  background: rgba(var(--accent-secondary-rgb), 0.1); border: 1px solid rgba(var(--accent-secondary-rgb), 0.2); color: var(--accent-secondary);
}
.bridge-side ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.bridge-side li { position: relative; padding-left: 20px; font-size: 14.5px; color: var(--ink-muted); }
.bridge-side li::before {
  content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: bold;
}
.bridge-side.it li::before { color: var(--accent-secondary); }

.bridge-connector-v2 { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bridge-line-v2 { width: 2px; height: 60px; background: linear-gradient(var(--accent), var(--accent-secondary)); }
.bridge-node {
  width: 48px; height: 48px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
  display: grid; place-items: center; color: var(--accent); font-family: var(--font-mono);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.2); font-weight: bold;
}
.bridge-desc { text-align: center; margin-top: 24px; font-size: 18px; font-weight: 400; color: var(--ink); font-family: var(--font-display); }

/* 4. Experience Card (Bento Timeline) */
.card-experience { grid-column: span 2; grid-row: span 3; }
.timeline-v2 { display: flex; flex-direction: column; gap: 24px; margin-top: 10px; }
.time-item { display: flex; gap: 20px; position: relative; }
.time-item:not(:last-child)::after {
  content: ""; position: absolute; left: 6px; top: 20px; bottom: -24px; width: 1.5px; background: var(--panel-border);
}
.time-dot { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--accent); background: var(--panel); z-index: 2; margin-top: 5px; flex-shrink: 0; }
.time-content { display: flex; flex-direction: column; }
.time-period { font-family: var(--font-mono); font-size: 12px; color: var(--accent); margin-bottom: 2px; font-weight: 500; }
.time-role { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.time-company { font-size: 13px; color: var(--ink-muted); margin-bottom: 8px; }
.time-bullets { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.time-bullets li { font-size: 13.5px; color: var(--ink-muted); position: relative; padding-left: 14px; line-height: 1.45; }
.time-bullets li::before { content: "•"; position: absolute; left: 0; color: var(--ink-dim); }

/* 5. Stats Cards (Bento style) */
.card-stat { grid-column: span 1; justify-content: center; align-items: center; text-align: center; }
.stat-num { font-family: var(--font-display); font-size: 48px; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-title { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.05em; }

/* 6. Skills Grid Card */
.card-skills { grid-column: span 2; grid-row: span 2; }
.skills-container { display: flex; flex-direction: column; gap: 16px; }
.skill-group { display: flex; flex-direction: column; gap: 8px; }
.skill-group-title { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; color: var(--ink-dim); letter-spacing: 0.05em; }
.skills-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag {
  background: var(--panel-border); border: 1px solid var(--panel-border);
  padding: 6px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-muted);
  transition: var(--transition); display: flex; align-items: center; gap: 6px;
}
.skill-tag:hover { border-color: var(--accent); color: var(--accent); background: rgba(var(--accent-rgb), 0.03); }
.skill-tag.high { font-weight: 500; color: var(--ink); border-color: rgba(var(--accent-rgb), 0.2); }

/* 7. Education & Languages Card */
.card-edu-lang { grid-column: span 2; }
.edu-lang-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; }
.edu-section, .lang-section { display: flex; flex-direction: column; gap: 16px; }
.edu-row { display: flex; flex-direction: column; gap: 2px; }
.edu-row .school { font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.edu-row .degree { font-size: 13px; color: var(--ink-muted); }
.edu-row .year { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }

.lang-row { display: flex; flex-direction: column; gap: 6px; }
.lang-row .lang-info { display: flex; justify-content: space-between; font-size: 14px; }
.lang-row .lang-level { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); }
.lang-progress-bar { height: 4px; background: var(--panel-border); border-radius: 2px; overflow: hidden; }
.lang-progress { height: 100%; background: var(--accent); border-radius: 2px; width: var(--w); }

/* 8. Interests Card */
.card-interests { grid-column: span 2; }
.interests-grid-v2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.interest-item {
  background: var(--panel-border); border: 1px solid var(--panel-border);
  padding: 16px; border-radius: var(--r-sm); transition: var(--transition);
  display: flex; gap: 12px; align-items: flex-start;
}
.interest-item:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.02); }
.interest-icon {
  width: 36px; height: 36px; border-radius: 8px; background: var(--panel); border: 1px solid var(--panel-border);
  display: grid; place-items: center; color: var(--accent); flex-shrink: 0;
}
.interest-text h4 { font-family: var(--font-display); font-size: 14px; font-weight: 600; }
.interest-text p { font-size: 12px; color: var(--ink-muted); margin-top: 4px; line-height: 1.4; }

/* 9. Contact Card */
.card-contact { grid-column: span 2; justify-content: space-between; }
.contact-info-list { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.contact-item { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-sm); transition: var(--transition); }
a.contact-item:hover { background: var(--panel-border); color: var(--accent); }
.contact-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--panel-border); border: 1px solid var(--panel-border);
  display: grid; place-items: center; color: var(--accent); flex-shrink: 0; transition: var(--transition);
}
a.contact-item:hover .contact-icon { background: var(--panel); border-color: var(--accent); }
.contact-detail .title { font-family: var(--font-mono); font-size: 10px; color: var(--ink-dim); text-transform: uppercase; }
.contact-detail .val { font-size: 15px; font-weight: 500; margin-top: 2px; }

/* Footer */
.footer { border-top: 1px solid var(--panel-border); padding: 24px 0; margin-top: 40px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Reveal Scroll Effect */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(3, 1fr); padding-top: 100px; gap: 16px; }
  
  /* Reset col spans that would exceed 3 columns */
  .col-span-4, .card-bridge, .card-experience, .card-edu-lang, .card-interests, .card-contact {
    grid-column: span 3 !important;
  }
  .card-hero { grid-column: span 2; }
  .card-skills { grid-column: span 2; }
  .card-photo { grid-column: span 1; }
  .card-stat { grid-column: span 1; }
  
  /* Reset height distortion on tablet */
  .row-span-2, .row-span-3 { grid-row: auto !important; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 74px; left: 24px; right: 24px;
    background: var(--bg); /* Solid background to prevent overlapping text readability issues */
    border: 1px solid var(--panel-border); border-radius: var(--r-sm); padding: 16px; gap: 4px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 999;
  }
  .nav-links.open a {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--ink);
    border-bottom: 1px solid var(--grid-line);
  }
  .nav-links.open a:last-child {
    border-bottom: none;
  }
  .burger { display: block; }
  
  .bento-grid { grid-template-columns: 1fr; gap: 16px; padding-top: 90px; }
  
  /* Force all bento items to span 1 column, auto height and reduced padding on mobile */
  .bento-card {
    padding: 20px !important; /* Smaller padding gives more space for content */
  }
  .bento-card, .col-span-1, .col-span-2, .col-span-3, .col-span-4 {
    grid-column: span 1 !important;
    grid-row: auto !important;
  }
  
  .bridge-grid { grid-template-columns: 1fr; gap: 20px; }
  .bridge-connector-v2 { transform: rotate(90deg); margin: 10px 0; height: 40px; justify-content: center; }
  .bridge-line-v2 { height: 30px; }
  .bridge-desc { font-size: 16px; }
  
  .edu-lang-grid { grid-template-columns: 1fr; gap: 24px; }
  .interests-grid-v2 { grid-template-columns: 1fr; }
  
  /* Prevent horizontal overflow of long URLs in contact items */
  .contact-detail .val {
    word-break: break-all;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .nav { padding: 12px 0; }
  .brand { font-size: 17px; }
  .brand-mark { width: 28px; height: 28px; font-size: 14px; }
  .nav-actions { gap: 8px; }
  .btn-toggle { width: 32px; height: 32px; }
  .lang-selector a { padding: 4px 8px; font-size: 11px; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero-tag .dot::after { animation: none; }
  * { transition-duration: 0s !important; animation-duration: 0s !important; }
}

@media print {
  body { background: #fff; color: #000; font-size: 11px; }
  .nav, .grid-overlay, .glow-orb, .cta-group, .btn-toggle, .lang-selector, .burger { display: none !important; }
  .bento-grid { display: flex; flex-direction: column; gap: 15px; padding-top: 20px; }
  .bento-card { background: #fff !important; border: 1px solid #ddd !important; border-radius: 8px !important; box-shadow: none !important; padding: 15px !important; break-inside: avoid; }
  .bridge-side { background: #fff !important; border: 1px solid #ddd !important; }
  .time-dot { border-color: #000 !important; }
  .lang-progress-bar { border: 1px solid #ddd !important; background: #fff !important; }
  .lang-progress { background: #000 !important; }
}
