/* ============================
   Base
============================ */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f4f7fb;
  --bg-alt: #eaf0f8;
  --text: #1f2937;
  --muted: #5f6b7a;
  --card: #ffffff;
  --accent: #1f4f8d;
  --accent-2: #2b6cb0;
  --header: #0f172a;
  --header-text: #e6edf7;
  --border: #dbe3ef;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

body.dark-mode {
  --bg: #0b1220;
  --bg-alt: #111a2e;
  --text: #e5ecf7;
  --muted: #b3bfd0;
  --card: #172235;
  --accent: #8db8ff;
  --accent-2: #79a9fb;
  --header: #070d18;
  --header-text: #dbe7fb;
  --border: #2a3a57;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

/* ============================
  Typography + Layout
============================ */

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg-alt));
  transition: background 0.3s ease, color 0.3s ease;
}

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

/* ============================
   Header + Navigation
============================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header);
  box-shadow: var(--shadow);
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--header-text);
}

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

.nav a {
  color: var(--header-text);
  opacity: 0.9;
}

.nav a:hover {
  opacity: 1;
  color: var(--accent);
}

#theme-toggle,
#mobile-menu {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--header-text);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}

#mobile-menu {
  display: none;
}

/* ============================
   Hero
============================ */

.hero {
  min-height: 68vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 72px 16px;
  color: #ffffff;
  background:
    linear-gradient(130deg, rgba(15, 23, 42, 0.94), rgba(31, 79, 141, 0.88)),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.16), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.12), transparent 30%);
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 52px);
  letter-spacing: 0.4px;
}

.subtitle {
  margin: 10px 0;
  font-weight: 600;
  opacity: 0.96;
}

.hero-summary {
  margin: 0 auto 20px;
  max-width: 760px;
  opacity: 0.95;
}

.cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

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

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

.hero .btn-outline {
  color: #fff;
  border-color: #fff;
}

/* ============================
   Sections
============================ */

.section {
  padding: 64px 16px;
}

.section.alt {
  background: rgba(255, 255, 255, 0.35);
}

body.dark-mode .section.alt {
  background: rgba(255, 255, 255, 0.03);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(24px, 4vw, 32px);
}

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

.small {
  font-size: 0.92rem;
}

/* ============================
   About
============================ */

.about-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

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

.socials a {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
}

/* ============================
   Profile
============================ */

.profile-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 18px;
  align-items: start;
}

.profile-card,
.profile-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#profile-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #dbe3ef;
}

.profile-form .card-actions {
  margin-top: 4px;
}

.profile-form input:disabled,
.profile-form textarea:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

/* ============================
   Skills
============================ */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.skill {
  padding: 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.skill-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(31, 79, 141, 0.12);
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.level-90 {
  width: 90%;
}

.level-85 {
  width: 85%;
}

.level-80 {
  width: 80%;
}

.level-75 {
  width: 75%;
}

.level-70 {
  width: 70%;
}

/* ============================
   Projects
============================ */

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

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

.card-body {
  padding: 16px;
}

.card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.card p {
  margin: 10px 0;
  color: var(--muted);
}

.project-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.project-meta span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.82rem;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-small {
  font-size: 0.92rem;
  padding: 8px 12px;
}

/* ============================
   Contact Form
============================ */

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

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

input,
textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

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

/* ============================
   Footer
============================ */

.footer {
  background: var(--header);
  color: var(--header-text);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.back-to-top {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  color: var(--header-text);
  padding: 6px 10px;
}

/* ============================
   Responsive
============================ */

@media (max-width: 720px) {
  #mobile-menu {
    display: block;
  }

  .nav .links {
    display: none;
    position: absolute;
    right: 12px;
    top: 58px;
    width: min(74vw, 290px);
    padding: 12px;
    border-radius: 14px;
    background: var(--header);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: flex-start;
  }

  .nav .links.show {
    display: flex;
  }

  .nav .links a,
  .nav .links button {
    width: 100%;
    text-align: left;
  }

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

  .profile-layout {
    grid-template-columns: 1fr;
  }
}
