/* Homepage content. Shared tokens, containers, navigation and footer are in site.css. */

body[data-page="index"] img { width: 100%; }
.card, .skill-tag, .card-tag { transition: background 0.3s, color 0.3s, border-color 0.3s; }

/* HERO */

#hero {
  padding-top: calc(var(--site-nav-height) + var(--space-lg));
  padding-bottom: var(--space-lg);
  min-height: 100svh;
  display: flex;
  align-items: center;
}
.hero-label {
  font-family: var(--font-mono);
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--site-accent);
  margin-bottom: var(--space-md);
}
.hero-title {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 16ch;
  margin-bottom: var(--space-md);
}
.hero-title em {
  font-style: normal;
  color: var(--site-accent);
}
.hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 48ch;
  margin-bottom: var(--space-md);
  line-height: 1.65;
}
.hero-cta { gap: 0.6rem; }

/* SECTION SHARED */

section { padding: clamp(3.5rem, 6vw, 5rem) 0; }
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--site-accent);
  margin-bottom: var(--space-sm);
}
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--space-md);
}

/* Secondary project collection */
.fun-entry {
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
}
.fun-entry-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}
.fun-entry h2 {
  font-size: 1.2rem;
}
.fun-entry p {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.fun-entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
.fun-entry-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  color: var(--site-accent);
  font-size: 0.85rem;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.fun-entry-links a:hover { color: var(--site-text); }
.fun-entry-links a:focus-visible {
  outline: 2px solid var(--site-accent);
  outline-offset: 4px;
}

/* ABOUT */

#about { border-top: 1px solid var(--border); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-lg);
  align-items: start;
}
.about-body {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.75;
}
.about-body p + p { margin-top: var(--space-sm); }
.about-body strong { color: var(--text); }
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: var(--space-md);
  list-style: none;
  padding: 0;
}
.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--site-accent);
}
.skill-tag:not(:first-child)::before {
  content: "\00B7";
  margin-right: 0.75rem;
  color: var(--text-muted);
}

/* WORK */

#work { border-top: 1px solid var(--border); }
.work-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 0;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: none;
  padding: 0.35rem 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active {
  color: var(--site-accent);
  border-bottom-color: var(--site-accent);
}

.card.hidden {
  display: none;
}

/* Card Grid — ruled entries on the page, not boxes */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2rem;
}
.card {
  position: relative;
  cursor: pointer;
}
.card-thumb {
  aspect-ratio: 16 / 9;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-thumb img { transform: scale(1.04); }
/* Full-page website screenshots: show the hero (top) instead of a mid-page band */
.card-thumb img.thumb-top { object-position: top; }
.card-body { padding: 1.1rem 0 0; }
.card-tags {
  display: flex;
  gap: 0.4rem 0.85rem;
  flex-wrap: wrap;
  margin: 0.85rem 0 0;
  list-style: none;
  padding: 0;
}
.card-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--site-accent);
}
.card-tag::before {
  content: "#";
  color: var(--site-accent);
  margin-right: 1px;
}
.card-title {
  font-size: 20px;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.card-desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--site-accent);
  letter-spacing: 0.04em;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: border-color 0.2s, color 0.2s;
}
.card:hover .card-link { color: var(--site-text); }

/* Featured (hero) card */
.card-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 2.5rem;
  align-items: stretch;
  cursor: default;
  margin-bottom: 1rem;
}

/* Live preview (click-to-interact) */
.live-preview { position: relative; }
.live-launch {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--action-fg);
  background: var(--action-bg);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
  transition: transform 0.2s, background 0.2s, color 0.2s;
  z-index: 2;
}
.live-launch:hover { color: var(--action-hover-fg); background: var(--action-hover-bg); transform: translate(-50%, -50%) scale(1.05); }
.live-launch svg { display: block; }
.live-stage {
  position: absolute;
  inset: 0;
  display: none;
  background: var(--bg);
}
.live-frame { width: 100%; height: 100%; border: 0; display: block; }
.live-controls {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: none;
  gap: 0.4rem;
  z-index: 3;
}
.live-ctrl,
.live-close {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1;
  padding: 0.38rem 0.6rem;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.live-ctrl:hover,
.live-close:hover { border-color: var(--site-accent); color: var(--site-accent); }
.live-preview.is-active .live-poster-img,
.live-preview.is-active .live-launch { display: none; }
.live-preview.is-active .live-stage { display: block; }
.live-preview.is-active .live-controls { display: flex; }
.card-featured .card-thumb {
  aspect-ratio: auto;
  height: 100%;
  min-height: 360px;
}
.card-featured .card-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.card-featured .card-title {
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  margin-bottom: 0.75rem;
}
.card-featured .card-link {
  margin-top: 1.5rem;
  align-self: flex-start;
}
.card-featured .card-tags {
  margin: 1.1rem 0 0;
}

/* Award badge */
.award-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.4rem;
  row-gap: 0.15rem;
  margin: -0.25rem 0 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
}
.award-badge svg {
  width: 16px;
  height: 16px;
  color: var(--site-accent);
  flex-shrink: 0;
}
.award-place {
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--site-accent);
  white-space: nowrap;
}
.award-event {
  font-weight: 600;
  color: var(--text);
}
.award-sub {
  color: var(--text-muted);
}

/* CONTACT */

#contact { border-top: 1px solid var(--border); }
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}
.contact-inner .hero-cta { margin-top: var(--space-md); }
.contact-text {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 42ch;
  line-height: 1.7;
}
.social-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-self: end;
  list-style: none;
  padding: 0;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.social-link:hover { color: var(--text); }
.social-link span {
  width: 36px;
  height: 1px;
  background: var(--border);
  transition: width 0.3s, background 0.2s;
}
.social-link:hover span { width: 56px; background: var(--site-accent); }

/* BACK TO TOP */

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 90;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  color: var(--text-muted);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s, border-color 0.2s, color 0.2s;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  border-color: var(--site-accent);
  color: var(--site-accent);
}
.back-to-top svg { width: 16px; height: 16px; }

/* RESPONSIVE */

@media (max-width: 1024px) {
  .work-grid     { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .about-grid    { grid-template-columns: 1fr; }
  .work-grid     { grid-template-columns: 1fr; }
  .contact-inner { grid-template-columns: 1fr; }
  .social-links  { justify-self: start; }
  .filter-bar    { gap: 0.4rem; }
  .filter-btn    { font-size: 0.72rem; padding: 0.4rem 0.75rem; }
  .card-featured { grid-template-columns: 1fr; gap: 0; }
  .card-featured .card-thumb { aspect-ratio: 16 / 9; min-height: 0; }
  .card-featured .card-body  { padding: 1.1rem 0 0; }
}

.card-thumb img.rehello-preview {
  position: static;
  inset: auto;
  width: 62%;
  height: auto;
  max-height: 92%;
  object-fit: contain;
}

.card:hover .card-thumb img.rehello-preview {
  transform: none;
}

/* Keep the motion preference after component transitions so it wins the cascade. */
@media (prefers-reduced-motion: reduce) {
  .card,
  .card-thumb img,
  .hero-cta,
  .live-launch,
  .social-link span,
  .back-to-top { transition: none; }
  .card:hover .card-thumb img { transform: none; }
  .live-launch:hover { transform: translate(-50%, -50%); }
}
