/* ============================================================
   旭光工作室 — 範本共用基礎樣式
   每個模板透過 :root 覆寫主題變數即可換色換調性
   必填主題變數：--accent --accent-2 --ink --ink-2 --ink-3
                --bg --bg-soft --line --font-display --font-body --radius
   ============================================================ */

*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

body {
  font-family: var(--font-body, "Noto Sans TC", system-ui, sans-serif);
  color: var(--ink, #18181b);
  background: var(--bg, #fff);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.wrap { width: min(1180px, 100% - clamp(36px, 8vw, 120px)); margin-inline: auto; }
.wrap-narrow { width: min(880px, 100% - clamp(36px, 8vw, 120px)); margin-inline: auto; }

h1,h2,h3,h4 { font-family: var(--font-display); line-height: 1.12; font-weight: 700; letter-spacing: -.01em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: var(--accent); display: inline-block; }
.eyebrow.no-rule::before { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 26px; border-radius: var(--radius, 10px);
  font-weight: 600; font-size: 15px; letter-spacing: .01em;
  transition: transform .25s cubic-bezier(.22,.61,.36,1), box-shadow .25s, background .25s, color .25s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: var(--btn-ink, #fff); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px var(--accent); }
.btn-ghost { border: 1.5px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 17px 34px; font-size: 16px; }

/* ---------- Placeholder image frame ---------- */
.ph {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, var(--ph-line, rgba(0,0,0,.045)) 0 1px, transparent 1px 11px),
    var(--ph-bg, color-mix(in srgb, var(--accent) 7%, var(--bg-soft, #f4f4f5)));
  border: 1px dashed var(--ph-border, color-mix(in srgb, var(--accent) 28%, var(--line)));
  border-radius: var(--radius, 10px);
  display: flex; align-items: center; justify-content: center;
}
.ph::after {
  content: attr(data-label);
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; letter-spacing: .06em;
  color: color-mix(in srgb, var(--accent) 65%, var(--ink-3, #71717a));
  text-align: center; padding: 12px; line-height: 1.5;
}
.ph::before {
  content: "";
  position: absolute; left: 50%; top: calc(50% - 22px); transform: translate(-50%,-50%);
  width: 30px; height: 30px; opacity: .7;
  background: color-mix(in srgb, var(--accent) 60%, var(--ink-3, #71717a));
  -webkit-mask: var(--ph-icon, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='m3 17 5-4 4 3 3-3 6 5'/%3E%3C/svg%3E")) center/contain no-repeat;
          mask: var(--ph-icon, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='m3 17 5-4 4 3 3-3 6 5'/%3E%3C/svg%3E")) center/contain no-repeat;
}
.ph[data-label]::after { padding-top: 18px; }

/* ---------- Real media inside a .ph frame (img / iframe) ---------- */
.ph:has(> img), .ph:has(> iframe) { background: none; border: none; }
.ph:has(> img)::before, .ph:has(> img)::after,
.ph:has(> iframe)::before, .ph:has(> iframe)::after { content: none; }
.ph > img, .ph > iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border: 0; display: block;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.22,.61,.36,1), transform .8s cubic-bezier(.22,.61,.36,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce){ .reveal { opacity:1; transform:none; } }

/* ---------- Back-to-gallery floating badge ---------- */
.tpl-badge {
  position: fixed; top: 16px; right: 16px; z-index: 999;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 15px 9px 12px; border-radius: 999px;
  background: rgba(20,21,27,.82); color: #fff; backdrop-filter: blur(10px);
  font-family: "Noto Sans TC", sans-serif; font-size: 13px; font-weight: 600; letter-spacing: .01em;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4);
  transition: transform .25s, background .25s;
}
.tpl-badge:hover { transform: translateY(-1px); background: #14151b; }
.tpl-badge svg { width: 15px; height: 15px; }
.tpl-badge .sun { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(120deg,#FF9A3D,#FF6A2C 55%,#FF3D77); }
@media (max-width: 640px){ .tpl-badge span.lbl { display: none; } }

/* ---------- Section rhythm ---------- */
section { position: relative; }
.sec-pad { padding-block: clamp(64px, 9vw, 120px); }
.muted { color: var(--ink-3, #71717a); }
