/* =========================================================
   MOUX Method Cards – styles.css
   Clean, readable, minimal. Dark UI + modal + grid layout.
   ========================================================= */

:root {
  --bg: #0d0e11;
  --fg: #e9ecf1;
  --muted: #aab4c0;
  --card: #151821;
  --chip: #222638;
  --border: #2a3042;
  --accent: #67e8f9;
  --radius: 12px;
  --container: 1100px;
  --modal-max: 1080px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
}

.card-link {
  text-decoration: none;
  color: inherit;
}

.card-link * {
  text-decoration: none !important;
}

.logo {
  display: block;
  width: 120px;
  height: auto;
  margin: 2rem auto;
  line-height: 0;
}

.logo-wrapper {
  margin-top: 0;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px;
}

h1 { margin: 0 0 4px; font-size: 28px; }
h2 { margin: 0; font-size: 22px; }
h3 { margin: 40px 0 0; font-size: 24px; color: #cfd7e4; font-weight: 500; }
p, ol {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 200;
}

.tagline {
  color: var(--muted);
  margin-bottom: 16px;
}

.modal-title {
  font-size: 24px;
  font-weight: 150;
  color: #cfd7e4;
  padding: 0 0 0.1rem 0;
}

.intro {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
  font-size: 30px;
  font-weight: 300;
}

.divider {
  border-top: 1px solid var(--border);
  margin: 32px auto;
  max-width: 80vw;
}

.divider_trans {
  border-top: 0;
  margin: 32px auto;
  max-width: 600px;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}
.cardtitle {
  color: #FFF;
  text-decoration: none;
  font-weight: 400;
  font-size: 20px;
  cursor: pointer;
}

.cardtitle:hover {
  text-decoration: none;
  color: #FFF;
}

.cardtitle:visited {
  text-decoration: none;
  color: #FFF;
}
.cardtitle:focus {
  text-decoration: none;
  color: #FFF;
}


#search {
  flex: 1;
  min-width: 220px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #10121a;
  color: var(--fg);
  outline: none;
  font-size: 1.2rem;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--fg);
  padding: 12px 12px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 18px;
}

.chip.active {
  outline: 2px solid var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.card {
  background: var(--card);
  border: 1px solid #22283b;
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .12s ease, border-color .2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #2e3b59;
}

.phase {
  font-size: 12px;
  color: #91a0b6;
  background: #10131d;
  padding: 4px 8px;
  border-radius: 999px;
  width: max-content;
  border: 1px solid var(--border);
}

.title {
  font-weight: 400;
  font-size: 20px;
  margin: 2px 0;
}

.title-intro {
  font-weight: 400;
  font-size: 32px;
  margin: 2px 0;
}

.subtitle {
  color: var(--muted);
  margin: 0;
}

.subtitle-intro {
  text-align: center;
  font-size: 20px;
  font-weight: 150;
  color: var(--muted);
}

.time {
  font-size: 12px;
  color: #88f1ff;
  background: #092530;
  border: 1px solid #0f3b49;
  border-radius: 999px;
  padding: 4px 8px;
  width: max-content;
}

.card-open {
  margin-top: auto;
  align-self: flex-start;
  background: #111425;
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
}

.card-open:hover {
  border-color: #3b4971;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  gap: 12px;
}

.footer a {
  color: var(--fg);
  opacity: 0.9;
  text-decoration: none;
}

.footer .dot {
  opacity: 0.4;
  margin: 0 6px;
}

dialog {
  border: none;
  border-radius: 16px;
  max-width: var(--modal-max);
  width: 95vw;
  max-height: 90vh;
  background: #0f121a;
  color: var(--fg);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

dialog article {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 80vh;
}

.modal-header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid #1f2433;
  position: sticky;
  top: 0;
  background: #0f121a;
  z-index: 1;
}

.modal-header,
.meta {
  flex: 0 0 auto;
}

.phase-badge {
  font-size: 12px;
  background: #10131d;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.time-badge {
  font-size: 12px;
  background: #092530;
  border: 1px solid #0f3b49;
  border-radius: 999px;
  padding: 4px 8px;
}

.meta {
  padding: 8px 24px 0;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px 20px;
  padding-right: 12px;
  overscroll-behavior: contain;
}
/* Phase Badge Styling */
.phase {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Phase Colour Themes */
.phase.Understand {
  background-color: #5f6b8c; /* Blue */
}
.phase.Frame {
  background-color: #776089; /* Purple */
}
.phase.Make {
  background-color: #608781; /* Green */
}
.phase.Test {
  background-color: #84715f; /* Brown */
}
.phase.Reflect {
  background-color: #835f5f; /* Red/Coral */
}

/* Optional: Modal badge colour matching */
.phase-badge.Understand {
  background-color: #5f6b8c;
}
.phase-badge.Frame {
  background-color: #776089;
}
.phase-badge.Make {
  background-color: #608781;
}
.phase-badge.Test {
  background-color: #84715f;
}
.phase-badge.Reflect {
  background-color: #835f5f;
}

.close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 20px;
  line-height: 20px;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  z-index: 2;
}

html:has(dialog[open]) {
  overflow: hidden;
}

@media (max-width: 640px) {
  h1 { font-size: 24px; }
  .grid { grid-template-columns: 1fr; }
  .toolbar { gap: 8px; }
}