/* =========================================================
   The Vibe Coding Log — Landing Page Styles
   1) Reset  2) Variables  3) Typography  4) Layout
   5) Components  6) Sections  7) Animations  8) Responsive
   ========================================================= */

/* ---------- 1) RESET ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- 2) VARIABLES ---------- */
:root {
  --primary: #1e3a8a;
  --secondary: #3b82f6;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --text: #1f2937;
  --muted: #64748b;
  --white: #ffffff;
  --border: #e2e8f0;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.16);

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1200px;
  --transition: 0.3s ease;
}

/* ---------- 3) TYPOGRAPHY ---------- */
body {
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont,
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

/* ---------- 4) LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 820px;
}

.section {
  padding: 96px 0;
}

.section--alt {
  background: var(--white);
}

.section__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.section__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 12px;
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 14px;
}

.section__lead {
  color: var(--muted);
  font-size: 1.05rem;
}

/* ---------- 5) COMPONENTS: Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition), color var(--transition);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--secondary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  background: var(--primary);
}

.btn--accent {
  background: var(--accent);
  color: #4a2e00;
  box-shadow: var(--shadow-md);
}

.btn--accent:hover {
  background: #fbbf24;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.28);
}

.btn--outline {
  background: transparent;
  color: var(--secondary);
  border: 1.5px solid var(--secondary);
}

.btn--outline:hover {
  background: var(--secondary);
  color: var(--white);
}

.btn--small {
  padding: 9px 18px;
  font-size: 0.85rem;
}

.btn--large {
  padding: 17px 40px;
  font-size: 1.15rem;
}

/* ---------- 6) NAVIGATION ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.nav.is-scrolled {
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary);
}

.nav__menu ul {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__link {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--text);
  transition: color var(--transition), background var(--transition);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--secondary);
  background: rgba(59, 130, 246, 0.1);
}

.nav__link--cta {
  background: var(--secondary);
  color: var(--white);
}

.nav__link--cta:hover,
.nav__link--cta.is-active {
  background: var(--primary);
  color: var(--white);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav__toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav__toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--white);
  padding: 110px 0 60px;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0f1f4d 0%, #1e3a8a 45%, #3b82f6 100%);
  z-index: -2;
}

.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
      circle at 20% 30%,
      rgba(245, 158, 11, 0.25),
      transparent 40%
    ),
    radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.35), transparent 45%);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero__title {
  color: var(--white);
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin-bottom: 18px;
}

.hero__subtitle {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 400;
  margin-bottom: 22px;
}

.hero__subtitle strong {
  color: var(--accent);
  font-weight: 800;
}

.hero__desc {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 520px;
  margin-bottom: 34px;
}

.hero__buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero__cover {
  display: flex;
  justify-content: center;
}

.hero__cover-img {
  width: 320px;
  max-width: 80%;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  transform: perspective(1000px) rotateY(-12deg);
  transition: transform 0.5s ease;
}

.hero__cover-img:hover {
  transform: perspective(1000px) rotateY(0deg) translateY(-8px);
}

.hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  color: var(--white);
  animation: bounce 1.8s infinite;
}

/* ---------- OVERVIEW ---------- */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.overview-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 18px;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.section--alt .overview-card {
  background: var(--white);
}

.overview-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.overview-card__icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.overview-card h3 {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.overview-card p {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}

/* ---------- FEATURES ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 34px 26px;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.feature-card__icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  margin-bottom: 18px;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--muted);
  font-size: 0.97rem;
}

/* ---------- TIMELINE ---------- */
.timeline {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding-left: 40px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: linear-gradient(var(--secondary), var(--accent));
  border-radius: 3px;
}

.timeline__item {
  position: relative;
  padding: 0 0 36px 28px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 4px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border: 4px solid var(--secondary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.timeline__day {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.timeline__content h3 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.timeline__content p {
  color: var(--muted);
}

/* ---------- PROJECTS ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}

.project-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.project-card__body {
  padding: 20px;
}

.project-card__body h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.project-card__body p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
  min-height: 48px;
}

/* ---------- RESOURCES ---------- */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.resource-card {
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 28px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.resource-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.resource-card img {
  margin: 0 auto 18px;
}

.resource-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.resource-card p {
  color: var(--muted);
  margin-bottom: 22px;
}

/* ---------- ACCORDION ---------- */
.accordion__item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  overflow: hidden;
}

.accordion__header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  text-align: left;
  font-size: 1.05rem;
  color: var(--text);
  transition: background var(--transition);
}

.accordion__header:hover {
  background: var(--bg);
}

.accordion__header strong {
  color: var(--secondary);
  margin-right: 6px;
}

.accordion__icon {
  font-size: 1.5rem;
  color: var(--secondary);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.accordion__item.is-open .accordion__icon {
  transform: rotate(45deg);
}

.accordion__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition);
}

.accordion__panel ul {
  padding: 0 24px 22px 44px;
}

.accordion__panel li {
  position: relative;
  color: var(--muted);
  padding: 6px 0;
}

.accordion__panel li::before {
  content: "•";
  position: absolute;
  left: -18px;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- AUTHOR ---------- */
.author {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

.author__photo img {
  width: 280px;
  height: 280px;
  object-fit: contain;
}

.author__info h3 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.author__role {
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 16px;
}

.author__bio {
  color: var(--muted);
  margin-bottom: 20px;
}

.author__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.author__tags li {
  background: rgba(59, 130, 246, 0.1);
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
}

.author__social {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- PURCHASE CTA ---------- */
.purchase {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  padding: 90px 0;
  text-align: center;
}

.purchase__title {
  color: var(--white);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 16px;
}

.purchase__desc {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 34px;
}

/* ---------- FOOTER ---------- */
.footer {
  background: #0f172a;
  color: rgba(255, 255, 255, 0.75);
  padding: 40px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--white);
}

.footer__copy {
  font-size: 0.9rem;
}

/* ---------- BACK TO TOP ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--white);
  font-size: 1.4rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity var(--transition), transform var(--transition),
    background var(--transition);
  z-index: 900;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary);
  transform: translateY(-4px);
}

/* ---------- 7) ANIMATIONS ---------- */
@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

/* Hero entrance: Fade In + Slide Up + Scale (CSS only) */
.hero__text {
  animation: heroFadeUp 0.9s ease both;
}

.hero__cover {
  animation: heroScale 1s ease 0.15s both;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroScale {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Scroll reveal (Intersection Observer) */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero animations run on load, so don't keep them hidden via .reveal */
.hero .reveal {
  opacity: 1;
  transform: none;
}

/* ---------- 8) RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .overview-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .feature-grid,
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .section {
    padding: 72px 0;
  }

  /* Mobile nav */
  .nav__toggle {
    display: flex;
  }

  .nav__menu {
    position: fixed;
    top: 70px;
    right: 0;
    width: min(78vw, 320px);
    height: calc(100vh - 70px);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--transition);
    padding: 24px;
  }

  .nav__menu.is-open {
    transform: translateX(0);
  }

  .nav__menu ul {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav__link {
    display: block;
    padding: 14px 16px;
  }

  .hero {
    text-align: center;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero__desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__buttons {
    justify-content: center;
  }

  .hero__cover {
    order: -1;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .author {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 28px;
  }

  .author__photo {
    justify-self: center;
  }

  .author__tags,
  .author__social {
    justify-content: center;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 18px;
  }

  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .hero__buttons {
    flex-direction: column;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
