/* 'upload' button — pure-CSS refinements, tuned against ../Sample.png (loaded last)
   Geometry (stage px): plate x18..295, y882..963; frame = copper bevel lit from the top-right with a cream rim
   (top row y885, right cols x292-293, left col x19); face x21..289 / y887..958.
   Texture: assets/tex/copper-patina.png = procedural cloud/mottle overlay (analysis/tmp_upload_gen.py), not from the mockup. */

/* ---- element: transparent; tight shadow to the left (the soft one below is part of the panel skin) ---- */
.plate-copper, .plate-copper:hover, .plate-copper:active {
  filter: drop-shadow(-3px 1px 1px rgba(0,0,0,.50));   /* the soft shadow below is painted by the panel (skin-left) */
}

/* ---- FRAME (::after): copper bevel, painted row/column-wise (1px gradients) over a copper base ---- */
.plate-copper::after, .plate-copper:hover::after, .plate-copper:active::after {
  inset: 0 -2px -2px -1px;                                   /* x18..295, y882..963 → 278 x 82 */
  clip-path: polygon(5px 0, 270px 0, 276px 6px, 100% 9px, 100% 74px, 271px 100%, 7px 100%, 0 75px, 0 5px);
  background:
    /* top-right corner: the cream rim runs around the chamfer; small glints on the left chamfers */
    linear-gradient(225deg, rgba(255,250,236,.9) 0 8px, rgba(255,240,220,0) 10px) 100% 1px / 16px 16px no-repeat,
    /* top rows y882..886 */
    linear-gradient(90deg, rgb(75,66,51) 0, rgb(88,68,48) 15%, rgb(94,71,49) 40%, rgb(122,95,71) 65%, rgb(135,109,86) 90%, rgb(134,113,94) 100%) 0 0 / 100% 1px no-repeat,
    linear-gradient(90deg, rgb(55,35,18) 0, rgb(111,73,45) 5%, rgb(124,79,45) 45%, rgb(167,116,72) 62%, rgb(204,156,111) 78%, rgb(228,201,170) 88%, rgb(226,200,170) 100%) 0 1px / 100% 1px no-repeat,
    linear-gradient(90deg, rgb(65,41,23) 0, rgb(124,76,42) 5%, rgb(147,95,53) 22%, rgb(150,108,68) 35%, rgb(165,124,86) 45%, rgb(176,134,92) 55%, rgb(198,164,125) 68%, rgb(236,210,173) 80%, rgb(255,243,218) 92%, rgb(255,245,222) 100%) 0 2px / 100% 1px no-repeat,
    linear-gradient(90deg, rgb(76,44,24) 0, rgb(120,80,50) 4%, rgb(165,118,80) 7%, rgb(188,138,96) 15%, rgb(221,185,144) 24%, rgb(238,215,185) 33%, rgb(247,236,215) 40%, rgb(252,247,232) 55%, rgb(255,252,240) 80%, rgb(245,223,195) 100%) 0 3px / 100% 1px no-repeat,
    linear-gradient(90deg, rgb(100,63,38) 0, rgb(107,69,41) 12%, rgb(121,86,56) 20%, rgb(116,80,56) 45%, rgb(145,108,80) 60%, rgb(150,107,76) 72%, rgb(145,98,66) 100%) 0 4px / 100% 1px no-repeat,
    /* bottom rows y959..963 */
    linear-gradient(90deg, rgb(82,50,26) 0, rgb(90,55,29) 8%, rgb(108,68,38) 16%, rgb(119,76,43) 28%, rgb(122,78,45) 50%, rgb(140,94,58) 65%, rgb(126,82,48) 80%, rgb(122,78,45) 100%) 0 77px / 100% 1px no-repeat,
    linear-gradient(90deg, rgb(86,52,27) 0, rgb(96,60,32) 8%, rgb(108,68,38) 18%, rgb(114,73,41) 30%, rgb(120,77,44) 50%, rgb(146,100,62) 63%, rgb(120,76,44) 80%, rgb(122,78,45) 100%) 0 78px / 100% 1px no-repeat,
    linear-gradient(90deg, rgb(78,46,22) 0, rgb(86,52,26) 30%, rgb(98,60,31) 60%, rgb(84,50,26) 100%) 0 79px / 100% 1px no-repeat,
    linear-gradient(90deg, rgb(44,28,14) 0 12%, rgb(70,44,23) 25%, rgb(90,56,30) 60%, rgb(66,42,22) 100%) 0 80px / 100% 1px no-repeat,
    linear-gradient(90deg, rgb(44,31,18), rgb(48,34,20)) 0 81px / 100% 1px no-repeat,
    /* left cols x18..20 */
    linear-gradient(180deg, rgb(92,58,32) 0, rgb(87,53,28) 40%, rgb(84,52,28) 100%) 0 0 / 1px 100% no-repeat,
    linear-gradient(180deg, rgb(120,80,50) 0, rgb(166,120,82) 9%, rgb(160,114,78) 55%, rgb(140,98,64) 78%, rgb(120,82,52) 90%, rgb(60,36,16) 100%) 1px 0 / 1px 100% no-repeat,
    linear-gradient(180deg, rgb(104,66,40) 0, rgb(116,76,47) 25%, rgb(114,74,46) 50%, rgb(96,60,34) 68%, rgb(94,58,33) 100%) 2px 0 / 1px 100% no-repeat,
    /* right cols x290..295 */
    linear-gradient(180deg, rgb(117,69,33), rgb(112,66,32)) 272px 0 / 1px 100% no-repeat,
    linear-gradient(180deg, rgb(200,150,105) 0, rgb(161,112,71) 12%, rgb(158,110,70) 70%, rgb(140,96,60) 100%) 273px 0 / 1px 100% no-repeat,
    linear-gradient(180deg, rgb(255,240,215) 0, rgb(238,197,149) 12%, rgb(236,196,148) 50%, rgb(222,178,130) 80%, rgb(205,160,115) 100%) 274px 0 / 1px 100% no-repeat,
    linear-gradient(180deg, rgb(250,220,180) 0, rgb(232,181,124) 15%, rgb(228,178,122) 60%, rgb(215,165,110) 100%) 275px 0 / 1px 100% no-repeat,
    linear-gradient(180deg, rgb(180,125,75) 0, rgb(165,109,62) 20%, rgb(160,105,60) 100%) 276px 0 / 1px 100% no-repeat,
    linear-gradient(180deg, rgb(140,108,82), rgb(133,104,80)) 277px 0 / 1px 100% no-repeat,
    /* base copper (fills corners) */
    linear-gradient(90deg, rgb(92,56,30) 0%, rgb(100,62,35) 40%, rgb(122,78,46) 70%, rgb(140,92,55) 100%);
}

/* ---- FACE (::before): worn copper, darker at the left, warm at the right ---- */
.plate-copper::before {
  left: 2px; top: 5px; right: 4px; bottom: 3px;              /* x21..289, y887..958 */
  clip-path: polygon(3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px), 0 3px);
  background:
    linear-gradient(var(--hov, rgba(255,255,255,0)), var(--hov, rgba(255,255,255,0))),
    url("assets/tex/copper-patina.png?h=f35a1b5f") 0 0 / 275px 80px no-repeat,
    radial-gradient(ellipse 34px 26px at 14px 62px, rgba(20,8,0,.30), rgba(20,8,0,0) 100%),
    radial-gradient(ellipse 80px 16px at 165px 5px, rgba(20,8,0,.16), rgba(20,8,0,0) 100%),
    radial-gradient(ellipse 70px 16px at 218px 6px, rgba(255,215,175,.03), rgba(255,215,175,0) 100%),
    radial-gradient(ellipse 60px 20px at 250px 40px, rgba(255,205,160,.04), rgba(255,205,160,0) 100%),
    linear-gradient(180deg, rgba(255,225,190,.03), rgba(255,225,190,0) 35%, rgba(0,0,0,0) 60%, rgba(0,0,0,.07) 100%),
    linear-gradient(90deg, rgb(86,52,27) 0, rgb(92,57,29) 18%, rgb(95,58,30) 40%, rgb(104,64,35) 52%, rgb(118,73,40) 68%, rgb(122,75,41) 85%, rgb(126,78,43) 100%);
  background-blend-mode: normal;
  box-shadow: none;
}

/* ---- rivets: cream domes lit from the top-right with a dark crescent at the bottom-left (inline SVG) ---- */
.plate-copper .rivet {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><defs><radialGradient id='d' cx='0.70' cy='0.30' r='0.80'><stop offset='0' stop-color='%23fffdf6'/><stop offset='0.12' stop-color='%23f2e8d4'/><stop offset='0.3' stop-color='%23b39470'/><stop offset='0.55' stop-color='%23916b47'/><stop offset='0.85' stop-color='%23663f20'/><stop offset='1' stop-color='%23402210'/></radialGradient><filter id='b' x='-50%25' y='-50%25' width='200%25' height='200%25'><feGaussianBlur stdDeviation='0.5'/></filter></defs><circle cx='4.5' cy='5.7' r='4.2' fill='%23200f04' opacity='.8' filter='url(%23b)'/><circle cx='5' cy='5' r='4' fill='%23553318'/><circle cx='5' cy='5' r='3.5' fill='url(%23d)'/></svg>");
  width: 10px !important; height: 10px !important;
}
.plate-copper .rivet:nth-of-type(1), .plate-copper .rivet:nth-of-type(3) { left: 2px !important; }
.plate-copper .rivet:nth-of-type(2), .plate-copper .rivet:nth-of-type(4) { left: 261px !important; }
.plate-copper .rivet:nth-of-type(1), .plate-copper .rivet:nth-of-type(2) { top: 6px !important; }
.plate-copper .rivet:nth-of-type(3), .plate-copper .rivet:nth-of-type(4) { top: 65px !important; }

/* ---- ?skin=tex: surfaces are baked there — keep only the hover/pressed tint ---- */
.tex .plate-copper, .tex .plate-copper:hover, .tex .plate-copper:active { filter: none; }
.tex .plate-copper::after, .tex .plate-copper:hover::after, .tex .plate-copper:active::after { inset: 0; background: rgba(255,255,255,0); z-index: auto; clip-path: none; }
.tex .plate-copper:hover::after { background: rgba(255,255,255,.12); }
.tex .plate-copper:active::after { background: rgba(0,0,0,.14); }
.tex .plate-copper::before { display: none; }

/* subtitle tracking: measured glyph positions were +5px wide at the line end (0.08em → 0.055em) */
.up-sub { letter-spacing: 0.055em; }
/* title tracking: line end measured +2px wide (0.071em → 0.065em) */
.up-title { letter-spacing: 0.065em; }
/* label ink: the mockup lettering is a warm off-white (sub p99 ≈ 220, title ≈ 247), not pure white */
.up-sub { color: #d8cdbf; }
.up-title { color: #ede8e1; }
.up-sub, .up-title { text-shadow: 1px 1px 2px rgba(0,0,0,.2); }   /* faint emboss shadow, as in the mockup */

/* ?skin=tex: keep the hover/pressed tint inside the chamfered silhouette */
.tex .plate-copper::after, .tex .plate-copper:hover::after, .tex .plate-copper: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);
}
