/* Homepage only. Shared thread, step, and fact-sheet styles are in flow.css. */
.home-page .site-navigation {
  position: relative;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 35%, transparent);
}
/* Hero */
.home-hero { padding: 54px 0 0; }
.home-hero-copy { position: relative; z-index: 3; padding-inline: 28px; text-align: center; }
.home-hero h1 {
  font-size: clamp(60px, 7.6vw, 104px);
  line-height: .97;
  letter-spacing: -.055em;
  font-weight: 500;
}
.home-intro {
  max-width: 600px;
  margin: 26px auto 26px;
  text-wrap: balance;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
  color: var(--text-secondary);
}
.home-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
}
.home-hero-actions .button-group { margin: 0; max-width: none; }
.home-hero-actions .primary-link { margin-top: 0; }
.home-tour-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-size: 15px;
  text-decoration: none;
}
.home-tour-link span { color: var(--accent); font-size: 20px; transition: transform 180ms ease; }
.home-tour-link:hover span { transform: translateY(4px); }
.home-hero .status-message { max-width: 520px; margin: 18px auto 0; }

/* Hero stream: gathered material flows into the project, the paper flows out.
   The stacked layout below is the default; home.js switches wide screens to
   the flowing layout. */
.home-stream {
  position: relative;
  width: min(100%, 1360px);
  margin: 40px auto 0;
  padding: 0 24px 76px;
}
.home-stream-lines { display: none; }
.home-stream-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-stream-chips li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  background: var(--story-background);
  color: var(--text-primary);
  font-family: "Avenir-Medium", "Avenir Next", Avenir, sans-serif;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
}
.home-stream-chips svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-stream-result li { background: var(--accent); color: var(--on-accent); }
.home-stream-window {
  margin: 18px 0;
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  border-radius: 14px;
  overflow: hidden;
  background: var(--background);
  box-shadow: 0 30px 70px var(--screenshot-shadow);
}
.home-stream-window img { display: block; width: 100%; height: auto; }
.home-stream-caption { display: none; }

@media (min-width: 901px) {
  .home-stream.is-flowing { aspect-ratio: 1200 / 460; padding: 0; }
  .is-flowing .home-stream-lines {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    fill: none;
    stroke: var(--flow-tan-deep);
    stroke-width: 2;
    stroke-linecap: round;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 11%, #000 89%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 11%, #000 89%, transparent);
  }
  .is-flowing .home-stream-out { stroke: var(--flow-rose); }
  .is-flowing .home-stream-chips { position: absolute; inset: 0; z-index: 1; display: block; pointer-events: none; }
  .is-flowing .home-stream-chips li {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    will-change: transform, opacity;
    box-shadow: 0 6px 16px var(--screenshot-shadow);
  }
  .is-flowing .home-stream-window {
    position: absolute;
    z-index: 2;
    top: 7%;
    left: 23%;
    width: 54%;
    margin: 0;
  }
  .is-flowing .home-stream-caption {
    position: absolute;
    top: 0;
    display: block;
    margin: 0;
    color: var(--text-tertiary);
    font-size: 13px;
  }
  .is-flowing .home-stream-caption-in { left: 5%; }
  .is-flowing .home-stream-caption-out { right: 5%; }
}

/* Read step: a highlighted source beside the note it produced. */
.home-linked-note { display: flex; flex-direction: column; justify-content: flex-end; }
.home-linked-title { margin-top: 12px !important; font-family: "Avenir-Medium", "Avenir Next", Avenir, sans-serif; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.25; letter-spacing: -.02em; }
.home-linked-text { margin-top: 14px !important; color: var(--text-secondary); font-family: "AppleSDGothicNeo-Regular", "Apple SD Gothic Neo", sans-serif; font-size: 15px; line-height: 1.75; }
.home-linked mark { padding: 2px 0; background-size: 100% 100%; color: var(--text-primary); }
/* The highlight is drawn first, then the note it produced appears. */
.motion-ok .home-linked mark { background-size: 0% 100%; transition: background-size 900ms 350ms var(--flow-ease); }
.motion-ok .home-linked.is-visible mark { background-size: 100% 100%; }
.motion-ok .home-linked-note p { opacity: 0; transition: opacity 500ms 1350ms ease; }
.motion-ok .home-linked.is-visible .home-linked-note p { opacity: 1; }

/* Project search */
.home-find {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 80px;
  width: min(calc(100% - 56px), var(--flow-width));
  margin: 130px auto;
}
.home-find-image { aspect-ratio: 1.12; margin: 0; overflow: hidden; border-radius: 24px; background: var(--background); border: 1px solid var(--flow-rule); }
.home-find-image img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.42); }
.home-find-copy h2 { font-size: clamp(34px, 3.5vw, 48px); }
.home-find-copy > p { max-width: 400px; margin: 24px 0 0; font-size: 18px; line-height: 1.65; color: var(--text-secondary); }
.home-find-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 30px; padding: 0; list-style: none; }
.home-find-kinds li { padding: 6px 14px; border-radius: 999px; background: var(--story-background); font-size: 14px; }
.home-shortcut { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.home-shortcut kbd { width: 36px; height: 36px; border-bottom-width: 3px; border-radius: 7px; font-size: 16px; }
.home-shortcut span { margin-left: 8px; font-size: 13px; }

/* Plans */
.home-plans {
  --flow-inset: max(28px, calc((100% - var(--flow-width)) / 2));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 96px var(--flow-inset) 104px;
}
.home-plans article { padding-top: 26px; border-top: 2px solid var(--accent); }
.home-plans h3 { font-size: clamp(24px, 2.2vw, 30px); letter-spacing: -.03em; }
.home-plans p { max-width: 460px; margin: 14px 0 20px; color: var(--text-secondary); font-size: 17px; line-height: 1.65; }
.home-plans a { color: var(--accent); font-family: "Avenir-Medium", "Avenir Next", Avenir, sans-serif; font-size: 16px; text-decoration: none; }
.home-plans a span { display: inline-block; transition: transform 180ms ease; }
.home-plans a:hover span { transform: translateX(4px); }

@media (max-width: 1100px) {
  .home-find { gap: 48px; }
}
@media (max-width: 900px) {
  .home-hero { padding-top: 52px; }
  .home-stream { margin-top: 40px; padding-bottom: 60px; }
  .home-find { width: calc(100% - 48px); margin: 84px auto; gap: 36px; }
  .home-find-copy h2 { font-size: 34px; }
  .home-plans { --flow-inset: 24px; gap: 36px; padding-block: 72px 80px; }
}
@media (max-width: 600px) {
  .home-page .site-navigation { padding-inline: 16px; column-gap: 6px; }
  .home-page .site-navigation-brand { gap: 5px; font-size: 14px; }
  .home-page .site-navigation-brand img { width: 28px; height: 28px; }
  .home-page .site-navigation-tabs a { padding: 7px 10px; font-size: 12px; }
  .home-page .header-sign-in { font-size: 12px; padding-inline: 5px; }
  .home-hero { padding-top: 44px; }
  .home-hero h1 { font-size: clamp(42px, 12.4vw, 78px); }
  .home-intro { margin: 24px auto; font-size: 17px; }
  .home-hero-actions { flex-direction: column; gap: 19px; }
  .home-stream { margin-top: 34px; padding-inline: 16px; }
  .home-stream-window { border-radius: 9px; }
  .home-find { grid-template-columns: 1fr; gap: 30px; margin-block: 64px; }
  .home-find-image { order: 2; border-radius: 14px; }
  .home-plans { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .home-page .home-linked mark { background-size: 100% 100%; }
  .home-page .home-linked-note p { opacity: 1; }
}
