/* ============================================================
   MintedFrame Style System — MicroGardenCore
   Namespace: mf-
   ============================================================ */

/* -------------------  Root Tokens  ------------------- */
:root {
  --mf-primary: #88d6c2;
  --mf-surface: #f6f8f7;
  --mf-paper: #fdfdfc;
  --mf-ink: #1b1b1b;
  --mf-muted: #707070;
  --mf-edge: rgba(0,0,0,0.08);
  --mf-shadow: rgba(0,0,0,0.1);

  --mf-radius: 8px;
  --mf-width: 1024px;
  --mf-space: 1.5rem;

  --mf-motion-fast: 150ms;
  --mf-motion-med: 260ms;
  --mf-motion-slow: 420ms;
  --mf-easing: cubic-bezier(.22,.61,.36,1);
}

/* -------------------  Reset & Base  ------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--mf-paper);
  color: var(--mf-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--mf-radius);
}

a {
  color: var(--mf-primary);
  text-decoration: none;
  transition: color var(--mf-motion-fast) var(--mf-easing);
}

a:hover {
  color: #4bbfa0;
}

/* Paragraph justification rule (mandatory) */
article p,
section p,
main p,
p {
  text-align: justify !important;
  text-justify: inter-word !important;
  -webkit-hyphens: auto !important;
  -ms-hyphens: auto !important;
  hyphens: auto !important;
}

/* -------------------  Layout  ------------------- */
.mf-header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  background: linear-gradient(180deg, #eefaf6, #ffffff 60%);
  box-shadow: 0 2px 8px var(--mf-shadow);
  position: relative;
  z-index: 2;
}

.mf-logo {
  width: 180px;
  margin: 0 auto 1rem;
}

.mf-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.mf-nav a {
  position: relative;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
  color: var(--mf-ink);
}

.mf-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 2px;
  width: 100%;
  background: var(--mf-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--mf-motion-med) var(--mf-easing);
}

.mf-nav a:hover::after {
  transform: scaleX(1);
}

.mf-main {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: var(--mf-space);
  max-width: var(--mf-width);
  margin: 3rem auto;
  padding: 0 1rem;
}

.mf-article {
  background: var(--mf-surface);
  border-radius: var(--mf-radius);
  box-shadow: 0 2px 8px var(--mf-shadow);
  padding: 2rem;
}

.mf-sidebar {
  background: #ffffff;
  border-radius: var(--mf-radius);
  box-shadow: 0 2px 8px var(--mf-shadow);
  padding: 1.5rem;
  height: fit-content;
}

/* -------------------  Typography  ------------------- */
h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--mf-ink);
  line-height: 1.25;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.6rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.mf-dek {
  font-size: 1.1rem;
  color: var(--mf-muted);
  margin-bottom: 1.5rem;
}

/* -------------------  Hero Image  ------------------- */
.mf-hero {
  margin-bottom: 2rem;
}

.mf-hero img {
  border: 2px solid var(--mf-primary);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* -------------------  Sections  ------------------- */
.mf-section {
  margin-bottom: 2.5rem;
  position: relative;
}

.mf-section::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--mf-primary), transparent);
  transition: width var(--mf-motion-slow) var(--mf-easing);
}

.mf-section.is-seen::before {
  width: 100%;
}

.mf-section p + p {
  margin-top: 1rem;
}

/* -------------------  Sidebar  ------------------- */
.mf-card {
  border: 1px solid var(--mf-edge);
  border-radius: var(--mf-radius);
  padding: 1rem;
  transition: transform var(--mf-motion-fast) var(--mf-easing),
              box-shadow var(--mf-motion-fast) var(--mf-easing),
              border-color var(--mf-motion-fast) var(--mf-easing);
}

.mf-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--mf-shadow);
  border-color: rgba(0,0,0,0.15);
}

.mf-card h3 {
  margin-bottom: 0.5rem;
  color: var(--mf-ink);
}

.mf-card ul {
  list-style: none;
}

.mf-card li {
  margin-bottom: 0.4rem;
}

/* -------------------  Footer  ------------------- */
.mf-footer {
  text-align: center;
  padding: 2rem 1rem;
  background: #f9f9f8;
  font-size: 0.9rem;
  color: var(--mf-muted);
  border-top: 1px solid var(--mf-edge);
}

/* -------------------  Back to Top Button  ------------------- */
.mf-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.15);
  background: var(--mf-primary);
  color: #111;
  font: 700 18px/46px system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--mf-motion-med) var(--mf-easing),
              transform var(--mf-motion-med) var(--mf-easing);
  z-index: 9999;
}

.mf-to-top:hover {
  background: #a6e3d3;
}

.mf-to-top.mf-show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* -------------------  Motion & Delight  ------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(120% 60% at 80% 20%, rgba(255,255,255,.06), transparent 60%),
              linear-gradient(120deg, rgba(0,0,0,.02), rgba(255,255,255,.02));
  animation: mf-wash 24s ease-in-out infinite alternate;
  opacity: 0.35;
}

@keyframes mf-wash {
  0% { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(0,-2%,0) scale(1.02); }
}

/* -------------------  Reading Progress Bar  ------------------- */
.mf-progress {
  position: fixed;
  left: 0;
  top: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--mf-primary), transparent);
  z-index: 9998;
  transition: width var(--mf-motion-fast) linear;
}

/* -------------------  Responsive Adjustments  ------------------- */
@media (max-width: 900px) {
  .mf-main {
    grid-template-columns: 1fr;
  }
  .mf-sidebar {
    order: -1;
    margin-bottom: 2rem;
  }
}

@media (max-width: 600px) {
  .mf-nav ul {
    flex-direction: column;
    align-items: center;
  }
  .mf-article {
    padding: 1.5rem;
  }
}

.mf-footer {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 2rem 1rem;
  background: #f9f9f8;
  font-size: 0.9rem;
  color: var(--mf-muted);
  border-top: 1px solid var(--mf-edge);
}
