/* ==========================================================================
   Personal Portfolio — styles.css
   Layout: full-screen snap sections | Theme: cream + black only, Rockwell
   ========================================================================== */

/* ---------- Reset & tokens ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --cream: #FFFBF4;
  --ink: #000000;
  --font-stack: 'Rockwell', 'Rockwell Nova', 'Roboto Slab', 'Courier New', serif;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-stack);
  color: var(--ink);
  background: var(--cream);
  overflow: hidden; /* the snap container owns scrolling */
}

/* ---------- Scroll-snap container ---------- */
.snap-container {
  height: 100vh;
  height: 100svh;
  width: 100vw;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

/* ---------- Full-screen pages ---------- */
.page {
  position: relative;
  height: 100vh;
  height: 100svh;
  width: 100vw;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 3rem;
  overflow: hidden;

  /* Distinct "page" edge: thick black bar marks the start of each page */
  border-top: 10px solid var(--ink);
}

.page .content {
  width: min(1080px, 100%);
  z-index: 1;
}

/* ---------- Shared type & elements ---------- */
.section-heading {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.section-heading::after {
  content: "";
  display: block;
  width: 55%;
  height: 6px;
  margin-top: 0.5rem;
  background: var(--ink);
}

.meta {
  font-size: 0.95rem;
  opacity: 0.75;
  margin: 0.25rem 0 0.75rem;
}

ul {
  list-style-position: outside;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 1rem;
  color: var(--cream);
  background: var(--ink);
  border: 2px solid var(--ink);
  padding: 0.6rem 1.4rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--cream);
  color: var(--ink);
  transform: translateY(-2px);
}

/* ---------- 1. Hero / business card ---------- */
.page--hero .content {
  display: flex;
  justify-content: center;
}

.biz-card {
  border: 3px solid var(--ink);
  box-shadow: 12px 12px 0 var(--ink);
  background: var(--cream);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.75rem, 6vw, 4.5rem);
  text-align: center;
  max-width: 640px;
  width: 100%;
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.05;
}

.hero-title {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 400;
  margin-top: 0.6rem;
  letter-spacing: 0.05em;
}

.card-rule {
  border: none;
  border-top: 2px solid var(--ink);
  width: 40%;
  margin: 1.5rem auto;
}

.contact-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
}

.contact-list li {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.contact-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.6;
  min-width: 5.2rem;
  text-align: right;
}

.contact-list a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  border-bottom-color: var(--ink);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
  margin-top: 1.75rem;
}

.social-links a {
  color: var(--ink);
  display: inline-flex;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-links a:hover,
.social-links a:focus-visible {
  transform: translateY(-4px);
  opacity: 0.7;
}

/* Scroll-down indicator */
.scroll-indicator {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  z-index: 1;
}

.scroll-indicator .arrow {
  animation: bounce 1.6s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(9px); }
}

/* ---------- 2. About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.bio p {
  line-height: 1.7;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.skills h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.skill-tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill-tags li {
  border: 2px solid var(--ink);
  padding: 0.45rem 0.95rem;
  font-size: 0.95rem;
  margin: 0;
  transition: background 0.25s ease, color 0.25s ease;
}

.skill-tags li:hover {
  background: var(--ink);
  color: var(--cream);
}

/* ---------- 3. Portfolio ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}

.project-card {
  border: 2px solid var(--ink);
  background: var(--cream);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 8px 8px 0 var(--ink);
}

.project-img {
  aspect-ratio: 16 / 10;
  background: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.06),
    rgba(0, 0, 0, 0.06) 12px,
    transparent 12px,
    transparent 24px
  );
  border: 1px dashed rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
}

.project-card h3 {
  font-size: 1.15rem;
}

.project-card p {
  font-size: 0.92rem;
  line-height: 1.5;
  flex-grow: 1;
}

.project-card .btn {
  align-self: flex-start;
  font-size: 0.9rem;
  padding: 0.45rem 1.1rem;
}

/* ---------- 4. Research (timeline) ---------- */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 3px;
  background: var(--ink);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.25rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.35rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--cream);
  border: 3px solid var(--ink);
}

.timeline-body h3 {
  font-size: 1.25rem;
}

.timeline-body ul {
  font-size: 0.95rem;
}

.citation {
  border-left: 4px solid var(--ink);
  padding: 0.6rem 1rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
  background: rgba(0, 0, 0, 0.04);
}

.timeline-body .btn {
  font-size: 0.9rem;
  padding: 0.45rem 1.1rem;
}

/* ---------- 5. Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.edu-card {
  border: 2px solid var(--ink);
  border-left: 8px solid var(--ink);
  padding: 1.5rem;
  background: var(--cream);
}

.edu-card h3 {
  font-size: 1.25rem;
}

.edu-card ul {
  font-size: 0.95rem;
}

.btn--top {
  display: block;
  margin: 0 auto;
  font-size: 1.05rem;
  padding: 0.8rem 2rem;
}

/* ---------- Entry animations (triggered by JS adding .in-view) ---------- */
.animate {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: calc(var(--stagger, 0) * 0.15s);
  will-change: opacity, transform;
}

.animate[data-anim="fade-up"]    { transform: translateY(38px); }
.animate[data-anim="slide-left"] { transform: translateX(-46px); }

.animate[data-delay="1"] { --stagger: 1; }
.animate[data-delay="2"] { --stagger: 2; }
.animate[data-delay="3"] { --stagger: 3; }
.animate[data-delay="4"] { --stagger: 4; }

.animate.in-view {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .snap-container { scroll-behavior: auto; }
  .animate { opacity: 1; transform: none; transition: none; }
  .scroll-indicator .arrow { animation: none; }
}

/* ---------- Responsive: mobile ---------- */
@media (max-width: 760px) {
  /* Content can exceed the viewport on small screens — relax snapping so
     nothing becomes unreachable, and let sections grow. */
  .snap-container {
    scroll-snap-type: y proximity;
  }

  .page {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    padding: 3.5rem 1.25rem 4.5rem;
    overflow: visible;
  }

  .biz-card {
    box-shadow: 7px 7px 0 var(--ink);
  }

  .contact-list li {
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
  }

  .contact-label {
    text-align: center;
    min-width: 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .timeline {
    padding-left: 1.6rem;
  }

  .timeline-marker {
    left: -1.6rem;
  }
}

@media (max-width: 480px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}
