/* =====================================================================
   1. VARIABLES
   ===================================================================== */
:root {
  --primary: #4da6ff;
  --secondary: #4dff88;
  --text: #f2f2f2;
  --text-dim: #b8b8b8;
  --heading: #292424;
  --bg: #000000;
  --card-bg: #121212;
  --card-border: #262626;
  --head-font: Poppins, Inter, sans-serif;
  --body-font: Inter, sans-serif;

  --container-width: 1100px;
  --gap-sm: 12px;
  --gap-md: 24px;
  --gap-lg: 48px;
  --radius: 12px;
}

/* =====================================================================
   2. RESET / BASE
   ===================================================================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--body-font);
  line-height: 1.55;
  background-color: var(--bg);
  color: var(--text);
  font-size: 16px;
}

html {
  scroll-behavior: smooth;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* =====================================================================
   3. TYPOGRAPHY
   ===================================================================== */
h1, h2, h3 {
  font-family: var(--head-font);
  line-height: 1.15;
  margin: 0 0 0.4em 0;
  font-weight: 700;
}

h1 { font-size: clamp(2.4rem, 7vw, 4.5rem); }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

p {
  margin: 0 0 0.8em 0;
  color: var(--text-dim);
}

time {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--secondary);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* =====================================================================
   4. LAYOUT / SECTIONS
   ===================================================================== */
main {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px 40px;
}

.section-block {
  margin-top: var(--gap-lg);
  scroll-margin-top: 90px;
}

#skills,
#home {
  scroll-margin-top: 90px;
}

.section-head {
  display: inline-block;
  position: relative;
  margin-bottom: var(--gap-md);
}

.section-head::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -8px;
  left: 0;
  background-color: var(--text);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

.section-head:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* =====================================================================
   5. NAV
   ===================================================================== */
header {
  background-color: var(--bg);
  padding: 16px 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--card-border);
}

.navigator {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 18px;
  border-radius: 100rem;
  text-decoration: none;
  color: whitesmoke;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  transition: box-shadow .3s, color .3s, background .3s;
  white-space: nowrap;
}

.nav-link:hover {
  box-shadow: 0 0 40px #e1eab6ce;
  color: var(--bg);
  background: var(--text);
}

/* =====================================================================
   6. PROFILE HEADER
   ===================================================================== */
.profile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--gap-lg);
  margin-top: var(--gap-lg);
  text-align: center;
}

.profile {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform .3s, box-shadow .3s;
}

.profile:hover {
  transform: scale(1.05);
  box-shadow: 0 0 60px #e1eab6ce;
}

.profile-info {
  max-width: 480px;
}

@media (min-width: 700px) {
  .profile-header {
    text-align: left;
    justify-content: flex-start;
  }
}

/* =====================================================================
   7. SKILLS
   ===================================================================== */
#skills {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: var(--gap-lg);
}

.skill-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.skill-icons i {
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--primary);
  transition: color .3s ease-in, text-shadow .3s ease-in;
}

.skill-icons i:hover {
  color: var(--secondary);
  text-shadow: 0 0 40px #a6e3a1;
}

/* =====================================================================
   8. CARDS (shared by Projects / Writeups / Achievements)
   ===================================================================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  display: block;
  text-decoration: none;
  transition: border-color .25s, transform .25s;
}

.card:hover {
  border-color: var(--secondary);
  transform: translateY(-3px);
}

.card h3 {
  color: var(--text);
}

.card p {
  margin-bottom: 0.6em;
}

.empty-state {
  color: var(--text-dim);
  font-style: italic;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 100rem;
  background: rgba(77, 166, 255, 0.12);
  color: var(--primary);
  border: 1px solid rgba(77, 166, 255, 0.35);
}

/* ---- Projects grid ---- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap-md);
}

.project-card .card-body {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.card-img {
  width: 100%;
  border-radius: 8px;
}

@media (min-width: 700px) {
  .project-card .card-body {
    flex-direction: row;
    align-items: flex-start;
  }
  .card-img {
    width: 45%;
    flex-shrink: 0;
  }
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
}

.card-links a {
  color: var(--primary);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color .25s, text-shadow .25s;
}

.card-links a:hover {
  color: var(--secondary);
  text-shadow: 0 0 20px #a6e3a1;
}

.hashgen {
  margin-bottom: 14px;
}

#shaInput {
  background-color: transparent;
  border: none;
  border-bottom: 1px solid var(--card-border);
  color: var(--primary);
  padding: 10px 0;
  font-size: 1.1rem;
  width: 100%;
  outline: none;
  font-weight: bold;
}

#shaInput.hashed {
  color: var(--secondary);
  font-weight: bold;
}

#shaInput::placeholder {
  color: #f1e7c891;
}

/* ---- Writeups & Achievements lists ---- */
.writeups-list,
.achievements-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap-md);
}

.issuer {
  color: var(--secondary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

/* =====================================================================
   9. TIMELINE
   ===================================================================== */
.timeline-track {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--card-border);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--gap-lg);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -33px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 12px var(--secondary);
}

.timeline-content h3 {
  color: var(--text);
}

/* =====================================================================
   10. CONNECT / FOOTER
   ===================================================================== */
#connect {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--gap-lg) 20px;
}

#connect p {
  margin: 10px 0;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text);
}

#connect a {
  color: var(--secondary);
  text-decoration: none;
}

#connect a:hover {
  text-decoration: underline;
}

#connect i {
  color: var(--secondary);
  margin-right: 10px;
}

.copyright {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding-bottom: 24px;
}

/* =====================================================================
   11. ACCESSIBILITY
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
}
