/* =========================================================
   ROOT VARIABLES
   ========================================================= */
:root {
  --color-bg:          #f5f4f0;
  --color-surface:     #ffffff;
  --color-text:        #1a1a1a;
  --color-text-muted:  #5a5a5a;
  --color-border:      #e0ddd8;

  --color-primary:     #3d5a80;
  --color-primary-dk:  #2c4260;
  --color-accent:      #8b1a1a;

  /* Card accent colors */
  --card-cv:           #7a1010;
  --card-academic:     #d4848a;
  --card-nonacademic:  #3e3e32;
  --card-art:          #6b7a1a;

  --color-success:     #2e7d5e;
  --color-warning:     #b87333;
  --color-error:       #c0392b;

  --radius:            12px;
  --radius-sm:         6px;
  --shadow-sm:         0 2px 8px rgba(0,0,0,.08);
  --shadow-md:         0 6px 24px rgba(0,0,0,.12);
  --shadow-lg:         0 16px 48px rgba(0,0,0,.16);

  --transition:        0.3s ease;
  --wall-transition:   0.7s cubic-bezier(0.4, 0, 0.2, 1);
  --avatar-size:       192px;            /* profil fotoğrafı çapı */
  --avatar-overlap:    calc(var(--avatar-size) / 2); /* wall üstüne binme miktarı */

  --font-sans:         'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* =========================================================
   CONTAINER
   ========================================================= */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   ANA SAYFA BUTONU (alt sayfalar)
   ========================================================= */
.back-home {
  display: block;
  padding: 12px 0 0;
}

.back-home a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  transition: color var(--transition), border-color var(--transition),
              background var(--transition);
}

.back-home a:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: rgba(61,90,128,.06);
  text-decoration: none;
}

/* =========================================================
   WALL SECTION (index.html)
   =========================================================
   Collapsed : %30 yükseklik, object-fit cover.
   Expanded  : 100vh yükseklik, object-fit contain (tam görünür),
               arka plan wall'ın rengiyle aynı (#1a0a08).
   ========================================================= */
.wall-section {
  position: relative;
  width: 100%;
  overflow: hidden;
  height: 30vh;
  min-height: 180px;
  background: #1a0a08;
  cursor: pointer;
  transition: height var(--wall-transition);
}

.wall-section.expanded {
  height: 100vh;
}

.wall-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  display: block;
  transition: opacity 0.6s ease;
}
.wall-img-cover    { opacity: 1; }
.wall-img-contain  { object-fit: contain; opacity: 0; }

/* Expanded: cover ile contain katmanları yumuşakça yer değiştirir */
.wall-section.expanded .wall-img-cover   { opacity: 0; }
.wall-section.expanded .wall-img-contain { opacity: 1; }

.wall-hint {
  position: absolute;
  bottom: 12px;
  right: 20px;
  color: rgba(255,255,255,.7);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity var(--transition);
}

.wall-info {
  position: absolute;
  bottom: 12px;
  left: 20px;
  right: 100px;
  color: rgba(255,255,255,.85);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease 0.4s;
}

.wall-section.expanded .wall-info  { opacity: 1; }
.wall-section.expanded .wall-hint  { opacity: 0; }

/* =========================================================
   PROFILE SECTION (index.html)
   =========================================================
   Normal  : avatar yarısı wall'a biner (negatif margin-top).
   Expanded: wall genişlediğinde margin-top 0'a çekilerek
             avatar wall'ın altına tamamen kayar.
             Aynı anda profile-inner column→row geçişi yapılır.
   ========================================================= */
.profile-section {
  position: relative;
  z-index: 10;
  margin-top: calc(-1 * var(--avatar-overlap));
  padding-bottom: 8px;
  transition: margin-top var(--wall-transition);
}

/* Wall açıkken profil tamamen aşağıya iner */
.wall-section.expanded ~ .profile-section {
  margin-top: 24px;
}

.profile-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

/* Wall açıkken: isim sağa taşınır */
.wall-section.expanded ~ .profile-section .profile-inner {
  flex-direction: row;
  align-items: center;
}

.profile-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  min-width: var(--avatar-size);
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-surface);
  background: #ddd;
  box-shadow: var(--shadow-md);
}

.profile-name {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-text);
}

.bio-text {
  max-width: 640px;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-top: 12px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
}

/* =========================================================
   HOME CARDS (index.html)
   =========================================================
   AR: 1 / 1.25  — başlık üstte, resim başlığın altında
   sola yaslanmış, tam görünür (1:6 oranı korunur, kırpılmaz).
   ========================================================= */
.home-cards {
  padding: 40px 0 64px;
}

.home-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.home-card {
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #fff;
  position: relative;
  aspect-ratio: 1 / 1.25;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.35s ease;
  box-shadow: var(--shadow-md);
}

.home-card:hover {
  transform: translateY(-8px) scale(1.025);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.home-card.card-cv          { background: var(--card-cv); }
.home-card.card-academic    { background: var(--card-academic); }
.home-card.card-nonacademic { background: var(--card-nonacademic); }
.home-card.card-art         { background: var(--card-art); }

.home-card-title {
  padding: 14px 12px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 3px rgba(0,0,0,.3);
  flex-shrink: 0;
  line-height: 1.3;
}

/* Resim alanı: title'ın altını tamamen kapsar.
   İçindeki img yüksekliği 100%, genişliği auto → 1:6 oranı korunur,
   resmin tamamı görünür, sol-üst köşeye hizalanır. */
.home-card-img-wrap {
  flex: 1;
  padding: 0 5px 5px 5px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  min-height: 0;
}

.home-card-img-wrap img {
  height: 100%;
  width: auto;
  max-width: none;
  display: block;
  object-fit: contain;
  object-position: top left;
}

/* =========================================================
   PAGE HEADER (alt sayfalar)
   ========================================================= */
.page-header {
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 36px;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.page-header p {
  margin-top: 10px;
  color: var(--color-text-muted);
  max-width: 640px;
  line-height: 1.7;
}

/* =========================================================
   LICENSE BADGE
   ========================================================= */
.license-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 32px;
  line-height: 1.5;
}

.license-badge .cc-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* =========================================================
   CV PAGE
   ========================================================= */
.cv-page { padding-bottom: 80px; }

.cv-section {
  margin-bottom: 40px;
}

.cv-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 6px;
  margin-bottom: 20px;
}

.cv-intro {
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 720px;
}

.cv-skills-table {
  width: 100%;
  border-collapse: collapse;
}

.cv-skills-table tr td {
  padding: 6px 0;
  vertical-align: top;
}

.cv-skills-table td:first-child {
  font-weight: 600;
  width: 200px;
  color: var(--color-text);
  font-size: 0.9rem;
  white-space: nowrap;
  padding-right: 16px;
}

.cv-skills-table td:last-child {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.cv-entry {
  margin-bottom: 24px;
}

.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}

.cv-entry-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
}

.cv-entry-date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.cv-entry-sub {
  display: flex;
  justify-content: space-between;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
  gap: 4px;
}

.cv-entry ul {
  padding-left: 18px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.cv-entry ul li { margin-bottom: 4px; }

.cv-edu-entry {
  margin-bottom: 20px;
}

.cv-edu-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 2px;
}

.cv-edu-entry .degree {
  font-weight: 700;
  font-size: 0.95rem;
}

.cv-edu-entry .school {
  font-style: italic;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.cv-edu-entry .edu-date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.cv-edu-entry .detail {
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.cv-activity-list {
  list-style: none;
  padding: 0;
}

.cv-activity-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text);
  flex-wrap: wrap;
}

.cv-activity-list li .year {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
  align-self: center;
}

.cv-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 0.88rem;
}

.cv-contact-item { color: var(--color-text-muted); }
.cv-contact-item a { color: var(--color-primary); }

.cv-download-wrap { margin-bottom: 32px; }

/* =========================================================
   ACADEMIC / DOC CARDS
   ========================================================= */
.academic-page  { padding-bottom: 80px; }
.nonacademic-page { padding-bottom: 80px; }

.doc-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
  display: flex;
  gap: 0;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.doc-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.doc-card-preview {
  width: 200px;
  min-width: 200px;
  background: #f0ede8;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.doc-card-preview iframe,
.doc-card-preview object {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: none;
  pointer-events: none;
}

.doc-card-preview .preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-card-preview:hover .preview-overlay {
  background: rgba(0,0,0,.35);
}

.preview-overlay-text {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity var(--transition);
}

.doc-card-preview:hover .preview-overlay-text { opacity: 1; }

.doc-card-body {
  padding: 24px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.doc-card-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  flex: 1;
}

/* =========================================================
   PROJECT CARDS (non-academic)
   ========================================================= */
.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
  display: flex;
  gap: 0;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.project-card-img {
  width: 200px;
  min-width: 200px;
  background: #e8e5e0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.project-card-body {
  padding: 24px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

.project-card-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  flex: 1;
}

/* =========================================================
   ART GALLERY
   =========================================================
   .art-card-img normal: 50vh yükseklik.
   .art-card-img.expanded: 100vh yükseklik.
   Cursor pointer; smooth transition.
   ========================================================= */
.art-page { padding-bottom: 80px; }

.art-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.art-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.art-card:hover {
  box-shadow: var(--shadow-md);
}

.art-card-img {
  width: 100%;
  height: 50vh;
  background: #e8e5e0;
  overflow: hidden;
  cursor: pointer;
  transition: height 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Tıklanınca tüm ekranı kapla */
.art-card-img.expanded {
  height: 100vh;
}

/* Yatay (landscape) resimler:
   kapalıyken sadece üst ~60%'i görünsün, açılınca yana genişleyip tamamı görünsün. */
.art-card-img.is-landscape {
  height: 30vh;
}
.art-card-img.is-landscape.expanded {
  height: var(--expanded-height, 60vh);
  max-height: 100vh;
}

.art-card-img.is-landscape.expanded img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}
.art-card-img.is-landscape img {
  object-fit: cover;
  object-position: center top;
}
.art-card-img.is-landscape.expanded img {
  height: auto;
  max-height: 100vh;
  object-fit: contain;
}

.art-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.55s ease;
}

.art-card-img:hover img {
  transform: scale(1.025);
}

/* Açılma ipucu overlay */
.art-img-hint {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(0,0,0,.45);
  color: rgba(255,255,255,.85);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.art-card-img.expanded .art-img-hint {
  opacity: 0;
}

.art-card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.art-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.art-card-desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition),
              box-shadow var(--transition);
  text-decoration: none;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(61,90,128,.25);
}

.btn-primary:hover {
  background: var(--color-primary-dk);
  box-shadow: 0 4px 16px rgba(61,90,128,.35);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* =========================================================
   MODAL (PDF)
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--color-surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal-box { transform: scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.modal-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--color-text-muted);
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.modal-close:hover { background: var(--color-bg); }

.modal-body {
  flex: 1;
  overflow: hidden;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  min-height: 70vh;
  border: none;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: #1a1a1a;
  color: rgba(255,255,255,.45);
  font-size: 0.78rem;
  text-align: center;
  padding: 24px;
}

.site-footer a { color: rgba(255,255,255,.6); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .home-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .art-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --avatar-size: 140px;
    --avatar-overlap: 70px;
  }

  .wall-section {
    height: 22vh;
    min-height: 140px;
  }

  .home-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .art-card-img          { height: 60vh; }
  .art-card-img.expanded { height: 100vh; }
  .art-card-img.expanded img { object-fit: contain; }

  .doc-card,
  .project-card {
    flex-direction: column;
  }

  .doc-card-preview {
    width: 100%;
    min-width: unset;
    height: 200px;
  }

  .project-card-img {
    width: 100%;
    min-width: unset;
    height: 200px;
  }

  .profile-name { font-size: 1.4rem; }
  .page-header h1 { font-size: 1.5rem; }
  .cv-skills-table td:first-child { width: 130px; }
  .cv-contact-row { gap: 12px; }
  .cv-entry-header { flex-direction: column; }
  .cv-edu-header { flex-direction: column; }
}

@media (max-width: 420px) {
  .home-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}
