/* ==========================================================================
   yoyobuilds.com — shared styles (spec v4)
   ========================================================================== */

:root {
  --bg: #FFF8F0;
  --card: #FFFFFF;
  --alt: #F7F7F5;
  --text: #111111;
  --text-2: #555555;
  --border: #E5E5E5;
  --accent: #ffff00;
  --hero-bg: #121212;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(17, 17, 17, 0.05);
  --shadow-lift: 0 10px 28px rgba(17, 17, 17, 0.10);
  --maxw: 1120px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.35; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 80px 0; }
.section--alt { background: var(--alt); }
.section--white { background: var(--card); }

.section-title {
  font-size: clamp(26px, 4vw, 36px);
  margin-bottom: 16px;
  text-align: center;
}
.section-sub {
  color: var(--text-2);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  font-family: inherit;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn-primary { background: var(--accent); color: #111; }
.btn-primary:hover { background: #e8e800; }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-outline-dark { background: transparent; color: var(--text); border-color: var(--text); }
.btn-outline-dark:hover { border-color: var(--accent); background: var(--accent); }

.text-link {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.text-link:hover { color: #000; text-decoration-thickness: 3px; }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 248, 240, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-brand {
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.nav-brand .dot { color: var(--accent); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.18s ease;
}
.nav-links a:hover { border-bottom-color: var(--accent); }
.nav-cta { white-space: nowrap; padding: 10px 20px; font-size: 15px; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin-right: -10px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: none;
    padding: 12px 24px 24px;
    box-shadow: var(--shadow-lift);
  }
  .nav-menu.open { display: block; }
  .nav-links { flex-direction: column; align-items: flex-start; gap: 4px; }
  .nav-links a { display: block; padding: 12px 0; font-size: 17px; width: 100%; }
  .nav-menu .nav-cta { margin-top: 16px; display: inline-block; }
  .nav-inner .nav-cta-desktop { display: none; }
}
@media (min-width: 901px) {
  .nav-menu { display: flex; align-items: center; gap: 28px; }
  .nav-menu .nav-cta { display: none; }
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  background: var(--hero-bg);
  color: #fff;
  padding: 88px 0;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 0, 0.45);
  border-radius: 999px;
  padding: 6px 16px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  margin-bottom: 22px;
  letter-spacing: 0.01em;
}
.hero-body {
  color: rgba(255, 255, 255, 0.82);
  max-width: 520px;
  margin-bottom: 32px;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 18px; }
.hero-textlink {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}
.hero-textlink:hover { color: var(--accent); }

/* Hero photo — layered A/B with glitch dissolve (Photo B optional) */
.hero-photo {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 460px;
  margin-left: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  cursor: default;
}
.hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-photo .photo-b { opacity: 0; }
.hero-photo.has-b { cursor: pointer; }
.hero-photo.has-b .photo-a,
.hero-photo.has-b .photo-b { transition: opacity 0.12s steps(4, end); }
.hero-photo.show-b .photo-a { opacity: 0; }
.hero-photo.show-b .photo-b { opacity: 1; }
.hero-photo.glitching { animation: glitch-shift 0.5s steps(6, end) 1; }
@keyframes glitch-shift {
  0%   { clip-path: inset(0 0 0 0); transform: translateX(0); filter: none; }
  15%  { clip-path: inset(8% 0 62% 0); transform: translateX(-6px); filter: hue-rotate(20deg) saturate(1.6); }
  30%  { clip-path: inset(48% 0 22% 0); transform: translateX(5px); filter: hue-rotate(-25deg); }
  45%  { clip-path: inset(70% 0 4% 0); transform: translateX(-4px); filter: saturate(2); }
  60%  { clip-path: inset(20% 0 46% 0); transform: translateX(6px); filter: hue-rotate(30deg); }
  75%  { clip-path: inset(55% 0 10% 0); transform: translateX(-3px); }
  100% { clip-path: inset(0 0 0 0); transform: translateX(0); filter: none; }
}

@media (max-width: 900px) {
  .hero { padding: 56px 0 64px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo { margin: 0 auto; max-width: 420px; width: 100%; }
}

/* ── Trust wall ──────────────────────────────────────────────────────── */
.logo-marquee {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.logo-marquee::-webkit-scrollbar { display: none; }
.logo-track {
  display: flex;
  align-items: center;
  gap: 64px;
  width: max-content;
  padding: 12px 0;
  animation: marquee 36s linear infinite;
}
.logo-marquee:hover .logo-track,
.logo-marquee:focus-within .logo-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.logo-track img {
  height: 44px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  flex: none;
}
.logo-track a { flex: none; display: flex; }
.trust-note {
  text-align: center;
  color: var(--text-2);
  font-size: 15px;
  margin-top: 22px;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}
.stat-cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 128px;
}
.stat-num { font-size: clamp(24px, 3vw, 32px); font-weight: 700; }
.stat-num .accent-bar { color: var(--accent); }
.stat-label { color: var(--text-2); font-size: 15px; margin-top: 6px; }
.stat-cell--text .stat-num { font-size: clamp(17px, 2vw, 20px); line-height: 1.5; }
@media (max-width: 720px) {
  .stats-row { grid-template-columns: 1fr; }
  .stat-cell { min-height: 0; }
}

/* ── About ───────────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: center;
}
.about-photos { display: grid; gap: 18px; }
.about-photos img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  width: 100%;
  object-fit: cover;
}
.about-photos img:nth-child(2) { max-height: 260px; }
.about-text h2 { font-size: clamp(24px, 3.4vw, 32px); margin-bottom: 20px; text-align: left; }
.about-text p { color: var(--text-2); margin-bottom: 16px; }
.about-text .text-link { color: var(--text); }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* ── Services ────────────────────────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 1000px) and (min-width: 801px) {
  .services-grid { grid-template-columns: 1fr 1fr; }
}
.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.service-card h3 { font-size: 22px; }
.service-card p { color: var(--text-2); flex: 1; }
.service-note {
  text-align: center;
  color: var(--text-2);
  font-size: 15px;
  margin-top: 28px;
}
@media (max-width: 800px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* ── Testimonials / workshop photos ─────────────────────────────────── */
.workshop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.workshop-grid img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.workshop-grid img:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
@media (max-width: 800px) {
  .workshop-grid { grid-template-columns: 1fr; }
}

/* ── Event card ──────────────────────────────────────────────────────── */
.event-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  max-width: 760px;
  margin: 0 auto;
}
.event-card h3 { font-size: clamp(20px, 2.6vw, 26px); margin-bottom: 20px; }
.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  color: var(--text-2);
  font-size: 15px;
  margin-bottom: 18px;
  list-style: none;
}
.event-meta strong { color: var(--text); }
.event-desc { color: var(--text-2); margin-bottom: 26px; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.inline-form { display: flex; gap: 12px; flex-wrap: wrap; }
.inline-form input[type="email"] {
  flex: 1;
  min-width: 220px;
}
input[type="text"], input[type="email"], select, textarea {
  font-family: inherit;
  font-size: 16px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
label { font-weight: 500; font-size: 15px; display: block; margin-bottom: 6px; }
.form-row { margin-bottom: 20px; }
.form-hint { font-size: 14px; color: var(--text-2); margin-top: 8px; }
.form-error { color: #B42318; font-size: 14px; margin-top: 6px; display: none; }
.form-row.invalid .form-error { display: block; }
.form-row.invalid input, .form-row.invalid textarea, .form-row.invalid select { border-color: #B42318; }
.form-success {
  display: none;
  background: #F3FAF3;
  border: 1px solid #B7E0B7;
  color: #205B20;
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 16px;
}
.form-success.visible { display: block; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.newsletter-box {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.newsletter-box .inline-form { justify-content: center; margin-top: 24px; }
.newsletter-fineprint { font-size: 13px; color: var(--text-2); margin-top: 14px; }

/* ── Guide cards ─────────────────────────────────────────────────────── */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.guide-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.guide-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.guide-card h3 { font-size: 18px; line-height: 1.5; }
.guide-card p { color: var(--text-2); font-size: 15px; flex: 1; }
.guide-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  background: var(--alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  color: var(--text-2);
}
.guide-card .read-more { font-weight: 700; font-size: 15px; }
.guide-card .read-more::after { content: " →"; color: var(--accent); }
.guide-date { font-size: 13px; color: var(--text-2); }
.guides-cta { text-align: center; margin-top: 44px; }
@media (max-width: 900px) {
  .guides-grid { grid-template-columns: 1fr; }
}

/* Tag filter chips (guides list page) */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 44px; }
.chip {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); font-weight: 700; }

/* ── FAQ ─────────────────────────────────────────────────────────────── */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: 20px 24px;
  font-weight: 700;
  font-size: 17px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 22px;
  color: var(--accent);
  font-weight: 700;
  flex: none;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item .faq-answer { padding: 0 24px 22px; color: var(--text-2); }

/* ── Contact ─────────────────────────────────────────────────────────── */
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 40px;
  max-width: 720px;
  margin: 0 auto;
}
.contact-consent { font-size: 13px; color: var(--text-2); margin-top: 16px; }
.contact-consent a { color: var(--text); }
@media (max-width: 640px) {
  .contact-card { padding: 32px 22px; }
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer {
  background: var(--hero-bg);
  color: rgba(255, 255, 255, 0.75);
  padding: 56px 0 40px;
  font-size: 15px;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 36px;
}
.footer-brand { font-size: 20px; font-weight: 700; color: #fff; text-decoration: none; }
.footer-brand .dot { color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; list-style: none; }
.footer-links a { color: rgba(255, 255, 255, 0.75); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* ── Article pages ───────────────────────────────────────────────────── */
.article-hero { padding: 64px 0 40px; }
.article-hero .guide-tags { margin-bottom: 18px; }
.article-hero h1 { font-size: clamp(26px, 4vw, 40px); margin-bottom: 18px; max-width: 820px; }
.article-meta { color: var(--text-2); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.article-body { max-width: 760px; margin: 0 auto; padding-bottom: 40px; }
.article-body h2 {
  font-size: clamp(22px, 3vw, 28px);
  margin: 52px 0 18px;
  padding-top: 8px;
}
.article-body h3 { font-size: 20px; margin: 34px 0 12px; }
.article-body p { margin-bottom: 18px; color: #333; }
.article-body ul, .article-body ol { margin: 0 0 18px 1.4em; color: #333; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  border-left: 4px solid var(--accent);
  background: var(--alt);
  border-radius: 0 10px 10px 0;
  padding: 18px 22px;
  margin: 0 0 22px;
  color: #333;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 44px 0; }
.article-body img { border-radius: 10px; border: 1px solid var(--border); margin: 8px 0 18px; }
.article-body .table-wrap { overflow-x: auto; margin-bottom: 22px; }
.article-body table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
  background: var(--card);
}
.article-body th, .article-body td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.article-body th { background: var(--alt); font-weight: 700; }
.article-body pre {
  background: #1c1c1c;
  color: #eee;
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 22px;
}
.article-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.article-subscribe {
  background: var(--alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  margin: 52px 0 0;
  text-align: center;
}
.article-subscribe h2 { margin: 0 0 10px; font-size: 22px; }
.article-subscribe p { color: var(--text-2); margin-bottom: 4px; }
.related-guides { margin-top: 48px; }
.related-guides h2 { font-size: 20px; margin-bottom: 18px; }
.related-guides ul { list-style: none; margin: 0; }
.related-guides li { margin-bottom: 10px; }

/* Page hero for /guides and /privacy */
.page-hero { padding: 64px 0 44px; text-align: center; }
.page-hero h1 { font-size: clamp(28px, 4.4vw, 42px); margin-bottom: 14px; }
.page-hero p { color: var(--text-2); max-width: 620px; margin: 0 auto; }

/* Legal page */
.legal-body { max-width: 760px; margin: 0 auto; padding-bottom: 80px; }
.legal-body h2 { font-size: 22px; margin: 40px 0 14px; }
.legal-body p, .legal-body li { color: #333; }
.legal-body ul { margin: 0 0 18px 1.4em; }

/* ── Scroll fade-in ──────────────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: none; }

/* ── Reduced motion: kill all animation ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .logo-track { animation: none; }
  .fade-in { opacity: 1; transform: none; }
  .hero-photo.glitching { animation: none; }
}
