:root {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --card: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #4e87e3;
  --accent-2: #dbe4f0;
  --border: #334155;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --maxw: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

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

.container {
  width: 90%;
  max-width: var(--maxw);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* Hero */
.hero {
  padding: 90px 0 70px;
  background: radial-gradient(1000px 500px at 20% 10%, rgba(56, 189, 248, 0.15), transparent),
              radial-gradient(900px 450px at 80% 30%, rgba(167, 139, 250, 0.12), transparent);
}

.eyebrow { color: var(--accent); font-weight: 600; margin: 0 0 6px; }

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  margin: 0 0 8px;
  line-height: 1.1;
}

.lead { font-size: 1.2rem; color: var(--muted); margin: 0 0 12px; }

.hero-text { max-width: 600px; color: var(--muted); }

.hero-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, color 0.2s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0f172a;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-small { padding: 6px 14px; font-size: 0.9rem; }

/* Sections */
.section { padding: 70px 0; }

.section-alt { background: var(--bg-soft); }

.section-title {
  font-size: 1.9rem;
  margin: 0 0 30px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.about-card h3 { margin-top: 0; color: var(--accent); }

.tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.project-card:hover { transform: translateY(-4px); }

.project-thumb {
  height: 150px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}

.project-thumb::before { content: attr(data-label); font-size: 1.1rem; }

.project-body { padding: 18px; }

.project-body h3 { margin: 0 0 8px; font-size: 1.1rem; }

.project-body p { color: var(--muted); font-size: 0.92rem; margin: 0 0 12px; }

.project-links { display: flex; gap: 14px; }

.project-links a { font-size: 0.9rem; font-weight: 600; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.contact-info p { color: var(--muted); }
.contact-info a { font-weight: 600; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-form input,
.contact-form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Footer */
.site-footer {
  padding: 30px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

#cookieStatus { font-size: 0.8rem; opacity: 0.7; }

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-soft);
    padding: 16px 20px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .nav-links.open { display: flex; }

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

@media (max-width: 480px) {
  .hero { padding: 60px 0 50px; }
  .section { padding: 50px 0; }
}

/* Modal CV */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.modal.open { display: block; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  height: 85vh;
  margin: 5vh auto 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 2;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
}

#cvFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 768px) {
  .modal-content { width: 96%; height: 80vh; }
}
