/* Homepage — Pro board image nodes. Auth pages must not load this file. */

:root {
  --home-ink: #111111;
  --home-dot: rgb(230, 230, 230);
  --home-font: Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --home-line: #e8e8ec;
  --home-header-gap: 3.6rem;
  --home-page-inset-right: 40px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body.home-body {
  font-family: var(--home-font);
  color: var(--home-ink);
  background-color: #ffffff;
  background-image: radial-gradient(circle, var(--home-dot) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0;
  min-height: 100%;
}

a { color: inherit; }

.home-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid var(--home-line);
}

.home-logo {
  display: block;
  height: 24px;
  width: auto;
  flex: 0 0 auto;
}

.home-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0 1.85rem;
}

.home-nav a {
  text-decoration: none;
  color: #5c5c66;
  font-size: 0.84rem;
  white-space: nowrap;
}

.home-nav a:hover,
.home-nav a.is-active {
  color: var(--home-ink);
}

.home-nav a.nav-login {
  color: #fff;
  background: var(--home-ink);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
}

.home-nav a.nav-login:hover {
  background: #000;
  color: #fff;
}

/*
  Single board under the header divider.
  All node top/left/right are measured from this board — no outer padding + negative-top patch.
*/
.home-main {
  width: 100%;
  padding: 0;
}

.home-board {
  position: relative;
  width: 100%;
  /* Tall enough for divider-relative tops (120px band + prior % band + node height) */
  min-height: calc(280px + (100vh - var(--home-header-gap)));
  overflow: visible;
}

.home-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.home-edges path {
  fill: none;
  stroke: #000;
  stroke-width: 1px;
}

.home-node {
  position: absolute;
  z-index: 2;
  text-decoration: none;
  color: inherit;
}

.home-node:focus-visible .node-main {
  border: 2px solid #5082ff;
}

/* —— Pro ImageNode visuals (Clora Pro v1.0 ImageNode.vue) —— */

.image-node {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  box-sizing: border-box;
  font-family: var(--home-font);
}

.node-label {
  position: absolute;
  left: 14px;
  bottom: calc(100% + 6px);
  color: #b2b2b2;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

.node-main {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

.node-image {
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  display: block;
}

.placeholder {
  color: #999;
  font-size: 12px;
}

.image-node.has-image .node-main {
  border: none;
}

.node-download-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #ffffff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E")
    center / 14px 14px no-repeat;
  pointer-events: none;
  box-shadow: none;
}

.custom-handle {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  min-width: 6px;
  min-height: 6px;
  background: #000;
  border: none;
  border-radius: 50%;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
}

.custom-handle.handle-visible {
  opacity: 1;
}

.custom-handle.handle-left {
  left: -6px;
  transform: translate(-50%, -50%);
}

.custom-handle.handle-right {
  right: -6px;
  transform: translate(50%, -50%);
}

/*
  Placement: tops measured from the gray divider (board top).
  Locked: n2=50px, n4=100px + right 40px, n8 +15px, n9 -20px, n10 +30px.
  Others: prior visual = 120px + old board-% of (100vh - header).
*/
.home-node--n1 {
  left: 2.5%;
  top: calc(120px + (100vh - var(--home-header-gap)) * 0.06);
  width: 236px;
  height: 354px;
}
.home-node--n2 { left: 21%; top: 50px; width: 180px; height: 101px; }
.home-node--n3 {
  left: 46%;
  top: calc(120px + (100vh - var(--home-header-gap)) * 0.08);
  width: 380px;
  height: 214px;
}
.home-node--n4 {
  left: auto;
  right: var(--home-page-inset-right);
  top: 100px;
  width: 268px;
  height: 151px;
}
.home-node--n5 {
  left: 14%;
  top: calc(120px + (100vh - var(--home-header-gap)) * 0.44);
  width: 256px;
  height: 144px;
}
.home-node--n6 {
  left: 42%;
  top: calc(120px + (100vh - var(--home-header-gap)) * 0.38);
  width: 180px;
  height: 101px;
}
.home-node--n7 {
  left: min(68%, calc(100% - 336px - var(--home-page-inset-right)));
  top: calc(120px + (100vh - var(--home-header-gap)) * 0.42);
  width: 336px;
  height: 189px;
}
.home-node--n8 {
  left: calc(4% + 15px);
  top: calc(120px + (100vh - var(--home-header-gap)) * 0.72);
  width: 240px;
  height: 135px;
}
.home-node--n9 {
  left: 38%;
  top: calc(120px + (100vh - var(--home-header-gap)) * 0.68 - 20px);
  width: 220px;
  height: 124px;
}
.home-node--n10 {
  left: min(calc(72% + 30px), calc(100% - 240px - var(--home-page-inset-right)));
  top: calc(120px + (100vh - var(--home-header-gap)) * 0.74);
  width: 240px;
  height: 135px;
}

@media (max-width: 1200px) {
  .home-node--n1 { width: 150px; height: 225px; }
  .home-node--n3 { width: 250px; height: 140px; left: 44%; }
  .home-node--n4 { width: 220px; height: 124px; }
  .home-node--n7 {
    width: 240px;
    height: 135px;
    left: min(68%, calc(100% - 240px - var(--home-page-inset-right)));
  }
}

@media (max-width: 900px) {
  .home-board {
    min-height: auto;
    padding: 2rem 1rem 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem 1.75rem;
    justify-content: center;
    align-content: flex-start;
  }

  .home-edges { display: none; }

  .home-node {
    position: relative;
    left: auto !important;
    right: auto !important;
    top: auto !important;
  }

  .home-node--n1 { width: 140px; height: 210px; }
  .home-node--n2,
  .home-node--n5,
  .home-node--n6,
  .home-node--n8,
  .home-node--n10 { width: 200px; height: 112px; }
  .home-node--n3,
  .home-node--n4,
  .home-node--n7,
  .home-node--n9 { width: 210px; height: 118px; }
}

@media (max-width: 720px) {
  .home-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    gap: 0.65rem;
  }

  .home-nav {
    justify-content: flex-start;
    gap: 0.75rem 1.35rem;
  }
}
