/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* Roots canvas background */
#roots-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
}

body.type-home #R-body,
body.type-home #R-body-inner,
body.type-home .article-content {
  position: relative;
  z-index: 1;
}

/* Homepage dark theme */
body.type-home {
  --MAIN-TEXT-color: #e0e0e0;
  --MAIN-BG-color: #111;
  --MAIN-TITLES-TEXT-color: #fff;
  --MAIN-LINK-color: #aaa;
  --MAIN-LINK-HOVER-color: #fff;
  --CODE-BLOCK-BG-color: #1a1a1a;
}

body.type-home #R-body {
  background: linear-gradient(to bottom, #0a0a0a, #111);
  color: #e0e0e0;
}

body.type-home #R-body-inner {
  max-width: 950px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

/* Hero title */
.hero-title {
  margin-top: 1rem;
  margin-bottom: 2rem;
  padding-top: 1rem;
  text-align: left;
  display: block !important;
}

.hero-title .name {
  display: block;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 2.5em;
  letter-spacing: -0.02em;
  color: #111;
  line-height: 1.1;
}

.hero-title .course {
  display: block;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 0.75em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #555;
  margin-top: 0.6rem;
}

/* Homepage always has dark background, so force light text */
body.type-home .hero-title .name {
  color: #fff;
}

body.type-home .hero-title .course {
  color: #888;
}

@media (prefers-color-scheme: light) {
  body.type-home .hero-title .name {
    color: #fff;
  }
}

@media (prefers-color-scheme: dark) {
  body.type-home .hero-title .name {
    color: #fff;
  }
}

/* Hero layout - images left, bio right */
.hero-layout {
  display: flex;
  gap: 10px;
  margin-bottom: 3rem;
}

.hero-images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 200px);
  gap: 10px;
  flex: 1;
}

.grid-item {
  border-radius: 8px;
  overflow: hidden;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: saturate(0.85);
}

.grid-item img:hover {
  transform: scale(1.03);
  filter: saturate(1);
}

/* Bio card - full height right column */
.grid-item.bio-card {
  width: 280px;
  flex-shrink: 0;
  background: #151515;
  padding: 0;
  perspective: 1000px;
  overflow: visible;
  position: sticky;
  top: 1rem;
  align-self: stretch;
}

.bio-front,
.bio-back {
  padding: 1.5rem;
  backface-visibility: hidden;
  transition: transform 0.5s ease, opacity 0.3s ease;
  border-radius: 8px;
}

.bio-front {
  background: #151515;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.bio-back {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transform: rotateY(180deg);
  opacity: 0;
  overflow-y: auto;
}

.bio-card.flipped .bio-front {
  transform: rotateY(-180deg);
  opacity: 0;
  pointer-events: none;
}

.bio-card.flipped .bio-back {
  transform: rotateY(0);
  opacity: 1;
  pointer-events: auto;
}

.fig-label {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.7em;
  font-weight: 600;
  letter-spacing: 0.15em;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.hover-message {
  font-size: 0.85em;
  line-height: 1.8;
  margin: 0;
  text-align: left;
  color: #fff;
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.hover-message a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hover-message a:hover {
  color: #fff;
}

.bio-card .location {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.7em;
  color: #888;
  margin: 0 0 1rem 0;
  letter-spacing: 0.05em;
}

.bio-card p {
  font-size: 0.85em;
  color: #eee;
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

.bio-card strong {
  color: #fff;
  font-weight: 500;
}

.contact-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-links li {
  font-size: 0.8em;
  margin: 0.35rem 0;
  color: #555;
}

.contact-links a {
  color: #777;
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-links a:hover {
  color: #fff;
}

/* 3-column sections grid */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.section-col h2 {
  margin-top: 0;
}

@media (max-width: 700px) {
  .sections-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Section headers */
body.type-home h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 2.5rem;
  color: #666;
}

body.type-home a {
  color: #aaa;
  transition: color 0.2s ease;
}

body.type-home a:hover {
  color: #fff;
}

/* Hide the duplicate Hugo h1, keep custom .hero-title */
body.type-home #R-body-inner > h1,
body.type-home .article-content > h1:first-child,
h1#liam-edwards-playne {
  display: none !important;
}

/* Responsive */
@media (max-width: 700px) {
  .hero-layout {
    flex-direction: column;
  }

  .hero-images {
    grid-template-rows: repeat(2, 160px);
  }

  .grid-item.bio-card {
    width: 100%;
    height: auto;
  }

  .hero-title .name {
    font-size: 1.8em;
  }
}

@media (max-width: 450px) {
  .hero-images {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 140px);
  }
}
