/* ==========================================================================
   WWCODING — Case Study System (Apple Design)
   Self-contained: fonts, tokens, layout, footer, responsive.
   ========================================================================== */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600;1,700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  --apple-bg-white: #FFFFFF;
  --apple-bg-light: #F5F5F7;
  --apple-bg-light-2: #E8E8ED;
  --apple-bg-dark: #1D1D1F;
  --apple-bg-dark-2: #161617;
  --apple-bg-card-dark: #242426;

  --apple-text-primary: #1D1D1F;
  --apple-text-secondary: #6E6E73;
  --apple-text-tertiary: #86868B;
  --apple-text-white: #FFFFFF;
  --apple-text-muted-dark: #A1A1A6;

  --apple-accent: #A84F3E;
  --apple-accent-hover: #BF5A47;
  --apple-accent-soft: #F5EAE7;
  --apple-link-blue: #0066CC;
  --apple-link-blue-hover: #0077ED;

  --apple-line: #D2D2D7;
  --apple-line-light: rgba(0, 0, 0, 0.08);
  --apple-line-dark: rgba(255, 255, 255, 0.12);

  --apple-font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
  --apple-font-serif: 'Playfair Display', Georgia, serif;
  --apple-font-mono: 'IBM Plex Mono', SFMono-Regular, Menlo, monospace;

  --apple-section-gap: clamp(80px, 10vw, 120px);
  --apple-content-max-width: 1200px;
  --apple-gutter: clamp(20px, 4vw, 48px);

  --apple-radius-card: 18px;
  --apple-radius-card-sm: 12px;
  --apple-radius-card-lg: 22px;
  --apple-radius-button: 980px;
  --apple-radius-badge: 8px;

  --apple-shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --apple-shadow-hover: 0 6px 16px rgba(0,0,0,0.08), 0 16px 36px rgba(0,0,0,0.12);
  --apple-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --apple-shadow-dark: 0 4px 20px rgba(0,0,0,0.35);

  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Resets ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--apple-bg-white);
}
body {
  background: var(--apple-bg-white);
  color: var(--apple-text-primary);
  font-family: var(--apple-font-sans);
  font-size: 16px;
  line-height: 1.53;
}
body, button, input, textarea { font-family: var(--apple-font-sans); }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 {
  font-family: var(--apple-font-serif);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
h1 em, h2 em {
  color: var(--apple-accent);
  font-style: italic;
  font-weight: 600;
}

/* ── Glass Topbar ── */
.case-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px clamp(20px, 5vw, 64px);
  background: rgba(29, 29, 31, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.case-nav a {
  font-family: var(--apple-font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--apple-text-muted-dark);
  transition: color .2s var(--ease);
}
.case-nav a:first-child {
  color: #FFFFFF;
  font-weight: 600;
}
.case-nav a:first-child span { color: var(--apple-accent); }
.case-nav a:last-child {
  color: var(--apple-link-blue);
  padding: 6px 14px;
  border-radius: var(--apple-radius-button);
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  transition: all .2s var(--ease);
}
.case-nav a:last-child:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* ── Case Main ── */
.case-main {
  max-width: var(--apple-content-max-width);
  margin: auto;
  padding: clamp(60px, 8vw, 100px) var(--apple-gutter);
}

.case-kicker {
  margin: 0 0 16px;
  color: var(--apple-accent);
  font: 500 11px var(--apple-font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 48px;
}
.case-hero h1 {
  font-size: clamp(3.2rem, 6.5vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
}
.case-lead {
  color: var(--apple-text-secondary);
  font-size: 18px;
  line-height: 1.5;
}

/* ── Media Card ── */
.case-media {
  margin-top: 40px;
  border-radius: var(--apple-radius-card);
  overflow: hidden;
  background: var(--apple-bg-dark);
  box-shadow: var(--apple-shadow-card);
  border: 1px solid var(--apple-line-light);
}
.case-media picture,
.case-media img,
.case-media video {
  width: 100%;
  max-height: 680px;
  object-fit: cover;
}

/* ── Facts Row ── */
.case-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.case-facts div {
  padding: 24px 28px;
  border-radius: var(--apple-radius-card);
  background: var(--apple-bg-light);
  border: 1px solid var(--apple-line-light);
}
.case-facts span {
  display: block;
  color: var(--apple-text-tertiary);
  font: 500 10px var(--apple-font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.case-facts strong {
  display: block;
  margin-top: 8px;
  font: 600 18px/1.3 var(--apple-font-sans);
  color: var(--apple-text-primary);
}

/* ── Content ── */
.case-copy {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 60px;
  margin-top: 80px;
  padding-top: 60px;
  border-top: 1px solid var(--apple-line-light);
}
.case-copy h2 {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  line-height: 1.05;
}
.case-copy p {
  color: var(--apple-text-secondary);
  font-size: 16px;
  line-height: 1.6;
}
.case-copy p + p { margin-top: 18px; }

/* ── Back Link ── */
.case-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 64px;
  padding: 12px 24px;
  border-radius: var(--apple-radius-button);
  background: var(--apple-bg-light);
  color: var(--apple-text-primary);
  font: 500 13px var(--apple-font-sans);
  transition: all 0.2s var(--ease);
}
.case-back:hover {
  background: var(--apple-bg-light-2);
  transform: translateY(-2px);
}

/* ── CTA Section ── */
.case-cta {
  padding: var(--apple-section-gap) 0;
  background: var(--apple-bg-dark);
  color: var(--apple-text-white);
  text-align: center;
}
.case-cta h2 {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  letter-spacing: -0.03em;
  color: var(--apple-text-white);
}
.case-cta h2 em { color: var(--apple-accent); }
.case-cta p {
  max-width: 480px;
  margin: 16px auto 0;
  color: var(--apple-text-tertiary);
  font-size: 16px;
}
.case-cta-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
}

/* ── Apple Pill Buttons ── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 28px;
  border-radius: var(--apple-radius-button);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all 0.25s var(--ease);
  cursor: pointer;
}
.button:hover { transform: translateY(-2px); }
.button span { font-size: 16px; }
.button-accent {
  background: var(--apple-accent);
  color: #FFFFFF;
}
.button-accent:hover {
  background: var(--apple-accent-hover);
  box-shadow: 0 4px 14px rgba(168, 79, 62, 0.35);
}
.button-light {
  background: rgba(255,255,255,0.12);
  color: #FFFFFF;
}
.button-light:hover {
  background: rgba(255,255,255,0.2);
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--apple-link-blue);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.text-link:hover {
  color: var(--apple-link-blue-hover);
  text-decoration: underline;
}

/* ── Footer ── */
.case-footer {
  padding: 48px 0 28px;
  background: var(--apple-bg-dark);
  color: var(--apple-text-tertiary);
  font-size: 13px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.case-footer-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.case-footer-top p {
  color: var(--apple-text-muted-dark);
  font-size: 14px;
  margin-top: 8px;
}
.case-footer-nav {
  display: flex;
  gap: 20px;
}
.case-footer-nav a {
  color: var(--apple-text-muted-dark);
  transition: color .2s;
}
.case-footer-nav a:hover { color: #FFFFFF; }
.case-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  font-size: 12px;
}
.case-footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--apple-font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #FFFFFF;
}
.case-footer-brand span { color: var(--apple-accent); }

/* ── Scroll Progress ── */
.scroll-progress {
  position: fixed;
  z-index: 60;
  inset: 0 0 auto;
  width: 0;
  height: 2px;
  background: var(--apple-accent);
}

/* ── Responsive ── */
@media (max-width: 800px) {
  .case-hero, .case-copy {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .case-facts { grid-template-columns: 1fr; }
  .case-main { padding: 48px 20px; }
  .case-cta-actions { flex-direction: column; gap: 12px; }
  .case-footer-top { flex-direction: column; gap: 20px; }
  .case-footer-nav { flex-wrap: wrap; }
  .case-footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
}

@media (max-width: 680px) {
  .case-nav { padding: 14px 20px; }
  .case-hero h1 { font-size: clamp(2.6rem, 9vw, 3.6rem); }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
