/* =========================================================
   APPLICATIONS LIST PAGE
   Compact 4-card group:
     Big feature on one side (2 rows tall)
     2 small tiles stacked on top
     1 wide band tile on the bottom

   Group A: feature LEFT, small tiles top-right, band bottom-right
   Group B: feature RIGHT, small tiles top-left, band bottom-left

   Pattern alternates A → B → A → B …
   8 cards = 2 groups. Remainders fall into a clean equal row.

   Class prefix: al-  (applications list)
   ========================================================= */

/* =========================================================
   HERO
   ========================================================= */
.al-hero {
  position: relative;
  padding-top: calc(var(--header-h) + 32px);
  padding-bottom: clamp(36px, 5vw, 56px);
  background: #fff;
  border-bottom: 1px solid var(--border);
  clip-path: inset(0);
  overflow: hidden;
}

.al-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.al-hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(28, 25, 23, .07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 80% at 80% 50%, #000 30%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 80% 50%, #000 30%, transparent 95%);
}

.al-hero__bg-glow {
  position: absolute;
  top: 50%;
  left: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle,
      rgba(28, 25, 23, .14) 0%,
      rgba(28, 25, 23, .04) 40%,
      rgba(28, 25, 23, 0) 70%);
  filter: blur(40px);
  transform: translateY(-50%);
  animation: al-glow 8s ease-in-out infinite alternate;
}

@keyframes al-glow {
  0% {
    opacity: .6;
    transform: translateY(-50%) scale(.9);
  }

  100% {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
  }
}

.al-hero>.container {
  position: relative;
  z-index: 1;
}

.al-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(28px, 4vw, 44px);
  font-size: var(--t-xs);
  color: var(--text-muted);
}

.al-crumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.al-crumbs a:hover {
  color: var(--text);
}

.al-crumbs i {
  font-size: .75rem;
  color: var(--text-light);
}

.al-crumbs span {
  color: var(--text);
  font-weight: 500;
}

.al-hero__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.al-hero__text {
  max-width: 720px;
}

.al-hero__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 14px;
}

.al-hero__meta::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--text-muted);
}

.al-hero__title {
  font-size: clamp(1.85rem, 3.6vw, 2.6rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.025em;
  color: var(--text);
}

.al-hero__title em {
  font-style: normal;
  color: var(--accent);
}

.al-hero__count {
  font-size: var(--t-sm);
  color: var(--text-muted);
}

.al-hero__count strong {
  color: var(--text);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -.02em;
  display: inline-block;
  margin-right: 4px;
}

/* =========================================================
   GRID — modular 4-card groups + remainder row
   ========================================================= */
.al-list {
  padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px);
  background: #fff;
}

.al-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.5vw, 16px);
}

/* =========================================================
   GROUP — 4 cards: feature + 2 smalls top + 1 wide band bottom
   12-column grid, 2 rows tall.
   Feature spans 6 cols × 2 rows (kareye yakın oran)
   Smalls each span 3 cols × 1 row (kare hisli)
   Band spans 6 cols × 1 row (yatay panoramik)
   ========================================================= */
.al-group {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(160px, 18vw));
  gap: clamp(12px, 1.5vw, 16px);
}

/* ---- Group A: feature LEFT ---- */
.al-group--a .al-tile--feature {
  grid-column: 1 / span 6;
  grid-row: 1 / span 2;
}

.al-group--a .al-tile--small:nth-child(2) {
  grid-column: 7 / span 3;
  grid-row: 1 / span 1;
}

.al-group--a .al-tile--small:nth-child(3) {
  grid-column: 10 / span 3;
  grid-row: 1 / span 1;
}

.al-group--a .al-tile--band {
  grid-column: 7 / span 6;
  grid-row: 2 / span 1;
}

/* ---- Group B: feature RIGHT (mirror) ----
   In Group B markup, the feature comes LAST (4th child) so the
   2 smalls + band naturally fill the LEFT side first. */
.al-group--b .al-tile--small:nth-child(1) {
  grid-column: 1 / span 3;
  grid-row: 1 / span 1;
}

.al-group--b .al-tile--small:nth-child(2) {
  grid-column: 4 / span 3;
  grid-row: 1 / span 1;
}

.al-group--b .al-tile--band {
  grid-column: 1 / span 6;
  grid-row: 2 / span 1;
}

.al-group--b .al-tile--feature {
  grid-column: 7 / span 6;
  grid-row: 1 / span 2;
}

/* =========================================================
   REMAINDER ROW — for card counts that aren't multiples of 4
   1 card → full width band
   2 cards → halves
   3 cards → thirds
   ========================================================= */
.al-row {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  grid-auto-rows: minmax(180px, 18vw);
  gap: clamp(12px, 1.5vw, 16px);
}

.al-row--1 {
  --cols: 1;
}

.al-row--2 {
  --cols: 2;
}

.al-row--3 {
  --cols: 3;
}

/* =========================================================
   TILE — full-bleed image, hover-reveal info layer
   ========================================================= */
.al-tile {
  position: relative;
  display: block;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #0a0a0a;
  text-decoration: none;
  color: #fff;
  isolation: isolate;
  transition: transform var(--t-base-d) var(--ease);
  min-height: 120px;
}

.al-tile:hover {
  transform: translateY(-2px);
}

.al-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow) cubic-bezier(.2, .8, .2, 1),
    filter var(--t-base-d) var(--ease);
  z-index: 0;
}

.al-tile:hover .al-tile__img {
  transform: scale(1.06);
  filter: brightness(.85);
}

.al-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(0, 0, 0, 0) 30%,
      rgba(0, 0, 0, .4) 70%,
      rgba(0, 0, 0, .8) 100%);
  z-index: 1;
  transition: background var(--t-base-d) var(--ease);
}

.al-tile:hover::before {
  background: linear-gradient(180deg,
      rgba(0, 0, 0, .15) 0%,
      rgba(0, 0, 0, .55) 60%,
      rgba(0, 0, 0, .85) 100%);
}

.al-tile__num {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: .68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  border-radius: 999px;
  z-index: 3;
  transition: background var(--t-fast) var(--ease);
}

.al-tile:hover .al-tile__num {
  background: rgba(255, 255, 255, .25);
}

.al-tile__num strong {
  color: var(--accent);
  font-weight: 600;
}

.al-tile__arrow {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  z-index: 3;
  opacity: 0;
  transform: translate(8px, -8px);
  transition: opacity var(--t-base-d) var(--ease),
    transform var(--t-base-d) var(--ease),
    background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.al-tile:hover .al-tile__arrow {
  opacity: 1;
  transform: translate(0, 0);
  background: var(--accent);
  border-color: var(--accent);
}

.al-tile__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(14px, 1.8vw, 24px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.al-tile__title {
  font-size: clamp(.95rem, 1.25vw, 1.1rem);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.2;
  color: #fff;
  margin: 0;
  transition: transform var(--t-base-d) cubic-bezier(.2, .8, .2, 1);
}

.al-tile:hover .al-tile__title {
  transform: translateY(-2px);
}

.al-tile__desc {
  font-size: var(--t-sm);
  color: rgba(255, 255, 255, .85);
  line-height: 1.5;
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(8px);
  transition: max-height var(--t-base-d) cubic-bezier(.2, .8, .2, 1),
    opacity var(--t-base-d) var(--ease),
    transform var(--t-base-d) cubic-bezier(.2, .8, .2, 1);
}

.al-tile:hover .al-tile__desc {
  max-height: 200px;
  opacity: 1;
  transform: translateY(0);
}

/* Feature tile — bigger title, 2-line desc excerpt always visible */
.al-tile--feature .al-tile__title {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  letter-spacing: -.02em;
}

.al-tile--feature .al-tile__desc {
  max-height: 3em;
  opacity: .8;
  transform: translateY(0);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.al-tile--feature:hover .al-tile__desc {
  max-height: 200px;
  opacity: 1;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

/* Band tile — wider; can fit slightly larger title */
.al-tile--band .al-tile__title {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 992px) {
  .al-group {
    grid-template-rows: repeat(2, minmax(140px, 22vw));
  }
}

@media (max-width: 768px) {
  .al-hero {
    padding-top: calc(var(--header-h) + 24px);
  }

  /* On phones: collapse groups to a 1-col list of equal tiles */
  .al-group,
  .al-group--a,
  .al-group--b {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: clamp(240px, 56vw, 320px);
  }

  /* Force every tile back into a single column.
     Specificity must match or beat the desktop nth-child rules
     (e.g. ".al-group--a .al-tile--small:nth-child(2)") which have
     specificity (0,3,0). We use the same level here. */
  .al-group--a .al-tile--feature,
  .al-group--a .al-tile--small:nth-child(2),
  .al-group--a .al-tile--small:nth-child(3),
  .al-group--a .al-tile--band,
  .al-group--b .al-tile--small:nth-child(1),
  .al-group--b .al-tile--small:nth-child(2),
  .al-group--b .al-tile--band,
  .al-group--b .al-tile--feature {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  /* GROUP B FIX — markup order is small/small/band/feature so the
     feature naturally lands at the bottom. Move it to the top so
     every group on mobile leads with its biggest tile. */
  .al-group--b .al-tile--feature {
    order: -1;
  }

  .al-row,
  .al-row--1,
  .al-row--2,
  .al-row--3 {
    grid-template-columns: 1fr;
    grid-auto-rows: clamp(240px, 56vw, 320px);
  }

  /* On mobile: always show description (no hover available) */
  .al-tile__desc {
    max-height: 200px;
    opacity: 1;
    transform: translateY(0);
  }

  /* Larger content padding on mobile so title + desc breathe inside the tile */
  .al-tile__content {
    padding: 18px 18px 16px;
    gap: 8px;
  }

  /* Title sizes converge on mobile (tiles are all the same size now) */
  .al-tile__title,
  .al-tile--feature .al-tile__title,
  .al-tile--band .al-tile__title {
    font-size: clamp(1.1rem, 4vw, 1.35rem);
  }

  /* Slightly stronger gradient on mobile for better text legibility on
     phones in bright light */
  .al-tile::before {
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0) 25%,
        rgba(0, 0, 0, .55) 70%,
        rgba(0, 0, 0, .85) 100%);
  }
}