/* =========================================================
   CSS Development Lab 06
   Responsive Images + object-fit
   ========================================================= */

:root {
  --page-max: 1200px;
  --text: #171717;
  --muted: #686868;
  --line: #e6e6e0;
  --surface: #ffffff;
  --soft: #f5f5f1;
  --radius: 20px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.07);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--surface);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
}

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

.page-wrap {
  width: min(calc(100% - 40px), var(--page-max));
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 14px;
  color: #858585;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.intro {
  padding: clamp(72px, 10vw, 130px) 0 clamp(58px, 8vw, 90px);
  background:
    radial-gradient(circle at 86% 14%, rgba(0, 0, 0, 0.05), transparent 27%),
    linear-gradient(180deg, #fafaf8 0%, #f3f3ef 100%);
}

.intro-inner {
  max-width: 980px;
}

.intro h1,
.section-head h2,
.compare-copy h2 {
  margin: 0;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.intro h1 {
  font-size: clamp(2.8rem, 7vw, 6rem);
}

.intro-desc {
  max-width: 780px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
}

.lab {
  padding: clamp(80px, 10vw, 130px) 0;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr);
  align-items: end;
  gap: clamp(28px, 6vw, 80px);
}

.section-head h2,
.compare-copy h2 {
  font-size: clamp(2rem, 4.5vw, 4.5rem);
}

.section-head > p,
.compare-copy > p {
  margin: 0;
  color: var(--muted);
}

/* ---------- Common demo cards ---------- */

.demo-grid {
  margin-top: clamp(38px, 6vw, 60px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 28px);
}

.demo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.demo-media {
  overflow: hidden;
  background: #ecece7;
}

.demo-media img {
  width: 100%;
  height: 100%;
}

.ratio-4-3 {
  aspect-ratio: 4 / 3;
}

.logo-box {
  aspect-ratio: 4 / 3;
  padding: clamp(28px, 5vw, 70px);
}

.avatar-box {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: clamp(30px, 5vw, 64px);
  background: #efefeb;
}

.avatar-box img {
  width: min(68%, 280px);
  aspect-ratio: 1;
  border-radius: 50%;
}

.banner-box {
  aspect-ratio: 16 / 8;
}

.cover img {
  object-fit: cover;
}

.contain img {
  object-fit: contain;
}

.focus-right img {
  object-position: 78% center;
}

.demo-body {
  padding: 24px;
}

.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: #555;
  font-size: 0.75rem;
  font-weight: 750;
}

.demo-body h3 {
  margin: 14px 0 0;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  line-height: 1.22;
}

.demo-body p {
  margin: 12px 0 0;
  color: var(--muted);
}

/* ---------- Comparison ---------- */

.compare {
  padding: 0 0 clamp(90px, 11vw, 140px);
}

.compare-grid {
  padding: clamp(30px, 6vw, 64px);
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1.2fr);
  align-items: center;
  gap: clamp(36px, 7vw, 90px);
  border-radius: 28px;
  background: var(--soft);
}

.compare-copy > p {
  margin-top: 22px;
}

.compare-demo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.compare-item {
  display: grid;
  gap: 10px;
}

.compare-item strong {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.mini-frame {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.mini-frame img {
  width: 100%;
  height: 100%;
}

/* ---------- Notes ---------- */

.notes {
  padding: 0 0 clamp(90px, 12vw, 150px);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.notes-grid article {
  min-height: 220px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.notes-grid span {
  color: #999;
  font-size: 0.78rem;
  font-weight: 800;
}

.notes-grid h3 {
  margin: auto 0 10px;
  font-size: 1.3rem;
}

.notes-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .section-head,
  .compare-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .page-wrap {
    width: calc(100% - 28px);
  }

  .demo-grid,
  .compare-demo {
    grid-template-columns: 1fr;
  }

  .banner-box {
    aspect-ratio: 4 / 3;
  }

  .compare-grid {
    padding: 24px;
  }
}

:focus-visible {
  outline: 2px solid #171717;
  outline-offset: 3px;
}
