/* ============================================================
   Landing page styles for `_layouts/portfolio.html`
   Only loaded on the landing page (see _includes/metadata-hook.html).
   All colors are driven by Chirpy theme CSS variables so the page
   renders correctly in both light and dark mode.
   ============================================================ */

/* ------------------------------------------------------------
   Hide the Chirpy blog chrome on the landing page
   ------------------------------------------------------------ */
#sidebar,
#topbar-wrapper,
#panel-wrapper,
#tail-wrapper,
#back-to-top,
#mask {
  display: none !important;
}

#main-wrapper {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}

#main-wrapper > .container {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

main {
  width: 100% !important;
  max-width: none !important;
  flex: 0 0 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */
html.pf-page {
  scroll-behavior: smooth;
}

.pf-landing {
  background: var(--main-bg);
  color: var(--text-color);
  font-family: "Source Sans Pro", "Microsoft Yahei", sans-serif;
  line-height: 1.6;
}

.pf-landing a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.pf-landing a:hover {
  color: var(--link-color);
  text-decoration: underline;
}

.pf-landing h1,
.pf-landing h2,
.pf-landing h3 {
  font-family: Lato, "Microsoft Yahei", sans-serif;
  color: var(--heading-color);
  line-height: 1.25;
}

.pf-landing .pf-hero,
.pf-landing .pf-section {
  scroll-margin-top: 4.5rem;
}

.pf-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.pf-section {
  padding: 5.5rem 0;
}

.pf-section-alt {
  background: var(--highlight-bg-color);
  border-top: 1px solid var(--main-border-color);
  border-bottom: 1px solid var(--main-border-color);
}

.pf-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--link-color);
  margin: 0 0 0.5rem;
}

.pf-title {
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  font-weight: 700;
  margin: 0 0 1.5rem;
  max-width: 36ch;
}

.pf-lead {
  color: var(--text-muted-color);
  font-size: 1.05rem;
  margin: -0.75rem 0 2rem;
}

.pf-prose p {
  margin: 0 0 1.1rem;
  max-width: 72ch;
  font-size: 1.05rem;
}

.pf-more {
  margin: 1.5rem 0 0;
  font-weight: 600;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.pf-btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.pf-btn:hover {
  text-decoration: none;
}

.pf-btn-primary {
  background: color-mix(in srgb, var(--link-color) 78%, var(--main-bg));
  color: var(--main-bg);
}

.pf-btn-primary:hover {
  background: var(--link-color);
  color: var(--main-bg);
}

.pf-btn-ghost {
  background: transparent;
  border-color: var(--btn-border-color);
  color: var(--text-color);
}

.pf-btn-ghost:hover {
  border-color: var(--link-color);
  color: var(--link-color);
}

/* ------------------------------------------------------------
   Top navigation bar lives in assets/css/pf-nav.css (shared with
   the blog pages).
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.pf-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 4rem);
  padding: 5rem 1.5rem;
  background:
    radial-gradient(1100px 500px at 85% -10%, color-mix(in srgb, var(--link-color) 20%, transparent), transparent 70%),
    radial-gradient(900px 520px at 0% 110%, color-mix(in srgb, var(--checkbox-checked-color) 14%, transparent), transparent 70%),
    linear-gradient(165deg, var(--sidebar-bg) 0%, var(--main-bg) 55%);
  border-bottom: 1px solid var(--main-border-color);
}

.pf-hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
}

.pf-hero-eyebrow {
  color: var(--link-color);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1.05rem;
  margin: 0 0 1.25rem;
}

.pf-hero-title {
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}

.pf-hero-cta {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
}

.pf-hero-scroll {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted-color);
  font-size: 1.1rem;
  animation: pf-bob 2s ease-in-out infinite;
}

.pf-hero-scroll:hover {
  color: var(--link-color);
}

@keyframes pf-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* ------------------------------------------------------------
   Writing
   ------------------------------------------------------------ */
.pf-writing {
  margin-top: 3rem;
}

.pf-post-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--main-border-color);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.pf-post {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--main-border-color);
  transition: background 0.2s ease;
}

.pf-post:last-child {
  border-bottom: 0;
}

.pf-post:hover {
  background: var(--card-hover-bg);
  text-decoration: none;
}

.pf-post-title {
  color: var(--heading-color);
  font-weight: 600;
  font-size: 1.05rem;
}

.pf-post:hover .pf-post-title {
  color: var(--link-color);
}

.pf-post-date {
  color: var(--text-muted-color);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Selected Work cards
   ------------------------------------------------------------ */
.pf-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.pf-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--main-border-color);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 1.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pf-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
}

.pf-card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--link-color);
  margin-bottom: 0.6rem;
}

.pf-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
}

.pf-card-desc {
  color: var(--text-muted-color);
  font-size: 0.95rem;
  margin: 0 0 1rem;
  flex: 1;
}

.pf-card-status {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted-color);
  margin: 0;
}

.pf-earlier {
  margin-top: 2rem;
  font-size: 0.95rem;
  color: var(--text-muted-color);
}

.pf-earlier a {
  color: var(--text-color);
  text-decoration: underline;
  text-decoration-color: var(--link-underline-color);
  text-underline-offset: 2px;
}

.pf-earlier a:hover {
  color: var(--link-color);
}

/* ------------------------------------------------------------
   Demos
   ------------------------------------------------------------ */
.pf-demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.pf-demo-card {
  background: var(--card-bg);
  border: 1px solid var(--main-border-color);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.pf-demo-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--img-bg);
  margin-bottom: 1rem;
}

.pf-demo-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pf-demo-pending {
  color: var(--text-muted-color);
  font-style: italic;
  margin: 0.25rem 0 1rem;
}

.pf-demo-link {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.92rem;
}

/* ------------------------------------------------------------
   Publications
   ------------------------------------------------------------ */
.pf-pub-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pf-pub {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--main-border-color);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 1.75rem;
}

.pf-pub-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}

.pf-pub-meta {
  color: var(--text-muted-color);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.pf-pub-desc {
  color: var(--text-muted-color);
  font-size: 0.95rem;
  margin: 0;
}

.pf-pub .pf-btn {
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Experience timeline
   ------------------------------------------------------------ */
.pf-timeline {
  border-left: 2px solid var(--main-border-color);
  margin-left: 0.5rem;
  padding-left: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.pf-role {
  position: relative;
}

.pf-role::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 5px);
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--link-color);
  border: 2px solid var(--main-bg);
}

.pf-role-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pf-role-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.pf-role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--link-color) 14%, var(--main-bg));
  color: var(--link-color);
}

.pf-role-desc {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted-color);
  font-size: 0.95rem;
}

.pf-role-desc li {
  margin-bottom: 0.35rem;
}

/* ------------------------------------------------------------
   Contact
   ------------------------------------------------------------ */
.pf-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.pf-social {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.3rem;
  background: var(--card-bg);
  border: 1px solid var(--main-border-color);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  color: var(--text-color);
  font-weight: 600;
  font-size: 0.92rem;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.pf-social i {
  color: var(--link-color);
  font-size: 1.05rem;
}

.pf-social:hover {
  color: var(--link-color);
  border-color: var(--link-color);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.pf-footer {
  border-top: 1px solid var(--main-border-color);
  background: var(--highlight-bg-color);
  padding: 2rem 1.5rem;
  text-align: center;
}

.pf-footer p {
  margin: 0;
  color: var(--text-muted-color);
  font-size: 0.88rem;
}

/* ------------------------------------------------------------
   Reveal-on-scroll (only when JS is available)
   ------------------------------------------------------------ */
.pf-js .pf-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.pf-js .pf-reveal.pf-visible {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 860px) {
  .pf-section {
    padding: 4rem 0;
  }

  .pf-pub {
    flex-direction: column;
  }

  .pf-post {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .pf-hero {
    padding: 4rem 1.5rem;
  }
}

/* ------------------------------------------------------------
   Hero terminal (simulated inference session)
   ------------------------------------------------------------ */
.pf-hero-terminal {
  max-width: 640px;
  margin: 2.25rem auto 0;
  text-align: left;
  border: 1px solid var(--main-border-color);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}

.pf-hero-terminal:hover {
  border-color: color-mix(in srgb, var(--link-color) 55%, var(--main-border-color));
}

.pf-terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--main-border-color);
  background: color-mix(in srgb, var(--main-bg) 55%, transparent);
}

.pf-terminal-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
}

/* Literal traffic-light colors (deliberate exception to theme-only palette) */
.pf-dot-red { background: #ff5f57; }
.pf-dot-amber { background: #febc2e; }
.pf-dot-green { background: #28c840; }

.pf-terminal-label {
  margin-left: auto;
  color: var(--text-muted-color);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pf-terminal-body {
  margin: 0;
  padding: 1rem 1.1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.pf-term-dollar {
  color: var(--checkbox-checked-color);
  font-weight: 700;
}

.pf-term-prompt {
  color: var(--text-muted-color);
}

.pf-term-output {
  display: block;
  color: var(--text-color);
}

.pf-term-caret {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 2px;
  background: var(--link-color);
  vertical-align: text-bottom;
  animation: pf-blink 1s steps(1) infinite;
}

@keyframes pf-blink {
  50% { opacity: 0; }
}

.pf-term-stats {
  margin-top: 0.5rem;
  color: var(--link-color);
}

/* ------------------------------------------------------------
   Hero motion: orbs, entrance stagger
   ------------------------------------------------------------ */
.pf-hero {
  overflow: hidden;
}

.pf-hero-inner {
  position: relative;
  z-index: 1;
}

.pf-hero-scroll {
  z-index: 1;
}

.pf-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  will-change: transform;
}

.pf-hero-orb-a {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -140px;
  background: color-mix(in srgb, var(--link-color) 26%, transparent);
  animation: pf-orb-a 24s ease-in-out infinite alternate;
}

.pf-hero-orb-b {
  width: 360px;
  height: 360px;
  bottom: -140px;
  right: -100px;
  background: color-mix(in srgb, var(--checkbox-checked-color) 20%, transparent);
  animation: pf-orb-b 30s ease-in-out infinite alternate;
}

@keyframes pf-orb-a {
  to { transform: translate(60px, 40px) scale(1.1); }
}

@keyframes pf-orb-b {
  to { transform: translate(-50px, -30px) scale(0.95); }
}

.pf-hero-reveal {
  animation: pf-hero-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pf-hero-reveal-1 { animation-delay: 0.05s; }
.pf-hero-reveal-2 { animation-delay: 0.15s; }
.pf-hero-reveal-3 { animation-delay: 0.25s; }
.pf-hero-reveal-4 { animation-delay: 0.35s; }

@keyframes pf-hero-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html.pf-page { scroll-behavior: auto; }
  .pf-hero-scroll { animation: none; }
  .pf-js .pf-reveal { transition: none; }

  .pf-hero-orb {
    animation: none;
  }

  .pf-hero-reveal {
    animation: none;
  }

  .pf-term-caret {
    animation: none;
  }
}
