/* ============================================================
   components.css — hero, cards, buttons, placeholders
   (DESIGN.md §5.2, §5.4, §5.5, §5.7)
   ============================================================ */

/* ---------- Hero video stage (DESIGN.md §5.2) ---------- */

.hero {
  position: relative;
  /* Full viewport, pulled up under the translucent fixed header so the
     video bleeds edge-to-edge behind it */
  margin-top: calc(-1 * var(--header-height));
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg video,
.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none; /* hero video keeps full color (DESIGN.md §5.7 exemption) */
}

.hero__bg .placeholder {
  height: 100%;
}

/* Flat dark overlay: 65% at rest, eases to 25% while hovered
   so the video shows through (DESIGN.md §5.2) */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(11, 11, 12, 0.65);
  transition: background-color var(--dur-med) var(--ease);
  pointer-events: none;
}

@media (hover: hover) {
  .hero:hover .hero__overlay {
    background: rgba(11, 11, 12, 0.25);
  }
}

/* Single centered tagline over the video (DESIGN.md §5.2) */
.hero__tagline {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--page-pad);
  font-family: var(--font-sans);
  font-size: var(--type-hero-tagline);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: var(--tracking-h2);
  line-height: 0.95;
  color: var(--color-text);
  text-wrap: balance;
  /* 24ch of text width + the side padding it must contain (border-box) */
  max-width: calc(24ch + 2 * var(--page-pad));
  margin-inline: auto;
  pointer-events: none;
}

.hero__scroll {
  position: relative;
  z-index: 2;
  padding-bottom: var(--space-6);
  color: var(--color-text);
}

/* ---------- Work card (DESIGN.md §5.4) ---------- */

.card {
  display: block;
}

.card__media {
  aspect-ratio: 16 / 10;
  margin-bottom: var(--space-4);
  transition: filter var(--dur-med) var(--ease);
}

.card__meta {
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}

.card__title {
  font-size: var(--type-h3);
  font-weight: 700;
  margin-bottom: var(--space-2);
  transition: color var(--dur-fast) var(--ease);
}

.card__desc {
  color: var(--color-muted);
}

.card:hover .card__title {
  color: var(--color-accent);
}

.card:hover .card__media {
  filter: contrast(1.12);
}

/* ---------- Buttons (DESIGN.md §5.5) ---------- */

.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--type-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  line-height: 1;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

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

.btn--ghost {
  border: 1px solid var(--color-line);
  color: var(--color-text);
}

.btn--ghost:hover {
  border-color: var(--color-accent);
}

/* ---------- Media placeholder (DESIGN.md §5.7) ---------- */
/* Hatch pattern is the ONLY sanctioned use of a linear-gradient. */

.placeholder {
  display: grid;
  place-items: center;
  background-color: var(--color-surface);
  background-image: repeating-linear-gradient(
    45deg,
    var(--color-line) 0,
    var(--color-line) 1px,
    transparent 1px,
    transparent 12px
  );
  border: var(--hairline);
}

.placeholder__caption {
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  color: var(--color-muted);
}

/* ---------- Resume entries (DESIGN.md §5.8) ---------- */

.resume-entry {
  padding-block: var(--space-7);
  border-top: var(--hairline);
}

.resume-entry:last-of-type {
  border-bottom: var(--hairline);
}

@media (min-width: 1024px) {
  .resume-entry {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: var(--grid-gutter);
  }
}

.resume-entry__period {
  color: var(--color-muted);
  margin-bottom: var(--space-4);
}

@media (min-width: 1024px) {
  .resume-entry__period {
    margin-bottom: 0;
    padding-top: var(--space-1); /* optically aligns with the org line */
  }
}

.resume-entry__aside {
  margin-bottom: var(--space-4); /* breathing room when columns stack on mobile */
}

/* Company logo under the period (DESIGN.md §5.8) — white-on-alpha art,
   trimmed to content, dimmed to sit with the muted left column.
   Heights are optically matched per logo: a compact mark must be taller
   than a wide wordmark to carry the same visual weight. */
.resume-entry__logo {
  display: block;
  width: auto;
  max-width: 160px; /* never wider than the left column */
  margin-top: var(--space-4);
  opacity: 0.55;
}

.resume-entry__logo--tencent { height: 56px; }
.resume-entry__logo--ea      { height: 76px; }
.resume-entry__logo--ubisoft { height: 88px; }

.resume-entry__org {
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}

.resume-entry__role {
  font-size: var(--type-h3);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.resume-entry__desc {
  color: var(--color-muted);
}

/* Award/record line: the resume's single accent moment (DESIGN.md §5.8) */
.resume-entry__highlight {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  color: var(--color-text);
  line-height: 1.5;
}

.resume-entry__highlight::before {
  content: "";
  flex-shrink: 0;
  width: 4px;
  height: 4px;
  background: var(--color-accent);
}

/* ---------- Contact ---------- */

/* Email sits inline inside the CONTACT title, same scale, but keeps
   its lowercase form (an uppercased email reads like shouting a URL) */
.contact-email {
  text-transform: none;
  transition: color var(--dur-fast) var(--ease);
  word-break: break-all;
}

.contact-email:hover {
  color: var(--color-accent);
}

/* ---------- One-time section reveal (DESIGN.md §6) ---------- */
/* Scoped under .js (set by main.js) so content is never hidden
   when JavaScript is disabled or fails to load. */

.js .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--dur-med) var(--ease),
    transform var(--dur-med) var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
