/* ============================================================
   ASHLEY LAM — UX DESIGNER PORTFOLIO
   Dark · Editorial · Research-forward
   Accent: Electric Blue #4FC3F7
   Fonts: Playfair Display (serif) + Inter (sans)
   ============================================================ */


/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:         #000000;
  --fg:         #ffffff;
  --fg-70:      rgba(255, 255, 255, 0.70);
  --fg-40:      rgba(255, 255, 255, 0.40);
  --fg-15:      rgba(255, 255, 255, 0.15);
  --fg-07:      rgba(255, 255, 255, 0.07);

  --accent:     #FFB347;

  --serif:      'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --nav-h:      72px;
  --pad:        clamp(24px, 5vw, 64px);
  --row-h:      clamp(220px, 20vw, 290px);
}


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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
}

img  { display: block; max-width: 100%; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }


/* ── Custom Cursor (desktop only) ──────────────────────────── */

/* Only apply cursor: none on true pointer devices */
@media (hover: hover) and (pointer: fine) {
  html,
  a,
  button,
  .project-card { cursor: none; }
}

.cursor,
.cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9000;
  transform: translate(-50%, -50%);
  will-change: left, top;
  display: none; /* shown by JS only on pointer:fine devices */
}

.cursor {
  width: 6px;
  height: 6px;
  background: var(--fg);
  z-index: 9001;
}

.cursor-follower {
  width: 32px;
  height: 32px;
  border: 1px solid var(--fg-40);
  transition: width 0.35s ease, height 0.35s ease, border-color 0.35s ease;
}

.cursor-follower.is-hovering {
  width: 56px;
  height: 56px;
  border-color: var(--accent);
}


/* ── Navigation ────────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 200;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Fade vignette under nav so it reads over hero */
#nav::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.80) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

#nav.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}

.nav-links {
  display: flex;
  gap: 36px;
  position: relative;
  z-index: 1;
}

.nav-links a {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-70);
  transition: color 0.25s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--fg);
  outline: none;
}

.nav-links a:hover::after,
.nav-links a:focus::after {
  width: 100%;
}


/* ── Hero ───────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--nav-h) var(--pad) 80px;
  position: relative;
}

.hero-inner {
  max-width: 960px;
}

.hero-eyebrow {
  font-size: clamp(9px, 1.1vw, 11px);
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--fg-40);
  margin-bottom: clamp(24px, 4vh, 44px);
  line-height: 2;
}

.hero-name {
  font-family: var(--serif);
  font-size: clamp(64px, 11vw, 132px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin-bottom: clamp(24px, 4vh, 44px);
}

.hero-slogan {
  font-family: var(--serif);
  font-size: clamp(22px, 3.5vw, 38px);
  font-weight: 400;
  color: var(--fg-70);
  line-height: 1.3;
}

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

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hero-scroll span {
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--fg-15);
}

.scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--fg-40) 0%, transparent 100%);
  transform-origin: top;
  animation: scrollAnim 2.4s ease-in-out infinite;
}

@keyframes scrollAnim {
  0%   { transform: scaleY(0); opacity: 1; }
  50%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}


/* ── Section Wrapper ────────────────────────────────────────── */
.section-wrap {
  max-width: 1380px;
  margin: 0 auto;
  padding: clamp(80px, 10vh, 140px) var(--pad);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: clamp(40px, 6vh, 72px);
}

.section-header h2 {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 400;
}

.section-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.12em;
}


/* ── Project Grid ───────────────────────────────────────────── */
/*
  Layout (desktop):
  ┌───────────────────┬──────────┐
  │  Card 1 (tall)    │  Card 2  │
  │  MTR ASR          ├──────────┤
  │  (2 rows)         │  Card 3  │
  ├──────────┬────────┴──────────┤
  │  Card 4  │  Card 5           │
  └──────────┴───────────────────┘
*/
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: var(--row-h);
  gap: 10px;
}

/* Card 1 occupies 2 rows */
.project-card:nth-child(1) {
  grid-row: span 2;
}


/* ── Project Card ───────────────────────────────────────────── */
.project-card {
  position: relative;
  display: block;
  overflow: hidden;
  background: #080808;
  /* No default outline — we style focus ourselves */
  outline: none;
}

/* Image layer */
.project-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover .project-img,
.project-card:focus .project-img {
  transform: scale(1.05);
}

/* Ghost watermark text */
.project-img-watermark {
  position: absolute;
  bottom: 18px;
  left: 22px;
  font-family: var(--serif);
  font-size: clamp(18px, 2.2vw, 32px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.06);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* Gradient overlay — always present at bottom */
.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.12) 50%,
    transparent 100%
  );
  display: flex;
  align-items: flex-end;
  padding: clamp(16px, 2.5vw, 28px);
  transition: background 0.4s ease;
}

.project-card:hover .project-overlay,
.project-card:focus .project-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.45) 55%,
    rgba(0, 0, 0, 0.10) 100%
  );
}

/* Project info text */
.project-info {
  width: 100%;
}

.project-tag {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 7px;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.project-info h3 {
  font-family: var(--serif);
  font-size: clamp(14px, 1.8vw, 21px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--fg);
}

.project-info p {
  font-size: clamp(10px, 1.1vw, 12px);
  color: var(--fg-70);
  margin-top: 7px;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease 0.06s, transform 0.3s ease 0.06s;
}

.project-card:hover .project-tag,
.project-card:focus .project-tag,
.project-card:hover .project-info p,
.project-card:focus .project-info p {
  opacity: 1;
  transform: translateY(0);
}

/* Index number (top-right corner) */
.project-card::before {
  content: attr(data-index);
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.16);
  z-index: 2;
  font-weight: 300;
}

/* Keyboard focus ring */
.project-card:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* Touch devices — always show overlay content */
@media (hover: none) {
  .project-tag,
  .project-info p {
    opacity: 1;
    transform: none;
  }
}


/* ── About ──────────────────────────────────────────────────── */
#about {
  border-top: 1px solid var(--fg-15);
}

.about-wrap {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: clamp(48px, 8vw, 100px);
  align-items: start;
}

.about-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 32px;
  filter: grayscale(20%);
  border: 1px solid var(--fg-15);
}

.about-text h2 {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 400;
  margin-bottom: clamp(28px, 4vh, 44px);
}

.about-bio {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--fg-70);
  line-height: 1.85;
  max-width: 620px;
  margin-bottom: 18px;
}

.about-bio .accent {
  color: var(--accent);
  font-weight: 400;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}

.about-tags li {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-40);
  border: 1px solid var(--fg-15);
  padding: 6px 14px;
  transition: color 0.25s, border-color 0.25s;
}

.about-tags li:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Stats column */
.about-stats {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 4px;
}

.stat {
  border-left: 1px solid var(--fg-15);
  padding-left: 22px;
}

.stat-number {
  display: block;
  font-family: var(--serif);
  font-size: clamp(38px, 3.6vw, 52px);
  font-weight: 400;
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-40);
  margin-top: 6px;
}


/* ── Footer / Contact ───────────────────────────────────────── */
#contact {
  border-top: 1px solid var(--fg-15);
  text-align: center;
}

.footer-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: clamp(80px, 12vh, 160px) var(--pad) clamp(48px, 6vh, 80px);
}

.footer-heading {
  font-family: var(--serif);
  font-size: clamp(52px, 9vw, 112px);
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  margin-bottom: clamp(24px, 4vh, 40px);
}

.footer-email {
  display: inline-block;
  font-size: clamp(14px, 1.8vw, 18px);
  color: var(--fg-70);
  border-bottom: 1px solid var(--fg-15);
  padding-bottom: 3px;
  transition: color 0.25s, border-color 0.25s;
  margin-bottom: clamp(36px, 6vh, 60px);
}

.footer-email:hover,
.footer-email:focus {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-bottom: clamp(36px, 6vh, 60px);
}

.footer-links a {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-15);
  transition: color 0.25s;
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--fg-70);
  outline: none;
}

.footer-copy {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-15);
}


/* ── Scroll Fade-in (styles injected by JS) ─────────────────── */
/*
  .will-animate and .is-visible are injected via main.js
  so content remains visible if JS fails to load.
*/


/* ── Responsive ─────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 900px) {
  .about-wrap {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
  }

  .stat {
    min-width: 100px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --row-h: 56vw;
  }

  /* Single column grid on mobile */
  .project-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Remove 2-row span on mobile */
  .project-card:nth-child(1) {
    grid-row: span 1;
  }

  .nav-links {
    gap: 22px;
  }
}

/* Very small screens */
@media (max-width: 380px) {
  .nav-links li:nth-child(3) {
    display: none; /* hide Contact link on tiny screens, still in footer */
  }
}
