/* --------UNIVERSAL SELECTOR------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ----------ELEMENT SELECTOR / ROOT VARIABLES------------- */
:root {
  /* -----Backgrounds------ */
  --bg-main:     #f4f4f4;
  --bg-soft:     #f8fafc;
  --bg-gradient: linear-gradient(135deg, #ffffff, #d4f5ee);

  /* ----Text colors */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-dark:      #1e293b;

  /* ----Accent / border colors --- */
  --border:       #2563eb;
  --accent-green: #23bfa0;
  --accent-dark:  #0f172a;

  /* ----Shadows */
  --shadow-sm:  5px 5px 15px rgba(37, 99, 235, 0.18);
  --shadow-md:  0 8px 30px rgba(37, 99, 235, 0.13);

  /* ----Transitions */
  --transition: 0.3s ease;
}

/* ---------- BASE ELEMENTS ---------- */

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  background-color: var(--bg-main);
  color: var(--text-primary);
}

/* --- headings --- */
h1 {
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 900;
  text-align: left;
  word-spacing: 0.2rem;
  line-height: 1.2;
}

h2 {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  margin-bottom: 12px;
}

h3 {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  margin-bottom: 8px;
}

hr {
  border: 3px solid var(--border);
  border-radius: 5px;
  width: 80px;
  margin: 14px 0;
}

p {
  font-family: "Poppins", Arial, sans-serif;
  color: var(--text-primary);
  line-height: 1.7;
  word-spacing: 0.1rem;
}

abbr {
  text-decoration: none;
  font-weight: 600;
}

a {
  font-weight: 500;
  text-decoration: none;
  padding: 5px;
  border-radius: 10px;
}

ul, ol {
  list-style-type: none;
}

nav, li {
  padding: 5px;
}

/* --- table --- */
table {
  width: 100%;
  max-width: 700px;
  margin: auto;
  border-collapse: collapse;
}

thead {
  background: var(--border);
  color: var(--bg-soft);
}

tbody tr:nth-child(even) {
  background: #eef3ff;
}
tbody tr:nth-child(odd) {
  background: #ffffff;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}

/* wrapper so table scrolls on small screens */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  max-width: 700px;
  margin: auto;
}

/* --- iframe --- */
iframe {
  width: 100%;
  max-width: 560px;
  height: 315px;
  display: block;
  margin: auto;
  border-radius: 10px;
}

/* --- fieldset / form base --- */
fieldset {
  background: var(--bg-gradient);
  border: 2px outset var(--border);
  border-radius: 12px;
  padding: 28px;
  max-width: 560px;
  margin: auto;
}

legend {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  padding: 0 8px;
  color: var(--border);
}

label {
  display: block;
  margin-top: 12px;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.9rem;
}

input, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color var(--transition);
}

input:focus, textarea:focus {
  border-color: var(--border);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

button {
  margin-top: 20px;
  padding: 10px 22px;
  border-radius: 10px;
  border: none;
  font-size: 1em;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

/* --- footer --- */
footer {
  background-color: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  padding: 30px 20px;
  width: 100%;
  gap: 10px;
}


/* ============================================================
   CLASS SELECTORS
   ============================================================ */

/* ---- Logo ---- */
.logo {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  transition: var(--transition);
}

.logo:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-sm);
}

/* ---- Header ---- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  background: rgba(244, 244, 244, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #e2e8f0;
}

/* ---- Navbar ---- */
.navbar-links {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.navbar-links ul {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  align-items: center;
}

.navbar-links a {
  color: var(--text-primary);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  transition: background var(--transition), color var(--transition);
}

.navbar-links a:hover,
.navbar-links a.active {
  background: linear-gradient(135deg, #bcedc4, #048f73);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ---- Hamburger button ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-top: 0;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* animated hamburger */
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ---- Button styles ---- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background: var(--border);
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  color: white;
}

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

.btn-outline:hover {
  background: var(--border);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}


/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

/* ---- Section title ---- */
.section-title {
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.light-title {
  color: var(--bg-soft);
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 36px;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}


/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  background: var(--bg-gradient);
  max-width: 1000px;
  margin: 30px auto;
  margin-left: 10%;
  margin-right: 10%;
  padding: 40px 36px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  animation: scrollDown 0.8s ease-in;
  border: 1px solid #e2ecff;
}

.hero-text {
  flex: 1;
  min-width: 240px;
}

.hero-greeting {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
  max-width: none;
}

.hero-span {
  color: var(--border);
  font-weight: 700;
}

.hero-discripion {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
  min-height: 28px;
  max-width: none;
}

.hero-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* --- terminal decoration --- */
.hero-terminal {
  background: #0f172a;
  border-radius: 12px;
  padding: 0;
  min-width: 260px;
  max-width: 320px;
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

.terminal-bar {
  background: #1e293b;
  padding: 9px 14px;
  display: flex;
  gap: 7px;
  align-items: center;
}

.t-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.t-dot.red    { background: #ff5f57; }
.t-dot.yellow { background: #ffbd2e; }
.t-dot.green  { background: #28c940; }

.terminal-body {
  padding: 16px;
  color: #e2e8f0;
  line-height: 1.9;
}
.terminal-body p { color: #e2e8f0; max-width: none; font-size: 0.78rem; }
.t-green { color: #28c940; }
.t-blue  { color: #60a5fa; }
.t-out   { color: #94a3b8; padding-left: 0; }

.cursor-blink {
  display: inline-block;
  animation: blink 1s step-start infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}


/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-section {
  background: var(--bg-gradient);
  max-width: 850px;
  margin: 30px 10%;
  padding: 36px;
  border-radius: 18px;
  border: 1px solid #dce8ff;
  animation: scrollDown 0.8s ease-in;
}

.about-me-container {
  display: flex;
  gap: 30px;
  justify-content: center;
  align-items: center;
}

.profile-img {
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--border);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.about-me {
  flex: 1;
}

.about-me h2 {
  color: var(--border);
  font-size: 1.5rem;
}

.pragraph-about-me {
  font-size: 0.92rem;
  padding: 8px 0;
  border-radius: 10px;
  color: var(--text-secondary);
  max-width: none;
}

.paragraph-span {
  font-weight: 700;
  color: var(--border);
}

.about-socials {
  display: flex;
  gap: 14px;
  margin-top: 14px;
}

.about-socials a {
  color: var(--text-secondary);
  font-size: 1.3rem;
  padding: 8px;
  border-radius: 8px;
  transition: color var(--transition), transform var(--transition);
}

.about-socials a:hover    { transform: translateY(-3px); }
.about-socials .fa-telegram:hover  { color: #24A1DE; }
.about-socials .fa-github:hover    { color: #0f172a; }
.about-socials .fa-x-twitter:hover { color: #0f172a; }


/* ============================================================
   SKILLS SECTION
   ============================================================ */
.skills-section {
  background-color: #0f172a;
  padding: 60px 5%;
}

.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.card {
  background: var(--bg-gradient);
  margin: 0;
  padding: 20px;
  border-radius: 15px;
  border: 1px solid #dde7ff;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-sm);
}

.card-icon {
  font-size: 1.5rem;
  color: var(--border);
  margin-bottom: 10px;
}

.card h2 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.card li, .card ol li {
  font-size: 0.9rem;
  color: var(--border);
  padding: 4px 0;
}

.card li i {
  margin-right: 7px;
  width: 16px;
}

.card ol {
  list-style: decimal;
  padding-left: 18px;
}

.card ol li {
  list-style: decimal;
}

.table-discription {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--bg-soft);
  text-align: center;
  margin: 36px 0 16px;
}

table:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}


/* ============================================================
   PROJECTS SECTION
   ============================================================ */
.projects-section {
  padding: 60px 5%;
  background: var(--bg-soft);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  background: #ffffff;
  border-radius: 15px;
  padding: 24px;
  border: 1px solid #e2e8f0;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-icon {
  font-size: 1.6rem;
  color: var(--border);
}

.project-tag {
  font-size: 0.75rem;
  background: #eff6ff;
  color: var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.project-card h3 {
  font-size: 1rem;
  color: var(--text-primary);
}

.project-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  flex: 1;
}

.project-btns {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}


/* ============================================================
   CTF JOURNEY SECTION
   ============================================================ */
.ctf-section {
  padding: 60px 5%;
  background: #ffffff;
}

.ctf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 40px;
}

.ctf-card {
  background: var(--bg-gradient);
  border-radius: 15px;
  padding: 24px;
  border: 1px solid #dce8ff;
  transition: transform var(--transition), box-shadow var(--transition);
}

.ctf-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-sm);
}

.ctf-card-icon {
  font-size: 1.8rem;
  color: var(--border);
  margin-bottom: 12px;
}

.ctf-card h3 {
  color: var(--text-primary);
  font-size: 1rem;
}

.ctf-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: none;
}

/* stats row */
.ctf-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 28px;
  background: var(--bg-gradient);
  border-radius: 15px;
  border: 1px solid #dce8ff;
}

.stat-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-family: "Poppins", sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--border);
}

.stat-plus {
  font-size: 1.4rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}


/* ============================================================
   SERVICES SECTION
   ============================================================ */
.services {
  padding: 60px 5%;
  background: var(--bg-main);
}

.services-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 44px;
}

.service-item {
  background: #ffffff;
  border-radius: 15px;
  padding: 28px 22px;
  border: 1px solid #e2e8f0;
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.service-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.service-item > i {
  font-size: 2rem;
  color: var(--border);
  margin-bottom: 14px;
  display: block;
}

.service-item h3 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.service-item p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: none;
}

.services-video-wrapper {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.services-discription {
  text-align: center;
  max-width: 260px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.iframe-wrapper {
  flex: 1;
  min-width: 280px;
  max-width: 560px;
}

.iframe-wrapper iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}


/* ============================================================
   CONTACT SECTION
   ============================================================ */
.contact {
  padding: 60px 5%;
  background: var(--bg-soft);
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 160px;
}

.form-group {
  margin-bottom: 6px;
}

.form-error {
  display: block;
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 3px;
  min-height: 18px;
}

.form-success {
  display: none;
  color: #16a34a;
  font-size: 0.9rem;
  margin-top: 12px;
  font-weight: 500;
  max-width: none;
}

fieldset:hover {
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.18);
  transition: var(--transition);
}

.button:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  color: white;
}


/* ============================================================
   FOOTER
   ============================================================ */
.footer-logo {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0.85;
}

footer h4 {
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  color: #fff;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: none;
}

.footer-socials {
  display: flex;
  gap: 16px;
  margin: 8px 0;
}

.footer-socials a {
  color: var(--text-muted);
  font-size: 1.2rem;
  padding: 6px;
  border-radius: 8px;
  transition: color var(--transition), transform var(--transition);
}

.footer-socials a:hover {
  color: var(--accent-green);
  transform: translateY(-2px);
}

.footer-paragraph {
  font-size: 0.82rem;
  color: #475569;
  max-width: none;
}


/* ============================================================
   ICON COLORS
   ============================================================ */
.fa-telegram:hover  { color: #24A1DE; }
.fa-github:hover    { color: #e2e8f0; }
.fa-x-twitter:hover { color: #e2e8f0; }


/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes scrollDown {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}


/* ============================================================
   RESPONSIVE — TABLET (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {

  header {
    flex-wrap: wrap;
    padding: 10px 5%;
    gap: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .navbar-links {
    display: none;
    width: 100%;
    padding: 10px 0;
    border-top: 1px solid #e2e8f0;
  }

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

  .navbar-links ul {
    flex-direction: column;
    width: 100%;
    gap: 4px;
  }

  .navbar-links ul li {
    width: 100%;
  }

  .navbar-links a {
    display: block;
    width: 100%;
    padding: 10px 14px;
  }

  .hero {
    margin: 20px;
    flex-direction: column;
  }

  .hero-text h1 {
    text-align: center;
  }

  hr {
    margin: 14px auto;
  }

  .hero-btns {
    justify-content: center;
  }

  .hero-terminal {
    max-width: 100%;
    width: 100%;
  }

  .about-section {
    margin: 20px;
    padding: 24px;
  }

  .about-me-container {
    flex-direction: column;
    text-align: center;
  }

  .about-socials {
    justify-content: center;
  }

  .profile-img {
    width: 130px;
    height: 130px;
  }

  .contact {
    padding: 40px 5%;
  }

  fieldset {
    margin: 0;
    width: 100%;
    max-width: 100%;
  }

  .ctf-stats {
    gap: 24px;
  }

}


/* ============================================================
   RESPONSIVE — MOBILE (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {

  h1 {
    font-size: 1.4rem;
  }

  .skills-container {
    grid-template-columns: 1fr;
  }

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

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

  .services-cards {
    flex-direction: column;
    align-items: center;
  }

  .service-item {
    max-width: 100%;
  }

  .services-video-wrapper {
    flex-direction: column;
  }

  .services-discription {
    max-width: 100%;
  }

  .form-row {
    flex-direction: column;
  }

  fieldset {
    padding: 16px;
  }

  .ctf-stats {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .hero-terminal {
    font-size: 0.7rem;
  }

}
