/* pacod-gw: a house creative of the PACOD website (www.pacod.io), on pacod-cms's magazine set.
   One of six folders built on one base; only :root and the motif's motion at the end differ.
   Each folder is imported on its own, so each has its own copy: change all six together.
   index.html: the leaderboard, 320 to 1,300 wide, 90 high. square.html: the sidebar, 300 (+-40)
   by 250. tall.html: beside a post, 300 by 600. The faces are the website's own; the picture is
   the motif this project's post pictures are drawn with (stripes), in the same colours. All
   motion ends within 30 s, and none runs under prefers-reduced-motion. */

:root {
    --base: #0a5443;          /* the section's colours: the picture's gradient */
    --mid: #11866a;
    --accent: #bf9540;        /* the picture's bright shapes and the call to action */
    --deep: #06342a;          /* the ground */
    --deep-rgb: 6 52 42;
    --glow: #0b5645;          /* the light in a corner */
    --tile: #108166;          /* the monogram's square, dark enough for white */
    --soft: #dcc598;          /* the accent lightened for text on the ground */
    --on-accent: #040e0c;
    --hover: #dcc596;         /* the call to action under the pointer */
    --gold: #bf9540;         /* the PACOD bowl: the same in every creative */
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--deep); overflow: hidden; }
body { font-family: 'Inter', system-ui, sans-serif; color: #fff; -webkit-font-smoothing: antialiased; }

.piece {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    background: radial-gradient(60% 150% at 100% 0%, var(--glow), transparent 75%) var(--deep);
}
.piece:focus-visible { outline: 2px solid var(--soft); outline-offset: -2px; }

/* The label: the website prints none above a creative. */
.notice {
    position: absolute;
    top: 7px;
    right: 9px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 4px;
    font: 700 8.5px/1 'Inter', system-ui, sans-serif;
    letter-spacing: .2em;
    color: rgba(255, 255, 255, .86);
    text-shadow: 0 0 3px var(--deep), 0 0 8px var(--deep);
}
.notice svg { width: 7.5px; height: 9px; filter: drop-shadow(0 0 2px var(--deep)); }
.notice rect { fill: currentColor; }
.notice circle { fill: var(--gold); }

/* The picture. */
.art { position: relative; display: block; overflow: hidden; background: linear-gradient(135deg, var(--base), var(--mid)); }
.motif { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.motif .hi { fill: var(--accent); }
.motif g, .motif path, .motif circle, .motif rect { transform-box: view-box; transform-origin: 0 0; }

/* The project's mark: PACOD's rounded square with the monogram, and the gold dot. */
.tile { display: block; flex: none; overflow: visible; }
.tile rect { fill: var(--tile); stroke: rgba(255, 255, 255, .22); stroke-width: 1; }
.tile text { fill: #fff; font: 800 16px 'Fraunces', Georgia, serif; }
.tile circle { fill: var(--gold); stroke: var(--deep); stroke-width: 4; paint-order: stroke; }

.words { display: flex; flex-direction: column; min-width: 0; }
.kicker {
    display: block;
    font: 600 11.5px/1.2 'Inter', system-ui, sans-serif;
    letter-spacing: .02em;
    color: var(--soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: rise .8s ease-out both .1s;
}
.kicker small { margin-left: 8px; font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.headline { display: block; font: 500 24px/1.08 'Fraunces', Georgia, serif; letter-spacing: -.01em; color: #fff; animation: rise .8s ease-out both .25s; }
.headline em { font-style: italic; color: var(--soft); }
.sub { display: block; font-size: 12.5px; line-height: 1.4; color: rgba(255, 255, 255, .8); animation: rise .8s ease-out both .4s; }

.go {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font: 700 12px/1 'Inter', system-ui, sans-serif;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    animation: rise .8s ease-out both .55s;
}
.go .brief { display: none; }
.go::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: shine 5s ease-in-out 2s 3;
}
.piece:hover .go, .piece:focus-visible .go { background: var(--hover); }

/* ---------- the leaderboard: index.html ---------- */

.wide { align-items: center; gap: 18px; padding-right: 22px; }
.wide .art { flex: none; width: 28%; max-width: 340px; height: 100%; }
.wide .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 40%, var(--deep) 100%); }
.wide .tile { width: 44px; height: 44px; margin-left: -40px; position: relative; z-index: 1; }
.wide .words { flex: 1; }
.wide .headline, .wide .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wide .headline { margin-top: 5px; }
.wide .sub { margin-top: 5px; }
.wide .go { flex: none; }

@media (max-width: 899px) {
    .wide { gap: 14px; padding-right: 16px; }
    .wide .art { width: 22%; }
    .wide .tile { width: 40px; height: 40px; margin-left: -34px; }
    .wide .sub { display: none; }
    .wide .headline { margin-top: 6px; font-size: 21px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (max-width: 759px) {
    .wide .kicker small { display: none; }
    .wide .headline { font-size: 20px; }
}
@media (max-width: 639px) {
    .wide { gap: 12px; padding-right: 12px; }
    .wide .art { width: 15%; }
    .wide .tile { width: 36px; height: 36px; margin-left: -30px; }
    .wide .kicker { display: none; }
    .wide .headline { margin-top: 0; font-size: 17px; line-height: 1.12; }
    .wide .go { padding: 9px 12px; font-size: 11px; }
    .wide .go .long { display: none; }
    .wide .go .brief { display: inline; }
}
@media (max-width: 459px) {
    .wide { gap: 10px; padding-right: 10px; }
    .wide .art { width: 40px; }
    .wide .tile { width: 32px; height: 32px; margin-left: -26px; }
    .wide .headline { font-size: 15px; -webkit-line-clamp: 3; }
    .wide .go { padding: 8px 10px; font-size: 10.5px; }
}
@media (max-width: 379px) { .wide .headline { font-size: 14px; } }

/* ---------- the sidebar: square.html ---------- */

.square { display: block; background: radial-gradient(80% 70% at 100% 100%, var(--glow), transparent 80%) var(--deep); }
.square .art { position: absolute; top: 0; left: 0; right: 0; height: 46%; }
.square .art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(var(--deep-rgb) / .78) 0%, rgb(var(--deep-rgb) / .4) 50%, var(--deep) 100%);
}
.square .tile { position: absolute; top: 16px; left: 16px; width: 40px; height: 40px; }
/* The name sits on the picture: a halo of the ground keeps it legible over the bright shapes. */
.square .kicker { position: absolute; top: 20px; left: 68px; right: 16px; text-shadow: 0 0 3px var(--deep), 0 0 8px var(--deep), 0 0 14px var(--deep); }
.square .kicker small { display: block; margin: 6px 0 0; color: rgba(255, 255, 255, .86); }
.square .words { position: absolute; left: 16px; right: 16px; bottom: 16px; }
.square .sub { margin-top: 7px; font-size: 11.5px; line-height: 1.45; }
.square .go { align-self: flex-start; margin-top: 13px; padding: 9px 14px; font-size: 11.5px; }
@media (max-width: 289px) { .square .headline { font-size: 22px; } .square .sub { font-size: 11px; } }

/* ---------- the sidebar beside a post: tall.html ---------- */

.tall { flex-direction: column; background: radial-gradient(90% 45% at 100% 100%, var(--glow), transparent 80%) var(--deep); }
.tall .art { flex: 0 0 50%; }
.tall .art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(var(--deep-rgb) / .5) 0%, rgb(var(--deep-rgb) / 0) 30%, rgb(var(--deep-rgb) / 0) 62%, var(--deep) 100%);
}
.tall .tile { position: absolute; top: 20px; left: 20px; width: 52px; height: 52px; }
.tall .words { flex: 1; padding: 6px 22px 24px; }
.tall .kicker { font-size: 13px; }
.tall .kicker small { display: block; margin: 8px 0 0; font-size: 9.5px; }
.tall .headline { margin-top: 16px; font-size: 31px; line-height: 1.05; letter-spacing: -.015em; }
.tall .sub { margin-top: 14px; font-size: 13.5px; line-height: 1.5; }
.tall .go { align-self: flex-start; margin-top: auto; padding: 11px 18px; font-size: 12.5px; }
@media (max-width: 289px) { .tall .headline { font-size: 28px; } }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* ---------- the motif's motion ---------- */

.flow { animation: flow 24s linear 1; }
@keyframes flow { to { transform: translateX(266.67px); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; }
}
