/* =========================================================
   ED242 e-Portfolio Kit: stylesheet
   ---------------------------------------------------------
   Want different colours? Change the values in :root below.
   Everything else on the site uses these variables.
   ========================================================= */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  /* Brand */
  --canvas: #F8F8F6;        /* warm off-white page */
  --paper: #FFFFFF;         /* cards */
  --purple: #4C2A85;        /* UiTM purple */
  --purple-dark: #3A1F68;
  --purple-tint: #EFEAF6;
  --gold: #B8860B;          /* muted gold: decorative lines and large accents */
  --gold-ink: #7A5A06;      /* darker gold for small text (passes WCAG AA) */
  --gold-tint: #F6EFDC;

  /* Neutrals */
  --ink: #1F1C24;
  --ink-soft: #4A4652;
  --muted: #5F5A66;
  --line: #E4E1DB;
  --line-strong: #CFCAC1;

  /* Kolb's cycle colours */
  --kolb-ce: #A6462E; --kolb-ce-tint: #F8ECE8;   /* Concrete Experience */
  --kolb-ro: #255D85; --kolb-ro-tint: #E8F0F6;   /* Reflective Observation */
  --kolb-ac: #4C2A85; --kolb-ac-tint: #EFEAF6;   /* Abstract Conceptualisation */
  --kolb-ae: #2F6B3A; --kolb-ae-tint: #E9F3EA;   /* Active Experimentation */

  --danger: #A3271F;
  --ok: #2F6B3A;

  /* Type */
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --max: 1180px;
  --radius: 4px;
  --shadow: 0 1px 2px rgb(31 28 36 / .05), 0 8px 24px rgb(31 28 36 / .06);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--purple); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--purple-dark); text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }
.ic { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.15em; }
.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; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--purple); color: #fff; padding: 10px 16px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; color: #fff; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 350; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }
.eyebrow {
  font: 600 .74rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-ink); margin: 0 0 .9rem; display: flex; align-items: center; gap: .6rem;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold); }
.muted { color: var(--muted); }
.prose { max-width: 68ch; }
.prose p { white-space: pre-line; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(248 248 246 / .92); backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; height: var(--header-h);
  padding: 0 24px; display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.15; margin-right: auto; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-name { font-family: var(--serif); font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { white-space: nowrap; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.main-nav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.main-nav a {
  display: block; padding: 8px 12px; font-size: .9rem; text-decoration: none;
  color: var(--ink-soft); border-radius: var(--radius); position: relative; white-space: nowrap;
}
.main-nav a:hover { color: var(--purple); background: var(--purple-tint); }
.main-nav a[aria-current="page"] { color: var(--purple); font-weight: 600; }
.main-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--gold);
}
.btn.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 42px; padding: 8px 16px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink);
  font-size: .9rem; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--purple); color: var(--purple); }
.btn-primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); color: #fff; }
.btn-gold { background: var(--gold-tint); border-color: var(--gold); color: var(--gold-ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--purple-tint); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #E3B9B4; background: var(--paper); }
.btn-danger:hover { background: #FBEDEB; color: var(--danger); border-color: var(--danger); }
.btn-sm { min-height: 34px; padding: 4px 12px; font-size: .82rem; }
.btn-icon { width: 42px; padding: 0; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.edit-toggle[aria-pressed="true"] { background: var(--gold-tint); border-color: var(--gold); color: var(--gold-ink); }

/* Edit-only controls are hidden from visitors */
.edit-only { display: none !important; }
body.editing .edit-only { display: inline-flex !important; }
body.editing div.edit-only, body.editing section.edit-only { display: block !important; }

/* ---------- Layout ---------- */
main { min-height: 70vh; }
.page { max-width: var(--max); margin: 0 auto; padding: 56px 24px 96px; }
.page:focus, #page-title:focus { outline: none; }
.page-head { margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.page-head .btn-row { margin-top: 12px; }
.section { margin-top: 64px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; position: relative;
}
.card h3 { margin-bottom: .35em; }
.card-actions { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--purple-tint); color: var(--purple);
}
.tag-gold { background: var(--gold-tint); color: var(--gold-ink); }
.meta-line { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: .6em; }
.empty {
  border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted);
  background: rgb(255 255 255 / .5);
}

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 56px; align-items: center; }
.hero h1 { margin-bottom: .3em; }
.hero .tagline { font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--ink-soft); max-width: 34ch; line-height: 1.4; }
.hero-meta { margin: 24px 0 28px; display: grid; gap: 4px; font-size: .92rem; color: var(--ink-soft); }
.hero-photo { position: relative; }
.hero-photo img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); background: #EAE6DF; }
.hero-photo::before {
  content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 1px solid var(--gold); border-radius: var(--radius); z-index: -1;
}
.philosophy { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.philosophy > div { padding: 36px 36px 36px 0; }
.philosophy > div + div { padding: 36px 0 36px 36px; border-left: 1px solid var(--line); }
.philosophy p:not(.eyebrow) { font-family: var(--serif); font-size: 1.12rem; line-height: 1.6; color: var(--ink-soft); white-space: pre-line; }
.quickstart { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; list-style: none; padding: 0; margin: 0; }
.quickstart li { counter-increment: step; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.quickstart li::before {
  content: counter(step, decimal-leading-zero); display: block; font-family: var(--serif); font-size: 2rem; color: var(--gold); line-height: 1; margin-bottom: 12px;
}
.quickstart h3 { font-size: 1.1rem; }
.quickstart p { font-size: .92rem; color: var(--ink-soft); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.stats a { padding: 22px 24px; text-decoration: none; color: var(--ink); }
.stats a + a { border-left: 1px solid var(--line); }
.stats a:hover { background: var(--purple-tint); }
.stats strong { display: block; font-family: var(--serif); font-size: 2.2rem; font-weight: 350; color: var(--purple); line-height: 1.1; }
.stats span { font-size: .82rem; color: var(--muted); }

/* ---------- Filters ---------- */
.filters { display: grid; gap: 16px; padding: 20px 0 8px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-label { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); min-width: 86px; }
.chip {
  min-height: 36px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--paper); font-size: .85rem; cursor: pointer; color: var(--ink-soft);
}
.chip:hover { border-color: var(--purple); color: var(--purple); }
.chip[aria-pressed="true"] { background: var(--purple); border-color: var(--purple); color: #fff; }
.select {
  min-height: 38px; padding: 6px 36px 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper);
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234C2A85' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.result-count { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }

/* ---------- Carousel ---------- */
.carousel { margin-top: 36px; }
.carousel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.carousel-head h2 { font-size: 1.5rem; margin: 0; }
.carousel-head h2 small { font-family: var(--sans); font-size: .8rem; color: var(--muted); margin-left: 8px; }
.carousel-track {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 4px 4px 18px; margin: 0 -4px; list-style: none;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.carousel-track > li { scroll-snap-align: start; flex: none; }
.art-card {
  position: relative; display: block; height: 380px; border: 0; padding: 0; margin: 0;
  background: #ECE8E1; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; text-align: left;
}
.art-card img { height: 100%; width: auto; max-width: 78vw; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.art-card:hover img, .art-card:focus-visible img { transform: scale(1.03); }
.art-meta {
  position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 14px 16px;
  background: rgb(255 255 255 / .96); border-radius: var(--radius); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; pointer-events: none;
}
.art-card:hover .art-meta, .art-card:focus-visible .art-meta, .art-card:focus-within .art-meta { opacity: 1; transform: none; }
.art-meta strong { display: block; font-family: var(--serif); font-weight: 450; font-size: 1.1rem; color: var(--ink); line-height: 1.25; }
.art-meta span { display: block; font-size: .8rem; color: var(--muted); }
.art-meta .tag { margin-top: 8px; }
.art-caption { margin-top: 10px; font-size: .85rem; color: var(--ink-soft); max-width: 300px; }
.art-caption em { font-family: var(--serif); font-size: 1rem; color: var(--ink); }
@media (hover: none) {
  /* On phones the card shows a slim caption instead of the hover card */
  .art-meta { display: none; }
}
@media (hover: hover) { .art-caption { display: none; } }
.carousel-nav { display: flex; gap: 6px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 32px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 12px 16px; border: 0; background: none; cursor: pointer; font-size: .92rem; color: var(--ink-soft);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--purple); }
.tab[aria-selected="true"] { color: var(--purple); border-bottom-color: var(--gold); font-weight: 600; }
.tab .count { font-size: .75rem; color: var(--muted); margin-left: 4px; font-weight: 400; }

/* ---------- Teaching ---------- */
.shield {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; padding: 24px 28px; margin-bottom: 32px;
  border: 1px solid #D9C48F; border-left: 6px solid var(--gold); background: var(--gold-tint); border-radius: var(--radius);
}
.shield-icon { width: 44px; height: 44px; color: var(--gold-ink); }
.shield h2 { margin: 0 0 .4em; font-size: 1.3rem; }
.shield ul { margin: .4em 0 0; padding-left: 1.2em; }
.shield li { margin-bottom: .35em; }
.shield .btn-row { margin-top: 14px; }
.lp-card { display: grid; gap: 4px; }
.thumb { aspect-ratio: 4/3; width: 100%; object-fit: cover; border-radius: var(--radius); background: #ECE8E1; margin-bottom: 14px; }
.video-frame { position: relative; aspect-ratio: 16/9; background: #1F1C24; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-facade {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--purple-dark), #2A1D45); display: grid; place-items: center; padding: 0;
}
.video-facade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.video-facade .play {
  position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px;
  background: rgb(0 0 0 / .6); border-radius: 999px; font-size: .9rem;
}
.video-facade .play svg { width: 20px; height: 20px; }
.video-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #E4E1DB; font-size: .9rem; padding: 20px; text-align: center; }
.anon-ok { color: var(--ok); font-size: .82rem; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.anon-warn { color: var(--danger); font-size: .82rem; font-weight: 600; }

/* ---------- Reflections / Kolb ---------- */
.kolb-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 36px; padding: 0; list-style: none; }
.kolb-legend li { padding: 14px 16px; border-radius: var(--radius); border-top: 4px solid; font-size: .86rem; line-height: 1.45; }
.kolb-legend b { display: block; font-size: .92rem; margin-bottom: 2px; }
.k-ce { --k: var(--kolb-ce); --kt: var(--kolb-ce-tint); }
.k-ro { --k: var(--kolb-ro); --kt: var(--kolb-ro-tint); }
.k-ac { --k: var(--kolb-ac); --kt: var(--kolb-ac-tint); }
.k-ae { --k: var(--kolb-ae); --kt: var(--kolb-ae-tint); }
.kolb-legend li { background: var(--kt); border-color: var(--k); }
.kolb-legend b { color: var(--k); }
.reflection { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.reflection > summary {
  list-style: none; cursor: pointer; padding: 20px 24px; display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center;
}
.reflection > summary::-webkit-details-marker { display: none; }
.reflection > summary h3 { margin: 0; font-size: 1.25rem; }
.reflection > summary .meta-line { margin: 0; grid-column: 1; }
.reflection > summary .chev { grid-row: 1 / span 2; grid-column: 2; width: 22px; height: 22px; color: var(--purple); transition: transform .2s; }
.reflection[open] > summary .chev { transform: rotate(180deg); }
.reflection[open] > summary { border-bottom: 1px solid var(--line); }
.stage-dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.stage-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--k); display: inline-block; }
.stages { padding: 8px 24px 24px; display: grid; gap: 12px; }
.stage { border-left: 4px solid var(--k); background: var(--kt); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; }
.stage h4 { color: var(--k); margin: 0 0 .3em; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stage h4 small { font-weight: 400; color: var(--ink-soft); font-size: .8rem; }
.stage p { margin: 0; white-space: pre-line; }
.stage .prompt { font-size: .82rem; color: var(--ink-soft); font-style: italic; margin-top: 6px; }
.example-badge { background: var(--gold-tint); color: var(--gold-ink); }
.reflection .card-actions { padding: 0 24px 20px; }

/* ---------- Achievements & CV ---------- */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-strong); }
.timeline li { position: relative; padding: 0 0 28px 28px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 8px; width: 11px; height: 11px; background: var(--canvas); border: 2px solid var(--gold); border-radius: 50%; }
.timeline .year { font-family: var(--serif); color: var(--gold-ink); font-size: .95rem; }
.timeline h3 { font-size: 1.15rem; margin: 2px 0 4px; }
.cv-sheet {
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow);
  max-width: 820px; margin: 0 auto; padding: 56px 64px; font-size: .92rem; line-height: 1.55;
}
.cv-header { display: flex; justify-content: space-between; gap: 24px; align-items: end; border-bottom: 2px solid var(--purple); padding-bottom: 18px; margin-bottom: 22px; }
.cv-header h2 { font-size: 2rem; margin: 0; }
.cv-header .role { color: var(--gold-ink); font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; margin: 4px 0 0; }
.cv-contact { text-align: right; font-size: .82rem; color: var(--ink-soft); }
.cv-contact div { word-break: break-word; }
.cv-block { margin-bottom: 18px; break-inside: avoid; }
.cv-block h3 { font-family: var(--sans); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--purple); font-weight: 700; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.cv-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; margin-bottom: 6px; }
.cv-row .when { color: var(--muted); font-size: .85rem; }
.cv-row strong { font-weight: 600; }
.cv-list { margin: 0; padding-left: 1.1em; columns: 2; column-gap: 32px; }
.cv-list li { break-inside: avoid; }

/* ---------- Guide ---------- */
.guide-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.guide-toc { position: sticky; top: calc(var(--header-h) + 24px); }
.guide-toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.guide-toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 2px solid transparent; text-decoration: none; color: var(--ink-soft); font-size: .9rem; line-height: 1.35; }
.guide-toc a:hover { color: var(--purple); border-left-color: var(--line-strong); }
.guide-toc a span { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
.unit { padding-bottom: 44px; margin-bottom: 44px; border-bottom: 1px solid var(--line); }
.unit:last-child { border-bottom: 0; }
.unit h2 { font-size: 1.8rem; }
.unit ul, .unit ol { padding-left: 1.3em; }
.unit li { margin-bottom: .4em; }
.callout { background: var(--purple-tint); border-left: 4px solid var(--purple); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 16px 0; }
.callout.gold { background: var(--gold-tint); border-left-color: var(--gold); }
code, .mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .88em; background: #EFEDE8; padding: 1px 5px; border-radius: 3px; }
pre.mono { padding: 14px; overflow-x: auto; white-space: pre; line-height: 1.5; }
.tool { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 20px 0; }
.tool h3 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.tool h3 .ic { color: var(--gold); width: 24px; height: 24px; }
.unit .checklist { padding-left: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.fn-output {
  margin-top: 18px; display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap;
}
.fn-output output {
  flex: 1 1 280px; font-family: ui-monospace, Consolas, monospace; font-size: .95rem; background: var(--canvas);
  border: 1px dashed var(--gold); padding: 10px 14px; border-radius: var(--radius); word-break: break-all; display: flex; align-items: center;
}
.progress { height: 8px; background: #ECE8E1; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), #7A5BA6); border-radius: 999px; transition: width .3s; }
.sem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.sem-btn {
  border: 1px solid var(--line-strong); background: var(--paper); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; text-align: left; display: grid; gap: 6px;
}
.sem-btn b { font-size: .88rem; font-weight: 600; }
.sem-btn small { font-size: .74rem; color: var(--muted); }
.sem-btn[aria-pressed="true"] { border-color: var(--purple); box-shadow: inset 0 0 0 1px var(--purple); background: var(--purple-tint); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { border-bottom: 1px solid var(--line); }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; cursor: pointer; }
.checklist input { width: 20px; height: 20px; accent-color: var(--purple); margin-top: 2px; flex: none; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--gold); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field > span, .field legend { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.field small { color: var(--muted); font-size: .78rem; line-height: 1.4; }
.input, .textarea, .field select {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .field select:focus { border-color: var(--purple); outline: 2px solid rgb(76 42 133 / .2); outline-offset: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); margin-top: 3px; flex: none; }
.img-preview { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.img-preview img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius); background: #ECE8E1; border: 1px solid var(--line); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgb(31 28 36 / .55); backdrop-filter: blur(2px); }
.modal-dialog {
  position: relative; background: var(--paper); border-radius: 6px; width: min(680px, 100%); max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; box-shadow: 0 24px 64px rgb(0 0 0 / .25);
}
.modal-dialog.wide { width: min(1080px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.35rem; margin: 0; }
.modal-body { padding: 24px; overflow-y: auto; display: grid; gap: 16px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.modal-foot .right { display: flex; gap: 10px; margin-left: auto; }
.lightbox { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.lightbox img { width: 100%; max-height: 72vh; object-fit: contain; background: #F1EEE9; border-radius: var(--radius); }
.lightbox dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .9rem; margin: 16px 0; }
.lightbox dt { color: var(--muted); }
.lightbox dd { margin: 0; }
body.modal-open { overflow: hidden; }

/* ---------- Editor bar & toast ---------- */
.editor-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: #fff; border-radius: 8px; padding: 10px 12px 10px 18px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 12px 32px rgb(0 0 0 / .3);
  width: max-content; max-width: calc(100vw - 24px); flex-wrap: wrap;
}
.editor-bar .status { font-size: .82rem; color: #D9D4E6; margin-right: 6px; }
.editor-bar .status b { color: #F0D98C; font-weight: 600; }
.editor-bar .btn { background: transparent; color: #fff; border-color: rgb(255 255 255 / .28); min-height: 36px; font-size: .82rem; }
.editor-bar .btn:hover { background: rgb(255 255 255 / .1); border-color: #fff; color: #fff; }
.editor-bar .btn-primary { background: var(--gold); border-color: var(--gold); color: #1F1C24; }
.editor-bar .btn-primary:hover { background: #D4A21E; color: #1F1C24; }
body.editing main { padding-bottom: 96px; }
.toast-wrap { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 120; display: grid; gap: 8px; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 6px; font-size: .9rem; max-width: 360px; box-shadow: var(--shadow);
  animation: toast-in .25s ease;
}
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
.notice {
  max-width: 720px; margin: 64px auto; padding: 28px 32px; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--danger); border-radius: var(--radius);
}
.notice.info { border-top-color: var(--gold); }
.notice pre { white-space: pre-wrap; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 24px; }
.footer-inner { max-width: calc(var(--max) - 48px); margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.footer-inner a { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .main-nav a { padding: 8px 8px; font-size: .85rem; }
  .brand-sub { display: none; }
}
@media (max-width: 1000px) {
  :root { --header-h: 60px; }
  .btn.nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; background: var(--canvas); border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgb(0 0 0 / .08); padding: 8px 16px 16px; display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { padding: 12px; font-size: 1rem; }
  .main-nav a[aria-current="page"]::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo { max-width: 340px; order: -1; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .guide-toc { position: static; }
  .guide-toc ol { display: flex; overflow-x: auto; border: 0; gap: 8px; padding-bottom: 6px; }
  .guide-toc li { flex: none; }
  .guide-toc a { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 0; background: var(--paper); }
  .lightbox { grid-template-columns: 1fr; }
  .kolb-legend { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; gap: 8px; }
  .brand-sub { display: none; }
  .edit-toggle .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .edit-toggle { width: 42px; padding: 0; }
  .hero-photo { max-width: 260px; }
  .art-meta { display: none; }
  .art-caption { display: block !important; }
  .page { padding: 36px 18px 72px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .philosophy { grid-template-columns: 1fr; }
  .philosophy > div, .philosophy > div + div { padding: 28px 0; border-left: 0; }
  .philosophy > div + div { border-top: 1px solid var(--line); }
  .quickstart { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats a:nth-child(3) { border-left: 0; }
  .stats a:nth-child(n+3) { border-top: 1px solid var(--line); }
  .art-card { height: 280px; }
  .filter-label { min-width: 100%; }
  .shield { grid-template-columns: 1fr; padding: 20px; }
  .kolb-legend { grid-template-columns: 1fr; }
  .reflection > summary, .stages { padding-left: 16px; padding-right: 16px; }
  .cv-sheet { padding: 28px 20px; }
  .cv-header { flex-direction: column; align-items: start; }
  .cv-contact { text-align: left; }
  .cv-row { grid-template-columns: 1fr; gap: 0; }
  .cv-list { columns: 1; }
  .sem-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { padding: 0; align-items: end; }
  .modal-dialog { max-height: 92vh; border-radius: 10px 10px 0 0; }
  .editor-bar { bottom: 8px; padding: 8px; gap: 6px; justify-content: center; }
  .editor-bar .status { width: 100%; text-align: center; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* =========================================================
   PRINT: clean A4 output. On the Achievements page only the
   CV sheet prints. Other pages print without navigation.
   ========================================================= */
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  :root { --canvas: #fff; }
  body { background: #fff; font-size: 10.5pt; color: #000; }
  .site-header, .site-footer, .editor-bar, .toast-wrap, .skip-link, .no-print, .edit-only, .filters, .carousel-nav, .tabs, .modal { display: none !important; }
  .page { padding: 0; max-width: none; }
  a { color: #000; text-decoration: none; }
  body[data-route="achievements"] .page > *:not(.cv-wrap) { display: none !important; }
  body[data-route="achievements"] .cv-wrap > *:not(.cv-sheet) { display: none !important; }
  .cv-wrap { margin: 0 !important; }
  .cv-sheet { border: 0; box-shadow: none; padding: 0; max-width: none; font-size: 10pt; }
  .cv-header { border-bottom-color: #4C2A85; }
  .cv-header h2 { font-size: 22pt; }
  .card, .reflection, .stage, .tool { break-inside: avoid; box-shadow: none; }
  .reflection:not([open]) .stages { display: grid !important; }
  .carousel-track { flex-wrap: wrap; overflow: visible; }
  .art-card { height: 180px; }
  .art-meta { display: none; }
}
