/* ============================================================
   Batınberk Cengiz — personal site
   Terminal / Developer aesthetic · dark+light · electric blue
   ============================================================ */

:root {
  /* DARK (default) ------------------------------------------ */
  --bg: #0a0c10;
  --bg-elev: #0f1218;
  --bg-card: #11141b;
  --border: #1d222c;
  --border-strong: #2a3140;
  --fg: #e6e9ef;
  --fg-muted: #8b93a5;
  --fg-dim: #5a6273;
  --accent: oklch(0.72 0.17 235);        /* electric blue */
  --accent-soft: oklch(0.72 0.17 235 / 0.12);
  --accent-line: oklch(0.72 0.17 235 / 0.35);
  --success: oklch(0.78 0.15 155);
  --warning: oklch(0.82 0.15 85);

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1200px;
  --gutter: clamp(20px, 4vw, 56px);

  --radius: 4px;
  --radius-lg: 10px;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f7f6f3;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --border: #e5e2db;
  --border-strong: #c9c5ba;
  --fg: #14161c;
  --fg-muted: #5a6273;
  --fg-dim: #8a8577;
  --accent: oklch(0.52 0.17 235);
  --accent-soft: oklch(0.52 0.17 235 / 0.10);
  --accent-line: oklch(0.52 0.17 235 / 0.35);

  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

/* Subtle grid background in dark mode */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at 50% 20%, black 40%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, black 40%, transparent 75%);
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--bg); }

/* ------------------------ Layout ------------------------ */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 1;
}

section {
  padding: clamp(80px, 12vh, 140px) 0;
  border-top: 1px solid var(--border);
  position: relative;
}

.section-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-label::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-heading {
  font-family: var(--sans);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 48px;
  max-width: 26ch;
  text-wrap: balance;
}

.section-sub {
  color: var(--fg-muted);
  max-width: 60ch;
  margin-top: -32px;
  margin-bottom: 56px;
  font-size: 15px;
}

/* ------------------------ Nav ------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
}
.nav-logo .dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px color-mix(in oklab, var(--success) 60%, transparent);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}
.nav-links {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 13px;
}
.nav-links a {
  color: var(--fg-muted);
  transition: color 0.15s ease;
  position: relative;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-links a:hover::before { transform: scaleX(1); }

.nav-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.icon-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  border-radius: var(--radius);
  cursor: pointer;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.icon-btn:hover {
  border-color: var(--accent-line);
  color: var(--fg);
  background: var(--accent-soft);
}
.icon-btn svg { width: 14px; height: 14px; }

@media (max-width: 680px) {
  .nav-links { display: none; }
}

/* ------------------------ Hero ------------------------ */
.hero {
  padding-top: clamp(60px, 10vh, 110px);
  padding-bottom: clamp(80px, 12vh, 140px);
  border-top: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.hero-meta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.hero-meta .dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px color-mix(in oklab, var(--success) 70%, transparent);
}

h1.hero-name {
  font-family: var(--sans);
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 18px;
}
h1.hero-name .accent { color: var(--accent); }

.hero-role {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hero-role::before {
  content: ">";
  color: var(--accent);
}

.hero-tagline {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--fg);
  line-height: 1.5;
  max-width: 52ch;
  margin-bottom: 36px;
  text-wrap: pretty;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: transparent;
  color: var(--accent);
}
.btn svg { width: 14px; height: 14px; }

/* Terminal card */
.terminal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 1px 0 0 color-mix(in oklab, white 4%, transparent) inset,
    0 20px 50px -20px rgba(0,0,0,0.5);
  font-family: var(--mono);
}
.term-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in oklab, var(--bg-card) 85%, black);
}
.term-dots { display: flex; gap: 6px; }
.term-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.term-dot.red { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green { background: #28c840; }
.term-title {
  font-size: 12px;
  color: var(--fg-dim);
  margin-left: 8px;
}
.term-body {
  padding: 20px 20px 22px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg);
  min-height: 280px;
}
.term-line { display: block; white-space: pre-wrap; }
.term-prompt { color: var(--accent); }
.term-comment { color: var(--fg-dim); }
.term-str { color: var(--success); }
.term-key { color: var(--warning); }
.term-out { color: var(--fg-muted); padding-left: 2px; }
.term-caret {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ------------------------ About ------------------------ */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}
.about-body p {
  color: var(--fg);
  font-size: 17px;
  line-height: 1.65;
  margin-bottom: 18px;
  max-width: 58ch;
  text-wrap: pretty;
}
.about-body p + p { color: var(--fg-muted); }

.stats {
  display: grid;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.stat { border-bottom: 1px dashed var(--border); padding-bottom: 18px; }
.stat:last-child { border-bottom: none; padding-bottom: 0; }
.stat-value {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-muted);
}

/* ------------------------ Experience (timeline) ------------------------ */
.timeline {
  position: relative;
  padding-left: 32px;
  border-left: 1px solid var(--border-strong);
}
.tl-item {
  position: relative;
  padding-bottom: 48px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 6px;
  width: 13px; height: 13px;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--bg);
}
.tl-period {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-muted);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.tl-role {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.tl-company {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 18px;
}
.tl-bullets {
  list-style: none;
  padding: 0;
}
.tl-bullets li {
  position: relative;
  padding-left: 22px;
  color: var(--fg-muted);
  margin-bottom: 10px;
  line-height: 1.55;
  text-wrap: pretty;
}
.tl-bullets li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
}
.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}
.tl-projects-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-top: 28px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tl-projects-label::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--border-strong);
}
.chip {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-muted);
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.chip:hover {
  border-color: var(--accent-line);
  color: var(--fg);
}

/* ------------------------ Projects ------------------------ */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.projects.single {
  grid-template-columns: 1fr;
}
@media (max-width: 760px) {
  .projects { grid-template-columns: 1fr; }
}
.proj {
  background: var(--bg-card);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.2s ease;
  position: relative;
}
.proj:hover { background: var(--bg-elev); }
.proj:hover .proj-id { color: var(--accent); }
.proj-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.proj-id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  transition: color 0.2s;
}
.proj-metric {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  padding: 3px 8px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  white-space: nowrap;
}
.proj-name {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.proj-desc {
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* ------------------------ Stack ------------------------ */
.stack-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) {
  .stack-wrap { grid-template-columns: 1fr; }
}
.stack-col {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  background: var(--bg-card);
}
.stack-col.experimental { border-style: dashed; }
.stack-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}
.stack-title h3 {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
}
.stack-title .badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 3px 7px;
  background: var(--accent-soft);
  border-radius: 3px;
}
.stack-col.experimental .stack-title .badge {
  color: var(--warning);
  background: color-mix(in oklab, var(--warning) 12%, transparent);
}
.stack-subtitle {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  margin-bottom: 22px;
}

.stack-group {
  padding: 18px 0;
  border-top: 1px dashed var(--border);
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: start;
}
.stack-group:first-of-type { border-top: none; padding-top: 4px; }
.stack-group-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
  padding-top: 4px;
}
.stack-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stack-item {
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--fg);
  background: var(--bg);
  white-space: nowrap;
  transition: all 0.15s ease;
}
.stack-item:hover {
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 520px) {
  .stack-group { grid-template-columns: 1fr; gap: 8px; }
}

/* ------------------------ Contact ------------------------ */
.contact-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 56px);
  background:
    radial-gradient(ellipse at top right, var(--accent-soft), transparent 60%),
    var(--bg-card);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 760px) {
  .contact-card { grid-template-columns: 1fr; }
}
.contact-card h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 16px;
  text-wrap: balance;
}
.contact-card p {
  color: var(--fg-muted);
  max-width: 48ch;
  margin-bottom: 28px;
  text-wrap: pretty;
}
.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contact-actions .btn { justify-content: space-between; min-width: 240px; }

/* ------------------------ Footer ------------------------ */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ------------------------ Reveal animation ------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-stagger.in > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 0.33s; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .term-caret, .nav-logo .dot, .hero-meta .dot { animation: none; }
}
