/* 'home' button — pure-CSS refinements, tuned against ../Sample.png (loaded last) */

/* Architecture (roles unchanged): element = transparent hit area (x19..292, y812..868);
   ::after = chrome FRAME, extended to x14..295 / y811..876 so it can also paint the cast shadow (3 soft
   columns on the left, 8 rows below, 1px line on the right) with OPAQUE per-row/per-column tones measured
   from the mockup — the panel already paints a shadow band under the plate (x33..279), so a drop-shadow
   filter would double it; ::before = black FACE (hover/pressed tint as its top layer). */
.plate-dark.home {
  background: none !important; clip-path: none !important; filter: none !important;
  box-shadow: 0 -2px 0 rgba(255,255,255,.06) !important;   /* lit line above the plate */
}

/* chrome frame: plate x17..294 y811..868 (chamfers: TL 8x9, TR ~7x9 rounded, BR 6, BL 7 — corners painted by facet tiles) + cast shadow */
.plate-dark.home::after, .plate-dark.home:hover::after, .plate-dark.home:active::after {
  inset: -1px -3px -8px -5px;   /* x14..295: 3 soft-shadow columns + plate x17..294 + 1px shadow line x295 */
  clip-path: polygon(11px 0, calc(100% - 1px) 0, calc(100% - 1px) 9px, 100% 9px, 100% 58px, calc(100% - 1px) 58px, calc(100% - 1px) 100%, 0 100%, 0 9px, 3px 9px);
  background:
    /* bottom-right: the cast shadow's soft diagonal edge (continues the chamfer line), panel tone outside it */
    linear-gradient(315deg, #8e8e8e 0 7.6px, rgba(142,142,142,.6) 8.4px, rgba(142,142,142,.35) 9.6px, rgba(142,142,142,.12) 11.4px, rgba(142,142,142,0) 12.8px) calc(100% - 1px) 100% / 12px 8px no-repeat,
    /* soft shadow columns x14..16 (left of the plate): fade in from row 822, fade out over the shadow rows */
    linear-gradient(180deg, rgba(104,104,104,1) 0 11px, rgba(104,104,104,.6) 14px, rgba(104,104,104,0) 19px, rgba(104,104,104,0) 57px, rgba(104,104,104,.35) 60px, rgba(104,104,104,.85) 66px) 0 0 / 3px 100% no-repeat,
    linear-gradient(90deg, rgba(0,0,0,.2) 0 1px, rgba(0,0,0,.43) 1px 2px, rgba(0,0,0,.68) 2px 3px) 0 0 / 3px 100% no-repeat,
    /* cast shadow rows 869..876: measured per-row darkness over the panel tone; softer at the far left */
    linear-gradient(90deg, rgba(102,102,102,.55) 0, rgba(102,102,102,0) 12px) 3px 58px / 12px 8px no-repeat,
    linear-gradient(180deg, rgba(0,0,0,.86) 0 1px, rgba(0,0,0,.74) 1px 2px, rgba(0,0,0,.57) 2px 3px, rgba(0,0,0,.53) 3px 4px, rgba(0,0,0,.43) 4px 5px, rgba(0,0,0,.28) 5px 6px, rgba(0,0,0,.16) 6px 7px, rgba(0,0,0,.06) 7px 8px) 3px 58px / calc(100% - 4px) 8px no-repeat,
    linear-gradient(90deg, #666666 0 30px, #767676 150px, #878787 100%) 3px 58px / calc(100% - 4px) 8px no-repeat,
    /* top rows 811..812 (outer bevel, over the corner facets) */
    linear-gradient(90deg, #565654 0%, #62625f 60%, #6a6a67 100%) 3px 0 / 270.5px 1px no-repeat,
    linear-gradient(90deg, #2c2c2a 0%, #343432 20%, #3e3e3c 45%, #444442 65%, #626260 85%, #7c7c78 92%, #b4b4b0 100%) 3px 1px / 271.5px 1px no-repeat,
    /* corner facets: top-right bright, others dark outer 2px + thin lit line; bottom-left dark fills the notch (shadow) */
    linear-gradient(225deg, #8e8e8e 0 5.4px, #7e7e7c 5.7px 6.2px, rgba(255,255,255,.96) 6.5px 9.4px, rgba(255,255,255,0) 9.4px) calc(100% - 1px) 0 / 12px 12px no-repeat,
    linear-gradient(135deg, rgba(0,0,0,.6) 0 7.8px, rgba(255,255,255,.04) 7.8px 8.8px, rgba(255,255,255,0) 8.8px) 3px 0 / 10px 10px no-repeat,
    linear-gradient(45deg, #121212 0 7px, rgba(255,255,255,.07) 7px 8.4px, rgba(255,255,255,0) 8.4px) 3px calc(100% - 8px) / 12px 12px no-repeat,
    linear-gradient(315deg, #8e8e8e 0 2.9px, rgba(142,142,142,.55) 3.5px, rgba(142,142,142,.25) 4.2px, rgba(0,0,0,.6) 4.5px 6.2px, rgba(255,255,255,.06) 6.3px 6.7px, rgba(255,255,255,.16) 6.8px 8.4px, rgba(255,255,255,0) 9px) calc(100% - 1px) calc(100% - 8px) / 12px 12px no-repeat,
    /* top rows 813..815 */
    linear-gradient(90deg, #2a2a28 0%, #37372f 12%, #4c4c48 25%, #5a5a56 40%, #868682 62%, #d9d9d5 82%, #e6e6e2 92%, #f0f0ec 100%) 3px 2px / calc(100% - 4px) 1px no-repeat,
    linear-gradient(90deg, #3a3a38 0 6px, #575755 6.5px, #6a6a68 12%, #8a8a86 25%, #a6a6a2 45%, #c8c8c4 62%, #d9d9d5 82%, #d5d5d1 92%, #e1e1dd 100%) 3px 3px / calc(100% - 4px) 1px no-repeat,
    linear-gradient(90deg, #282826 0%, #323230 12%, #48484a 30%, #464644 60%, #4e4e4c 85%, #454543 100%) 3px 4px / calc(100% - 4px) 1px no-repeat,
    /* bottom rows 866..868 */
    linear-gradient(90deg, #2e2e2c 0%, #3e3e3c 18%, #3d3d3b 60%, #333331 80%, #383836 100%) 3px 55px / calc(100% - 4px) 1px no-repeat,
    linear-gradient(90deg, #1e1e1c 0%, #1a1a18 30%, #201f1e 60%, #181816 80%, #1f1f1d 100%) 3px 56px / calc(100% - 4px) 1px no-repeat,
    linear-gradient(90deg, #060606 0%, #0b0b0a 30%, #0f0f0e 60%, #060606 100%) 3px 57px / calc(100% - 4px) 1px no-repeat,
    /* bottom-right corner: lit strip dims toward the corner */
    linear-gradient(180deg, rgba(0,0,0,0) 0 50px, rgba(0,0,0,.5) 54px, rgba(0,0,0,.6) 58px) calc(100% - 1px) 0 / 6px 58px no-repeat,
    /* left cols x17..20 : dark outer bevel, lit 2px */
    linear-gradient(90deg, #141414 0 1px, #0c0c0c 1px 2px, #303030 2px 3px, #2c2c2c 3px 4px, rgba(0,0,0,0) 4px) 3px 0 / 5px 58px no-repeat,
    /* right cols x291..294 : lit 2px (69/120), dark outer 2px */
    linear-gradient(90deg, #454543 0 1px, #7a7a76 1px 2px, #464644 2px 3px, #2c2c2a 3px 4px) calc(100% - 1px) 0 / 4px 58px no-repeat,
    /* 1px shadow line right of the plate (x295) */
    linear-gradient(rgba(0,0,0,.26), rgba(0,0,0,.26)) 100% 9px / 1px 49px no-repeat,
    linear-gradient(90deg, #1c1c1a 0%, #262624 50%, #343432 100%) 3px 0 / calc(100% - 4px) 58px no-repeat;
}

/* face: x21..290 y816..865 — very dark, lighter toward the right, soft sheen at the top */
.plate-dark.home::before {
  left: 2px; right: 2px; top: 4px; bottom: 3px;
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
  box-shadow: none;
  background:
    linear-gradient(var(--hov, rgba(255,255,255,0)), var(--hov, rgba(255,255,255,0))),
    /* two small wear rings right of the label (elliptical, lit mostly on their lower half) */
    radial-gradient(3px 2.2px at 250.5px 7.6px, rgba(0,0,0,.4) 0 38%, rgba(0,0,0,0) 50%, rgba(255,255,255,.09) 60%, rgba(255,255,255,.14) 100%, rgba(255,255,255,0) 101%),
    radial-gradient(2.4px 2px at 250.5px 42.4px, rgba(0,0,0,.25) 0 35%, rgba(0,0,0,0) 48%, rgba(255,255,255,.11) 60%, rgba(255,255,255,.11) 100%, rgba(255,255,255,0) 101%),
    /* soft dimples around the four rivet heads */
    radial-gradient(circle at 5.5px 6.5px, rgba(0,0,0,.25) 0 4px, rgba(0,0,0,.1) 5.5px, rgba(0,0,0,0) 7.5px),
    radial-gradient(circle at 263.5px 6.5px, rgba(0,0,0,.25) 0 4px, rgba(0,0,0,.1) 5.5px, rgba(0,0,0,0) 7.5px),
    radial-gradient(circle at 5.5px 42.5px, rgba(0,0,0,.25) 0 4px, rgba(0,0,0,.1) 5.5px, rgba(0,0,0,0) 7.5px),
    radial-gradient(circle at 263.5px 42.5px, rgba(0,0,0,.25) 0 4px, rgba(0,0,0,.1) 5.5px, rgba(0,0,0,0) 7.5px),
    /* right groove pair (x289 light / x290 dark) is lighter at the top, darker at the bottom */
    linear-gradient(180deg, rgba(255,255,255,.06) 0, rgba(255,255,255,0) 35%, rgba(0,0,0,.45) 100%) 268px 0 / 2px 100% no-repeat,
    url("assets/tex/brushed-home.png?h=1ef4183c") 0 0 / 270px 50px no-repeat,
    /* top sheen: 2-3 bright rows fading fast; a soft glow at the right end; a small spot right of the icon */
    linear-gradient(180deg, rgba(255,255,255,.08) 0 2px, rgba(255,255,255,.06) 2px 3px, rgba(255,255,255,.04) 3px 4px, rgba(255,255,255,.03) 4px 6px, rgba(255,255,255,.015) 6px 9px, rgba(255,255,255,.006) 9px 14px, rgba(255,255,255,0) 14px),
    radial-gradient(ellipse 50px 20px at 88% 12%, rgba(255,255,255,.03), rgba(255,255,255,0) 100%),
    radial-gradient(ellipse 16px 12px at 56px 6px, rgba(255,255,255,.08), rgba(255,255,255,0) 100%),
    /* faint vertical reflection band right of the icon */
    linear-gradient(90deg, rgba(255,255,255,0) 40px, rgba(255,255,255,.03) 46px, rgba(255,255,255,.03) 60px, rgba(255,255,255,0) 68px),
    linear-gradient(90deg, rgba(0,0,0,.45) 0 12px, rgba(0,0,0,.25) 24px, rgba(0,0,0,0) 40px) 0 0 / 40px 4px no-repeat,
    /* faint lift on the last rows (lit bevel below) */
    linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, rgba(255,255,255,.012) 1px 4px, rgba(255,255,255,0) 6px),
    /* base: inner groove 2px, then 17 -> 23 -> 38 left→right, thin light/dark lines at the right */
    linear-gradient(90deg, #0b0b0b 0 2px, #0d0d0d 2px 8px, #111111 15px, #141414 22px, #171717 60px, #171717 170px, #1b1b1b 200px, #1c1c1c 218px, #1e1e1e 239px, #202020 248px, #1f1f1f 263px, #222222 265px 267px, #292929 267px 268px, #1b1b1b 268px 270px);
}

/* label: half a pixel left (stem-position correlation vs the design); pressed state keeps its 1px drop */
.plate-dark.home span { transform: translate(-0.5px, 0); }
.plate-dark.home:active span { transform: translate(-0.5px, 1px); }
.plate-dark.home:focus-visible::before { box-shadow: inset 0 0 0 2px #b87333; }

/* ?skin=tex: everything is baked there */
.tex .plate-dark.home { filter: none !important; box-shadow: none !important; }
.tex .plate-dark.home::after { background: rgba(255,255,255,0); inset: 0; clip-path: none; }
.tex .plate-dark.home:hover::after { background: rgba(255,255,255,.12); }
.tex .plate-dark.home:active::after { background: rgba(0,0,0,.14); }

/* pressed feedback on the near-black face: a slight lift + inset instead of an invisible darkening */
.plate-dark.home:active { --hov: rgba(255,255,255,.075); }
.plate-dark.home:active::before { box-shadow: inset 0 2px 4px rgba(0,0,0,.6), inset 0 -1px 0 rgba(255,255,255,.06); }
/* ?skin=tex: keep the hover/pressed tint inside the chamfered silhouette */
.tex .plate-dark.home::after, .tex .plate-dark.home:hover::after, .tex .plate-dark.home:active::after {
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
}
