 .nav-back:hover { color: var(--text); }

    /* ---- MAIN ---- */
    main {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 60px 24px;
      position: relative;
      overflow: hidden;
      margin: 20px auto;
    }

    /* Big ghost 404 */
    .ghost-404 {
      position: absolute;
      font-size: clamp(160px, 28vw, 340px);
      font-weight: 700;
      color: rgba(0,0,0,0.032);
      letter-spacing: -0.05em;
      user-select: none;
      pointer-events: none;
      white-space: nowrap;
      animation: ghostFloat 6s ease-in-out infinite;
    }

    @keyframes ghostFloat {
      0%, 100% { transform: translateY(0px); }
      50%       { transform: translateY(-16px); }
    }

    /* Content card */
    .card-404 {
      background: white;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 52px 48px;
      max-width: 520px;
      width: 100%;
      text-align: center;
      position: relative;
      z-index: 2;
      box-shadow: 0 4px 32px rgba(0,0,0,0.06);
      animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    @keyframes cardIn {
      from { opacity: 0; transform: translateY(24px) scale(0.97); }
      to   { opacity: 1; transform: translateY(0) scale(1); }
    }

    /* Spinning abstract shape */
    .shape-404 {
      width: 80px;
      margin: 0 auto 24px;
      animation: shapeRotate 14s linear infinite;
    }
    @keyframes shapeRotate {
      from { transform: rotate(0deg); }
      to   { transform: rotate(360deg); }
    }

    .error-code {
      font-size: 11px; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.12em;
      color: var(--orange);
      background: #fff1ec; border: 1px solid #f4c4a8;
      padding: 4px 12px; border-radius: 20px;
      display: inline-block; margin-bottom: 20px;
    }

    h1 {
      font-size: clamp(24px, 4vw, 34px);
      font-weight: 700; letter-spacing: -0.025em; line-height: 1.2;
      margin-bottom: 14px;
    }

    h1 em {
      font-family: 'Playfair Display', serif;
      font-style: italic; font-weight: 400; color: var(--muted);
    }

    .desc-404 {
      font-size: 14px; color: var(--muted); line-height: 1.65;
      margin-bottom: 32px;
      max-width: 360px; margin-left: auto; margin-right: auto;
    }

    .btns-404 {
      display: flex; gap: 10px; justify-content: center;
      flex-wrap: wrap; margin-bottom: 36px;
    }

    .btn-home {
      font-family: 'DM Sans', sans-serif;
      font-size: 14px; font-weight: 600;
      color: white; background: black;
      border: none; padding: 12px 24px; border-radius: 50px; cursor: pointer;
      text-decoration: none;
      display: inline-flex; align-items: center; gap: 7px;
      transition: opacity 0.2s, transform 0.15s;
    }
    .btn-home:hover { opacity: 0.82; }
    .btn-home:active { transform: scale(0.97); }
    .btn-home svg { width: 15px; height: 15px; }

    .btn-back {
      font-family: 'DM Sans', sans-serif;
      font-size: 14px; font-weight: 500;
      color: var(--text); background: white;
      border: 1.5px solid var(--border);
      padding: 12px 24px; border-radius: 50px; cursor: pointer;
      text-decoration: none; transition: border-color 0.15s;
    }
    .btn-back:hover { border-color: var(--text); }

    /* Quick links */
    .quick-links { border-top: 1px solid #f0ede6; padding-top: 24px; }

    .ql-title {
      font-size: 11px; font-weight: 600;
      text-transform: uppercase; letter-spacing: 0.08em;
      color: #ccc; margin-bottom: 14px;
    }

    .ql-grid {
      display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    }

    .ql-item {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 12px;
      background: #faf9f6; border: 1px solid #f0ede6;
      border-radius: 10px; text-decoration: none;
      color: var(--text); font-size: 13px; font-weight: 500;
      transition: background 0.15s, border-color 0.15s, transform 0.15s;
    }
    .ql-item:hover { background: white; border-color: var(--border); transform: translateY(-1px); }

    .ql-icon {
      width: 28px; height: 28px; background: #f0ede6; border-radius: 7px;
      display: flex; align-items: center; justify-content: center;
      font-size: 14px; flex-shrink: 0;
    }

    /* Footer hint */
    .footer-404 {
      margin-top: 32px; font-size: 12px; color: #ccc; z-index: 2;
      animation: cardIn 0.5s 0.15s cubic-bezier(0.22,1,0.36,1) both;
    }
    .footer-404 a { color: var(--orange); text-decoration: none; }
    .footer-404 a:hover { text-decoration: underline; }

    /* Floating deco shapes */
    .deco {
      position: absolute; pointer-events: none; z-index: 1; opacity: 0.45;
    }
    .deco-1 { top: 10%; left: 5%;  animation: decoFloat 7s 0s   ease-in-out infinite; }
    .deco-2 { top: 18%; right: 6%; animation: decoFloat 8s 1s   ease-in-out infinite; }
    .deco-3 { bottom: 14%; left: 8%;  animation: decoFloat 9s 2s ease-in-out infinite; }
    .deco-4 { bottom: 18%; right: 5%; animation: decoFloat 7s 0.5s ease-in-out infinite; }

    @keyframes decoFloat {
      0%, 100% { transform: translateY(0) rotate(0deg); }
      33%       { transform: translateY(-10px) rotate(6deg); }
      66%       { transform: translateY(5px) rotate(-4deg); }
    }

    @media (max-width: 520px) {
      nav { padding: 0 20px; }
      .card-404 { padding: 36px 24px; }
      .ql-grid { grid-template-columns: 1fr; }
      .ghost-404 { font-size: 140px; }
    }