/* ============================================================
   Brand design page (brand.php only). Loaded after styles.css.
   The sample logo is one SVG <symbol> reused everywhere; each use is
   styled through inherited custom properties (they cross into <use>).
   ============================================================ */

/* Animatable custom properties (0 = drawn / visible, 1 = hidden) */
@property --draw-ring  { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --draw-sprig { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --mk-fill    { syntax: '<number>'; inherits: true; initial-value: 1; }

:root {
  --fern-ink: #2f4a3a;
  --fern-sage: #8fa98f;
  --fern-blush: #f2c4c9;
  --fern-cream: #f7f1e8;
}

/* ---------- The sample mark ---------- */
.m-ring, .m-stem, .m-leaf, .m-bud {
  stroke: var(--mk-stroke, var(--fern-ink)); stroke-width: var(--mk-sw, 3.5);
  stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1;
}
.m-ring { stroke-dashoffset: var(--draw-ring); fill: var(--mk-ring-fill, var(--fern-blush)); fill-opacity: var(--mk-fill); }
.m-stem, .m-leaf, .m-bud { stroke-dashoffset: var(--draw-sprig); }
.m-stem { fill: none; }
.m-leaf, .m-bud { fill: var(--mk-leaf-fill, var(--fern-sage)); fill-opacity: var(--mk-fill); }

.mark-wrap { position: relative; }
.mark-wrap svg { display: block; width: 100%; height: auto; }
.art-anchor { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: #fff; border: 1.5px solid #1a73e8; opacity: 0; transform: scale(.4); }
.art-anchor.a1 { left: 50%; top: 10%; } .art-anchor.a2 { left: 90%; top: 50%; }
.art-anchor.a3 { left: 50%; top: 90%; } .art-anchor.a4 { left: 10%; top: 50%; }

/* ---------- Hero ---------- */
.brand-hero { background: radial-gradient(75% 95% at 78% 60%, #9a2d5a 0%, #6a1f40 38%, #3a1828 70%, #261620 100%); padding: 110px 32px 0; overflow: hidden; }
.brand-hero-inner { max-width: 1240px; margin: 0 auto; }
.brand-hero .label-overline-red { color: var(--accent-soft); margin-bottom: 18px; }
.brand-hero-copy { padding-bottom: 90px; }
.brand-hero h1 { color: #fff; font-size: clamp(40px, 4.4vw, 64px); line-height: 1.04; margin-bottom: 22px; }
.brand-accent { color: var(--accent-soft); }
.brand-hero-sub { color: rgba(255,255,255,.88); font-size: 18px; line-height: 1.75; max-width: 520px; margin-bottom: 34px; }

/* Design app window */
.artboard-app { position: relative; background: #2b2a2f; border-radius: 16px; overflow: hidden; box-shadow: 0 40px 100px rgba(0,0,0,.55); }
.app-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 16px; background: #1f1e22; color: rgba(255,255,255,.75); font-size: 14px; }
.app-bar span { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,.2); }
.app-bar em { font-style: normal; margin-left: 10px; }
.app-bar small { font-size: 14px; color: rgba(255,255,255,.55); }
.app-body { display: grid; grid-template-columns: 52px 1fr 170px; min-height: 440px; }
.app-tools { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 18px 0; background: #252428; color: rgba(255,255,255,.6); font-size: 16px; }
.app-tools .is-active { color: var(--accent-soft); }
.app-canvas { display: flex; align-items: center; justify-content: center; padding: 26px; background: #3a393f; }
.artboard { position: relative; width: 100%; max-width: 440px; aspect-ratio: 4 / 3.4; background: var(--fern-cream); box-shadow: 0 8px 24px rgba(0,0,0,.3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px; }
.artboard-label { position: absolute; top: -24px; left: 0; font-size: 13px; color: rgba(255,255,255,.7); }
.artboard .mark-wrap { width: 46%; }
.art-word { text-align: center; }
.art-name { display: block; font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: clamp(22px, 2.6vw, 32px); color: var(--fern-ink); letter-spacing: .02em; line-height: 1; }
.art-tag { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: var(--fern-ink); }
.app-panel { padding: 16px 14px; background: #252428; color: rgba(255,255,255,.85); font-size: 13px; }
.panel-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.6); margin: 4px 0 10px; }
.panel-title ~ .panel-title { margin-top: 18px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sw { display: block; aspect-ratio: 1; border-radius: 50%; }
.sw1 { background: var(--fern-ink); } .sw2 { background: var(--fern-sage); } .sw3 { background: var(--fern-blush); } .sw4 { background: var(--fern-cream); }
.type-spec { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.type-spec b { font-family: 'Playfair Display', Georgia, serif; font-size: 22px; font-weight: 700; color: #fff; }
.type-spec--sans b { font-family: 'Inter', sans-serif; }
.type-spec span { font-size: 13px; color: rgba(255,255,255,.75); }
.layers { list-style: none; margin: 0; padding: 0; }
.layers li { padding: 5px 8px; border-radius: 6px; font-size: 13px; color: rgba(255,255,255,.8); }
.layers li:first-child { background: rgba(224,117,143,.2); color: #fff; }
.app-replay {
  margin-left: 18px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 999px; background: rgba(255,255,255,.08); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.app-replay:hover { background: var(--accent); }
.sample-note--dark { margin: 12px 0 0; text-align: right; font-size: 14px; color: var(--gray-600); }

/* Hero drawing sequence (restarted by brand.js "Replay") */
.artboard-app .art-mark { --draw-ring: 1; --draw-sprig: 1; --mk-fill: 0; }
.artboard-app .art-word, .artboard-app .sw, .artboard-app .type-spec, .artboard-app .layers li { opacity: 0; }
.artboard-app.is-drawing .art-mark { animation: drawRing 1.3s ease forwards .4s, drawSprig 1.3s ease forwards 1.5s, fillIn .7s ease forwards 2.9s; }
.artboard-app.is-drawing .art-anchor { animation: anchorIn .3s ease forwards 1.6s, anchorOut .3s ease forwards 3.4s; }
.artboard-app.is-drawing .art-word { animation: wordIn .8s ease forwards 3.3s; }
.artboard-app.is-drawing .sw { animation: popIn .35s cubic-bezier(.34,1.56,.64,1) forwards; }
.artboard-app.is-drawing .sw1 { animation-delay: 3s; } .artboard-app.is-drawing .sw2 { animation-delay: 3.1s; }
.artboard-app.is-drawing .sw3 { animation-delay: 3.2s; } .artboard-app.is-drawing .sw4 { animation-delay: 3.3s; }
.artboard-app.is-drawing .type-spec { animation: popIn .35s ease forwards 3.6s; }
.artboard-app.is-drawing .type-spec--sans { animation-delay: 3.75s; }
.artboard-app.is-drawing .layers li { animation: popIn .3s ease forwards; }
.artboard-app.is-drawing .layers li:nth-child(3) { animation-delay: 1.4s; }
.artboard-app.is-drawing .layers li:nth-child(2) { animation-delay: 2.6s; }
.artboard-app.is-drawing .layers li:nth-child(1) { animation-delay: 3.4s; }
@keyframes drawRing  { to { --draw-ring: 0; } }
@keyframes drawSprig { to { --draw-sprig: 0; } }
@keyframes fillIn    { to { --mk-fill: 1; } }
@keyframes anchorIn  { to { opacity: 1; transform: none; } }
@keyframes anchorOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: none; } }
@keyframes wordIn    { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes popIn     { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

/* ---------- Sketch to system ---------- */
.evolve { margin-top: 8px; }
.evo { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 20px; padding: 18%; margin-bottom: 18px; }
.evo > svg, .evo .mark-wrap { width: 100%; }
.evo--sketch { background: #fbfaf6; }
.evo--sketch svg { --mk-stroke: #555; --mk-sw: 2.4; --mk-fill: 0; filter: url(#sketchy); }
.evo--vector { background: #f3f5f9; }
.evo--vector svg { --mk-stroke: #1a73e8; --mk-sw: 1.6; --mk-fill: 0; }
.evo--vector .art-anchor { opacity: 1; transform: none; }
.evo--colour { background: var(--fern-cream); }
.evo--system { background: var(--fern-ink); flex-direction: column; gap: 14px; padding: 14% 18%; }
.evo--system svg { --mk-ring-fill: var(--fern-cream); --mk-stroke: var(--fern-cream); }
.evo-sys { display: flex; align-items: center; gap: 8px; }
.evo-sys .sw { width: 22px; }
.evo-sys .sw1 { background: var(--fern-blush); }
.evo-sys b { margin-left: 6px; font-family: 'Playfair Display', Georgia, serif; font-size: 26px; color: var(--fern-cream); }
.evo-num { display: block; font-size: 14px; font-weight: 800; letter-spacing: .1em; color: var(--accent); margin-bottom: 4px; }
.evolve h3 { font-size: 22px; margin-bottom: 8px; }
.evolve p { font-size: 16px; line-height: 1.7; color: var(--gray-600); margin: 0; }
/* each frame draws itself when scrolled into view */
.evolve .reveal svg { --draw-ring: 1; --draw-sprig: 1; }
.evolve .reveal.visible svg { animation: drawRing 1.2s ease forwards .2s, drawSprig 1.2s ease forwards 1s; }

/* ---------- Business cards ---------- */
.cards-section { background: var(--fern-cream); }
.cards-section h2 { color: var(--near-black); }
.cards-lead { font-size: 18px; line-height: 1.8; color: var(--gray-700); margin: 16px 0 22px; }
.brand-checks { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }
.brand-checks li { display: flex; gap: 12px; font-size: 17px; color: var(--gray-700); }
.brand-checks i { color: var(--accent); padding-top: 5px; font-size: 15px; }

.biz-cards { position: relative; height: 420px; }
.biz-card { position: absolute; width: 72%; aspect-ratio: 3.5 / 2; border-radius: 14px; box-shadow: 0 30px 60px rgba(47,74,58,.25); }
.biz-card--back { top: 0; right: 0; background: var(--fern-ink); display: flex; align-items: center; justify-content: center; transform: rotate(6deg); }
.biz-card--back svg { width: 34%; --mk-ring-fill: var(--fern-cream); --mk-stroke: var(--fern-cream); }
.biz-card--front { left: 0; bottom: 0; background: #fffdf9; padding: 7% 8%; transform: rotate(-4deg); }
.biz-name { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; color: var(--fern-ink); line-height: 1.1; }
.biz-role { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--fern-sage); margin-top: 6px; }
.biz-lines { margin-top: 10%; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--fern-ink); }
.biz-sign { position: absolute; right: 7%; bottom: 10%; width: 46%; }
.biz-sign path { fill: none; stroke: #962547; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.reveal.visible .biz-sign path { animation: sign 2.2s ease-in-out forwards .6s; }
@keyframes sign { to { stroke-dashoffset: 0; } }
.biz-mark { position: absolute; top: 9%; right: 7%; width: 15%; }
.biz-mark svg { display: block; width: 100%; }

/* ---------- Real logo tiles ---------- */
.logo-tile { display: block; border-radius: 16px; overflow: hidden; background: #fff; color: var(--near-black); box-shadow: 0 10px 30px rgba(17,17,17,.08); transition: transform .25s ease, box-shadow .25s ease; }
.logo-tile:hover { transform: translateY(-4px); box-shadow: 0 22px 50px rgba(110,26,55,.18); color: var(--accent); }
.logo-tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.logo-tile span { display: block; padding: 12px 14px; font-size: 15px; font-weight: 600; }

@media (min-width: 992px) {
  .brand-hero .row { align-items: flex-end !important; }
  .brand-hero-app { align-self: flex-end; }
  .brand-hero-app .artboard-app {
    /* slight tilt; only a sliver bleeds past the right edge */
    margin-right: calc(-1 * max(32px, (100vw - 1240px) / 2 + 32px) + 60px);
    margin-bottom: -70px; border-radius: 16px 16px 0 0;
    transform: rotate(3deg); transform-origin: left bottom;
  }
  .brand-hero-app .app-body { min-height: 560px; }
  .brand-hero-app .app-canvas { padding: 40px 40px 110px; }
}
@media (max-width: 991px) {
  .brand-hero { padding: 100px 20px 64px; }
  .brand-hero-copy { padding-bottom: 0; }
  .app-body { grid-template-columns: 44px 1fr; }
  .app-panel { display: none; }
  .biz-cards { height: 340px; margin-top: 10px; }
}
@media (max-width: 575px) {
  .app-tools { gap: 14px; }
  .biz-card { width: 86%; }
  .biz-cards { height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .artboard-app .art-mark, .evolve .reveal svg { --draw-ring: 0; --draw-sprig: 0; --mk-fill: 1; animation: none !important; }
  .evo--sketch svg, .evo--vector svg { --mk-fill: 0; }
  .artboard-app .art-word, .artboard-app .sw, .artboard-app .type-spec, .artboard-app .layers li { opacity: 1; animation: none !important; }
  .biz-sign path { stroke-dashoffset: 0; animation: none !important; }
}
