/* Tema: açık / koyu — tasarım referanslarına uygun değişkenler */
:root,
[data-theme="light"] {
  --bg: #ffffff;
  --bg-muted: #f8f9fa;
  --bg-elevated: #f3f4f6;
  --text: #111827;
  --text-muted: #4b5563;
  --accent: #4f46e5;
  --label: #0d9488;
  --border: #d1d5db;
  --header-bg: rgba(255, 255, 255, 0.85);
  --btn-primary-fg: #ffffff;
  --btn-outline-fg: var(--accent);
  --cta-top: linear-gradient(90deg, var(--accent), #7c3aed);
  --shadow: 0 18px 50px -24px rgba(17, 24, 39, 0.25);
  --shadow-card: 0 10px 40px -20px rgba(17, 24, 39, 0.18);
  --radius: 12px;
  --radius-lg: 16px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --max-w: 1120px;
}

[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-muted: #12161f;
  --bg-elevated: #151a24;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #a5a6f6;
  --label: #5eead4;
  --border: #1e293b;
  --header-bg: rgba(11, 14, 20, 0.88);
  --btn-primary-fg: #0b0e14;
  --btn-outline-fg: var(--text);
  --cta-top: linear-gradient(90deg, #5eead4, var(--accent));
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 12px 40px -18px rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

body.loaded {
  opacity: 1;
}

body.loading {
  opacity: 0;
}

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

.container {
  width: min(100% - 2.5rem, var(--max-w));
  margin-inline: auto;
}

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

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
  margin: 0 0 1rem;
}

.eyebrow--center {
  text-align: center;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
  max-width: min(100% - 2.5rem, calc(var(--max-w) + 2rem));
  margin-inline: auto;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

#logoImg {
  height: 100px;
  max-width: 320px;
  width: auto;
  display: block;
  object-fit: contain;
}

#footerLogoImg {
  height: 60px;
  max-width: 240px;
  width: auto;
  display: block;
  object-fit: contain;
}

.logo--footer {
  color: var(--text);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
  padding: 0.25rem 0;
}

.nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
  transform-origin: right;
}

.nav a:hover,
.nav a.active {
  color: var(--accent);
}

.nav a:hover::after,
.nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Reveal on Scroll */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.lang-btn {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: color 0.2s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  color: var(--accent);
}

.lang-sep {
  opacity: 0.3;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-icon {
  display: grid;
  place-items: center;
}

.theme-icon[hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .logo {
    flex: 1; /* Pushes actions to the right */
  }

  #logoImg {
    height: clamp(48px, 12vw, 64px) !important;
    max-width: 120px;
  }

  .nav {
    order: 3; /* Forces nav to the next line */
    width: 100%;
    justify-content: flex-start;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(var(--border), 0.1);
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .header-actions {
    order: 2;
  }
}

/* Sections */
.section {
  padding: clamp(6rem, 12vw, 8rem) 0 clamp(4rem, 10vw, 6.5rem);
  scroll-margin-top: 130px;
}

.hero {
  padding-top: clamp(3rem, 8vw, 5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-visual {
  max-width: 460px;
  justify-self: end;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
    max-width: 360px;
    margin-inline: auto;
    justify-self: center;
  }
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}

.hero-desc {
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:hover {
  opacity: 0.92;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--btn-primary-fg);
  border: 2px solid transparent;
}

.btn-outline {
  background: transparent;
  color: var(--btn-outline-fg);
  border: 4px solid var(--accent);
}

.hero-photo-wrap {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-photo {
  width: 100%;
  aspect-ratio: 520 / 620;
  object-fit: cover;
  background: var(--bg-elevated);
}

/* About */
.about {
  background: var(--bg-muted);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about-heading {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}

.about-body {
  color: var(--text-muted);
}

.about-body p {
  margin: 0 0 1rem;
}

.about-body p:last-child {
  margin-bottom: 0;
}

/* Skills */
.section-head {
  margin-bottom: 2.5rem;
}

.section-head--center {
  text-align: center;
}

.section-head--center h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.section-head--row h2 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.75rem, 3vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.link-arrow {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
}

.link-arrow:hover {
  text-decoration: underline;
}

/* Skills Filters */
.skills-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.02em;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.skills-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

.skill-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.125rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1), 0 0 10px rgba(99, 102, 241, 0.1);
}

.skill-icon-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--accent);
  transition: all 0.3s ease;
}

.skill-card:hover .skill-icon-wrap {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: scale(1.1) rotate(5deg);
}

.skill-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.skill-name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.skill-cat {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

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

.project-code-icon {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}

.project-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.project-desc {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.project-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tags li {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--label);
  border: 1px solid var(--border);
}

[data-theme="dark"] .project-tags li {
  color: var(--accent);
}

/* CTA */
.cta .container {
  max-width: min(100% - 2.5rem, 900px);
}

.cta-box {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 3.5rem) clamp(1.5rem, 4vw, 2.5rem);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px -15px rgba(17, 24, 39, 0.1);
  position: relative;
  overflow: hidden;
}

.cta-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cta-top);
}

.cta-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.cta-desc {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.cta-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.cta-email:hover {
  text-decoration: underline;
}

.cta-socials {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
}

.cta-socials a {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
}

.cta-socials a:hover {
  color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  background: var(--bg-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copy {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}
