/* =========================================================
   Portfolio — style.css
   Sections: 1 Variables  2 Base  3 Background  4 Nav
             5 Hero  6 Sections  7 Cards/Timeline
             8 Projects/Modal  9 Contact 10 Footer
            11 Animations 12 Responsive
   ========================================================= */

/* ---------- 1. Variables ---------- */
:root {
  --bg: #07080c;
  --bg-alt: #0a0c12;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-glow: rgba(120, 200, 255, 0.35);
  --text: #eef1f6;
  --text-muted: #9aa3b2;
  --accent: #4fd1ff;
  --accent-2: #8b7bff;
  --accent-3: #37e6c0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: #04121a; padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1.4rem; border-radius: 999px; border: 1px solid var(--border);
  font-family: var(--font-display); font-size: 0.92rem; font-weight: 600;
  cursor: pointer; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    background 0.3s var(--ease), border-color 0.3s var(--ease), opacity 0.3s;
  background: var(--surface); color: var(--text);
}
.btn:hover { transform: translateY(-2px); border-color: var(--border-glow); box-shadow: 0 10px 30px rgba(79, 209, 255, 0.15); }
.btn--primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #050a12; border-color: transparent;
}
.btn--primary:hover { box-shadow: 0 12px 34px rgba(79, 209, 255, 0.32); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 0.55rem 1rem; font-size: 0.82rem; }
.btn.is-disabled,
a[data-link].is-disabled {
  opacity: 0.45; cursor: not-allowed; pointer-events: none;
}

/* ---------- 3. Background layers ---------- */
.bg-grid, .bg-glow, .bg-particles { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.bg-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
}
.bg-glow { filter: blur(120px); opacity: 0.5; }
.bg-glow--a {
  background: radial-gradient(420px 420px at 15% 10%, rgba(79,209,255,0.35), transparent 70%);
  animation: drift 24s ease-in-out infinite alternate;
}
.bg-glow--b {
  background: radial-gradient(460px 460px at 85% 30%, rgba(139,123,255,0.3), transparent 70%);
  animation: drift 30s ease-in-out infinite alternate-reverse;
}
@keyframes drift { from { transform: translate3d(0,0,0); } to { transform: translate3d(-4%, 6%, 0); } }

/* ---------- 4. Navbar ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(7, 8, 12, 0.35);
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}
.navbar.is-scrolled { background: rgba(7, 8, 12, 0.82); border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; }
.logo { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.02em; display: flex; gap: 0.5rem; align-items: center; }
.logo-mark { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1.15rem; flex-wrap: wrap; }
.nav-links a { font-size: 0.87rem; color: var(--text-muted); position: relative; transition: color 0.25s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after, .nav-links a.is-active::after { width: 100%; }
.nav-links a.is-active { color: var(--accent); }
.nav-resume { color: #050a12 !important; font-size: 0.82rem; padding: 0.55rem 1rem; }
.nav-resume::after { display: none; }

.hamburger {
  display: none; flex-direction: column; gap: 5px; background: transparent;
  border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem; cursor: pointer;
}
.hamburger span { width: 20px; height: 2px; background: var(--text); transition: transform 0.3s var(--ease), opacity 0.2s; }
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 5. Hero ---------- */
.hero {
  min-height: 100svh; display: flex; align-items: center; position: relative;
  padding: 8rem 0 5rem; text-align: center;
}
.hero-inner { max-width: 860px; margin-inline: auto; }
.hero-eyebrow {
  display: inline-block; font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--border); background: var(--surface);
  padding: 0.4rem 0.9rem; border-radius: 999px;
}
.hero-title {
  font-size: clamp(2.6rem, 8vw, 5.2rem); font-weight: 700; letter-spacing: -0.03em;
  background: linear-gradient(120deg, #ffffff 25%, var(--accent) 60%, var(--accent-2) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-role { font-family: var(--font-display); font-size: clamp(1rem, 2.4vw, 1.35rem); color: var(--text); }
.hero-role span { color: var(--accent); margin: 0 0.35rem; }
.hero-tagline { color: var(--text-muted); max-width: 620px; margin-inline: auto; }
.hero-actions { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }
.social-row { display: flex; gap: 1.4rem; justify-content: center; margin-top: 2rem; }
.social { font-size: 0.86rem; color: var(--text-muted); transition: color 0.25s, transform 0.25s; }
.social:hover { color: var(--accent); transform: translateY(-2px); }

.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  width: 22px; height: 36px; border: 1px solid var(--border); border-radius: 12px;
}
.scroll-hint span {
  display: block; width: 3px; height: 7px; border-radius: 3px; background: var(--accent);
  margin: 6px auto; animation: scrollDot 1.8s infinite;
}
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translateY(12px); } }

/* ---------- 6. Sections ---------- */
.section { padding: 6rem 0; position: relative; }
.section--alt { background: linear-gradient(180deg, transparent, var(--bg-alt) 15%, var(--bg-alt) 85%, transparent); }
.section-head { margin-bottom: 3rem; }
.section-kicker { font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.4rem; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -0.02em; }

/* ---------- 7. Cards, About, Timeline ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; backdrop-filter: blur(10px);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-glow); box-shadow: var(--shadow); background: var(--surface-strong); }
.card h3 { font-size: 1.02rem; }
.card p { color: var(--text-muted); margin: 0; font-size: 0.92rem; }

.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 3rem; align-items: start; }
.about-visual { border-radius: 22px; overflow: hidden; border: 1px solid var(--border); position: relative; }
.about-visual::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(7,8,12,0.75));
}
.about-visual img { width: 100%; max-height: 520px; object-fit: cover; transition: transform 0.6s var(--ease); }
.about-visual:hover img { transform: scale(1.05); }
.about-content p { color: var(--text-muted); }
.info-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.8rem; }

.skills-groups { display: grid; gap: 2.5rem; }
.skill-group h3 { font-size: 1.05rem; color: var(--accent); letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.85rem; }
.skill-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.skill-card { display: flex; gap: 0.9rem; align-items: flex-start; }
.skill-icon {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(140deg, rgba(79,209,255,0.18), rgba(139,123,255,0.18));
  border: 1px solid var(--border); font-size: 1.05rem;
}
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.meta { font-size: 0.8rem; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; }

.timeline { position: relative; padding-left: 1.8rem; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item::before {
  content: ""; position: absolute; left: -1.8rem; top: 1.6rem; width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(79, 209, 255, 0.14);
}
.timeline-item h3 { margin-bottom: 0.2rem; }
.timeline-item ul { margin-top: 0.7rem; display: grid; gap: 0.35rem; }
.timeline-item li { color: var(--text-muted); font-size: 0.9rem; padding-left: 1rem; position: relative; }
.timeline-item li::before { content: "▹"; position: absolute; left: 0; color: var(--accent-3); }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }
.tag {
  font-size: 0.74rem; letter-spacing: 0.04em; padding: 0.25rem 0.6rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted); background: rgba(255,255,255,0.03);
}
.empty-note { color: var(--text-muted); font-style: italic; }

/* ---------- 8. Projects & Modal ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.filter-btn {
  padding: 0.5rem 1rem; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font-size: 0.83rem; cursor: pointer;
  transition: all 0.3s var(--ease);
}
.filter-btn:hover { color: var(--text); border-color: var(--border-glow); }
.filter-btn.is-active { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #050a12; border-color: transparent; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.5rem; }
.project-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project-card.is-hidden { display: none; }
.project-card.is-filtering { opacity: 0; transform: translateY(12px); }
.project-media { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--border); }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.project-card:hover .project-media img { transform: scale(1.06); }
.project-body { padding: 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.project-body h3 { margin: 0; font-size: 1.2rem; }
.project-features { margin-top: 0.4rem; display: grid; gap: 0.3rem; }
.project-features li { font-size: 0.86rem; color: var(--text-muted); padding-left: 1rem; position: relative; }
.project-features li::before { content: "•"; position: absolute; left: 0; color: var(--accent); }
.project-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 1rem; }

.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 5, 9, 0.75); backdrop-filter: blur(6px); animation: fade 0.25s ease; }
.modal-panel {
  position: relative; width: min(100%, 820px); max-height: 88vh; overflow-y: auto;
  background: #0b0e15; border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
  animation: modalIn 0.35s var(--ease);
}
.modal-close {
  position: sticky; top: 0.7rem; left: calc(100% - 3.2rem); z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: rgba(10,12,18,0.9); color: var(--text); font-size: 1.3rem; cursor: pointer;
}
.modal-body { padding: 0 1.6rem 1.8rem; }
.modal-body img { border-radius: 14px; border: 1px solid var(--border); margin-bottom: 1.2rem; }
.modal-body h2 { font-size: 1.6rem; }
.modal-body h4 { margin: 1.2rem 0 0.3rem; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.modal-body p, .modal-body li { color: var(--text-muted); font-size: 0.93rem; }
.modal-body ul { display: grid; gap: 0.3rem; }
.modal-body li { padding-left: 1rem; position: relative; }
.modal-body li::before { content: "▹"; position: absolute; left: 0; color: var(--accent-3); }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
body.no-scroll { overflow: hidden; }

/* ---------- 9. Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; align-items: start; }
.contact-form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-size: 0.82rem; color: var(--text-muted); letter-spacing: 0.05em; }
.field input, .field textarea {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem; color: var(--text); font-family: inherit; font-size: 0.95rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,209,255,0.15); }
.field .error { color: #ff8a8a; font-size: 0.78rem; margin: 0; min-height: 1em; }
.form-status { font-size: 0.88rem; margin: 0; }
.form-status.success { color: var(--accent-3); }
.form-status.error { color: #ff8a8a; }
.contact-side { display: grid; gap: 1rem; }
.contact-side a { color: var(--accent); word-break: break-word; }

.resume-panel {
  text-align: center; border: 1px solid var(--border); border-radius: 24px; padding: 3rem 1.6rem;
  background: radial-gradient(700px 220px at 50% 0%, rgba(79,209,255,0.12), transparent 70%), var(--surface);
  backdrop-filter: blur(10px);
}
.resume-panel p { color: var(--text-muted); max-width: 560px; margin-inline: auto; }

/* ---------- 10. Footer ---------- */
.footer { position: relative; padding: 3rem 0 2rem; }
.footer-line { height: 1px; background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); box-shadow: 0 0 18px rgba(79,209,255,0.5); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; padding-top: 2.5rem; }
.footer-name { font-family: var(--font-display); font-weight: 600; margin: 0; }
.footer-tag { color: var(--text-muted); font-size: 0.88rem; margin: 0; }
.footer-nav, .footer-social { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: 0.88rem; color: var(--text-muted); }
.footer-nav a:hover, .footer-social a:hover { color: var(--accent); }
.copyright { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin: 2rem 0 0; }

.to-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border); background: rgba(10,12,18,0.85); color: var(--text);
  opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s var(--ease);
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px); border-color: var(--border-glow); }

/* ---------- 11. Animations ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 12. Responsive ---------- */
@media (max-width: 1024px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .nav-links a { font-size: 0.82rem; }
}
@media (max-width: 900px) {
  .nav-inner { min-height: 64px; }
  .edit-toggle { margin-left: auto; }
  .hamburger { display: flex; }
  .nav-links {
    position: fixed; inset: 64px 0 auto; flex-direction: column; align-items: flex-start;
    gap: 0.2rem; padding: 1.2rem 1.5rem 2rem; background: rgba(7,8,12,0.97);
    border-bottom: 1px solid var(--border); backdrop-filter: blur(16px);
    transform: translateY(-120%); transition: transform 0.4s var(--ease); max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .nav-links.is-open { transform: translateY(0); }
  .nav-links a { padding: 0.6rem 0; font-size: 0.98rem; width: 100%; }
  .nav-resume { margin-top: 0.6rem; }
}
@media (max-width: 620px) {
  .container { width: min(100% - 1.5rem, var(--max)); }
  .hero { min-height: auto; padding: 7.5rem 0 4.5rem; }
  .hero-title { font-size: clamp(2.35rem, 14vw, 3.5rem); overflow-wrap: anywhere; }
  .hero-role span { margin-inline: 0.2rem; }
  .social-row { flex-wrap: wrap; gap: 0.75rem 1.25rem; }
  .section { padding: 4rem 0; }
  .info-cards { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .project-actions .btn { width: auto; flex: 1 1 auto; }
  .footer-inner { flex-direction: column; }
  .edit-toggle { width: auto; padding-inline: 0.75rem; }
  .edit-bar { width: calc(100% - 1.5rem); align-items: stretch; flex-direction: column; gap: 0.6rem; }
  .edit-bar-actions .btn { flex: 1; }
  .modal { padding: 0.5rem; }
  .modal-panel { max-height: 94vh; border-radius: var(--radius); }
  .modal-body { padding-inline: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ===== Edit mode ===== */
.edit-toggle { margin-left: 0.6rem; padding: 0.4rem 0.9rem; font-size: 0.85rem; }
body.edit-mode main h1, body.edit-mode main h2, body.edit-mode main h3,
body.edit-mode main p, body.edit-mode main li, body.edit-mode footer p {
  outline: 1px dashed rgba(120, 180, 255, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
  cursor: text;
  transition: background 0.15s ease;
}
body.edit-mode main h1:hover, body.edit-mode main h2:hover, body.edit-mode main h3:hover,
body.edit-mode main p:hover, body.edit-mode main li:hover, body.edit-mode footer p:hover,
body.edit-mode [contenteditable="true"]:focus {
  background: rgba(120, 180, 255, 0.12);
  outline: 1px solid rgba(120, 180, 255, 0.9);
}
.edit-bar {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  display: flex; align-items: center; gap: 1rem; z-index: 999;
  background: rgba(15, 23, 42, 0.92); border: 1px solid rgba(120, 180, 255, 0.4);
  border-radius: 12px; padding: 0.7rem 1.1rem; backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.edit-bar p { margin: 0; font-size: 0.85rem; opacity: 0.85; }
.edit-bar-actions { display: flex; gap: 0.5rem; }
.edit-bar .btn { width: auto; padding: 0.4rem 0.9rem; font-size: 0.85rem; }
