/* 首頁改版預覽專用樣式。由 index.html（英文）與 index.zh.html（繁中）載入，不影響 About、總覽與文章頁。 */

body.home-redesign {
  --home-ink: #070d19;
  --home-deep: #0a192f;
  --home-mist: #eef5fb;
  --home-panel: #f4f7fb;
  --home-line: rgba(7, 13, 25, 0.1);
  --home-muted: #5c6788;
  --header-height: 76px;
  overflow-x: clip;
}

body.home-redesign .site-header {
  background: rgba(7, 13, 25, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

body.home-redesign .site-header__inner {
  min-height: var(--header-height);
}

body.home-redesign .site-logo {
  color: #fff;
  align-items: center;
  font-size: 1.02rem;
}

body.home-redesign .site-logo::before {
  height: 1.85rem;
  margin-top: 0;
}

body.home-redesign .site-logo:hover {
  color: #fff;
}

body.home-redesign .site-logo__text {
  gap: 0.12rem;
}

body.home-redesign .site-logo__role {
  display: block;
  color: rgba(255, 255, 255, 0.58);
}

body.home-redesign .site-nav a {
  color: rgba(255, 255, 255, 0.86);
}

body.home-redesign .site-nav a:hover,
body.home-redesign .site-nav a[aria-current="page"] {
  color: #fff;
}

body.home-redesign .site-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--lr-teal);
}

body.home-redesign .site-nav a:focus-visible,
body.home-redesign .lang-switch a:focus-visible,
body.home-redesign .nav-toggle:focus-visible,
body.home-redesign .btn:focus-visible {
  outline: 2px solid var(--lr-teal);
  outline-offset: 3px;
}

body.home-redesign .site-nav__linkedin-icon path {
  fill: #fff;
}

body.home-redesign .lang-switch a {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

body.home-redesign .lang-switch a:hover {
  border-color: var(--lr-teal);
  color: var(--lr-teal);
}

body.home-redesign .lang-switch a[aria-current="true"] {
  background: rgba(0, 197, 183, 0.18);
  border-color: var(--lr-teal);
  color: #fff;
  pointer-events: none;
}

body.home-redesign .nav-toggle {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

@media (max-width: 640px) {
  body.home-redesign .site-nav {
    background: var(--home-ink);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    top: var(--header-height);
  }

  body.home-redesign .site-nav a {
    align-self: flex-start;
    color: #fff;
  }
}

/* Shared line icons */

.home-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  border: 1px solid rgba(0, 197, 183, 0.35);
  border-radius: 999px;
  background: #fff;
  color: var(--lr-teal-dark);
}

.home-mark svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* Hero */

.home-hero {
  position: relative;
  isolation: isolate;
  min-height: min(88vh, 760px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: var(--home-deep);
  overflow: hidden;
}

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

.home-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.home-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 13, 25, 0.88) 0%, rgba(7, 13, 25, 0.58) 44%, rgba(7, 13, 25, 0.22) 100%),
    linear-gradient(180deg, rgba(7, 13, 25, 0.18) 0%, rgba(7, 13, 25, 0.1) 40%, rgba(7, 13, 25, 0.58) 100%);
}

.home-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 5.5rem 1.5rem 4.25rem;
}

.home-kicker {
  margin: 0 0 0.85rem;
  color: var(--lr-teal);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.home-hero h1 {
  margin: 0 0 1.15rem;
  max-width: 12.5em;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.home-hero .lead {
  margin: 0;
  max-width: 36rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  line-height: 1.7;
}

.home-hero .lead + .lead {
  margin-top: 0.8rem;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.85rem;
}

body.home-redesign .home-hero .btn--outline {
  margin: 0;
  border-color: rgba(255, 255, 255, 0.78);
}

body.home-redesign .home-hero .btn--outline:hover,
body.home-redesign .home-hero .btn--outline:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}

/* Shared homepage section shell */

.home-section,
.home-hero,
.home-cta {
  scroll-margin-top: calc(var(--header-height) + 0.75rem);
}

.home-section {
  padding: 4.25rem 0;
}

.home-section--mist {
  background: var(--home-mist);
}

.home-section--panel {
  background: var(--home-panel);
}

.home-wrap {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.home-section__title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--home-ink);
}

.home-section__title--rule::before {
  content: "";
  display: block;
  width: 2.1rem;
  height: 2px;
  margin-bottom: 0.85rem;
  background: var(--lr-teal);
}

.home-section__lead {
  margin: 0 0 1.85rem;
  max-width: 40rem;
  color: var(--home-muted);
  font-size: 1.02rem;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: var(--lr-teal-dark);
  font-weight: 700;
  text-decoration: none;
}

.home-link:hover,
.home-link:focus-visible {
  color: var(--lr-hero);
  text-decoration: underline;
}

.home-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}

/* Featured: one large + two stacked; summaries always visible */

.home-featured__grid {
  display: grid;
  gap: 1.15rem;
}

.home-featured__card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--home-line);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.home-featured__card:hover,
.home-featured__card:focus-visible {
  border-color: var(--lr-teal);
  box-shadow: 0 14px 32px rgba(7, 13, 25, 0.1);
  text-decoration: none;
  outline: none;
}

.home-featured__card:focus-visible {
  outline: 2px solid var(--lr-teal);
  outline-offset: 3px;
}

.home-featured__media {
  min-height: 160px;
  overflow: hidden;
  background: var(--home-deep);
}

.home-featured__media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
}

.home-featured__body {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-width: 0;
  padding: 1.2rem 1.3rem 1.35rem;
}

.home-label {
  margin: 0 0 0.45rem;
  color: var(--lr-teal-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.home-featured__card h3 {
  margin: 0 0 0.5rem;
  color: var(--home-ink);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.home-featured__excerpt {
  margin: 0 0 1rem;
  color: var(--home-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.home-featured__card .home-link {
  margin-top: auto;
}

.home-featured__card:hover h3,
.home-featured__card:focus-visible h3 {
  color: var(--lr-hero);
}

@media (min-width: 900px) {
  .home-featured__grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .home-featured__card--lead {
    grid-row: span 2;
  }

  .home-featured__card--lead .home-featured__media {
    flex: 1 1 auto;
    min-height: 220px;
  }

  .home-featured__card--lead .home-featured__media img {
    min-height: 220px;
  }

  .home-featured__card--side .home-featured__media {
    min-height: 132px;
    max-height: 150px;
  }

  .home-featured__card--side .home-featured__media img {
    min-height: 132px;
  }

  .home-featured__card--side h3 {
    font-size: 1.05rem;
  }

  .home-featured__card--side .home-featured__excerpt {
    font-size: 0.92rem;
  }
}

@media (min-width: 1100px) {
  .home-featured__card--side {
    display: grid;
    grid-template-columns: 32% minmax(0, 1fr);
    align-items: stretch;
  }

  .home-featured__card--side .home-featured__media,
  .home-featured__card--side .home-featured__media img {
    min-height: 100%;
    max-height: none;
    height: 100%;
  }

  .home-featured__card--side .home-featured__body {
    padding: 1.15rem 1.2rem 1.25rem;
  }
}

/* Explore: two equal gateways */

.home-explore__grid {
  display: grid;
  gap: 1.15rem;
}

.home-explore__card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.6rem 1.5rem 1.5rem;
  background: #fff;
  border: 1px solid var(--home-line);
  border-top: 3px solid var(--lr-teal);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-explore__card:hover,
.home-explore__card:focus-visible {
  border-color: var(--lr-teal);
  box-shadow: 0 12px 28px rgba(7, 13, 25, 0.08);
  text-decoration: none;
}

.home-explore__card:focus-visible {
  outline: 2px solid var(--lr-teal);
  outline-offset: 3px;
}

.home-explore__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.home-explore__card h3 {
  margin: 0;
  color: var(--home-ink);
  font-size: 1.25rem;
}

.home-explore__card p {
  margin: 0 0 1rem;
  color: var(--home-muted);
  flex: 1;
}

.home-explore__topics {
  flex: 0 0 auto;
  margin: 0 0 1.15rem;
  color: var(--home-ink);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.home-explore__card .home-link {
  margin-top: auto;
}

@media (min-width: 768px) {
  .home-explore__grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Recent notes list */

.home-recent__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--home-line);
}

.home-recent__item a {
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr) auto;
  gap: 0.85rem 1.1rem;
  align-items: center;
  padding: 1.15rem 0.15rem;
  border-bottom: 1px solid var(--home-line);
  color: inherit;
  text-decoration: none;
}

.home-recent__item a:hover,
.home-recent__item a:focus-visible {
  text-decoration: none;
}

.home-recent__item a:focus-visible {
  outline: 2px solid var(--lr-teal);
  outline-offset: 2px;
}

.home-recent__date {
  color: var(--home-muted);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.home-recent__title {
  min-width: 0;
  color: var(--home-ink);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.45;
}

.home-recent__item a:hover .home-recent__title,
.home-recent__item a:focus-visible .home-recent__title {
  color: var(--lr-hero);
}

.home-recent__arrow {
  color: var(--lr-teal);
  font-size: 1.15rem;
  line-height: 1;
}

/* Author */

.home-author {
  display: grid;
  gap: 1.75rem;
}

.home-author__bio {
  margin: 0.85rem 0 0;
  max-width: 40rem;
  color: var(--home-muted);
}

.home-author__motive {
  margin: 1.35rem 0 0;
  padding: 0.2rem 0 0.2rem 1.05rem;
  max-width: 38rem;
  border-left: 2px solid var(--lr-teal);
  color: var(--home-ink);
  line-height: 1.75;
}

.home-author__story .home-link {
  margin-top: 1.5rem;
}

.home-author__lenses {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-author__lenses li {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  min-width: 0;
}

.home-author__lenses strong {
  display: block;
  color: var(--home-ink);
  font-size: 1rem;
}

.home-author__lenses li span span {
  display: block;
  margin-top: 0.2rem;
  color: var(--home-muted);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.55;
}

@media (min-width: 900px) {
  .home-author {
    grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 0.9fr);
    gap: 2.75rem;
    align-items: start;
  }
}

/* Exchange CTA */

.home-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: var(--home-deep);
}

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

.home-cta__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.home-cta__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 13, 25, 0.82) 0%, rgba(7, 13, 25, 0.55) 100%);
}

.home-cta .home-wrap {
  position: relative;
  z-index: 1;
  padding-top: 4.25rem;
  padding-bottom: 4.25rem;
}

.home-cta h2 {
  margin: 0 0 0.65rem;
  max-width: 14em;
  font-size: clamp(1.7rem, 3.5vw, 2.25rem);
  line-height: 1.25;
}

.home-cta p {
  margin: 0 0 1.5rem;
  max-width: 38rem;
  color: rgba(255, 255, 255, 0.86);
}

body.home-redesign .home-cta .btn--outline {
  margin: 0;
}

body.home-redesign .home-cta .btn--outline:hover,
body.home-redesign .home-cta .btn--outline:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}

body.home-redesign .home-cta .btn__icon--linkedin path {
  fill: #fff;
}

/* Footer candidate layout */

body.home-redesign .site-footer {
  padding: 1.75rem 1.5rem 1.9rem;
}

body.home-redesign .site-footer__inner {
  display: grid;
  gap: 0.85rem 1.5rem;
}

body.home-redesign .site-footer__tagline,
body.home-redesign .site-footer__copy,
body.home-redesign .site-footer__meta-row {
  display: none;
}

body.home-redesign .site-footer__url {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

body.home-redesign .site-footer__note {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
}

@media (min-width: 768px) {
  body.home-redesign .site-footer__inner {
    grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.4fr);
    align-items: center;
  }

  body.home-redesign .site-footer__url {
    text-align: center;
  }

  body.home-redesign .site-footer__note {
    text-align: right;
  }
}

@media (max-width: 720px) {
  body.home-redesign .site-header__inner {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding-inline: 1rem;
  }

  body.home-redesign .site-logo {
    font-size: 0.76rem;
    min-width: 0;
  }

  body.home-redesign .site-logo::before {
    height: 1.65rem;
  }

  body.home-redesign .site-header__end {
    flex-shrink: 0;
  }

  .home-hero {
    min-height: min(92vh, 720px);
    align-items: flex-end;
  }

  .home-hero__media img {
    object-position: center 40%;
  }

  .home-hero__media::after {
    background:
      linear-gradient(180deg, rgba(7, 13, 25, 0.28) 0%, rgba(7, 13, 25, 0.7) 52%, rgba(7, 13, 25, 0.9) 100%);
  }

  .home-hero__inner {
    padding: 4.5rem 1.25rem 2.75rem;
  }

  .home-hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.35rem);
  }

  .home-hero .lead {
    font-size: 0.98rem;
  }

  .home-recent__item a {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .home-recent__date {
    grid-column: 1 / -1;
    margin-bottom: -0.45rem;
  }

  .home-featured__card h3,
  .home-recent__title,
  .home-explore__card h3 {
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-featured__card,
  .home-explore__card {
    transition: none;
  }
}
