/* Mirco Cloud Primer — design system (original to this project) */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --teal-900: #0b4f4c;
  --teal-700: #0e8e89;
  --teal-600: #129e97;
  --teal-500: #1fbdb5;
  --teal-300: #74e3db;
  --teal-100: #e7fbfa;
  --orange-600: #f2922a;
  --orange-500: #fbac4a;
  --orange-100: #fff1dd;
  --ink: #142428;
  --ink-soft: #3c5458;
  --gray-700: #4c5c60;
  --gray-400: #8aa0a3;
  --gray-200: #d9e6e6;
  --gray-100: #eff6f6;
  --white: #ffffff;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 2px rgba(11, 79, 76, 0.06), 0 6px 20px rgba(11, 79, 76, 0.08);
  --maxw: 1180px;
  --font-head: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  font-size: 17px;
}

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--teal-900); line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.9rem); margin-top: 1.6em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--teal-700); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--orange-600); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.3em; }

:focus-visible {
  outline: 3px solid var(--orange-500);
  outline-offset: 2px;
  border-radius: 4px;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--teal-900); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header { border-bottom: 1px solid var(--gray-200); background: var(--white); position: sticky; top: 0; z-index: 50; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--teal-900); text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand:hover { color: var(--teal-700); }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--ink-soft); font-weight: 600; font-size: 0.95rem; text-decoration: none; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--teal-100); color: var(--teal-900); }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .main-nav { display: none; width: 100%; flex-direction: column; gap: 2px; }
  .main-nav.open { display: flex; }
  .site-header .bar { flex-wrap: wrap; }
  .nav-toggle {
    display: inline-flex; margin-left: auto; background: var(--teal-100); border: none; border-radius: var(--radius-sm);
    padding: 8px 12px; font-weight: 700; color: var(--teal-900); cursor: pointer;
  }
}

/* Photography (hero, category banners, article headers) */
.hero-media { margin-top: 28px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.hero-media img { width: 100%; height: auto; display: block; aspect-ratio: 1200 / 627; object-fit: cover; }
.category-banner { border-radius: var(--radius-lg); overflow: hidden; margin: 18px 0 28px; box-shadow: var(--shadow-card); }
.category-banner img { width: 100%; height: auto; display: block; aspect-ratio: 1200 / 627; object-fit: cover; max-height: 320px; }
.article-photo { border-radius: var(--radius-md); overflow: hidden; margin: 18px 0 8px; box-shadow: var(--shadow-card); }
.article-photo img { width: 100%; height: auto; display: block; aspect-ratio: 1200 / 627; object-fit: cover; max-height: 360px; }
.photo-credit { font-size: 0.75rem; color: var(--gray-400); text-align: right; margin: 4px 0 0; }
.photo-credit a { color: inherit; }

/* Hero */
.hero { background: linear-gradient(160deg, var(--teal-100), #ffffff 60%); padding: 56px 0 44px; }
.eyebrow { color: var(--orange-600); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.85rem; }
.eyebrow a { color: inherit; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* Flowing-lines hero background (adapted from KokonutUI Background Paths, MIT) */
.hero--paths { position: relative; overflow: hidden; }
.hero--paths .container { position: relative; }
.paths-bg {
  position: absolute; inset: 0; pointer-events: none; color: var(--teal-600);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent), linear-gradient(to right, rgb(0 0 0 / 0.22), #000 62%);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent), linear-gradient(to right, rgb(0 0 0 / 0.22), #000 62%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.paths-bg canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 0.5s ease-out; }
.paths-toggle {
  position: absolute; right: 20px; bottom: 12px; padding: 4px 12px; border: 1px solid var(--gray-200);
  border-radius: 999px; background: rgba(255, 255, 255, 0.75); color: var(--ink-soft);
  font: inherit; font-size: 0.8rem; cursor: pointer;
}
.paths-toggle:hover { border-color: var(--teal-500); color: var(--teal-900); }
@media print { .paths-bg, .paths-toggle { display: none !important; } }

.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: var(--radius-sm); padding: 12px 20px; font-weight: 700; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-size: 1rem; font-family: var(--font-body); }
.btn-primary { background: var(--teal-700); color: #fff; }
.btn-primary:hover { background: var(--teal-900); color: #fff; }
.btn-secondary { background: #fff; color: var(--teal-900); border-color: var(--teal-500); }
.btn-secondary:hover { background: var(--teal-100); color: var(--teal-900); }
.btn-ghost { background: transparent; color: var(--teal-700); padding: 10px 14px; }

/* Sections / grids */
.section { padding: 48px 0; }
.section-alt { background: var(--gray-100); }
.section-head { max-width: 70ch; margin-bottom: 28px; }
.grid { display: grid; gap: 20px; }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid-5 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-5, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-card); }
.card h3 { margin-top: 0; }
.card a.card-link { text-decoration: none; color: inherit; display: block; }
.card a.card-link:hover h3 { color: var(--teal-700); }

.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: 0.02em; }
.badge-level-beginner { background: var(--teal-100); color: var(--teal-900); }
.badge-level-intermediate { background: var(--orange-100); color: var(--orange-600); }
.badge-model { background: var(--gray-100); color: var(--ink-soft); border: 1px solid var(--gray-200); }

/* Breadcrumbs */
.breadcrumbs { font-size: 0.85rem; color: var(--gray-700); padding: 14px 0; }
.breadcrumbs a { color: var(--gray-700); text-decoration: none; }
.breadcrumbs a:hover { color: var(--teal-700); text-decoration: underline; }
.breadcrumbs li { display: inline; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin: 0 8px; color: var(--gray-400); }

/* Article */
.article-header { padding: 36px 0 10px; }
.article-meta { color: var(--gray-700); font-size: 0.9rem; display: flex; gap: 14px; flex-wrap: wrap; }
.article-body { max-width: 72ch; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.95rem; }
.article-body th, .article-body td { border: 1px solid var(--gray-200); padding: 10px 12px; text-align: left; vertical-align: top; }
.article-body th { background: var(--teal-100); color: var(--teal-900); }
.article-body blockquote { border-left: 4px solid var(--orange-500); margin: 1.4em 0; padding: 4px 1.2em; color: var(--ink-soft); background: var(--orange-100); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.callout { border: 1px solid var(--teal-300); background: var(--teal-100); border-radius: var(--radius-md); padding: 16px 18px; margin: 1.4em 0; }
.callout-warning { border-color: var(--orange-500); background: var(--orange-100); }
.faq-item { border-bottom: 1px solid var(--gray-200); padding: 14px 0; }
.faq-item summary { cursor: pointer; font-weight: 700; color: var(--teal-900); }
.related-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.related-list a { display: block; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); text-decoration: none; }
.related-list a:hover { border-color: var(--teal-500); background: var(--teal-100); }
.sources-list { font-size: 0.9rem; color: var(--gray-700); }
.diagram { margin: 1.6em 0; text-align: center; }
.diagram svg { max-width: 100%; height: auto; }
.diagram figcaption { font-size: 0.85rem; color: var(--gray-700); margin-top: 8px; }

/* Explorer / library */
.explorer-toolbar { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-card); display: grid; gap: 14px; }
.search-field { display: flex; flex-direction: column; gap: 6px; }
.search-field label { font-weight: 700; font-size: 0.9rem; color: var(--teal-900); }
.search-field input[type="search"] {
  padding: 12px 14px; border: 2px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 1rem; width: 100%;
}
.search-field input[type="search"]:focus { border-color: var(--teal-500); }
.filters-row { display: flex; gap: 12px; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.filter-group label { font-weight: 700; color: var(--ink-soft); }
.filter-group select { padding: 8px 10px; border: 2px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 0.95rem; }
.tag-chip { border: 1px solid var(--gray-200); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 0.85rem; cursor: pointer; }
.tag-chip[aria-pressed="true"] { background: var(--teal-700); color: #fff; border-color: var(--teal-700); }

.results-meta { font-size: 0.9rem; color: var(--gray-700); margin: 16px 0 8px; }
.concept-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 8px; }
.concept-card .term-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.concept-card h3 { margin: 0; font-size: 1.1rem; }
.concept-card .def { font-weight: 600; }
.concept-card .analogy { color: var(--ink-soft); font-style: italic; }
.concept-card dl { margin: 6px 0 0; font-size: 0.92rem; }
.concept-card dt { font-weight: 700; color: var(--teal-900); margin-top: 8px; }
.concept-card dd { margin: 2px 0 0; color: var(--ink-soft); }
.concept-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.icon-btn { background: none; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 0.85rem; cursor: pointer; color: var(--ink-soft); }
.icon-btn[aria-pressed="true"] { border-color: var(--orange-500); color: var(--orange-600); background: var(--orange-100); }
.icon-btn:hover { border-color: var(--teal-500); color: var(--teal-700); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--gray-700); }
.empty-state .suggestions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

.compare-tray { position: sticky; bottom: 0; background: var(--teal-900); color: #fff; padding: 14px; border-radius: var(--radius-md) var(--radius-md) 0 0; display: none; }
.compare-tray.show { display: block; }
.compare-tray .container { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.compare-tray a { color: #fff; }
.compare-tray .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.compare-tray .btn-ghost:hover { color: var(--orange-500); border-color: var(--orange-500); }
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td { border: 1px solid var(--gray-200); padding: 10px 12px; vertical-align: top; text-align: left; }
.compare-table th { background: var(--teal-100); }

/* Forms */
form .field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
form label { font-weight: 700; font-size: 0.9rem; }
form input, form textarea, form select { padding: 10px 12px; border: 2px solid var(--gray-200); border-radius: var(--radius-sm); font: inherit; width: 100%; }
form input:focus, form textarea:focus, form select:focus { border-color: var(--teal-500); }
.form-note { font-size: 0.85rem; color: var(--gray-700); }

/* Footer */
.site-footer { background: var(--teal-900); color: #d7ece9; padding: 44px 0 26px; margin-top: 40px; }
.site-footer a { color: #d7ece9; }
.site-footer a:hover { color: var(--orange-500); }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.footer-grid h4 { color: #fff; font-size: 0.9rem; letter-spacing: 0.03em; text-transform: uppercase; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 0.92rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); margin-top: 28px; padding-top: 18px; font-size: 0.85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media print {
  .site-header, .site-footer, .compare-tray, .explorer-toolbar, .hero-actions { display: none !important; }
}
