/* Design Templates gallery: Cru Cornerstone tokens and components. */
  /* Cru Cornerstone tokens (light "Design Templates" look) */
  :root {
    --text: #1d1d1d;
    --quiet: #565652;
    --border: #e5e6e5;
    --border-strong: #cacaca;
    --surface: #f0efee;
    --bg: #ffffff;
    --brand: #ffd000;      /* Cru yellow: highlights, number badges, accents */
    --lemon: #ffe378;      /* softer yellow: buttons */
    --lemon-hover: #ffda4d;
    --tag-bg: #fff3c4;     /* category tags */
    --tag-text: #5c4a12;
    --on-brand: #261d00;
    --dark: #1d1d1d;
    --link: #007990;       /* Cru turquoise */
    --danger: #b3261e;
    --ok: #1e6b3a;
    --r-control: 6px;
    --r-card: 12px;
    --tap: 44px;
    --shadow-panel: 0 8px 28px rgba(29, 29, 29, .08);
    --heading: 'Sora', system-ui, sans-serif;
    --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  }
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 16px/1.5 var(--body);
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3 { font-family: var(--heading); font-weight: 600; line-height: 1.15; margin: 0; }
  h1 { font-weight: 800; letter-spacing: -.02em; }
  a { color: inherit; }
  .wrap { max-width: 1104px; margin: 0 auto; padding: 0 16px; }
  .quiet { color: var(--quiet); }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .eyebrow { margin: 0; font: 600 12px/1.4 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--quiet); }

  /* Top bar with the Cru logo */
  .topnav { background: var(--bg); border-bottom: 1px solid var(--border); }
  .topnav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
  .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); min-width: 0; }
  .brand .cru-logo { width: 46px; height: auto; flex: none; display: block; }
  .brand .divider { width: 1px; height: 24px; background: var(--border-strong); flex: none; }
  .brand-name { font: 600 16px/1.2 var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topnav nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
  .text-link {
    display: inline-flex; align-items: center; min-height: var(--tap); padding: 0; border: 0; background: none;
    font: 500 15px/1.2 var(--body); color: var(--text); cursor: pointer;
    text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 4px;
  }
  .text-link:hover { text-decoration-color: currentColor; }
  .text-link.is-teal { color: var(--link); text-decoration-style: dotted; text-decoration-color: currentColor; }

  /* Cru logo: letters follow the text color, so it works on light and dark */
  .cru-logo path:not([class]) { fill: currentColor; }

  /* Dark footer */
  .site-footer { background: var(--dark); color: #cacaca; }
  .site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 28px; padding-bottom: 28px; }
  .site-footer .cru-logo { width: 48px; height: auto; color: #fff; display: block; }
  .site-footer p { margin: 0; font-size: 14px; }

  /* Controls */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--tap); padding: 0 18px;
    border: 1px solid var(--border-strong); border-radius: var(--r-control);
    background: var(--bg); color: var(--text);
    font: 500 15px/1.2 var(--body); text-decoration: none; cursor: pointer;
    transition: background .15s, border-color .15s;
  }
  .btn:hover { background: var(--surface); }
  .btn:focus-visible, .input:focus-visible, .chip:focus-visible, select:focus-visible, textarea:focus-visible, .text-link:focus-visible {
    outline: 3px solid var(--brand); outline-offset: 2px;
  }
  .btn-primary { background: var(--lemon); border-color: var(--lemon); color: var(--on-brand); }
  .btn-primary:hover { background: var(--lemon-hover); border-color: var(--lemon-hover); }
  .btn-danger { color: var(--danger); border-color: #e3b7b4; }
  .btn-danger:hover { background: #fbeeed; }
  .btn-ghost { border-color: transparent; background: transparent; }
  .btn-small { min-height: 36px; padding: 0 12px; font-size: 14px; }
  .btn-lg { min-height: 52px; padding: 0 20px; font-size: 17px; }
  .btn[disabled] { opacity: .55; cursor: default; }
  .btn svg { flex: none; }
  .input, select.input, textarea.input {
    width: 100%; min-height: var(--tap); padding: 10px 12px;
    border: 1px solid var(--border-strong); border-radius: var(--r-control);
    background: var(--bg); color: var(--text); font: 400 16px/1.4 var(--body);
  }
  select.input {
    appearance: none; -webkit-appearance: none; padding-right: 40px;
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23565652' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center;
  }
  textarea.input { min-height: 88px; resize: vertical; }
  .field { display: block; margin-bottom: 16px; }
  .field > span:first-child, .label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
  .hint { display: block; font-size: 13px; color: var(--quiet); margin-top: 6px; }
  .error-text { display: block; font-size: 13px; color: var(--danger); margin-top: 6px; }

  .chip {
    display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px;
    border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg);
    font: 500 15px/1 var(--body); color: var(--text); cursor: pointer; white-space: nowrap;
  }
  .chip:hover { background: var(--surface); }
  .chip[aria-pressed="true"] { background: #e2e1df; border-color: #e2e1df; }

  .tag {
    display: inline-block; padding: 4px 9px; border-radius: 4px;
    background: var(--tag-bg); color: var(--tag-text);
    font: 500 12px/1.3 var(--body);
  }
  .tag-live { background: #e3f3e8; color: var(--ok); }
  .tag-hidden { background: var(--surface); color: var(--quiet); }
  .tag-archived { background: #efeae0; color: #6b5a2e; }
  .tag-plain { background: var(--surface); color: var(--quiet); }

  .panel { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); }

  /* Toast */
  .toast {
    position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
    max-width: calc(100% - 32px); padding: 12px 18px; border-radius: var(--r-control);
    background: var(--text); color: #fff; font-weight: 500; z-index: 100;
    box-shadow: 0 6px 24px rgba(0,0,0,.2);
  }
  .toast.is-error { background: var(--danger); }
  [hidden] { display: none !important; }

  @media (max-width: 560px) {
    .topnav .wrap { min-height: 56px; }
    .brand { gap: 10px; }
    .brand .cru-logo { width: 40px; }
    .brand-name { font-size: 15px; }
  }

    /* Hero */
    .hero { background: var(--surface); padding: 64px 0 104px; overflow: hidden; }
    .hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; }
    .hero h1 { font-size: clamp(40px, 5.6vw, 64px); line-height: 1.02; margin: 18px 0 22px; }
    .hero h1 mark { background: var(--brand); color: inherit; padding: 0 .1em; }
    .lede { font-size: 18px; line-height: 1.6; color: #3d3d3a; max-width: 460px; margin: 0 0 28px; }
    .lede strong { color: var(--text); font-weight: 600; }
    .hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

    /* Fanned stack of sample designs */
    .hero-art { position: relative; height: 400px; }
    .fan {
      position: absolute; top: 50%; left: 50%; width: 200px; aspect-ratio: 13 / 20;
      background: #e6e5e3; box-shadow: 0 18px 40px rgba(29,29,29,.22); border-radius: 4px; overflow: hidden;
    }
    .fan img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
    .fan-1 { transform: translate(-125%, -44%) rotate(-7deg); z-index: 1; }
    .fan-3 { transform: translate(28%, -46%) rotate(6deg); z-index: 1; }
    .fan-2 { width: 240px; transform: translate(-50%, -52%); z-index: 2; }
    .hero-art.count-1 .fan-2 { transform: translate(-50%, -50%) rotate(-3deg); }

    /* Filters panel, overlapping the hero */
    .filters {
      position: relative; margin-top: -46px; padding: 20px;
      display: grid; grid-template-columns: 240px minmax(0, 1fr) 270px; gap: 16px 20px; align-items: end;
      border: 0; box-shadow: var(--shadow-panel);
    }
    .chips { display: flex; gap: 8px; flex-wrap: wrap; }
    .search { position: relative; }
    .search .input { padding-left: 42px; }
    .search svg { position: absolute; left: 14px; bottom: 13px; color: var(--quiet); }

    /* Event heading */
    .past-note {
      margin-top: 32px; padding: 12px 16px; border-radius: var(--r-control); background: #efeae0; color: #4d4122;
      display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; justify-content: space-between;
    }
    .event-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 52px 0 28px; }
    .event-head h2 { font-weight: 800; font-size: clamp(30px, 4vw, 40px); letter-spacing: -.02em; }
    .event-head p { margin: 12px 0 0; max-width: 600px; color: #3d3d3a; font-size: 16px; }
    .count { display: inline-flex; align-items: center; gap: 10px; font: 600 15px var(--heading); white-space: nowrap; }
    .count::before { content: ''; width: 10px; height: 10px; border-radius: 2px; background: var(--brand); }

    /* Masonry grid of cards */
    .grid { display: flex; gap: 20px; align-items: flex-start; }
    .grid > .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
    .grid > .empty { flex: 1; }
    .card {
      display: flex; flex-direction: column;
      border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; background: var(--bg);
    }
    .thumb { background: var(--surface); padding: 18px; }
    .thumb img { width: 100%; height: auto; display: block; box-shadow: 0 6px 18px rgba(29,29,29,.18); border-radius: 2px; }
    .thumb.is-empty { aspect-ratio: 4 / 5; display: grid; place-items: center; color: var(--quiet); font-size: 13px; }
    .thumb.is-loading img { min-height: 160px; background: #e6e5e3; }

    /* Several pictures: arrows and dots under the picture */
    .thumb.carousel { padding-bottom: 8px; }
    .viewport { overflow: hidden; touch-action: pan-y; }
    .track { display: flex; align-items: center; transition: transform .3s ease; }
    .slide { flex: 0 0 100%; min-width: 0; padding: 0 1px; }
    .slide.is-loading { min-height: 160px; }
    .slide img { pointer-events: none; -webkit-user-drag: none; user-select: none; width: 100%; height: auto; display: block; box-shadow: 0 6px 18px rgba(29,29,29,.18); border-radius: 2px; }
    .slide.is-empty { aspect-ratio: 4 / 5; display: grid; place-items: center; color: var(--quiet); font-size: 13px; }
    .controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
    .arrow {
      flex: none; width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid var(--border-strong);
      background: #fff; color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0;
    }
    .arrow:hover { background: var(--lemon); border-color: var(--lemon); }
    .arrow:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
    .dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; min-width: 0; }
    .dot { width: 20px; height: 24px; border: 0; padding: 0; background: none; cursor: pointer; display: grid; place-items: center; }
    .dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); transition: background .2s, transform .2s; }
    .dot[aria-current="true"]::before { background: var(--text); transform: scale(1.2); }
    .dot:focus-visible { outline: 2px solid var(--brand); border-radius: 4px; }
    @media (prefers-reduced-motion: reduce) { .track { transition: none; } }
    .card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px; }
    .card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--quiet); }
    .card h3 { font-size: 17px; line-height: 1.3; }
    .card-event { font-size: 13px; color: var(--quiet); margin-top: -4px; }
    .card .tip { font-size: 14px; color: var(--quiet); margin: 0; }
    .card .btn { margin-top: 8px; width: 100%; }

    .empty { padding: 48px 16px; text-align: center; color: var(--quiet); background: var(--surface); border-radius: var(--r-card); }

    /* Past events */
    .past { margin: 20px 0 72px; }
    .past summary {
      display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 18px;
      cursor: pointer; list-style: none; font: 500 15px var(--body);
    }
    .past summary::-webkit-details-marker { display: none; }
    .past summary::after {
      content: ''; width: 8px; height: 8px; border-right: 1.6px solid var(--quiet); border-bottom: 1.6px solid var(--quiet);
      transform: rotate(-45deg); transition: transform .15s;
    }
    .past[open] summary::after { transform: rotate(45deg); }
    .past ul { list-style: none; margin: 0; padding: 0 8px 8px; }
    .past li button {
      width: 100%; min-height: var(--tap); display: flex; justify-content: space-between; gap: 12px; align-items: center;
      padding: 10px; border: 0; border-top: 1px solid var(--border); background: none; text-align: left;
      font: 500 15px var(--body); color: var(--text); cursor: pointer;
    }
    .past li button:hover { background: var(--surface); }

    /* How it works */
    .how { background: var(--surface); padding: 64px 0 72px; }
    .how h2 { font-weight: 800; font-size: clamp(30px, 4vw, 40px); letter-spacing: -.02em; margin-bottom: 36px; }
    .how ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
    .how .num {
      width: 56px; height: 48px; border-radius: var(--r-control); background: var(--brand); color: var(--on-brand);
      display: grid; place-items: center; font: 800 26px/1 var(--heading); margin-bottom: 18px;
    }
    .how h3 { font-size: 20px; margin-bottom: 10px; }
    .how p { margin: 0; color: #3d3d3a; font-size: 15px; max-width: 300px; }

    @media (max-width: 900px) {
      .filters { grid-template-columns: 1fr 1fr; }
      .filters .chips { grid-column: 1 / -1; order: 3; }
    }
    @media (max-width: 760px) {
      .hero { padding: 36px 0 84px; }
      .hero-grid { grid-template-columns: 1fr; gap: 24px; }
      .hero h1 { margin: 12px 0 16px; }
      .lede { font-size: 16px; margin-bottom: 22px; }
      .hero-art { height: 210px; }
      .fan { width: 104px; }
      .fan-2 { width: 124px; }
      .topnav .hide-sm { display: none; }
      .how ol { grid-template-columns: 1fr; gap: 20px; }
      .how li { display: grid; grid-template-columns: 56px 1fr; column-gap: 16px; }
      .how .num { margin: 0; grid-row: span 2; }
      .how h3 { margin-bottom: 4px; align-self: center; }
    }
    @media (max-width: 560px) {
      .filters { grid-template-columns: 1fr; padding: 16px; margin-top: -56px; }
      .filters .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
      .filters .chips::-webkit-scrollbar { display: none; }
      .hero-actions .btn { width: 100%; }
      .hero-actions .text-link { display: none; }
      .event-head { margin: 36px 0 20px; }
      .grid, .grid > .col { gap: 12px; }
      .card { border-radius: 10px; }
      .thumb { padding: 12px; }
      .thumb.carousel { padding-bottom: 6px; }
      .arrow { width: 36px; height: 36px; }
      .dot { width: 14px; }
      .dot::before { width: 7px; height: 7px; }
      .card-body { padding: 12px; gap: 4px; }
      .card h3 { font-size: 15px; }
      .card .tip { display: none; }
      .card-meta .tag { background: none; padding: 0; color: var(--quiet); font-size: 13px; }
      .card-meta .tag + .fmt::before { content: '\00b7'; }
      .card-meta { display: block; line-height: 1.4; }
      .card-meta .tag + .fmt::before { margin: 0 4px 0 2px; }
      .card .btn { font-size: 15px; padding: 0 8px; }
      .card .btn .long, .card .btn svg { display: none; }
      .past { margin-bottom: 48px; }
      .how { padding: 48px 0 56px; }
    }

  /* ---------- Loading placeholders (shown until the designs arrive) ---------- */
  @keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
  .skel {
    background: #e9e8e6 linear-gradient(90deg, #e9e8e6 0, #f4f3f2 40%, #e9e8e6 80%) no-repeat;
    background-size: 800px 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: 6px;
  }
  .card.is-skel .thumb { aspect-ratio: 4 / 5; }
  .card.is-skel .thumb .skel { width: 100%; height: 100%; }
  .card.is-skel .card-body .skel { height: 12px; }
  .card.is-skel .card-body .skel.line-title { height: 18px; width: 75%; }
  .card.is-skel .card-body .skel.line-btn { height: 44px; margin-top: 8px; }
  .fan.skel { box-shadow: none; }
  body.is-loading .count, body.is-loading #eventDesc { visibility: hidden; }
  .load-error { padding: 40px 16px; text-align: center; color: var(--quiet); background: var(--surface); border-radius: var(--r-card); }
  .load-error p { margin: 0 0 14px; }
  @media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
