/* «Свет снизу»: общий материал карточек только на главной. */
.home .home-surface {
  --surface-radius: 25px;
  --surface-edge: #ffffff32;
  --surface-corners: #ffffff2e;
  --surface-offset: 11px;
  --surface-light: 0;
  position: relative;
  isolation: isolate;
  overflow: visible;
  clip-path: none;
  border: 1px solid var(--surface-edge);
  border-radius: var(--surface-radius);
  background: radial-gradient(ellipse at 44% 0%, #454545 0%, #232323 36%, #121212 80%);
  box-shadow: inset 0 1px 0 #ffffff18, inset 0 -2px 2px #0009, 0 7px 14px #0004;
  transition: border-color .35s, box-shadow .35s;
}
.home .home-surface::before {
  content: '';
  position: absolute;
  inset: calc(-1 * var(--surface-offset));
  z-index: -1;
  border: 1px solid var(--surface-corners);
  border-radius: calc(var(--surface-radius) + var(--surface-offset));
  background: none;
  pointer-events: none;
  mask: linear-gradient(90deg, #000 23%, transparent 23%, transparent 77%, #000 77%) intersect,
        linear-gradient(#000 23%, transparent 23%, transparent 77%, #000 77%);
  transition: inset .35s, border-color .35s, border-radius .35s;
}
/* A quiet reflection under text cards and secondary controls. */
.home .home-surface::after {
  content: '';
  position: absolute;
  inset: auto 20% 0;
  height: 1px;
  z-index: 0;
  border: 0;
  border-radius: 50%;
  background: #ffbd83;
  box-shadow: 0 -5px 24px 7px #ff944f38, 0 0 9px #ff944f80;
  opacity: var(--surface-light);
  pointer-events: none;
  transition: opacity .35s;
}
.home .home-surface:is(:focus-visible, :active),
.home .home-server-card:has(:focus-visible) {
  --surface-edge: #ff944f;
  --surface-corners: #ff944f9e;
  --surface-offset: 7px;
  --surface-light: 1;
  box-shadow: inset 0 1px 0 #ffffff35, inset 0 -2px 2px #0009, 0 6px 22px #0005, 0 0 18px #ff944f26;
}
.home .home-surface:focus-visible {outline: 2px solid #ffd5b1; outline-offset: 10px}
@media (hover: hover) and (pointer: fine) {
  .home .home-surface:hover {
    --surface-edge: #ff944f;
    --surface-corners: #ff944f9e;
    --surface-offset: 7px;
    --surface-light: 1;
    box-shadow: inset 0 1px 0 #ffffff35, inset 0 -2px 2px #0009, 0 6px 22px #0005, 0 0 18px #ff944f26;
  }
}

.home .home-tools-grid {grid-template-columns: 1.2fr 1fr 1fr; grid-template-rows: repeat(2, minmax(216px, auto)); grid-auto-rows: auto; gap: 28px}
.home .home-tool {display: flex; flex-direction: column; gap: 12px; min-height: 216px; padding: 18px; color: #eee8e8}
.home .home-tool::after {display: none}
.home .home-tool-copy {position: relative; z-index: 2; flex-shrink: 0; padding-right: 16px}
.home .home-tool h3 {font-size: 22px; line-height: 1.2}
.home .home-tool-arrow {right: 18px; bottom: 21px; color: #cfa27e; transform: none}
.home .home-tool-action {position: relative; margin-top: 0; color: #eab58a; font-size: 13px}
.home .home-art-frame {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 100%;
  height: 110px;
  margin-bottom: 5px;
}
/* Light is tied to the illustration's base, never to a fixed card height. */
.home .home-art-frame::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: auto 4% 0;
  height: 85%;
  background: radial-gradient(ellipse at 50% 100%, #ffc084b3, #ff944f70 30%, transparent 74%);
  filter: blur(14px);
  opacity: var(--surface-light);
  pointer-events: none;
  transition: opacity .4s;
}
.home .home-art-frame::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: auto 4% -5px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #080808 12%, #080808 88%, transparent);
  box-shadow: 0 2px 0 #ffffff08;
  pointer-events: none;
  transition: background .35s, box-shadow .35s;
}
.home .home-surface:is(:focus-visible, :active) .home-art-frame::after {
  background: linear-gradient(90deg, transparent, #ff944f 12%, #ffe1c5 50%, #ff944f 88%, transparent);
  box-shadow: 0 0 10px #ff944f75;
}
@media (hover: hover) and (pointer: fine) {
  .home .home-surface:hover .home-art-frame::after {
    background: linear-gradient(90deg, transparent, #ff944f 12%, #ffe1c5 50%, #ff944f 88%, transparent);
    box-shadow: 0 0 10px #ff944f75;
  }
}
.home .home-tool-art {
  position: relative;
  inset: auto;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  margin: 0;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: normal;
  mask-image: none;
  transform: none;
  pointer-events: none;
}
.home .home-tool-featured {grid-column: auto; grid-row: 1 / span 2; padding: 22px; gap: 18px}
.home .home-tool-featured .home-art-frame {flex: 1; min-height: 160px; max-height: 260px; margin-block: auto}
.home .home-tool-featured h3 {font-size: clamp(28px, 2.4vw, 34px); line-height: 1.13}
.home .home-tool-featured p {font-size: 13px; max-width: 300px}
.home .home-tool-featured .home-tool-action {max-width: none; margin-top: 0}

.home .home-server-grid, .home .home-tables, .home .home-playlist-grid {gap: 28px}
.home .home-server-card {--surface-radius: 24px; padding: 24px}
.home .home-server-card > * {position: relative; z-index: 1}
.home .home-server-heading {margin-bottom: 26px}
.home .home-table-link {--surface-radius: 20px}
.home .home-table-link > * {position: relative; z-index: 1}
.home .home-playlist-card {--surface-radius: 22px}
.home .home-playlist-thumb {border-radius: calc(var(--surface-radius) - 1px) calc(var(--surface-radius) - 1px) 0 0}
.home .home-playlist-copy {position: relative; z-index: 1}
.home .home-button-secondary {--surface-radius: 12px; color: #eee5dc}
/* Pressing changes light, not geometry. No click toggle or persistent :focus glow. */
.home .home-button:is(:hover, :active), .home .home-button:hover .icon-arrow-right {transform: none}
.home .home-button-secondary:active {color: #fff1e6}

@media (min-width: 781px) and (max-width: 960px) {
  .home .home-tools-grid {grid-template-columns: 1fr 1fr; grid-template-rows: auto}
  .home .home-tool-featured {grid-column: 1 / -1; grid-row: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; min-height: 240px}
  .home .home-tool-featured .home-art-frame {grid-column: 2; grid-row: 1 / span 2; height: 200px; min-height: 0; margin: 0}
  .home .home-tool-featured .home-tool-copy {grid-column: 1; grid-row: 1; align-self: end; max-width: none}
  .home .home-tool-featured .home-tool-action {grid-column: 1; align-self: start}
}
@media (max-width: 780px) {
  .home .home-tools-grid {grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 28px}
  .home .home-tool, .home .home-tool-featured {grid-column: auto; grid-row: auto; min-height: 0; padding: 20px; gap: 16px}
  .home .home-art-frame, .home .home-tool-featured .home-art-frame {flex: none; height: clamp(130px, 25vw, 180px); min-height: 0; max-height: none; margin: 0 auto 5px}
  .home .home-tool-art {max-width: 370px}
  .home .home-tool h3 {font-size: 24px}
  .home .home-tool-featured h3 {font-size: 28px}
  .home .home-tool-featured .home-tool-action {margin-top: 0}
  .home .home-tool-arrow {right: 20px; bottom: 23px}
}
@media (max-width: 360px) {
  .home .home-tool, .home .home-tool-featured {padding: 18px}
  .home .home-tool h3 {font-size: 22px}
  .home .home-tool-featured h3 {font-size: 28px}
  .home .home-server-card {padding: 20px}
  .home .home-actions {gap: 18px}
  .home .home-actions .home-button {flex-basis: 100%}
}
