@import url('colors.css');

/*
home.css
--------
Styles for homepage sections and layouts.
*/

.content-section {
  position: relative;
  padding: 4rem 2rem;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  transition: transform 0.3s ease;
  min-height: 320px;

  /* NEW: default background if JSON doesn't specify one */
  background-color: var(--bg-main);
}

.content-section.clickable {
  cursor: pointer;
}

.content-section.clickable:hover {
  transform: scale(1.01);
}

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

.section-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.section-inner.image-right {
  flex-direction: row-reverse;
}

.section-text {
  flex: 1;
  min-width: 0;
  max-width: 1080px;
}

.section-text h2 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-text h3 {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.section-text p {
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-line;
}

.section-image img {
  max-width: 100%;
  border-radius: 6px;
}

.tools-viewer {
  flex: 1;
  overflow: hidden;
  padding-bottom: 2rem;
  min-width: 0;
  width: 100%;
}

.tools-track {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  /* removed max-width so desktop can fit 6 across */
}

.tool-card {
  /* NEW: mobile-friendly sizing (wrap naturally) */
  flex: 1 1 140px;
  max-width: 160px;

  min-width: 140px;
  height: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  text-decoration: none;
  color: var(--text-secondary);

  transition: transform 0.2s ease, background 0.2s ease;
}

/* NEW: 6 across on normal laptop/desktop */
@media (min-width: 1024px) {
  .tool-card {
    flex: 0 0 calc((100% - 5rem) / 6); /* 6 cards, 5 gaps */
    max-width: calc((100% - 5rem) / 6);
  }
}

.tool-card:hover {
  transform: translateY(-3px);
  background: var(--bg-highlight);
}

.tool-card img {
  height: 32px;           /* constrain SVG size */
  width: auto;
  max-width: 60px;        /* prevent giant SVGs */
  display: block;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tool-card:hover img {
  opacity: 1;
  transform: scale(1.03);
}

/* Stack tools card vertically: text on top, scroller below */
.content-section[data-section-type="tools"] .section-inner {
  flex-direction: column;
  align-items: flex-start;
}

/* Make tools area span full width */
.content-section[data-section-type="tools"] .tools-viewer {
  width: 100%;
  margin-top: 2rem;
  padding-bottom: 2rem;
}

#about {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

/* Stack roadmap section vertically (same pattern as tools) */
.content-section[data-section-type="roadmap"] .section-inner {
  flex-direction: column;
  align-items: flex-start;
  padding-bottom: 6rem;
}

/* Roadmap container */
.roadmap {
  width: 100%;
  margin-top: 3rem;
  position: relative;
}

/* Horizontal track */
.roadmap-track {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;

  /* make the connector line anchor correctly */
  position: relative;
}

/* Individual step */
.roadmap-step {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  /* keep steps above the line */
  position: relative;
  z-index: 1;
}

/* Step label */
.roadmap-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.roadmap-sub {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.2;
  opacity: 0.9;
}

/* Optional subtle connector line (desktop only) */
@media (min-width: 900px) {
  .roadmap-track::before {
    content: "";
    position: absolute;

    /* center of 92px hex = 46px */
    top: 46px;

    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-subtle);
    opacity: 0.6;
    z-index: 0;
  }
}

/* Mobile: stack steps */
@media (max-width: 768px) {
  .roadmap-track {
    flex-direction: column;
    align-items: flex-start;
  }

  .roadmap-step {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 0.5rem;
  }
}

.hex-card {
  width: 92px;
  height: 92px;

  clip-path: polygon(
    25% 6%, 75% 6%,
    96% 50%,
    75% 94%, 25% 94%,
    4% 50%
  );

  background: var(--bg-card);
  border: 1px solid var(--border-subtle);

  box-shadow: 0 10px 30px var(--border-subtle);

  pointer-events: none; /* not clickable */
}

.hex-card__inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.hex-card svg {
  width: 36px;
  height: 36px;
  color: var(--text-secondary);
  opacity: 0.85;
}

.content-section--roadmap {
  padding-top: 2.5rem;      /* default is 4rem */
  padding-bottom: 2.75rem;  /* default is 4rem */
  min-height: auto;         /* override 320px only for roadmap */
}

.content-section--roadmap .section-inner {
  align-items: flex-start;
  gap: 1.25rem;             /* tighter than default 2rem */
}

.content-section--roadmap .roadmap {
  margin-top: 1.5rem;       /* tighter than 2.5rem */
}