/* =========================================================================
   INFM737 Capstone Archive: main stylesheet
   Light, modern, academic-tech. Mobile-first; breakpoints scale up.
   ========================================================================= */

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;

  --text: #0c0a09;
  --text-muted: #57534e;
  --text-subtle: #78716c;

  --primary: #0c0a09;
  --accent: #b91c1c;        /* refined deep red, academic, confident */
  --accent-soft: #fef2f2;
  --link: #1d4ed8;

  --hero-bg: #0a0a0a;
  --hero-bg-2: #1c1917;
  --hero-text: #fafaf9;
  --hero-muted: #a8a29e;
  --hero-accent: #fbbf24;   /* warm gold */

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.10);

  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  --max-width: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  background: radial-gradient(
      120% 80% at 80% 0%,
      rgba(251, 191, 36, 0.10) 0%,
      transparent 50%
    ),
    linear-gradient(180deg, var(--hero-bg) 0%, var(--hero-bg-2) 100%);
  color: var(--hero-text);
  overflow: hidden;
  padding-block: clamp(4rem, 9vw, 7rem) clamp(3.5rem, 7vw, 5.5rem);
  border-bottom: 1px solid #1c1917;
}

.hero::before {
  /* subtle grid texture */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at top right, black 0%, transparent 70%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  gap: 1.75rem;
  max-width: 56rem;
}

.hero__eyebrow {
  color: var(--hero-muted);
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}

.hero__title em {
  font-style: italic;
  color: var(--hero-accent);
}

.hero__subtitle {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.55;
  color: var(--hero-muted);
  max-width: 44rem;
  margin: 0;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--hero-muted);
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0.5rem;
}

.hero__meta strong {
  color: var(--hero-text);
  font-weight: 600;
}

/* =========================================================================
   Semester nav (scroll anchors)
   ========================================================================= */
.semester-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 250, 249, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.semester-nav__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
  padding-block: 0.85rem;
  scrollbar-width: none;
}

.semester-nav__inner::-webkit-scrollbar {
  display: none;
}

.semester-nav__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  flex-shrink: 0;
}

.semester-nav__link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.semester-nav__link:hover {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
  text-decoration: none;
}

.semester-nav__link span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.semester-nav__link:hover span {
  color: rgba(255, 255, 255, 0.7);
}

/* =========================================================================
   Gallery + semester sections
   ========================================================================= */
.gallery {
  padding-block: clamp(3rem, 6vw, 5rem) clamp(4rem, 8vw, 7rem);
}

.semester-section {
  scroll-margin-top: 5rem; /* account for sticky nav */
}

.semester-section + .semester-section {
  margin-top: clamp(3rem, 6vw, 5rem);
}

.semester-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.semester-section__title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

.semester-section__count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
}

.project-grid {
  display: grid;
  gap: clamp(1.25rem, 2vw, 1.75rem);
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================================================================
   Project card
   ========================================================================= */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  min-height: 100%;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.card__semester {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.card__partner {
  font-size: 0.75rem;
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-align: right;
}

.card__partner::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.card__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 0.6rem;
}

.card__team {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.card__team strong {
  color: var(--text);
  font-weight: 500;
}

.card__abstract {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  /* Clamp long abstracts so cards stay aligned. */
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.card__tools {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-subtle);
  margin: 0 0 1.25rem;
  letter-spacing: 0.01em;
}

.card__tools span {
  color: var(--text-muted);
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
  text-decoration: none;
}

.btn--primary {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

.btn--primary:hover {
  background: #1c1917;
  border-color: #1c1917;
}

.btn--disabled,
.btn[aria-disabled='true'] {
  background: var(--surface-2);
  color: var(--text-subtle);
  border-color: var(--border);
  cursor: not-allowed;
  pointer-events: none;
}

.btn__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* =========================================================================
   Footer
   ========================================================================= */
.footer {
  background: #0a0a0a;
  color: var(--hero-muted);
  padding-block: 3rem 2.5rem;
  border-top: 1px solid #1c1917;
}

.footer__inner {
  display: grid;
  gap: 2rem;
}

@media (min-width: 720px) {
  .footer__inner {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.footer__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--hero-text);
  margin: 0 0 0.5rem;
}

.footer__text {
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 0 0.5rem;
}

.footer__heading {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hero-text);
  margin: 0 0 0.75rem;
}

.footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
  font-size: 0.88rem;
}

.footer__list a {
  color: var(--hero-muted);
}

.footer__list a:hover {
  color: var(--hero-text);
}

.footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #1c1917;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: #57534e;
}

/* =========================================================================
   Reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
