/* ==========================================================
   PAGE CSS CONTROLLER - PORTFOLIO
   Change these variables first. They control this page only.
   ========================================================== */
body.dt-page-portfolio {
  --dt-h1-size: clamp(42px, 5vw, 70px);
  --dt-h2-size: clamp(28px, 3vw, 38px);
  --dt-p-size: 18px;
  --dt-mobile-h1-size: clamp(29px, 9vw, 38px);
  --dt-mobile-h2-size: clamp(24px, 7vw, 32px);
  --dt-mobile-p-size: 15px;

  --page-first-section-padding-top: 130px;
  --page-mobile-first-section-padding-top: 94px;
  --page-small-first-section-padding-top: 88px;

  --portfolio-hero-min-height: 456px;
  --portfolio-hero-padding-bottom: 118px;
  --portfolio-title-size: clamp(42px, 5vw, 70px);
  --portfolio-text-size: clamp(17px, 1.5vw, 22px);
  --portfolio-tabs-margin-top: 42px;
}

:root {
      --ink: #090a13;
      --muted: #565866;
      --violet: #7124ef;
      --pink: #ec4d9d;
      --orange: #ff7f18;
      --blue: #095de5;
      --dark: #080713;
      --card: #ffffff;
      --line: rgba(10, 10, 20, 0.12);
      --shadow: 0 22px 60px rgba(19, 10, 57, 0.12);
    }

    * {
      box-sizing: border-box;
    }

    html {
      scroll-behavior: smooth;
    }

    body {
      margin: 0;
      color: var(--ink);
      background: #fff;
      font-family: "Inter", "Segoe UI", Arial, sans-serif;
      overflow-x: hidden;
    }

    button {
      font: inherit;
    }

    img {
      max-width: 100%;
    }

    .dt-portfolio-page {
      min-height: 100vh;
      background: #fff;
    }

    .container {
      width: min(1410px, calc(100% - 48px));
      margin: 0 auto;
    }

    .portfolio-hero {
      min-height: 456px;
      padding: 38px 0 118px;
      color: #fff;
      overflow: hidden;
      position: relative;
      background:
        radial-gradient(circle at 5% 96%, rgba(116, 35, 255, 0.9), transparent 23%),
        radial-gradient(circle at 92% 85%, rgba(5, 95, 225, 0.78), transparent 22%),
        radial-gradient(circle at 98% 0, rgba(97, 35, 225, 0.24), transparent 32%),
        linear-gradient(135deg, #130b3c 0%, #080713 62%, #0b081f 100%);
    }

    .portfolio-hero::before {
      content: "";
      position: absolute;
      inset: 0;
      opacity: 0.34;
      pointer-events: none;
      background:
        radial-gradient(circle, rgba(255,255,255,0.2) 1px, transparent 1.8px),
        linear-gradient(120deg, transparent 0 64%, rgba(255,255,255,0.07) 64% 64.35%, transparent 64.35% 100%);
      background-size: 18px 18px, 20px 20px;
    }

    .portfolio-hero::after {
      content: "";
      position: absolute;
      inset: auto -8% -38% auto;
      width: 44vw;
      height: 44vw;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(20, 103, 255, 0.58), transparent 62%);
      filter: blur(10px);
      pointer-events: none;
    }

    .portfolio-title {
      position: relative;
      z-index: 1;
      max-width: 840px;
      margin: 0 auto;
      text-align: center;
    }

    .portfolio-title h1 {
      margin: 0;
      color: #fff;
      font-size: clamp(36px, 4vw, 56px);
      line-height: 1.05;
      letter-spacing: -0.04em;
      font-weight: 950;
    }

    .portfolio-title p {
      max-width: 760px;
      margin: 8px auto 0;
      color: rgba(255,255,255,0.52);
      font-size: clamp(17px, 1.8vw, 24px);
      line-height: 1.35;
      font-weight: 600;
    }

    .tabs-wrap {
      position: relative;
      z-index: 2;
      display: flex;
      justify-content: center;
      flex-wrap: wrap;
      gap: 26px;
      margin-top: 126px;
    }

    .portfolio-tab {
      min-height: 68px;
      padding: 0 26px;
      border: 2px solid transparent;
      border-radius: 7px;
      color: #fff;
      font-size: clamp(18px, 1.9vw, 25px);
      font-weight: 950;
      letter-spacing: 0.035em;
      cursor: pointer;
      background:
        linear-gradient(#201b32, #201b32) padding-box,
        linear-gradient(120deg, var(--violet), var(--pink), var(--orange)) border-box;
      box-shadow: 0 12px 30px rgba(0,0,0,0.14);
      transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    }

    .portfolio-tab:hover,
    .portfolio-tab.is-active {
      transform: translateY(-3px);
      background:
        linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.035)) padding-box,
        linear-gradient(120deg, var(--violet), var(--pink), var(--orange)) border-box;
      box-shadow: 0 18px 42px rgba(108, 36, 239, 0.26);
    }

    .portfolio-body {
      padding: 92px 0 96px;
      background: #fff;
    }

    .projects-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 68px 28px;
      transition: opacity 0.22s ease, transform 0.22s ease;
    }

    .projects-grid.is-switching {
      opacity: 0;
      transform: translateY(12px);
    }

    .project-card {
      min-width: 0;
      animation: cardIn 0.36s ease both;
    }

    .project-link {
      display: block;
      color: inherit;
      text-decoration: none;
    }

    .project-card.is-hidden {
      display: none;
    }

    .project-image {
      height: 306px;
      overflow: hidden;
      position: relative;
      border-radius: 8px;
      background:
        radial-gradient(circle at 74% 20%, rgba(236, 77, 157, 0.22), transparent 34%),
        linear-gradient(135deg, #f6f2ff, #fff);
      box-shadow: 0 1px 0 rgba(0,0,0,0.04);
    }

    .project-image img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
      transition: transform 0.34s ease, filter 0.34s ease;
    }

    .project-card:hover .project-image img {
      transform: scale(1.045);
      filter: saturate(1.04);
    }

    .project-card.image-missing .project-image {
      display: grid;
      place-items: center;
      border: 1px solid rgba(112, 36, 239, 0.16);
      background:
        radial-gradient(circle at 78% 20%, rgba(255,127,24,0.24), transparent 32%),
        radial-gradient(circle at 18% 82%, rgba(113,36,239,0.24), transparent 34%),
        linear-gradient(135deg, #fbf8ff, #fff);
    }

    .project-card.image-missing .project-image img {
      display: none;
    }

    .project-card.image-missing .project-image::before {
      content: attr(data-title);
      padding: 24px;
      color: var(--ink);
      font-size: 30px;
      line-height: 1.1;
      font-weight: 950;
      text-align: center;
      letter-spacing: -0.035em;
    }

    .project-card h2 {
      margin: 22px 14px 0;
      color: #0a0a0d;
      font-size: clamp(24px, 2.4vw, 30px);
      line-height: 1.12;
      letter-spacing: -0.035em;
      font-weight: 950;
    }

    .project-card p {
      margin: 19px 14px 0;
      color: #444650;
      font-size: 18px;
      line-height: 1.35;
    }

    .view-more-holder {
      display: flex;
      justify-content: center;
      margin-top: 70px;
    }

    .view-more {
      min-height: 60px;
      padding: 0 34px;
      border: 2px solid transparent;
      border-radius: 999px;
      color: #fff;
      font-size: 18px;
      font-weight: 950;
      cursor: pointer;
      background:
        linear-gradient(135deg, #171323, #171323) padding-box,
        linear-gradient(120deg, var(--violet), var(--pink), var(--orange)) border-box;
      box-shadow: 0 16px 36px rgba(10, 10, 20, 0.16);
      transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .view-more:hover {
      transform: translateY(-2px);
    }

    .view-more.is-hidden {
      display: none;
    }

    .empty-state {
      display: none;
      min-height: 180px;
      place-items: center;
      border: 1px dashed var(--line);
      border-radius: 22px;
      color: var(--muted);
      font-size: 20px;
      font-weight: 800;
      text-align: center;
    }

    .empty-state.is-visible {
      display: grid;
    }

    @keyframes cardIn {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @media (max-width: 1080px) {
      .portfolio-hero {
        min-height: auto;
        padding-bottom: 70px;
      }

      .tabs-wrap {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 14px;
        margin-top: 58px;
        overflow-x: auto;
        padding: 4px 0 12px;
        scrollbar-width: thin;
      }

      .portfolio-tab {
        flex: 0 0 auto;
        min-height: 56px;
        padding: 0 18px;
        font-size: 17px;
      }

      .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 54px 24px;
      }

      .project-image {
        height: 280px;
      }
    }

    @media (max-width: 680px) {
      .container {
        width: min(100% - 28px, 1410px);
      }

      .portfolio-hero {
        padding: 34px 0 54px;
      }

      .portfolio-title h1 {
        font-size: 36px;
      }

      .portfolio-title p {
        font-size: 16px;
      }

      .tabs-wrap {
        margin-top: 40px;
        gap: 10px;
      }

      .portfolio-tab {
        min-height: 52px;
        padding: 0 15px;
        font-size: 15px;
      }

      .portfolio-body {
        padding: 56px 0 72px;
      }

      .projects-grid {
        grid-template-columns: 1fr;
        gap: 42px;
      }

      .project-image {
        height: 240px;
      }

      .project-card h2 {
        margin-top: 16px;
      }

      .project-card p {
        margin-top: 10px;
      }

      .view-more-holder {
        margin-top: 48px;
      }

      .view-more {
        width: 100%;
      }
    }

/* Page controller mappings - PORTFOLIO */
body.dt-page-portfolio .portfolio-hero {
  min-height: var(--portfolio-hero-min-height);
  padding-bottom: var(--portfolio-hero-padding-bottom);
}

body.dt-page-portfolio .portfolio-title h1 {
  font-size: var(--portfolio-title-size);
}

body.dt-page-portfolio .portfolio-title p {
  font-size: var(--portfolio-text-size);
}

body.dt-page-portfolio .tabs-wrap {
  margin-top: var(--portfolio-tabs-margin-top);
}
