/*
 * Premium materials for builder cards. Each template in config/card_templates.php
 * names a 'material' (body class mat-*) and optionally a foil 'tone' (tone-*).
 * Brushed metal lives in materials-metal.css. Free templates have no material
 * and use the plain look from v2.css.
 *
 * Template colours still apply: --bg, --text, --accent, --accent-text,
 * --surface, --surface-text come from CardBuilder::styleVars().
 */

/* ---------- Shared textures ---------- */
.mat {
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E");
    /* foil tones: a bright metallic ramp used for lettering, rules and buttons */
    --foil: linear-gradient(100deg, #8a6418 0%, #e9c96b 22%, #fff4c9 38%, #c9a03a 55%, #f6dd8d 72%, #9c7420 100%);
    --foil-base: #c9a03a;
    --foil-ink: #2a1d03;
    /* Deeper ramp for foil LETTERING on light backgrounds (paper, marble) */
    --foil-deep: linear-gradient(100deg, #5a3f08 0%, #9c7420 25%, #c9a03a 42%, #6e4f10 60%, #a8812a 80%, #4f3706 100%);
}
.tone-silver { --foil-deep: linear-gradient(100deg, #2b2f35 0%, #5d636c 30%, #8b919a 45%, #3a3e45 65%, #6a7079 85%, #24272c 100%); --foil: linear-gradient(100deg, #6f747c 0%, #cfd3d8 22%, #ffffff 38%, #a9aeb5 55%, #e6e9ec 72%, #7c8188 100%); --foil-base: #b4b9c0; --foil-ink: #1e2126; }
.tone-rose { --foil-deep: linear-gradient(100deg, #6b2f22 0%, #a85a47 28%, #c97f6c 44%, #7d3a2b 64%, #b06a58 84%, #5c2519 100%); --foil: linear-gradient(100deg, #9a5a4b 0%, #e7aa98 22%, #ffe1d6 38%, #c98371 55%, #f2c2b1 72%, #a3604f 100%); --foil-base: #d08d7a; --foil-ink: #3a1810; }
.tone-copper { --foil-deep: linear-gradient(100deg, #5a2408 0%, #9a4a1c 28%, #c06d36 44%, #6e2d0b 64%, #a85a26 84%, #4d1e06 100%); --foil: linear-gradient(100deg, #7c3c14 0%, #d58247 22%, #ffd0a8 38%, #b5652f 55%, #e9a26b 72%, #86431a 100%); --foil-base: #c06d36; --foil-ink: #2f1405; }
.tone-emerald { --foil-deep: linear-gradient(100deg, #053522 0%, #0f6544 28%, #1f8a5e 44%, #08452d 64%, #16754f 84%, #042c1c 100%); --foil: linear-gradient(100deg, #0b4d35 0%, #2f9b6f 22%, #a6f0cc 38%, #1f7a55 55%, #5cc797 72%, #0d5a3e 100%); --foil-base: #22845c; --foil-ink: #04281b; }
.tone-graphite { --foil-deep: linear-gradient(100deg, #111214 0%, #3a3e45 30%, #6b7079 45%, #1f2226 65%, #4c5159 85%, #0d0e10 100%); --foil: linear-gradient(100deg, #1b1d21 0%, #4c5159 22%, #9aa0a8 38%, #2f333a 55%, #6b7079 72%, #1f2226 100%); --foil-base: #3d4148; --foil-ink: #ffffff; }

/* Foil lettering (only where the material asks for it). Light materials use the deep ramp. */
.mat-paper .company, .mat-marble .company, .mat-paper .section > h2, .mat-marble .section > h2 { --foil-letter: var(--foil-deep); }
.mat-paper .company, .mat-foil .company, .mat-marble .company, .mat-wood .company,
.mat-paper .section > h2, .mat-foil .section > h2, .mat-marble .section > h2 {
    background: var(--foil-letter, var(--foil));
    -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 1px 0 rgb(255 255 255 / .35));
}
.mat-foil .company, .mat-marble .company, .mat-paper .company { letter-spacing: .04em; }

/* ======================================================================
   FROSTED GLASS: glowing colour light behind frosted panels
   ====================================================================== */
body.mat-glass {
    background:
        radial-gradient(55% 35% at 12% 8%, color-mix(in srgb, var(--accent) 70%, transparent), transparent 70%),
        radial-gradient(45% 30% at 92% 28%, color-mix(in srgb, var(--accent) 45%, #ffffff 10%), transparent 70%),
        radial-gradient(60% 40% at 50% 100%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%),
        var(--grain), var(--bg);
    background-attachment: fixed;
    background-blend-mode: normal, normal, normal, overlay, normal;
}
/* Slowly drifting light behind the glass */
body.mat-glass::before {
    content: ''; position: fixed; inset: -20%; z-index: 0; pointer-events: none; filter: blur(40px); opacity: .55; will-change: transform; /* its own layer, so the moving light never softens the text */
    background:
        radial-gradient(22% 18% at 30% 30%, color-mix(in srgb, var(--accent) 80%, white 20%), transparent 70%),
        radial-gradient(20% 16% at 70% 65%, color-mix(in srgb, var(--accent) 60%, #ffffff 0%), transparent 70%);
}
@media (prefers-reduced-motion: no-preference) {
    body.mat-glass::before { animation: glass-drift 18s ease-in-out infinite alternate; }
    @keyframes glass-drift { from { transform: translate(-6%, -4%) scale(1); } to { transform: translate(6%, 5%) scale(1.15); } }
}
.mat-glass .page { position: relative; z-index: 1; }
.mat-glass .company { font-weight: 800; letter-spacing: 0; text-shadow: 0 1px 2px rgb(0 0 0 / .3); } /* a tight shadow: a wide soft one made the name look smudged */
.mat-glass .section, .mat-glass.btn-list .action, .mat-glass.btn-tiles .action {
    background: linear-gradient(140deg, rgb(255 255 255 / .2), rgb(255 255 255 / .06));
    color: var(--text);
    border: 1px solid rgb(255 255 255 / .28);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), 0 22px 44px -12px rgb(0 0 0 / .35);
    backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.mat-glass .action .ic, .mat-glass .contact-row .ic {
    background: linear-gradient(140deg, rgb(255 255 255 / .28), rgb(255 255 255 / .08));
    color: var(--text);
    border: 1px solid rgb(255 255 255 / .4);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), 0 0 22px color-mix(in srgb, var(--accent) 45%, transparent), 0 8px 18px rgb(0 0 0 / .2);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.mat-glass.btn-pills .action { background: linear-gradient(140deg, rgb(255 255 255 / .26), rgb(255 255 255 / .08)); color: var(--text); border: 1px solid rgb(255 255 255 / .35); backdrop-filter: blur(10px); }
.mat-glass .btn, .mat-glass .link-btn, .mat-glass .product .btn {
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, black));
    color: var(--accent-text);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), 0 10px 24px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.mat-glass .btn-outline { background: rgb(255 255 255 / .12); color: var(--text); border: 1px solid rgb(255 255 255 / .45); box-shadow: none; backdrop-filter: blur(10px); }
.mat-glass .contact-row, .mat-glass .row, .mat-glass .item { border-color: rgb(255 255 255 / .16); }
.mat-glass .quote, .mat-glass .product { background: rgb(255 255 255 / .1); }
/* Prices on see-through glass: the box's own text colour, bold (owner 2026-11-19: "price on green background also not
   standing out"; the accent colour disappeared on a background of the same colour). The old price stays readable too. */
.mat-glass .product .price { color: var(--text); font-weight: 800; }
.mat-glass .product del { color: var(--text); opacity: .75; }
.mat-glass .rich a, .mat-glass .item a.more { color: var(--text); }

/* ======================================================================
   LETTERPRESS PAPER: cotton paper, pressed ink, foil-stamped name
   ====================================================================== */
body.mat-paper {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.035' numOctaves='4' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.42 0 0 0 0 0.38 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23p)'/%3E%3C/svg%3E"),
        var(--grain), var(--bg);
    background-attachment: fixed;
}
.mat-paper .company { font-size: 30px; }
.mat-paper .person, .mat-paper .position { text-shadow: 0 1px 0 rgb(255 255 255 / .7); }
.mat-paper .position { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; }
.mat-paper .header > div::after { content: ''; display: block; width: 64px; height: 2px; margin: 16px auto 0; background: var(--foil); border-radius: 2px; }
.mat-paper.hdr-split .header > div::after { margin-left: 0; }
.mat-paper .section {
    background: var(--grain), color-mix(in srgb, var(--surface) 94%, transparent);
    color: var(--surface-text);
    border: 1px solid rgb(0 0 0 / .07);
    box-shadow: 0 1px 1px rgb(0 0 0 / .05), 0 18px 34px -16px rgb(0 0 0 / .25);
}
.mat-paper .section > h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .18em; }
/* Ink pressed into paper */
.mat-paper .action .ic, .mat-paper .contact-row .ic {
    background: var(--accent); color: var(--accent-text);
    box-shadow: inset 0 2px 3px rgb(0 0 0 / .25), inset 0 -1px 0 rgb(255 255 255 / .2), 0 1px 0 rgb(255 255 255 / .8);
}
.mat-paper .action .lbl { text-shadow: 0 1px 0 rgb(255 255 255 / .7); }
.mat-paper .btn, .mat-paper .link-btn, .mat-paper .product .btn {
    background: var(--accent); color: var(--accent-text);
    box-shadow: inset 0 -2px 0 rgb(0 0 0 / .18), 0 6px 14px -6px rgb(0 0 0 / .35);
}
.mat-paper .btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); box-shadow: none; }
.mat-paper .contact-row, .mat-paper .row, .mat-paper .item { border-bottom-style: dashed; }

/* ======================================================================
   VELVET & FOIL: deep matte velvet, foil lettering and foil buttons
   ====================================================================== */
body.mat-foil {
    background:
        radial-gradient(120% 70% at 50% -10%, rgb(255 255 255 / .1), transparent 60%),
        radial-gradient(140% 100% at 50% 120%, rgb(0 0 0 / .55), transparent 60%),
        var(--grain), var(--bg);
    background-attachment: fixed;
}
.mat-foil .company { font-size: 30px; text-transform: uppercase; letter-spacing: .08em; }
.mat-foil .person { color: var(--text); letter-spacing: .04em; }
.mat-foil .position { color: var(--foil-base); opacity: 1; text-transform: uppercase; letter-spacing: .2em; font-size: 12px; }
/* Double foil rule under the name */
.mat-foil .header > div::after {
    content: ''; display: block; width: 140px; height: 5px; margin: 18px auto 0;
    border-top: 1px solid var(--foil-base); border-bottom: 1px solid var(--foil-base); opacity: .8;
}
.mat-foil.hdr-split .header > div::after { margin-left: 0; }
.mat-foil .section {
    background: linear-gradient(180deg, rgb(255 255 255 / .05), rgb(255 255 255 / .015));
    color: var(--text);
    border: 1px solid color-mix(in srgb, var(--foil-base) 45%, transparent);
    box-shadow: inset 0 0 0 4px rgb(0 0 0 / .15), inset 0 0 0 5px color-mix(in srgb, var(--foil-base) 18%, transparent), 0 20px 40px -18px rgb(0 0 0 / .6);
}
.mat-foil .section > h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .2em; }
.mat-foil .action .ic, .mat-foil .contact-row .ic, .mat-foil.btn-pills .action, .mat-foil.btn-tiles .action, .mat-foil.btn-list .action {
    background: var(--foil); color: var(--foil-ink);
    border: 1px solid rgb(0 0 0 / .35);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), 0 6px 16px rgb(0 0 0 / .45);
}
.mat-foil.btn-pills .action .ic, .mat-foil.btn-tiles .action .ic { background: transparent; border: 0; box-shadow: none; }
.mat-foil.btn-list .action { background: rgb(255 255 255 / .04); color: var(--text); border: 1px solid color-mix(in srgb, var(--foil-base) 45%, transparent); box-shadow: 0 8px 20px -10px rgb(0 0 0 / .6); }
.mat-foil.btn-list .action .ic { background: var(--foil); color: var(--foil-ink); border: 0; box-shadow: inset 0 1px 0 rgb(255 255 255 / .5); }
.mat-foil .action .lbl { color: var(--text); }
.mat-foil .btn, .mat-foil .link-btn, .mat-foil .product .btn {
    background: var(--foil); color: var(--foil-ink);
    border: 1px solid rgb(0 0 0 / .35);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .5), 0 8px 20px -6px rgb(0 0 0 / .6);
    text-transform: uppercase; letter-spacing: .08em; font-size: 12px;
}
.mat-foil .btn-outline { background: transparent; color: var(--foil-base); border: 1px solid var(--foil-base); }
.mat-foil .contact-row, .mat-foil .row, .mat-foil .item { border-color: color-mix(in srgb, var(--foil-base) 22%, transparent); }
.mat-foil .rich a, .mat-foil .item a.more, .mat-foil .product .price { color: var(--foil-base); }
.mat-foil .quote, .mat-foil .product { background: rgb(255 255 255 / .04); border: 1px solid color-mix(in srgb, var(--foil-base) 25%, transparent); }

/* ======================================================================
   CARBON FIBRE: woven carbon with a gloss and coloured glow
   ====================================================================== */
body.mat-carbon {
    background:
        linear-gradient(115deg, transparent 30%, rgb(255 255 255 / .06) 45%, transparent 60%),
        linear-gradient(27deg, #151515 5px, transparent 5px) 0 5px,
        linear-gradient(207deg, #151515 5px, transparent 5px) 10px 0,
        linear-gradient(27deg, #222 5px, transparent 5px) 0 10px,
        linear-gradient(207deg, #222 5px, transparent 5px) 10px 5px,
        linear-gradient(90deg, #1b1b1b 10px, transparent 10px),
        linear-gradient(#1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #242424 75%, #242424);
    background-color: #131313;
    background-size: 100% 100%, 20px 20px, 20px 20px, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
    background-attachment: fixed;
    color: #f3f4f6;
}
.mat-carbon .company { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.mat-carbon .position { color: var(--accent); opacity: 1; text-transform: uppercase; letter-spacing: .18em; font-size: 12px; }
.mat-carbon .section {
    background: linear-gradient(180deg, rgb(40 40 40 / .92), rgb(18 18 18 / .95));
    color: #e5e7eb;
    border: 1px solid rgb(255 255 255 / .08);
    border-top: 2px solid var(--accent);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .06), 0 22px 40px -16px rgb(0 0 0 / .8);
}
.mat-carbon .section > h2 { text-transform: uppercase; letter-spacing: .14em; font-size: 15px; }
.mat-carbon .action .ic, .mat-carbon .contact-row .ic {
    background: linear-gradient(160deg, #3a3a3a, #121212);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .15), 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
.mat-carbon.btn-list .action, .mat-carbon.btn-tiles .action { background: linear-gradient(180deg, #2a2a2a, #161616); color: #e5e7eb; border: 1px solid rgb(255 255 255 / .08); }
.mat-carbon .btn, .mat-carbon .link-btn, .mat-carbon .product .btn {
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, black)); color: var(--accent-text);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 10px 26px -8px color-mix(in srgb, var(--accent) 80%, transparent);
    text-transform: uppercase; letter-spacing: .06em; font-size: 12px;
}
.mat-carbon .btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.mat-carbon .contact-row, .mat-carbon .row, .mat-carbon .item { border-color: rgb(255 255 255 / .08); }
.mat-carbon .rich a, .mat-carbon .item a.more, .mat-carbon .product .price { color: var(--accent); }
.mat-carbon .quote, .mat-carbon .product { background: rgb(255 255 255 / .04); }

/* ======================================================================
   WALNUT WOOD: wood grain, brass fittings, cream panels
   ====================================================================== */
body.mat-wood {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.006 0.12' numOctaves='4' seed='11'/%3E%3CfeColorMatrix values='0 0 0 0 0.16 0 0 0 0 0.08 0 0 0 0 0.03 0 0 0 0.75 0'/%3E%3C/filter%3E%3Crect width='800' height='800' filter='url(%23w)'/%3E%3C/svg%3E"),
        linear-gradient(170deg, #6b4423 0%, #4a2c14 45%, #3a210d 100%);
    background-attachment: fixed;
    color: #fbf3e4;
}
.mat-wood .company { font-size: 30px; filter: drop-shadow(0 2px 2px rgb(0 0 0 / .5)); }
.mat-wood .person { color: #fbf3e4; text-shadow: 0 1px 2px rgb(0 0 0 / .5); }
.mat-wood .position { color: var(--foil-base); opacity: 1; text-transform: uppercase; letter-spacing: .18em; font-size: 12px; }
.mat-wood .section {
    background: var(--grain), linear-gradient(180deg, #fbf3e2, #efe0c2);
    color: #3a250f;
    border: 1px solid rgb(0 0 0 / .25);
    box-shadow: inset 0 0 0 3px rgb(255 255 255 / .35), 0 18px 36px -14px rgb(0 0 0 / .7);
}
.mat-wood .section > h2 { color: #4a2c14; text-transform: uppercase; letter-spacing: .16em; font-size: 15px; }
.mat-wood .action .ic, .mat-wood .contact-row .ic {
    background: var(--foil); color: var(--foil-ink);
    border: 1px solid rgb(0 0 0 / .35);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), 0 6px 14px rgb(0 0 0 / .5);
}
.mat-wood .action .lbl { color: #fbf3e4; text-shadow: 0 1px 2px rgb(0 0 0 / .6); }
.mat-wood .btn, .mat-wood .link-btn, .mat-wood .product .btn { background: var(--foil); color: var(--foil-ink); border: 1px solid rgb(0 0 0 / .35); box-shadow: inset 0 1px 0 rgb(255 255 255 / .5), 0 8px 18px -6px rgb(0 0 0 / .6); }
.mat-wood .btn-outline { background: rgb(255 255 255 / .1); color: #fbf3e4; border: 1px solid var(--foil-base); }
.mat-wood .rich a, .mat-wood .item a.more, .mat-wood .product .price { color: #7a4a1c; }

/* ======================================================================
   POLISHED MARBLE: marble with gold foil and polished white panels
   ====================================================================== */
body.mat-marble { color: #2a2a2a; }
.mat-marble .company { font-size: 30px; text-transform: uppercase; letter-spacing: .06em; }
.mat-marble .person { color: #2a2a2a; text-shadow: 0 1px 0 rgb(255 255 255 / .8); }
.mat-marble .position { color: #6b5420; opacity: 1; text-transform: uppercase; letter-spacing: .18em; font-size: 12px; }
.mat-marble .header > div::after { content: ''; display: block; width: 80px; height: 2px; margin: 16px auto 0; background: var(--foil); }
.mat-marble .section {
    background: linear-gradient(160deg, rgb(255 255 255 / .9), rgb(246 244 240 / .82));
    color: #2a2a2a;
    border: 1px solid rgb(255 255 255 / .9);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--foil-base) 35%, transparent), 0 24px 44px -18px rgb(0 0 0 / .35);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.mat-marble .section > h2 { text-transform: uppercase; letter-spacing: .2em; font-size: 14px; }
.mat-marble .action .ic, .mat-marble .contact-row .ic { background: var(--foil); color: var(--foil-ink); border: 1px solid rgb(0 0 0 / .2); box-shadow: inset 0 1px 0 rgb(255 255 255 / .6), 0 6px 14px rgb(0 0 0 / .2); }
.mat-marble .action .lbl { color: #2a2a2a; text-shadow: 0 1px 0 rgb(255 255 255 / .8); }
.mat-marble .btn, .mat-marble .link-btn, .mat-marble .product .btn { background: #1f1f1f; color: #f6e7b5; box-shadow: inset 0 1px 0 rgb(255 255 255 / .15), 0 8px 18px -6px rgb(0 0 0 / .45); letter-spacing: .06em; }
.mat-marble .btn-outline { background: rgb(255 255 255 / .6); color: #1f1f1f; border: 1px solid #1f1f1f; }
.mat-marble .rich a, .mat-marble .item a.more, .mat-marble .product .price { color: #6b5420; }

/* Glass over a photo background: tint the photo with the template colour so the glass glows */
body.mat-glass { background-blend-mode: normal, normal, normal, overlay, normal; }
.mat-glass .page::before {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(170deg, color-mix(in srgb, var(--accent) 22%, transparent), rgb(0 0 0 / .25));
}

/* A background the owner picked (picture, moving, colour) shows through the
   materials that otherwise paint their own surface. */
body.mat-metal.own-bg, body.mat-carbon.own-bg, body.mat-wood.own-bg {
    background: var(--bg);
    background-size: auto;
    background-blend-mode: normal;
    background-attachment: fixed;
}

/* Marble is gold throughout: buttons, rules and highlights. */
.mat-marble .btn, .mat-marble .link-btn, .mat-marble .product .btn { background: var(--foil); color: var(--foil-ink); border: 1px solid rgb(0 0 0 / .18); text-shadow: none; }
.mat-marble .btn-outline { background: rgb(255 255 255 / .7); color: #5a4310; border: 1px solid var(--foil-base); }
.mat-marble .bar .btn.share { background: #fff; color: #5a4310; }
.mat-marble .company, .mat-marble .section > h2 { filter: drop-shadow(0 1px 0 rgb(255 255 255 / .5)); }
.mat-marble .social { background: var(--foil); color: var(--foil-ink) !important; }
