/* ============================================================
   Portfolio — style.css
   Author: Deepika Panthee
   Description: Custom styles for personal portfolio site.
   Layout: Flexbox (header/nav/form) + CSS Grid (about/projects)
   Palette: slate navy / teal accent / light gray background
   ============================================================ */

/* ---------- 1. CSS Variables (cohesive color palette) ---------- */
:root {
  --bg: #f8fafc;          /* page background */
  --surface: #ffffff;     /* cards / form background */
  --text: #1e293b;        /* main body text */
  --muted: #64748b;       /* secondary text */
  --heading: #0f172a;     /* headings / header background */
  --primary: #0f766e;     /* teal - links, buttons */
  --primary-dark: #115e59;/* teal hover */
  --accent: #14b8a6;      /* accent border / highlights */
  --border: #e2e8f0;      /* card borders */
  --radius: 12px;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --max-width: 1100px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- 2. Reset (no browser-default layouts) ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
}

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

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ---------- 3. Reusable container ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Skip link for keyboard / screen-reader users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--heading);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- 4. Header + Navigation (Flexbox) ---------- */
.site-header {
  background-color: var(--heading);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand h1 {
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.brand .tagline {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: #cbd5e1;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.95rem;
}

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

/* ---------- 5. Main sections ---------- */
main section {
  padding: 3.5rem 0;
}

main section + section {
  border-top: 1px solid var(--border);
}

h2 {
  font-size: 1.9rem;
  color: var(--heading);
  margin-bottom: 1.25rem;
  line-height: 1.25;
}

h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 0.5rem;
}

h3 {
  font-size: 1.15rem;
  color: var(--heading);
  margin-bottom: 0.75rem;
}

section > .container > p,
.about-text p {
  color: var(--text);
  margin-bottom: 1rem;
  max-width: 65ch;
}

/* ---------- 6. Hero (portrait on top + animated name) ---------- */
.hero {
  text-align: center;
  background: var(--surface);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.hero-img {
  width: 240px;
  height: 240px;
  margin-top: 0.5rem;
}

.hero-name {
  font-size: 2.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0;
  color: var(--heading);
}

.hero-name::after {
  display: none;
}

.hero-name span {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px);
  animation: letter-in 0.55s ease forwards;
}

.hero-name .hero-space {
  width: 0.5em;
}

.hero-name span:nth-child(1) { animation-delay: 0.05s; }
.hero-name span:nth-child(2) { animation-delay: 0.12s; }
.hero-name span:nth-child(3) { animation-delay: 0.19s; }
.hero-name span:nth-child(4) { animation-delay: 0.26s; }
.hero-name span:nth-child(5) { animation-delay: 0.33s; }
.hero-name span:nth-child(6) { animation-delay: 0.40s; }
.hero-name span:nth-child(7) { animation-delay: 0.47s; }
.hero-name span:nth-child(8) { animation-delay: 0.54s; }
.hero-name span:nth-child(9) { animation-delay: 0.61s; }
.hero-name span:nth-child(10) { animation-delay: 0.68s; }
.hero-name span:nth-child(11) { animation-delay: 0.75s; }
.hero-name span:nth-child(12) { animation-delay: 0.82s; }
.hero-name span:nth-child(13) { animation-delay: 0.89s; }
.hero-name span:nth-child(14) { animation-delay: 0.96s; }
.hero-name span:nth-child(15) { animation-delay: 1.03s; }

@keyframes letter-in {
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-role {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

/* ---------- 7. About layout (single column, hero holds portrait) ---------- */
.about-grid {
  display: block;
  max-width: 800px;
}

.profile-img {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 6px solid var(--surface);
  outline: 4px solid var(--accent);
  outline-offset: 4px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.18);
  justify-self: center;
  align-self: center;
}

/* Skills in 3 aesthetic columns */
.skills {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.skills-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.skill-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  text-align: center;
}

.skill-group dt {
  font-weight: 700;
  color: var(--heading);
  margin: 0 auto 0.7rem;
  font-size: 1rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.2rem;
  width: fit-content;
  display: block;
}

.skill-group dd {
  display: inline-block;
  background: #ccfbf1;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 0.2rem 0.9rem;
  margin: 0 0.3rem 0.45rem 0;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ---------- 7. Projects layout (CSS Grid cards) ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.project-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.project-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.project-body p {
  color: var(--muted);
  font-size: 0.96rem;
}

/* Button-style link */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  margin-top: auto;
  width: fit-content;
}

.btn:hover,
.btn:focus {
  background: var(--primary-dark);
  color: #fff;
  text-decoration: none;
}

/* ---------- 8. Contact form (Flexbox) ---------- */
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  max-width: 640px;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-weight: 600;
  color: var(--heading);
  font-size: 0.93rem;
}

.form-group input,
.form-group textarea {
  font: inherit;
  padding: 0.7rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: 2px solid var(--accent);
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
}

button[type="submit"] {
  font: inherit;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  align-self: flex-start;
}

button[type="submit"]:hover,
button[type="submit"]:focus {
  background: var(--primary-dark);
}

/* ---------- 9. Footer ---------- */
.site-footer {
  background: var(--heading);
  color: #cbd5e1;
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.9rem;
}

/* ---------- 10. Responsive: tablet + mobile (media queries) ---------- */
@media (max-width: 800px) {
  .hero-name {
    font-size: 1.9rem;
  }

  .profile-img {
    width: 220px;
    height: 220px;
    margin: 0 auto;
  }

  .skills-columns {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

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

  main section {
    padding: 2.5rem 0;
  }
}

@media (max-width: 560px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav ul {
    gap: 1rem;
    flex-wrap: wrap;
  }

  h2 {
    font-size: 1.55rem;
  }

  .hero-name {
    font-size: 1.5rem;
    letter-spacing: 0.08em;
  }

  .contact-form {
    padding: 1.25rem;
  }

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

  button[type="submit"],
  .btn {
    width: 100%;
    text-align: center;
  }
}
