/* ========================================
   MAIN STYLESHEET - Dynamic Motion
   ======================================== */

/* Import order matters */
@import 'reset.css';
@import 'variables.css';
@import 'base.css';
@import 'components.css';
@import 'animations.css';
/* responsive.css is linked separately in index.html AFTER this file so its
   media-query overrides win over the section rules defined below. */

/* ========================================
   PAGE-SPECIFIC STYLES
   ======================================== */

/* ---- Hero Section ---- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--header-height);
  position: relative;
  overflow: hidden;
}

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

.hero__gradient {
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 150%;
  background: radial-gradient(ellipse at center, rgba(0, 255, 135, 0.08) 0%, transparent 60%);
  transform: rotate(-15deg);
}

.hero__lines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 100px,
    rgba(255, 255, 255, 0.01) 100px,
    rgba(255, 255, 255, 0.01) 101px
  );
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__title {
  font-size: var(--text-hero);
  line-height: 0.95;
  margin-bottom: var(--space-lg);
}

.hero__subtitle {
  font-size: var(--text-h3);
  color: var(--smoke);
  max-width: 550px;
  margin-bottom: var(--space-xl);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-out) 0.8s forwards;
}

.hero__scroll {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
}

/* ---- Projects Section ---- */

.projects {
  background: var(--carbon);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.project-card {
  position: relative;
  cursor: pointer;
}

.project-card__image-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  margin-bottom: var(--space-md);
}

.project-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%);
  transition: filter var(--duration-normal) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.project-card:hover .project-card__image {
  filter: grayscale(0%);
  transform: scale(1.05);
}

.project-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 255, 135, 0.1) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.project-card:hover .project-card__overlay {
  opacity: 1;
}

.project-card__number {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--velocity);
  opacity: 0.7;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.project-card__title {
  font-size: var(--text-h3);
  margin-bottom: var(--space-xs);
  transition: color var(--duration-fast) var(--ease-out);
}

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

.project-card__description {
  font-size: var(--text-small);
  color: var(--smoke);
}

/* ---- About Section ---- */

.about__content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-2xl);
  align-items: start;
}

.about__image-wrapper {
  position: relative;
}

.about__image {
  width: 100%;
  clip-path: polygon(0 5%, 100% 0, 100% 95%, 0 100%);
}

.about__image-accent {
  position: absolute;
  top: -10px;
  left: -10px;
  right: 10px;
  bottom: 10px;
  border: 1px solid var(--velocity);
  clip-path: polygon(0 5%, 100% 0, 100% 95%, 0 100%);
  opacity: 0.3;
}

.about__text {
  margin-bottom: var(--space-xl);
}

.about__text p {
  margin-bottom: var(--space-md);
  font-size: var(--text-body);
  line-height: 1.8;
}

.about__highlight {
  color: var(--white);
  font-weight: 500;
}

.about__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--steel);
}

.stat {
  text-align: left;
}

.stat__number {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 700;
  color: var(--velocity);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat__label {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--smoke);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---- Cycling Section ---- */

.cycling {
  background: var(--carbon);
}

.cycling__content {
  max-width: 900px;
}

.cycling__hero {
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--steel);
}

.cycling__hero-image {
  width: 100%;
  height: auto;
  display: block;
}

.cycling__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.cycling__stat-card {
  background: var(--carbon);
  border: 1px solid var(--steel);
  border-radius: var(--radius-sm);
  padding: var(--space-lg);
  text-align: center;
  transition: border-color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.cycling__stat-card:hover {
  border-color: var(--velocity);
  transform: translateY(-2px);
}

.cycling__stat-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto var(--space-sm);
  color: var(--velocity);
}

.cycling__stat-icon svg {
  width: 100%;
  height: 100%;
}

.cycling__stat-value {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

/* Skeleton shimmer shown until Strava data loads (toggled via JS) */
.skeleton-bar,
.cycling__stat-value.is-loading {
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg,
    var(--skeleton-base) 30%, var(--skeleton-highlight) 50%, var(--skeleton-base) 70%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  user-select: none;
}

.cycling__stat-value.is-loading {
  display: inline-block;
  width: 72px;
  height: var(--text-h2);
  color: transparent;
}

.skeleton-bar {
  display: block;
  height: 0.85em;
}

@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-bar,
  .cycling__stat-value.is-loading {
    animation: none;
    background-position: 0 0;
  }
}

.cycling__stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--smoke);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cycling__koms {
  margin-bottom: var(--space-xl);
}

.cycling__koms-title {
  font-size: var(--text-h3);
  margin-bottom: var(--space-md);
}

.cycling__koms-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.cycling__koms-loading {
  color: var(--smoke);
  font-family: var(--font-mono);
  font-size: var(--text-small);
}

.cycling__kom-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-md);
  align-items: center;
  background: var(--graphite);
  border: 1px solid var(--steel);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.cycling__kom-item:hover {
  border-color: var(--velocity);
}

.cycling__kom-segment {
  font-weight: 500;
  color: var(--white);
}

.cycling__kom-meta {
  display: flex;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--smoke);
  margin-top: 4px;
}

.cycling__kom-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cycling__kom-stats {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.cycling__kom-time {
  font-family: var(--font-mono);
  font-size: var(--text-body);
  color: var(--velocity);
  font-weight: 600;
}

.cycling__kom-power {
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: var(--smoke);
  min-width: 50px;
  text-align: right;
}

/* Skeleton KOM rows (rendered via JS until /koms resolves) */
.cycling__kom-item--skeleton {
  pointer-events: none;
}

.cycling__kom-item--skeleton:hover {
  border-color: var(--steel);
}

.cycling__kom-skeleton-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.skeleton-bar--title { width: 70%; height: 1em; }
.skeleton-bar--meta  { width: 45%; }
.skeleton-bar--time  { width: 56px; height: 1em; }

.cycling__links {
  display: flex;
  gap: var(--space-md);
}

.cycling__links .social-link {
  width: auto;
  height: auto;
  padding: var(--space-sm) var(--space-md);
  gap: var(--space-xs);
}

.cycling__links .social-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.cycling__links .social-link span {
  font-family: var(--font-mono);
  font-size: var(--text-small);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.social-link--strava:hover {
  color: #fc4c02;
  border-color: #fc4c02;
}

/* ---- Experience Section ---- */

.experience {
  background: var(--void);
}

.experience__content {
  max-width: 800px;
}

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

.contact {
  background: var(--carbon);
}

.contact__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
}

.contact__info h3 {
  margin-bottom: var(--space-md);
}

.contact__info p {
  margin-bottom: var(--space-lg);
}

.contact__form {
  background: var(--graphite);
  padding: var(--space-xl);
  border-radius: var(--radius-md);
  border: 1px solid var(--steel);
}

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

.contact__simple {
  max-width: 600px;
}

.contact__text {
  font-size: var(--text-h3);
  color: var(--smoke);
  margin-bottom: var(--space-xl);
}

.social-links--large {
  gap: var(--space-lg);
}

.social-links--large .social-link {
  width: auto;
  padding: var(--space-sm) var(--space-lg);
  gap: var(--space-sm);
}

.social-links--large .social-link span {
  font-family: var(--font-mono);
  font-size: var(--text-small);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Placeholders ---- */

.project-card__placeholder {
  background: var(--graphite);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 700;
  color: var(--steel);
  letter-spacing: 0.05em;
}

.project-card__placeholder .text-gradient {
  font-size: var(--text-h1);
}

.about__placeholder {
  background: var(--graphite);
  width: 100%;
  aspect-ratio: 3 / 4;
  clip-path: polygon(0 5%, 100% 0, 100% 95%, 0 100%);
}
