/* =====================
   CSS VARIABLES
   ===================== */
:root {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --bg-card-hover: #22262d;
  --border: #30363d;
  --border-hover: #1f6feb;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #1f6feb;
  --accent-dark: #004990;
  --accent-hover: #388bfd;
  --radius: 8px;
  --radius-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'Fira Code', Consolas, monospace;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* =====================
   BASE
   ===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

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

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

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

main {
  flex: 1;
  padding: 48px 0;
}

/* =====================
   HEADER
   ===================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text) !important;
}

.logo-owasp {
  background: var(--accent-dark);
  color: white;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.logo-porto {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.01em;
}

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

header nav a {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
}

header nav a:hover { color: var(--text); }

.header-luma-btn {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: white !important;
  background: var(--accent);
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: background 0.15s;
  white-space: nowrap;
}

.header-luma-btn:hover {
  background: var(--accent-hover);
  color: white !important;
}

/* =====================
   HERO (INDEX PAGE)
   ===================== */
.hero {
  position: relative;
  padding: 72px 0 64px;
  background: linear-gradient(135deg, #0d1117 0%, #0f1b2d 60%, #0d1117 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 111, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 111, 235, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero .container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 56px;
}

.hero-text { flex: 1; }

.hero-img {
  flex: 0 0 auto;
  width: 460px;
}

.hero-img img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Archive callout */
.archive-callout {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(214, 163, 0, 0.1);
  border: 1px solid rgba(214, 163, 0, 0.35);
  color: #d4a520;
  font-size: 1rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.archive-icon { font-size: 1.1rem; }

.hero .container h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #e6edf3 0%, #adbac7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
  max-width: 560px;
  line-height: 1.6;
}

/* Luma CTA */
.luma-cta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 44px;
  padding: 28px 32px;
  background: rgba(31, 111, 235, 0.07);
  border: 1px solid rgba(31, 111, 235, 0.28);
  border-radius: var(--radius-lg);
  max-width: 600px;
}

.luma-cta-label {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.luma-btn {
  display: inline-block;
  background: var(--accent);
  color: white !important;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius);
  transition: background 0.15s, transform 0.15s;
  width: fit-content;
  letter-spacing: -0.01em;
}

.luma-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.hero-stats {
  display: flex;
  gap: 36px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-n {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-l {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* =====================
   SECTION TITLE
   ===================== */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* =====================
   EVENTS GRID
   ===================== */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

/* =====================
   EVENT CARD
   ===================== */
.event-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
}

.event-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 32px rgba(31, 111, 235, 0.12);
  color: var(--text);
}

.card-thumb {
  position: relative;
  height: 165px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.card-num {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 14px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
}

.card-body {
  padding: 18px 20px 22px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.year-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(31, 111, 235, 0.1);
  border: 1px solid rgba(31, 111, 235, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
}

.card-date {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text);
  line-height: 1.3;
}

.card-venue {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.card-talks {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.card-talk-item {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.4;
}

.card-talk-item::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.card-talk-speaker {
  display: block;
  font-size: 0.73rem;
  color: var(--accent);
  opacity: 0.8;
  margin-top: 1px;
}

/* =====================
   BREADCRUMB
   ===================== */
.breadcrumb {
  padding: 20px 0 0;
}

.breadcrumb a {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

/* =====================
   EVENT HERO (EVENT PAGES)
   ===================== */
.event-hero {
  padding: 52px 0 44px;
  background: linear-gradient(135deg, #0d1117 0%, #0f1b2d 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.event-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 111, 235, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 111, 235, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.event-hero .container { position: relative; }

.event-num {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 800;
  color: rgba(31, 111, 235, 0.22);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.event-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
  color: var(--text);
  line-height: 1.15;
}

.decoded {
  font-size: 0.55em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0;
}

.event-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.event-meta-bar .sep { color: var(--border); }

.event-meta-bar a {
  color: var(--accent);
  font-size: 0.88rem;
}

/* =====================
   EVENT CONTENT
   ===================== */
.event-content { padding: 48px 0 16px; }

.event-section { margin-bottom: 52px; }

.event-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* =====================
   AGENDA
   ===================== */
.agenda {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.agenda-item {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 16px;
  padding: 11px 16px;
  border-radius: var(--radius);
  align-items: start;
}

.agenda-item:nth-child(odd) { background: var(--bg-card); }

.agenda-time {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--accent);
  font-weight: 600;
  padding-top: 2px;
  white-space: nowrap;
}

.agenda-desc {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.5;
}

/* =====================
   TALKS
   ===================== */
.talks-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.talk-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 24px 20px;
  position: relative;
  overflow: hidden;
}

.talk-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.talk-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.35;
}

.talk-speaker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.speaker-name {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.92rem;
}

.linkedin-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 4px;
  transition: border-color 0.15s, color 0.15s;
}

.linkedin-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.talk-abstract {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.72;
  margin-bottom: 14px;
}

.speaker-bio {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.speaker-bio summary {
  cursor: pointer;
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}

.speaker-bio summary::-webkit-details-marker { display: none; }

.speaker-bio summary::before {
  content: '▸';
  font-size: 0.68rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.speaker-bio[open] summary::before { transform: rotate(90deg); }

.speaker-bio summary:hover { color: var(--text); }

.bio-content {
  padding: 12px 14px 14px;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.68;
  border-top: 1px solid var(--border);
}

/* =====================
   VIDEOS
   ===================== */
.videos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.video-link::before {
  content: '▶';
  color: #e63946;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.video-link:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  color: var(--text);
}

/* =====================
   PHOTO GALLERY
   ===================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.gallery-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: opacity 0.2s, transform 0.2s;
}

.gallery-img:hover {
  opacity: 0.82;
  transform: scale(1.02);
}

/* =====================
   LIGHTBOX
   ===================== */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.94);
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.active { display: flex; }

.lb-img-wrap {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
}

.lb-close, .lb-prev, .lb-next {
  position: fixed;
  background: rgba(22, 27, 34, 0.9);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}

.lb-close { top: 18px; right: 18px; font-size: 1.6rem; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: rgba(48, 54, 61, 0.95);
  border-color: var(--accent);
}

.lb-counter {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(13, 17, 23, 0.85);
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* =====================
   EVENT NAVIGATION
   ===================== */
.event-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 12px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.event-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}

.event-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.event-nav .spacer { flex: 1; }

/* =====================
   FOOTER
   ===================== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  margin-top: auto;
}

footer p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

footer p:last-child { margin-bottom: 0; }

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

/* =====================
   YEAR CARDS (INDEX PAGE)
   ===================== */
.years-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.year-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
}

.year-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 32px rgba(31, 111, 235, 0.12);
  color: var(--text);
}

.year-card-thumb {
  position: relative;
  height: 165px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.year-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.year-card:hover .year-card-thumb img {
  transform: scale(1.06);
}

.year-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 14px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: white;
}

.year-card-body {
  padding: 18px 20px 22px;
}

.year-card-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.year-events-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.year-event-item {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.4;
}

.year-event-item::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.year-event-date {
  display: block;
  font-size: 0.73rem;
  color: var(--accent);
  opacity: 0.8;
  margin-top: 1px;
}

/* =====================
   YEAR PAGE HERO
   ===================== */
.year-hero {
  padding: 52px 0 44px;
  background: linear-gradient(135deg, #0d1117 0%, #0f1b2d 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.year-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 111, 235, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 111, 235, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.year-hero .container { position: relative; }

.year-hero-num {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.04em;
}

.year-hero-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* =====================
   YEAR NAVIGATION
   ===================== */
.year-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 12px;
  border-top: 1px solid var(--border);
  gap: 12px;
  margin-top: 8px;
}

.year-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}

.year-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.year-nav .spacer { flex: 1; }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 820px) {
  .hero .container {
    flex-direction: column-reverse;
    gap: 32px;
  }

  .hero-img { width: 100%; max-width: 380px; margin: 0 auto; }

  .luma-cta { padding: 20px; }
  .luma-btn { font-size: 1rem; }
  .luma-cta-label { font-size: 1rem; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }

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

  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  header nav { gap: 16px; }

  header nav a:not(:last-child) { display: none; }

  .event-num { font-size: 2.4rem; }

  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }

  .agenda-item { grid-template-columns: 56px 1fr; gap: 10px; }
}
