/* ============================================================
   CASE STUDY — MILGO
   Education platform · branding + product design
   Palette sampled directly from the project assets.
   ============================================================ */

/* ── PAGE-SCOPED TOKENS (MILGO palette) ────────────────────── */
:root {
  --mg-cream:   #F3EDE5;   /* brand background — shapes, icons, logo */
  --mg-paper:   #F8F7F4;   /* near-white — statement + overview      */
  --mg-blue:    #4778E9;   /* primary brand blue — CTA               */
  --mg-green:   #43B980;   /* closing green                          */
  --mg-yellow:  #FED485;   /* product screens                        */
  --mg-lilac:   #E8CCF7;   /* gradient start — device mockups        */
  --mg-pink:    #F9D3CE;   /* gradient end — device mockups          */
  --mg-orange:  #F26B4E;   /* accent                                 */
  --mg-purple:  #C9A9F5;   /* accent                                 */
  --mg-ink:     #1C1C1C;   /* wordmark + headings                    */
  --mg-muted:   #6B6660;   /* secondary text                         */
  --mg-rule:    #E2DACF;   /* hairlines                              */
}

/* NOTE: index.html also loads this file (for the portfolio card at
   the bottom), so nothing here may style `body` or any global tag. */

/* ── SCROLL-REVEAL ANIMATIONS ──────────────────────────────── */
.mg-anim-up    { opacity: 0; transform: translateY(36px); transition: opacity .75s ease, transform .75s ease; }
.mg-anim-left  { opacity: 0; transform: translateX(-50px); transition: opacity .75s ease, transform .75s ease; }
.mg-anim-right { opacity: 0; transform: translateX(50px);  transition: opacity .75s ease, transform .75s ease; }
.mg-anim-up.in,
.mg-anim-left.in,
.mg-anim-right.in { opacity: 1; transform: none; }

/* ── HERO ──────────────────────────────────────────────────── */
.mg-hero {
  background: var(--mg-cream);
  padding: 200px 80px 110px;
  border-bottom: 1px solid var(--mg-rule);
}

.mg-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.mg-wordmark {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -1.5px;
  color: var(--mg-ink);
  line-height: 1;
  direction: ltr;
  text-align: right;   /* RTL page — the mark sits at the start of the line */
  margin-bottom: 40px;
}

.mg-hero-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 200;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 1.14;
  color: var(--mg-ink);
  margin: 0 0 28px;
  max-width: 22ch;
}

.mg-hero-sub {
  font-size: 19px;
  line-height: 1.65;
  color: var(--mg-muted);
  max-width: 46ch;
  margin: 0 0 48px;
}

.mg-hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;   /* LTR row, parked on the RTL start edge */
  gap: 12px;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--mg-muted);
  direction: ltr;
}
.mg-meta-dot { color: var(--mg-rule); }

/* ── MEDIA BLOCKS ──────────────────────────────────────────────
   Every video / still is edge-to-edge and sits on a background
   sampled from the asset itself, so the sections fuse together
   with no visible seam.
   ─────────────────────────────────────────────────────────── */
.mg-media {
  width: 100%;
  line-height: 0;
  background: var(--mg-cream);
}

.mg-media video,
.mg-media img {
  display: block;
  width: 100%;
  height: auto;
}

/* backgrounds per asset */
.mg-media--paper    { background: var(--mg-paper); }
.mg-media--cream    { background: var(--mg-cream); }
.mg-media--blue     { background: var(--mg-blue); }
.mg-media--green    { background: var(--mg-green); }
.mg-media--gradient { background: linear-gradient(100deg, var(--mg-lilac), var(--mg-pink)); }

/* square assets (logo build-up, chart card) — framed instead of
   full-bleed, otherwise a 1:1 asset becomes a screen-high wall */
.mg-media--boxed {
  padding: 90px 80px;
}
.mg-media--boxed video,
.mg-media--boxed img {
  max-width: 620px;
  margin: 0 auto;
}

/* two assets side by side — the phone mockup is portrait and the video
   near-square, so they're centred on a shared baseline rather than
   stretched to matching heights */
.mg-media--pair .mg-pair-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  gap: 56px;
  max-width: 1100px;
  margin: 0 auto;
}

/* the phone is portrait and much taller than the near-square video —
   cap it so neither side dominates the row */
.mg-media--pair .mg-pair-inner img {
  max-height: 620px;
  width: auto;
}

.mg-media--pair .mg-pair-inner video,
.mg-media--pair .mg-pair-inner img {
  max-width: 100%;
  margin: 0;
}

/* ── OVERVIEW ──────────────────────────────────────────────── */
.mg-overview {
  background: var(--mg-paper);
  padding: 110px 80px 120px;
}

.mg-overview-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 90px;
  max-width: 1100px;
  margin: 0 auto;
}

.mg-sub-h {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #A9A29A;
  margin: 34px 0 10px;
}
.mg-sub-h:first-of-type { margin-top: 0; }

.mg-body {
  font-size: 17px;
  line-height: 1.8;
  color: #33302C;
  margin: 0;
  max-width: 60ch;
}

.mg-body + .mg-body {
  margin-top: 14px;
}

.mg-body-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  max-width: 60ch;
}

.mg-body-list li {
  font-size: 17px;
  line-height: 1.8;
  color: #33302C;
  padding-inline-start: 18px;
  position: relative;
}

.mg-body-list li + li {
  margin-top: 12px;
}

/* RTL-safe bullet — inset start edge works on both sides */
.mg-body-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mg-orange);
}

.mg-body-list strong {
  color: var(--mg-ink);
  font-weight: 700;
}

/* Full width of the credits column so it reads as the page's main CTA */
.mg-live-link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 34px;
  background: var(--mg-blue);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 22px 34px;
  border-radius: 50px;
  text-decoration: none;
  transition: background .25s, transform .2s;
}

.mg-live-link:hover {
  background: #2f5ed0;
  transform: translateY(-2px);
}

.mg-meta-table {
  border-top: 1px solid var(--mg-rule);
}

.mg-meta-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px 0;
  border-bottom: 1px solid var(--mg-rule);
}

.mg-meta-key {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #A9A29A;
}

.mg-meta-val {
  font-size: 14px;
  color: var(--mg-ink);
  direction: ltr;
}

/* ── CLOSING QUOTE ─────────────────────────────────────────── */
.mg-closing {
  background: var(--mg-green);
  padding: 130px 80px 140px;
  text-align: center;
}

.mg-closing-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 200;
  font-size: clamp(34px, 4.6vw, 62px);
  line-height: 1.2;
  color: #fff;
  margin: 0 auto 24px;
  max-width: 18ch;
}

.mg-closing-sub {
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
  max-width: 44ch;
  margin: 0 auto;
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .mg-hero          { padding: 150px 24px 80px; }
  .mg-wordmark      { font-size: 34px; margin-bottom: 28px; }
  .mg-hero-sub      { margin-bottom: 34px; }
  .mg-overview      { padding: 80px 24px 90px; }
  .mg-overview-grid { grid-template-columns: 1fr; gap: 50px; }
  .mg-media--boxed  { padding: 56px 24px; }
  .mg-media--pair .mg-pair-inner { grid-template-columns: 1fr; gap: 40px; }
  .mg-closing       { padding: 90px 24px 100px; }
}

/* ============================================================
   PORTFOLIO CARD (index.html) — CSS-drawn Milgo thumbnail
   ============================================================ */
.mg-card-visual {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--mg-cream);
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mg-card-visual::before {
  content: 'milgo';
  font-size: 48px;
  font-weight: 700;
  color: var(--mg-ink);
  letter-spacing: -2px;
  position: relative;
  z-index: 1;
}

.mg-card-visual .mg-cv-blob { position: absolute; }
.mg-card-visual .mg-cv-b1 {
  width: 80px; height: 80px;
  background: var(--mg-orange);
  border-radius: 999px;
  top: 12%; left: 8%;
}
.mg-card-visual .mg-cv-b2 {
  width: 64px; height: 32px;
  background: var(--mg-yellow);
  border-radius: 0 0 999px 999px;
  bottom: 16%; left: 12%;
}
.mg-card-visual .mg-cv-b3 {
  width: 58px; height: 58px;
  background: var(--mg-green);
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
  top: 20%; right: 9%;
}
.mg-card-visual .mg-cv-b4 {
  width: 46px; height: 62px;
  background: var(--mg-purple);
  border-radius: 3px;
  bottom: 12%; right: 14%;
}
.mg-card-visual .mg-cv-b5 {
  width: 44px; height: 44px;
  background: var(--mg-blue);
  border-radius: 50%;
  top: 52%; right: 5%;
}


/* The nav is fixed, so on a phone it sits on top of the opening image.
   Reserve its height here — clears the fixed nav. */
@media (max-width: 900px) {
  /* :first-of-type would mean "first <div> among its siblings", and that is
     the mobile menu — so it matched nothing. Target the block that actually
     follows the menu. */
  #mobile-menu + .mg-media {
    padding-top: 70px;
  }
}
