/* ============================================================
   Emre Kesici — Portfolio
   Design tokens, light/dark theme, responsive layout
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --surface: #ffffff;
  --text: #1a1d24;
  --text-muted: #5b6472;
  --border: #e4e7ec;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --max: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  --bg: #0d1017;
  --bg-alt: #12161f;
  --surface: #161b26;
  --text: #e7eaf0;
  --text-muted: #9aa4b2;
  --border: #262d3a;
  --accent: #8b84ff;
  --accent-hover: #a29bff;
  --accent-soft: rgba(139, 132, 255, 0.14);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1017;
    --bg-alt: #12161f;
    --surface: #161b26;
    --text: #e7eaf0;
    --text-muted: #9aa4b2;
    --border: #262d3a;
    --accent: #8b84ff;
    --accent-hover: #a29bff;
    --accent-soft: rgba(139, 132, 255, 0.14);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

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

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

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }

.accent { color: var(--accent); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em; color: var(--text); }
.brand-dot { color: var(--accent); }
.nav-menu { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-menu a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav-menu a:hover { color: var(--text); }

.theme-toggle, .nav-toggle {
  background: none; border: none; cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  font-size: 1.05rem; transition: background var(--transition), border-color var(--transition);
}
.theme-toggle:hover { background: var(--bg-alt); border-color: var(--accent); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: 1px solid transparent; transition: all var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
  padding: 88px 24px 72px;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; font-weight: 700;
  color: var(--accent); margin-bottom: 18px;
}
.hero-title { font-size: clamp(2.6rem, 6vw, 4.2rem); margin-bottom: 22px; }
.hero-lead { font-size: 1.15rem; color: var(--text-muted); max-width: 30rem; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }
.hero-stats { display: flex; gap: 40px; list-style: none; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.7rem; font-weight: 800; }
.hero-stats span { font-size: 0.85rem; color: var(--text-muted); }

.hero-visual { position: relative; height: 380px; }
.orb {
  position: absolute; inset: 10% 8%; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 70%);
  opacity: 0.5; filter: blur(6px); animation: float 8s ease-in-out infinite;
}
.card-float {
  position: absolute; background: var(--surface); border: 1px solid var(--border);
  padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 0.9rem;
  box-shadow: var(--shadow); animation: float 6s ease-in-out infinite;
}
.card-1 { top: 8%; left: 6%; animation-delay: 0s; }
.card-2 { top: 44%; right: 2%; animation-delay: 1.2s; }
.card-3 { bottom: 8%; left: 18%; animation-delay: 2.4s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ---------- Sections ---------- */
.section { padding: 80px 24px; }
.section:nth-of-type(even) { background: var(--bg-alt); border-radius: 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 44px; }
.section-num { color: var(--accent); font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 44px; }
.about-text p { margin-bottom: 18px; color: var(--text-muted); font-size: 1.05rem; }
.about-facts {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); align-self: start;
}
.about-facts h3 { font-size: 1.05rem; margin-bottom: 18px; }
.about-facts dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 0.95rem; }
.about-facts dt { color: var(--text-muted); font-weight: 500; }
.about-facts dd { text-align: right; font-weight: 600; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.skill-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.skill-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.skill-card h3 { font-size: 1.1rem; margin-bottom: 16px; }
.skill-card ul { list-style: none; }
.skill-card li { padding: 6px 0 6px 20px; position: relative; color: var(--text-muted); font-size: 0.95rem; }
.skill-card li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

/* ---------- Projects ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.project-card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.project-tag {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  padding: 4px 12px; border-radius: 100px; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px;
}
.project-top h3 { font-size: 1.25rem; margin-bottom: 12px; }
.project-card > p { color: var(--text-muted); margin-bottom: 20px; flex-grow: 1; }
.project-stack { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-bottom: 18px; }
.project-stack li {
  font-size: 0.78rem; background: var(--bg-alt); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 6px; color: var(--text-muted); font-weight: 500;
}
.project-links a { font-weight: 600; font-size: 0.92rem; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; position: relative; padding-left: 8px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding: 0 0 36px 40px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
  position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--accent);
}
.timeline-date { color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.timeline-content h3 { font-size: 1.2rem; margin: 6px 0 4px; }
.timeline-org { color: var(--text-muted); font-weight: 600; font-size: 0.92rem; margin-bottom: 8px; }
.timeline-content > p:last-child { color: var(--text-muted); }

/* ---------- Contact ---------- */
.contact-wrap { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; }
.contact-intro p { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 26px; }
.contact-links { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.contact-links a { font-weight: 600; font-size: 1rem; }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field input, .field textarea {
  font-family: inherit; font-size: 0.98rem; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition); resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-status { font-size: 0.9rem; font-weight: 600; min-height: 1.2em; }
.form-status.success { color: #16a34a; }
.form-status.error { color: #dc2626; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-inner p { color: var(--text-muted); font-size: 0.9rem; }
.back-to-top { font-weight: 600; font-size: 0.9rem; }

/* ---------- Reveal on scroll ---------- */
.section, .hero-content { opacity: 1; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
  .hero-visual { display: none; }
  .about-grid, .contact-wrap { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 24px 20px; transform: translateY(-140%); transition: transform var(--transition);
    align-items: stretch;
  }
  .nav-menu.open { transform: translateY(0); }
  .nav-menu li { padding: 8px 0; border-bottom: 1px solid var(--border); }
  .nav-menu li:last-child { border-bottom: none; padding-top: 12px; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 480px) {
  .hero-stats { gap: 24px; }
  .section { padding: 56px 20px; }
}
