:root {
        --bg: #f8f9fa;
        --text: #333;
        --muted: #718096;
        --surface: #ffffff;
        --primary: #ff916f;
        --accent-start: #667eea;
        --accent-end: #764ba2;
        --hero-bg: #ffece4;
        --badge-bg: #1d1d1d;
        --nav-shadow: rgba(0, 0, 0, 0.08);
        --card-shadow: rgba(0, 0, 0, 0.07);
        --card-shadow-hover: rgba(0, 0, 0, 0.15);
        --focus-shadow: rgba(102, 126, 234, 0.1);
        --muted-border: #e1e8ed;
        --muted-light: #f0f4ff;
        --social-icon: #f0d9d6;
        --modal-overlay: rgba(0, 0, 0, 0.8);
        --placeholder-image: url("https://via.placeholder.com/400x300?text=Recipe+Image");
      }

      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }

      body {
        font-family:
          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
          Cantarell, sans-serif;
        line-height: 1.6;
        color: var(--text);
        background: var(--bg);
      }

      /* Navbar */
      .navbar {
        background: var(--surface);
        box-shadow: 0 2px 10px var(--nav-shadow);
        position: sticky;
        top: 0;
        z-index: 100;
        transition: transform 0.22s ease;
      }

      .navbar.navbar-hidden {
        transform: translateY(-100%);
      }

      .nav-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 1rem 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 2rem;
      }

      .logo {
        font-size: 1.2rem;
        font-weight: 700;
        color: #252525;
        text-decoration: none;
      }

      .logo img {
        display: block;
        margin-top: 4px;
      }

      .search-box {
        width: 100%;
      }

      .search-box input {
        width: 100%;
        padding: 0.75rem 1.25rem;
        border: 2px solid var(--muted-border);
        border-radius: 50px;
        font-size: 0.95rem;
        transition: all 0.3s;
      }

      .search-box input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px var(--focus-shadow);
      }

      .social-links {
        display: flex;
        gap: 1rem;
      }

      .social-links a {
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--surface);
        color: var(--social-icon);
        border-radius: 50%;
        text-decoration: none;
        font-size: 1.2rem;
        transition: all 0.3s;
      }

      .social-links a:hover {
        background: #f2d6d0;
        color: #555555;
        transform: translateY(-2px);
      }

      .social-links a:active {
        background: #f2d6d0;
        color: #555555;
      }

      .nav-search {
        position: relative;
      }

      .nav-search-toggle {
        width: 30px;
        height: 30px;
        border: 0;
        border-radius: 50%;
        background: #2f2f2f;
        color: #fff;
        cursor: pointer;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .nav-search-dropdown {
        position: absolute;
        right: 0;
        top: 40px;
        width: min(88vw, 380px);
        background: var(--surface);
        border: 1px solid var(--muted-border);
        border-radius: 12px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
        padding: 0.7rem;
        z-index: 250;
      }

      .nav-search-input {
        width: 100%;
        padding: 0.65rem 0.8rem;
        border: 2px solid var(--muted-border);
        border-radius: 10px;
        margin-bottom: 0.55rem;
        font-size: 0.9rem;
      }

      .nav-search-input:focus {
        outline: none;
        border-color: var(--primary);
      }

      .nav-search-results {
        max-height: 360px;
        overflow: auto;
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
      }

      .nav-search-item {
        width: 100%;
        border: 1px solid var(--muted-border);
        border-radius: 10px;
        background: #fff;
        padding: 0.35rem;
        cursor: pointer;
        display: grid;
        grid-template-columns: 58px 1fr;
        gap: 0.55rem;
        text-align: left;
      }

      .nav-search-item:hover {
        border-color: #2f2f2f;
        background: #fafafa;
      }

      .nav-search-thumb {
        width: 58px;
        height: 58px;
        border-radius: 8px;
        object-fit: cover;
      }

      .nav-search-title {
        font-size: 0.84rem;
        font-weight: 700;
        color: #1a202c;
        line-height: 1.2;
        margin-bottom: 0.15rem;
      }

      .nav-search-meta {
        font-size: 0.72rem;
        color: var(--muted);
        line-height: 1.25;
      }

      .nav-search-empty {
        color: var(--muted);
        font-size: 0.82rem;
        padding: 0.45rem 0.2rem;
      }

      /* Hero Section */
      .hero {
        max-width: 1200px;
        margin: 1.6rem auto;
        padding: 0 2rem;
        position: relative;
      }

      /* Welcome Section */
      .welcome-section {
        max-width: 1200px;
        margin: 2rem auto;
        padding: 1.5rem;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        align-items: center;
        background: var(--surface);
        border-radius: 16px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
      }

      .welcome-image img {
        width: 100%;
        height: 260px;
        object-fit: cover;
        border-radius: 12px;
        display: block;
      }

      .welcome-text h2 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
      }

      .welcome-text p {
        color: var(--muted);
        line-height: 1.6;
        margin-bottom: 0.75rem;
      }

      @media (max-width: 768px) {
        .welcome-section {
          grid-template-columns: 1fr;
        }
        .welcome-image img {
          height: 200px;
        }
      }

      .hero-content {
        background: var(--hero-bg);
        border-radius: 0 20px 20px 20px;
        overflow: hidden;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
        display: grid;
        grid-template-columns: 1fr 1fr;
        min-height: 450px;
        touch-action: pan-y;
      }

      .hero.has-carousel-panel .hero-content {
        border-radius: 0 20px 0 0;
      }

      .hero-carousel-title {
        display: flex;
        align-items: center;
        width: fit-content;
        line-height: 1;
        margin-bottom: 0;
        padding: 0.9rem 1.2rem 0.94rem;
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #555555;
        background: #f2d6d0;
        border: 0;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 8px 20px rgba(120, 90, 90, 0.14);
        transform: translateY(1px);
      }

      .hero-carousel-title + .hero-content {
        border-top-left-radius: 0;
      }

      .hero-image {
        position: relative;
        overflow: hidden;
        max-height: 500px;
        border-top-left-radius: 0;
      }

      .hero-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s;
        border-top-left-radius: 0;
      }

      .hero-image:hover img {
        transform: scale(1.05);
      }

      .hero-badge {
        position: absolute;
        top: 1.5rem;
        left: 1.5rem;
        background: var(--badge-bg);
        color: var(--surface);
        padding: 0.5rem 1.25rem;
        border-radius: 10px;
        font-weight: 600;
        font-size: 0.875rem;
      }

      .hero-text {
        padding: 3rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
      }

      .hero-text .recipe-categories {
        margin-bottom: 1rem;
      }

      .hero-title {
        font-size: 2.5rem;
        font-weight: 700;
        margin-bottom: 1rem;
        color: #1a202c;
        line-height: 1.2;
      }

      .hero-description {
        color: var(--muted);
        font-size: 1.1rem;
        margin-bottom: 2rem;
        line-height: 1.7;
      }

      .hero-meta {
        display: flex;
        gap: 2rem;
        margin-bottom: 2rem;
        color: var(--muted);
      }

      .hero-meta span {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 1rem;
        background: #f2d6d0;
        border-radius: 999px;
        padding: 0.38rem 0.8rem;
        color: #4a4a4a;
      }

      .hero-btn {
        background: #2f2f2f;
        color: var(--surface);
        padding: 1rem 2.5rem;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s;
        align-self: flex-start;
      }

      .hero-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
      }

      .hero-carousel-panel {
        margin-top: 0;
        background: var(--surface);
        border: 1px solid var(--muted-border);
        border-top: 0;
        border-radius: 0 0 20px 20px;
        padding: 0.6rem 0.7rem;
        display: grid;
        grid-template-columns: auto 1fr auto auto;
        gap: 0.55rem;
        align-items: center;
      }

      .hero-carousel-arrow {
        width: 34px;
        height: 34px;
        border: 1px solid #d7b2ab;
        border-radius: 10px;
        background: #ffffff;
        color: #555555;
        cursor: pointer;
        font-size: 1.2rem;
        line-height: 1;
      }

      .hero-carousel-arrow:hover {
        border-color: #555555;
      }

      .hero-carousel-indicators {
        display: flex;
        gap: 0.45rem;
        flex-wrap: wrap;
      }

      .hero-carousel-indicator {
        border: 1px solid #d7b2ab;
        background: #ffffff;
        border-radius: 999px;
        padding: 0.3rem 0.55rem;
        font-size: 0.75rem;
        color: #555555;
        cursor: pointer;
        max-width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .hero-carousel-indicator.active {
        background: #2f2f2f;
        border-color: #2f2f2f;
        color: #ffffff;
      }

      .hero-carousel-status {
        font-size: 0.82rem;
        color: #555555;
        font-weight: 600;
        text-align: right;
        min-width: 62px;
      }

      /* Top Controls */
      .top-controls {
        max-width: 1200px;
        margin: 0.7rem auto 0;
        padding: 0 2rem;
      }

      .top-controls-inner {
        background: var(--surface);
        border: 1px solid var(--muted-border);
        border-radius: 16px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
        padding: 1.1rem;
        display: flex;
        flex-direction: column;
        gap: 0.9rem;
      }

      .category-accordion {
        display: contents;
      }

      .category-accordion summary {
        list-style: none;
        cursor: pointer;
        padding: 0.75rem 0.95rem;
        font-weight: 600;
        font-size: 0.92rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--surface);
        border: 2px solid var(--muted-border);
        border-radius: 12px;
        height: 46px;
        grid-area: category;
      }

      .category-accordion summary::-webkit-details-marker {
        display: none;
      }

      #currentFilterLabel {
        background: #2f2f2f;
        color: #fff;
        font-size: 0.72rem;
        border-radius: 6px;
        padding: 0.15rem 0.45rem;
        font-weight: 600;
      }

      .category-list {
        display: flex;
        gap: 0.55rem;
        flex-wrap: wrap;
        max-height: 220px;
        overflow: auto;
        padding: 0.85rem;
        grid-area: category-list;
        border: 2px solid var(--muted-border);
        border-top: 0;
        border-radius: 0 0 12px 12px;
        margin-top: -2px;
      }

      .controls-row {
        display: grid;
        grid-template-columns: minmax(0, 85%) minmax(0, 15%);
        grid-template-areas:
          "category sort"
          "category-list category-list";
        gap: 0.85rem;
        align-items: start;
      }

      .sort-select {
        grid-area: sort;
        width: 100%;
        height: 46px;
        padding: 0.7rem 0.9rem;
        border: 2px solid var(--muted-border);
        border-radius: 12px;
        font-size: 0.95rem;
        background: var(--surface);
      }

      .sort-select:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px var(--focus-shadow);
      }

      .filter-buttons {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
      }

      .filter-btn {
        padding: 0.42rem 0.65rem;
        border: 2px solid var(--muted-border);
        background: var(--surface);
        border-radius: 8px;
        cursor: pointer;
        font-size: 0.76rem;
        font-weight: 600;
        line-height: 1.2;
        transition: all 0.3s;
      }

      .filter-btn:hover {
        border-color: #2f2f2f;
        color: #2f2f2f;
      }

      .filter-btn.active {
        background: #2f2f2f;
        color: var(--surface);
        border-color: #2f2f2f;
      }

      /* Recipes Grid */
      .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 2rem;
      }

      .recipes-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.25rem;
      }

      .recipe-card {
        background: var(--surface);
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 4px 6px var(--card-shadow);
        transition: all 0.3s;
        cursor: pointer;
      }

      .recipe-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 24px var(--card-shadow-hover);
      }

      .recipe-image {
        width: 100%;
        height: 330px;
        object-fit: cover;
        background: linear-gradient(
          135deg,
          var(--accent-start) 0%,
          var(--accent-end) 100%
        );
      }

      .recipe-content {
        padding: 1.25rem;
      }

      .recipe-category {
        display: inline-block;
        padding: 0.2rem 0.5rem;
        background: #2f2f2f;
        color: #fff;
        border-radius: 6px;
        font-size: 0.62rem;
        font-weight: 600;
      }

      .recipe-categories {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-bottom: 0.75rem;
      }

      .recipe-title {
        font-size: 1.5rem;
        font-weight: 700;
        margin-bottom: 0.75rem;
        color: #1a202c;
      }

      .recipe-description {
        color: var(--muted);
        margin-bottom: 1rem;
        font-size: 0.95rem;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        line-clamp: 3;
      }

      .recipe-meta {
        display: flex;
        gap: 1.5rem;
        color: var(--muted);
        font-size: 0.9rem;
      }

      .recipe-meta span {
        display: flex;
        align-items: center;
        gap: 0.375rem;
      }

      /* Modal */
      .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--modal-overlay);
        z-index: 1000;
        overflow-y: auto;
        padding: 2rem 1rem;
      }

      .modal.active {
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .modal-content {
        background: var(--surface);
        border-radius: 20px;
        max-width: 900px;
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        position: relative;
      }

      .modal-header {
        position: relative;
        height: 600px;
        overflow: hidden;
      }

      .modal-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }

      .close-btn {
        position: fixed;
        top: 2.2rem;
        right: calc((100vw - min(900px, calc(100vw - 2rem))) / 2 + 1rem);
        background: var(--surface);
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
        font-size: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        transition: all 0.3s;
        margin: 0;
        z-index: 1100;
      }

      .close-btn:hover {
        transform: scale(1.1);
      }

      .modal-body {
        padding: 2rem;
      }

      .modal-title {
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 1rem;
      }

      .modal-meta {
        display: flex;
        gap: 2rem;
        align-items: center;
        flex-wrap: wrap;
        margin-bottom: 2rem;
        padding-bottom: 2rem;
        border-bottom: 2px solid var(--muted-light);
      }

      .modal-meta > span {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        white-space: nowrap;
      }

      .serving-controls {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: nowrap;
      }

      .serving-value {
        min-width: 120px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        text-align: center;
        white-space: nowrap;
      }

      .portion-btn {
        width: 32px;
        height: 32px;
        border: 2px solid var(--muted-border);
        background: var(--surface);
        border-radius: 50%;
        cursor: pointer;
        font-weight: 700;
        transition: all 0.2s;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }

      .portion-btn:hover {
        background: var(--primary);
        color: var(--surface);
        border-color: var(--primary);
        transform: translateY(-1px);
      }

      .modal-section-title {
        font-size: 1.5rem;
        font-weight: 700;
        margin: 2rem 0 1rem;
        color: #1a202c;
      }

      .ingredients-list {
        list-style: none;
        margin-bottom: 2rem;
      }

      .ingredients-list li {
        padding: 0.75rem;
        border-bottom: 1px solid var(--muted-light);
        display: flex;
        align-items: center;
      }

      .ingredients-list li:before {
        content: "✓";
        color: var(--primary);
        font-weight: bold;
        margin-right: 1rem;
        font-size: 1.2rem;
      }

      .instructions-list {
        counter-reset: step-counter;
        list-style: none;
      }

      .instructions-list li {
        counter-increment: step-counter;
        padding: 1.5rem;
        margin-bottom: 1rem;
        background: var(--bg);
        border-radius: 12px;
        position: relative;
        padding-left: 4rem;
      }

      .instructions-list li:before {
        content: counter(step-counter);
        position: absolute;
        left: 1.5rem;
        top: 50%;
        transform: translateY(-50%);
        background: var(--primary);
        color: var(--surface);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
      }

      .no-results {
        text-align: center;
        padding: 4rem 2rem;
        color: var(--primary);
      }

      .no-results h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
      }

      /* Responsive */
      @media (max-width: 968px) {
        .hero-content {
          grid-template-columns: 1fr;
        }

        .hero-image {
          min-height: 300px;
        }

        .controls-row {
          grid-template-columns: 1fr;
          grid-template-areas:
            "category"
            "sort"
            "category-list";
        }
      }

      @media (max-width: 768px) {
        .logo {
          font-size: 1.5rem;
        }

        .hero {
          padding: 0 1rem;
        }

        .top-controls {
          padding: 0 1rem;
        }

        .container {
          padding: 1rem;
        }

        .hero-content {
          min-height: 0;
        }

        .hero-image {
          min-height: 220px;
          max-height: 220px;
        }

        .hero-title {
          font-size: 1.75rem;
        }

        .hero-description {
          font-size: 0.96rem;
          line-height: 1.55;
          margin-bottom: 1.25rem;
        }

        .hero-badge {
          top: 1rem;
          left: 1rem;
          font-size: 0.72rem;
          padding: 0.35rem 0.85rem;
        }

        .hero-meta {
          gap: 0.7rem;
          margin-bottom: 1.25rem;
        }

        .hero-meta span {
          font-size: 0.86rem;
          padding: 0.3rem 0.62rem;
        }

        .hero .recipe-category {
          font-size: 0.56rem;
          padding: 0.16rem 0.42rem;
        }

        .hero-text {
          padding: 1.35rem;
        }

        .hero-carousel-title {
          font-size: 0.68rem;
          padding: 0.86rem 1.05rem 0.9rem;
        }

        .hero-carousel-panel {
          grid-template-columns: auto 1fr auto auto;
        }

        .hero-carousel-indicators {
          gap: 0.35rem;
        }

        .hero-carousel-indicator {
          width: 10px;
          height: 10px;
          padding: 0;
          min-width: 10px;
          max-width: none;
          border-radius: 999px;
          font-size: 0;
          line-height: 0;
          overflow: hidden;
        }

        .hero-carousel-status {
          grid-column: auto;
          text-align: right;
          padding-left: 0;
          min-width: 44px;
        }

        .recipes-grid {
          grid-template-columns: 1fr;
        }

        .social-links {
          gap: 0.5rem;
        }

        .modal-header {
          height: 300px;
        }

        .modal-meta {
          gap: 1rem;
        }

        .serving-value {
          min-width: 96px;
        }
      }
