/* ============================================================
   INDEX.CSS — Portfolio main page styles
   ============================================================ */

/* ── Preloader ── */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader-logo {
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 10rem);
  color: var(--accent);
  letter-spacing: 0.05em;
  animation: preloaderPulse 1.2s ease infinite alternate;
}
@keyframes preloaderPulse {
  from { opacity: 0.4; }
  to   { opacity: 1; }
}
.preloader-bar {
  width: 160px;
  height: 1px;
  background: var(--border);
}
.preloader-fill {
  height: 1px;
  background: var(--accent);
  width: 0%;
  transition: width 0.12s ease;
}

/* ── Scroll progress bar ── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 9998;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(200,255,0,0.5);
}

/* ── Magnetic buttons ── */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
              border-color .2s, color .2s, background .2s;
  will-change: transform;
}


section {
  padding: 8rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 7vw, 8rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
  margin-bottom: 3rem;
}

/* ── Hero ── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 4rem 5rem;
  position: relative;
  overflow: hidden;
}

.hero-bg-text {
  position: absolute;
  top: 50%;
  left: -2rem;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: clamp(18vw, 25vw, 30vw);
  color: rgba(200,255,0,0.03);
  line-height: 0.85;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.2s ease forwards;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(5rem, 12vw, 14rem);
  line-height: 0.88;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s 0.35s ease forwards;
}
h1 span { color: var(--accent); }

.hero-sub {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.2vw, 1.6rem);
  font-style: italic;
  font-weight: 300;
  color: var(--muted);
  max-width: 42rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.5s ease forwards;
}

.hero-scroll {
  position: absolute;
  right: 4rem;
  bottom: 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  animation: fadeIn 1s 1s ease forwards;
}
.hero-scroll span {
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  writing-mode: vertical-rl;
}
.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollLine 2s 1.5s ease infinite;
}

@keyframes scrollLine {
  0%  { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100%{ transform: scaleY(0); transform-origin: bottom; }
}

/* ── About ── */
#about {
  border-top: 1px solid var(--border);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}
.about-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.75;
  color: #B8B5AE;
}
.about-text p + p { margin-top: 1.25rem; }
.about-text em { color: var(--text); font-style: italic; }

.about-details {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--muted); }
.detail-row .value { color: var(--text); text-align: right; }

/* ── Skills ── */
#skills {
  border-top: 1px solid var(--border);
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.skill-card {
  background: var(--bg);
  padding: 2.5rem;
  transition: background .3s;
}
.skill-card:hover { background: var(--surface); }
.skill-category {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.skill-card h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
  line-height: 1;
}
.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.skill-list li {
  font-size: 13px;
  color: #888882;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.skill-list li::before {
  content: '—';
  color: var(--accent);
  font-size: 10px;
}

/* ── Contact ── */
#contact {
  border-top: 1px solid var(--border);
  text-align: center;
}
#contact h2 {
  font-size: clamp(4rem, 10vw, 12rem);
}
.contact-sub {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 3rem;
}
.contact-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 5rem;
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 2rem;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.contact-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.contact-btn.primary {
  background: var(--accent);
  color: #080808;
  border-color: var(--accent);
  font-weight: 500;
}
.contact-btn.primary:hover {
  background: #b8ec00;
  border-color: #b8ec00;
  color: #080808;
}

/* ── Typewriter ── */
.hero-sub {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.2vw, 1.6rem);
  font-style: italic;
  font-weight: 300;
  color: var(--muted);
  max-width: 42rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.5s ease forwards;
}
.typewriter-word {
  color: var(--accent);
  font-style: italic;
}
.typewriter-cursor {
  color: var(--accent);
  font-style: normal;
  font-weight: 300;
}

/* ── Projects ── */
#projects {
  border-top: 1px solid var(--border);
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.project-card {
  background: var(--bg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: background .3s;
}
.project-card:hover { background: var(--surface); }

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.project-year {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid rgba(200,255,0,0.25);
  padding: 0.15rem 0.5rem;
  text-transform: uppercase;
}
.project-title {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--text);
}
.project-desc {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 300;
  color: #888882;
  line-height: 1.75;
  flex: 1;
}
.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.project-status {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.status-live { color: var(--accent); }
.status-wip  { color: var(--muted); }
.project-link {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color .2s;
}
.project-link:hover { color: var(--accent); }

/* ── Media queries ── */
@media (max-width: 900px) {
  section { padding: 5rem 2rem; }
  #hero {
    padding: 6rem 2rem 4rem;
    justify-content: center;
    min-height: 100svh;
  }
  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .hero-scroll { display: none; }
}
@media (max-width: 600px) {
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}