/* ============================================================
   INDEX.CSS — Homepage styles
   Hero · Projects · Courses · CTA
   ============================================================ */

/* ── HERO ────────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--off-white);
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--sage);
  clip-path: polygon(0 0, 60% 0, 36% 100%, 0 100%);
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--teal-dark);
  clip-path: polygon(75% 100%, 100% 100%, 100% 0, 97% 0);
}

/* ── TWO-TONE HERO BUTTONS ───────────────────────────────────
   The ghost buttons are transparent with white text, so any part of one that
   crosses the diagonal onto the off-white background becomes unreadable.
   Fix: a clipped copy of the hero content sits on top, styled for the light
   side. It is clipped with the exact inverse of the .hero-bg::before wedge,
   so the split follows the diagonal automatically and every breakpoint that
   changes the wedge only has to change this clip to match. */
.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  z-index: 3;
  pointer-events: none;
  user-select: none;
  clip-path: polygon(60% 0, 100% 0, 100% 100%, 36% 100%);
}

/* keep the layout, show only the button row */
.hero-overlay * { visibility: hidden; }
.hero-overlay .hero-ctas,
.hero-overlay .hero-ctas * { visibility: visible; }

/* the solid button is legible on both sides; only one copy should be drawn */
.hero-overlay .btn-white { visibility: hidden; }

.hero-overlay .btn-ghost {
  color: var(--navy-deep);
  border-color: rgba(55, 79, 89, 0.5);
  transform: none;
}

/* Decorative circles */
.dc {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.dc1 {
  width: 380px;
  height: 380px;
  top: -110px;
  left: -110px;
  border: 65px solid var(--sage-light);
  opacity: 0.45;
  animation: growIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.dc2 {
  width: 180px;
  height: 180px;
  bottom: -50px;
  left: 20%;
  background: var(--white);
  opacity: 0.12;
  animation: growIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
}

.dc3 {
  width: 280px;
  height: 280px;
  bottom: -90px;
  left: 39%;
  border: 55px solid var(--white);
  opacity: 0.1;
  animation: growIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both;
}

/* Zigzag accent */
.zigzag {
  position: absolute;
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  animation: slideL 0.9s cubic-bezier(0.25, 0.8, 0.25, 1) 0.4s both;
}

@keyframes slideL {
  from { transform: translateY(-50%) translateX(60px); opacity: 0; }
  to   { transform: translateY(-50%) translateX(0);    opacity: 0.5; }
}

/* Hero layout */
.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 8rem var(--pad-x) 4rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  align-items: center;
}

.hero-text {
  animation: slideUp 0.9s cubic-bezier(0.25, 0.8, 0.25, 1) 0.2s both;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 0.5rem;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.5rem, 7vw, 7.5rem);
  line-height: 0.9;
  text-transform: uppercase;
  color: var(--white);
  letter-spacing: -0.01em;
}

.hero-name span {
  display: block;
  opacity: 0.88;
}

.hero-divider {
  width: 72px;
  height: 4px;
  background: var(--sage-light);
  margin: 1.8rem 0;
}

.hero-sub {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
  max-width: 420px;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

/* Hero photo */
.hero-photo {
  animation: slideUp 0.9s cubic-bezier(0.25, 0.8, 0.25, 1) 0.35s both;
  position: relative;
  width: 260px;
  height: 260px;
}

.photo-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, 0.25);
  animation: spin 24s linear infinite;
}

.photo-frame {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  overflow: hidden;
  border: 7px solid var(--white);
  box-shadow: 0 20px 60px rgba(43, 77, 106, 0.45);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--sage), var(--teal-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  color: var(--white);
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-display);
  animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-arrow {
  width: 1px;
  height: 38px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
}

/* ── PROJECTS ────────────────────────────────────────────── */
#projects {
  background: var(--white);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8rem;
}

.proj-card {
  background: var(--off-white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}

.proj-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 50px rgba(43, 77, 106, 0.14);
}

.proj-card.featured {
  grid-column: span 2;
  flex-direction: row;
}

.proj-accent {
  height: 6px;
  background: var(--sage);
  flex-shrink: 0;
}

.proj-card.featured .proj-accent {
  width: 6px;
  height: auto;
}

.proj-accent--teal  { background: var(--teal-dark); }
.proj-accent--navy  { background: var(--navy); }

.proj-body {
  padding: 2rem;
  flex: 1;
}

.proj-card.featured .proj-body {
  padding: 2.5rem;
}

.proj-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage-text);
  margin-bottom: 0.7rem;
  display: block;
}

.proj-tag--teal { color: var(--teal-dark); }
.proj-tag--navy { color: var(--navy); }

.proj-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--navy-deep);
  margin-bottom: 0.9rem;
}

.proj-card.featured .proj-title {
  font-size: 2rem;
}

.proj-desc {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--navy-deep);
  opacity: 0.88;
  margin-bottom: 1.4rem;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
  background: var(--navy-deep);
  color: var(--white);
  border-radius: 2px;
}

.tag.light {
  background: rgba(90, 115, 105, 0.15);
  color: var(--sage-text);
}

.proj-icon {
  flex-shrink: 0;
  width: 240px;
  background: var(--navy-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}

.proj-icon svg {
  width: 72px;
  height: 72px;
  opacity: 0.3;
}

/* ── COURSES ─────────────────────────────────────────────── */
#courses {
  background: var(--off-white);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.course-card {
  background: var(--white);
  padding: 2rem;
  border-top: 5px solid var(--sage);
  transition: transform 0.2s, box-shadow 0.2s;
}

.course-card:nth-child(2) { border-top-color: var(--teal-dark); }
.course-card:nth-child(3) { border-top-color: var(--navy); }

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(43, 77, 106, 0.1);
}

.course-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.course-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--white);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.course-card:nth-child(1) .course-icon { background: var(--sage); }
.course-card:nth-child(2) .course-icon { background: var(--teal-dark); }
.course-card:nth-child(3) .course-icon { background: var(--navy); }

.course-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy-deep);
  margin-bottom: 1rem;
}

.course-topics {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.course-topics li {
  font-size: 0.85rem;
  color: var(--navy-deep);
  opacity: 0.82;
  padding-left: 1rem;
  position: relative;
  line-height: 1.4;
}

.course-topics li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--sage-text);
  font-size: 0.7rem;
}

/* ── CTA ─────────────────────────────────────────────────── */
#cta {
  background: var(--navy-deep);
  padding: 5rem var(--pad-x);
}

.cta-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cta-inner h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 3.2rem);
  text-transform: uppercase;
  line-height: 1;
  color: var(--white);
}

.cta-inner h2 span {
  color: #a9c6b6;
}

.cta-inner p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* ── RESPONSIVE: TABLET (≤900px) ────────────────────────── */
@media (max-width: 900px) {

  /* Hero: single column, centred */
  .hero-content {
    grid-template-columns: 1fr;
    padding: 7rem var(--pad-x-md) 4rem;
    gap: 0;
    text-align: center;
  }

  .hero-divider {
    margin: 1.5rem auto;
  }

  .hero-sub {
    max-width: 100%;
    margin: 0 auto;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-photo { display: none; }
  .zigzag     { display: none; }

  /* Full sage background on narrow screens —
     clip-path diagonal looks broken without the photo column */
  .hero-bg::before {
    clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%);
  }

  .hero-overlay {
    clip-path: polygon(0 100%, 100% 78%, 100% 100%);
  }

  .hero-bg::after {
    display: none;
  }

  /* Projects: 1-column.
     CRITICAL: reset grid-column span so the featured card
     doesn't force a phantom second implicit column */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .proj-card.featured {
    grid-column: 1;       /* ← reset the span-2 */
    flex-direction: column;
  }

  .proj-card.featured .proj-accent {
    width: 100%;
    height: 6px;
  }

  .proj-card.featured .proj-body {
    padding: 2rem;
  }

  .proj-card.featured .proj-title {
    font-size: 1.6rem;
  }

  .proj-icon {
    width: 100%;
    height: 120px;
  }

  /* Courses: skip 2-col middle step, go straight to 1-col */
  .courses-grid {
    grid-template-columns: 1fr;
  }

  /* CTA */
  #cta {
    padding: 4rem var(--pad-x-md);
  }

  .cta-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── RESPONSIVE: MOBILE (≤600px) ────────────────────────── */
@media (max-width: 600px) {

  .hero-name {
    font-size: clamp(2.8rem, 12vw, 4.5rem);
  }

  /* Simpler full-coverage background on small screens */
  .hero-bg::before {
    clip-path: polygon(0 0, 100% 0, 100% 72%, 0 100%);
  }

  .hero-overlay {
    clip-path: polygon(0 100%, 100% 72%, 100% 100%);
  }

  /* Scale down decorative circle so it doesn't overflow */
  .dc1 {
    width: 200px;
    height: 200px;
    border-width: 38px;
    top: -60px;
    left: -60px;
  }

  .dc2, .dc3 { display: none; }

  .section-block {
    padding: 3.5rem var(--pad-x-md);
  }

  .s-title {
    font-size: clamp(2rem, 9vw, 3rem);
    margin-bottom: 2rem;
  }

  .proj-body {
    padding: 1.5rem;
  }

  .proj-tags {
    gap: 0.4rem;
  }

  .tag {
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
  }

  .course-card {
    padding: 1.5rem;
  }

  #cta {
    padding: 3rem var(--pad-x-md);
  }
}

/* ── RESPONSIVE: SMALL MOBILE (≤400px) ──────────────────── */
@media (max-width: 400px) {

  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-ctas .btn {
    text-align: center;
  }

  .hero-name {
    font-size: clamp(2.4rem, 11vw, 3.2rem);
  }
}
