/* ==========================================================================
   Portfolio styles
   Sections: 1 Base · 2 Header · 3 Home layout · 4 Cards · 5 Inner pages
             6 Education · 7 Footer · 8 Interactive widgets · 9 Responsive
   ========================================================================== */

/* ---------- 1. BASE ---------- */
:root {
  --ink: #fff;
  --muted: #d1d5db;
  --accent: #60a5fa;
  --panel: rgba(0, 0, 0, 0.55);
  --line: rgba(255, 255, 255, 0.15);
  --line-strong: rgba(255, 255, 255, 0.2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font: 18px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Dark overlay on top of the background GIF. */
  background:
    linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)),
    url("../images/background.gif") center / cover fixed;
}

h1, h2, h3 { margin: 0; line-height: 1.15; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); }
a { color: var(--accent); }

/* Keeps anchored sections from hiding under the sticky header. */
section[id] { scroll-margin-top: 90px; }

/* ---------- 2. HEADER ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

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

.logo { font-weight: 800; color: var(--ink); text-decoration: none; }

nav { display: flex; gap: 24px; }
nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
nav a:hover,
nav a[aria-current="page"] { color: var(--accent); }

/* ---------- 3. HOME LAYOUT: SIDEBAR + MAIN ---------- */
.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

.sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
}
.sidebar h2 { font-size: 1.4rem; }
.sidebar h3 {
  font-size: 1rem;
  text-align: left;
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
.sidebar ul {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  text-align: left;
  font-size: 0.95rem;
  color: var(--muted);
}
.sidebar li { padding: 3px 0; overflow-wrap: anywhere; }

.photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
}
.role { color: var(--accent); font-weight: 600; margin: 4px 0 24px; }

main section { padding: 0 0 48px; }
main h2 { font-size: 1.8rem; margin-bottom: 20px; }
main p { color: var(--muted); }

.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.hero p { color: var(--muted); max-width: 45ch; margin: 14px 0 26px; }
#greeting { color: var(--accent); font-weight: 600; margin: 0 0 6px; }

.btn {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- 4. CARDS ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
.card p { margin: 8px 0; }
.card small { color: var(--accent); font-weight: 600; }

.card-link {
  display: block;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s;
}
.card-link:hover { transform: translateY(-4px); border-color: var(--accent); }

.card-img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* ---------- 5. INNER PAGES (projects, education) ---------- */
.page { max-width: 800px; margin: 0 auto; padding: 40px 20px 60px; }
.page h1 { font-size: 2.4rem; margin-bottom: 10px; }
.page h2 { font-size: 1.5rem; margin: 40px 0 16px; }
.intro { color: var(--muted); margin: 0 0 14px; }

.crumb { display: inline-block; margin-bottom: 20px; font-weight: 600; text-decoration: none; }
.crumb:hover { text-decoration: underline; }

.info-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 28px; }
.info-row div {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 16px;
}
.info-row strong { color: var(--accent); font-size: 0.85rem; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.gallery figure { margin: 0; }
.gallery img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  cursor: zoom-in; /* every gallery image opens in the lightbox (see main.js) */
}
.gallery figcaption { margin-top: 6px; font-size: 0.85rem; color: #9ca3af; }

.box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 20px;
}
.page .box h2 { font-size: 1.3rem; margin: 0 0 12px; }
.box p { margin: 0; color: var(--muted); }

.tasks { list-style: none; padding: 0; margin: 0; }
.tasks li { position: relative; padding: 6px 0 6px 30px; color: var(--muted); }
.tasks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
}
.project-nav a { font-weight: 600; text-decoration: none; }
.project-nav a:hover { text-decoration: underline; }

/* ---------- 6. EDUCATION TIMELINE ---------- */
.timeline { border-left: 3px solid var(--accent); padding-left: 28px; }

.edu-item {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}
.edu-item::before {
  content: "";
  position: absolute;
  left: -40px;
  top: 26px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
}
.edu-item h3 { margin: 6px 0 4px; }
.edu-year { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.edu-school { font-weight: 600; margin: 0; }

/* ---------- 7. FOOTER ---------- */
footer {
  padding: 30px 5%;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line-strong);
  background: var(--panel);
}
footer p { margin: 4px 0; }
.footer-title { color: var(--ink); font-weight: 600; font-size: 1rem; }

/* ---------- 8. INTERACTIVE WIDGETS (created by main.js) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- 9. RESPONSIVE ---------- */
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
}
