/* ==========================================================================
   Enes Turan — Speaking Archive Stylesheet
   Modern Developer + Professional Speaker Portfolio (Dark Theme)
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root {
  --bg-primary: #0a0b0e;
  --bg-secondary: #12131a;
  --bg-tertiary: #191b26;
  --bg-card: #13151f;
  --bg-card-hover: #181b28;
  --bg-glass: rgba(18, 19, 26, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-highlight: rgba(56, 189, 248, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-muted: #475569;

  --accent-primary: #38bdf8;       /* Tailwind sky-400 */
  --accent-secondary: #818cf8;     /* Indigo-400 */
  --accent-glow: rgba(56, 189, 248, 0.15);
  --badge-bg: rgba(56, 189, 248, 0.1);
  --badge-text: #7dd3fc;
  --badge-border: rgba(56, 189, 248, 0.25);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);

  --max-width: 1200px;
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.05), transparent 45%),
    radial-gradient(circle at 100% 30%, rgba(129, 140, 248, 0.03), transparent 30%);
  background-attachment: fixed;
}

/* --- Accessibility & Focus Styles --- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--accent-primary);
  color: #000;
  padding: 10px 18px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--transition-fast);
  text-decoration: none;
}

.skip-link:focus {
  top: 20px;
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

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

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

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

/* --- Header & Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color var(--transition-base);
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-name {
  color: var(--text-primary);
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--badge-text);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.social-link svg {
  display: inline-block;
  opacity: 0.85;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.social-link:hover svg {
  opacity: 1;
  transform: translateY(-1px);
}

/* --- Hero Section --- */
.hero-section {
  padding: 100px 24px 70px;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.hero-content {
  max-width: 820px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  margin-bottom: 24px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  padding: 6px 14px;
  border-radius: 999px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  display: inline-block;
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.hero-title .name {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text-primary);
}

.hero-title .tagline {
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-secondary);
}

.hero-description {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 680px;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background-color: var(--text-primary);
  color: var(--bg-primary);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 999px;
  transition: all var(--transition-base);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.cta-button:hover {
  background-color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(56, 189, 248, 0.25);
}

.arrow-down {
  font-size: 1.1rem;
  transition: transform var(--transition-fast);
}

.cta-button:hover .arrow-down {
  transform: translateY(3px);
}

/* --- Archive Section --- */
.archive-section {
  padding: 80px 24px 100px;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

.event-counter {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* --- Dynamic Year Filters --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.filter-btn {
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--bg-tertiary);
}

.filter-btn.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

/* --- Event Cards Grid --- */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 32px;
}

.event-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  text-align: left;
}

.event-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-highlight);
}

/* Event Image Container */
.card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: var(--bg-tertiary);
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.event-card:hover .card-img {
  transform: scale(1.03);
}

/* Tasteful CSS Placeholder */
.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #161822 0%, #1e2233 100%);
  color: var(--text-tertiary);
  position: relative;
  user-select: none;
}

.placeholder-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 4px 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.placeholder-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.photo-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(10, 11, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
}

.demo-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(245, 158, 11, 0.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  z-index: 2;
}

/* Event Content */
.card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.card-date {
  white-space: nowrap;
}

.card-city {
  text-align: right;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-event-name {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card-talk-title {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
  font-style: normal;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--bg-card);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  margin: 20px 0;
}

.empty-state.hidden {
  display: none;
}

.empty-icon {
  margin-bottom: 16px;
  color: var(--text-tertiary);
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto;
}

.empty-state code {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
}

/* --- About Section --- */
.about-section {
  padding: 80px 24px;
  background: linear-gradient(180deg, transparent 0%, rgba(18, 19, 26, 0.6) 100%);
  border-top: 1px solid var(--border-subtle);
}

.about-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 48px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: start;
}

.about-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.about-title {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.about-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-text {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.button-link:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.external-icon {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* --- Modal Dialog (Detail View & Gallery) --- */
.event-modal {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 900px;
  width: calc(100% - 32px);
  margin: auto;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-medium);
  overflow: hidden;
  color: var(--text-primary);
}

.event-modal::backdrop {
  background-color: rgba(5, 6, 10, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-inner {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(10, 11, 14, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  z-index: 10;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

/* Modal Gallery */
.modal-gallery {
  width: 100%;
  background: #08090d;
  display: flex;
  flex-direction: column;
}

.gallery-stage {
  width: 100%;
  height: 420px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #06070a;
  overflow: hidden;
}

.gallery-stage-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #06070a;
}

.gallery-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.gallery-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.gallery-arrow:hover:not(:disabled) {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.gallery-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gallery-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.gallery-thumbnails {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  overflow-x: auto;
  background: #0a0b10;
}

.gallery-thumb {
  width: 72px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.6;
  transition: all var(--transition-fast);
  background: var(--bg-tertiary);
}

.gallery-thumb.active {
  border-color: var(--accent-primary);
  opacity: 1;
}

.gallery-thumb:hover {
  opacity: 1;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal Information Area */
.modal-info {
  padding: 32px;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-date {
  color: var(--accent-primary);
}

.modal-city {
  color: var(--text-secondary);
}

.modal-event-name {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 20px;
}

.modal-talk-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.talk-box-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-secondary);
  margin-bottom: 6px;
}

.modal-talk-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
}

.modal-extra {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-description {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.modal-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-topic-tag {
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--text-secondary);
}

.modal-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.modal-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  transition: all var(--transition-fast);
}

.modal-ext-link:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--accent-primary);
}

/* --- Footer --- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  padding: 32px 24px;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 0.9rem;
  color: var(--text-tertiary);
}

.back-to-top {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.back-to-top:hover {
  color: var(--accent-primary);
}

/* --- Responsive Breakpoints --- */
@media (max-width: 900px) {
  .about-card {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px;
  }
  
  .gallery-stage {
    height: 320px;
  }
}

@media (max-width: 640px) {
  .hero-section {
    padding: 60px 20px 40px;
  }

  .archive-section {
    padding: 50px 20px 70px;
  }

  .events-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .header-container {
    padding: 14px 20px;
  }

  .nav-links {
    gap: 14px;
  }

  .about-card {
    padding: 24px;
  }

  .modal-info {
    padding: 20px;
  }

  .gallery-stage {
    height: 240px;
  }
}
