/* ============================================
   LazyDogLab homepage — paper-lab aesthetic
   ============================================ */

:root {
  --cream: #F4EFE0;
  --cream-deep: #ECE5D2;
  --paper: #FBF8EE;
  --ink: #1F3A5C;
  --ink-soft: #4A5E7C;
  --shiba: #E89B3C;
  --teal: #4BAEC9;
  --teal-light: #7FD0E3;
  --sage: #8FB996;
  --rule: rgba(31, 58, 92, 0.14);

  --bg: var(--cream);
  --fg: var(--ink);
  --surface: var(--paper);

  --font-display: "Nunito", "Noto Sans SC", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --font-body: "Nunito", "Noto Sans SC", "Noto Sans JP", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #15243A;
  --cream: #15243A;
  --cream-deep: #1B2C44;
  --paper: #1E3050;
  --ink: #F4EFE0;
  --ink-soft: #B7C4D5;
  --rule: rgba(244, 239, 224, 0.16);
  --fg: var(--ink);
  --surface: var(--paper);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* CJK: keep Nunito for Latin, switch to Noto for Han/Kana via font fallback chain.
   Slightly tighter line-height for CJK paragraphs */
.lang-zh, .lang-ja {
  font-family: "Noto Sans SC", "Noto Sans JP", "Nunito", system-ui, sans-serif;
}
.lang-ja {
  font-family: "Noto Sans JP", "Noto Sans SC", "Nunito", system-ui, sans-serif;
}

/* Paper grid background */
.paper-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.55;
  z-index: 0;
  mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 80%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 48px 48px;
}

/* ============================================
   Topbar
   ============================================ */
.topbar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 12px 0 24px;
  border-bottom: 1px dashed var(--rule);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 56px;
  height: 56px;
  object-fit: cover;
  object-position: center 38%;
  border-radius: 14px;
  border: 1.5px solid var(--rule);
  background: var(--paper);
}
.brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.brand-lazy { color: var(--ink); }
.brand-lab { color: var(--teal); }

.topnav {
  margin-left: auto;
  display: flex;
  gap: 28px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
}
.topnav a {
  position: relative;
  transition: color .2s;
}
.topnav a:hover { color: var(--ink); }
.topnav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--shiba);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.topnav a:hover::after { transform: scaleX(1); }

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme toggle (visible in topbar) */
.theme-toggle {
  appearance: none;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  padding: 4px;
  cursor: pointer;
  height: 36px;
  display: inline-flex;
  align-items: center;
  transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--ink-soft); }
.tt-track {
  position: relative;
  width: 56px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  color: var(--ink-soft);
}
.tt-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  z-index: 1;
  transition: color .2s, opacity .2s;
}
.tt-sun { color: var(--shiba); }
.tt-moon { color: var(--ink-soft); opacity: 0.55; }
.theme-toggle.is-dark .tt-sun { color: var(--ink-soft); opacity: 0.55; }
.theme-toggle.is-dark .tt-moon { color: var(--teal-light); opacity: 1; }
.tt-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform .28s cubic-bezier(.6,.2,.3,1.3);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.theme-toggle.is-dark .tt-knob {
  transform: translateX(30px);
  background: var(--teal);
}

.lang-switcher {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  padding: 4px;
  background: var(--paper);
  gap: 2px;
}
.lang-btn {
  font: inherit;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  cursor: pointer;
  min-width: 36px;
  transition: all .2s;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active {
  background: var(--ink);
  color: var(--paper);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
  padding: 72px 0 80px;
  position: relative;
}
.layout-centered .hero {
  grid-template-columns: 1fr;
  text-align: center;
  justify-items: center;
  padding: 56px 0 64px;
}
.layout-centered .hero-actions { justify-content: center; }
.layout-centered .hero-right { display: none; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
}
.eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--shiba);
  box-shadow: 0 0 0 4px rgba(232, 155, 60, 0.18);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.6vw, 76px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 22px 0 22px;
  color: var(--ink);
}
.hero-title span { display: block; }
.hero-title-hl {
  position: relative;
  color: var(--teal);
  width: fit-content;
}
.layout-centered .hero-title-hl { margin: 0 auto; }
.underline {
  position: absolute;
  left: 0; right: 0;
  bottom: -4px;
  height: 0.22em;
  width: 100%;
}

.hero-lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 32px;
}
.lang-zh .hero-lede, .lang-ja .hero-lede { line-height: 1.75; font-size: 17px; }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease;
  border: 0;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 4px 0 0 rgba(0,0,0,0.18);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 0 rgba(0,0,0,0.22);
}
.btn-primary:active { transform: translateY(1px); box-shadow: 0 2px 0 0 rgba(0,0,0,0.22); }

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sage);
  position: relative;
}
.status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--sage);
  opacity: 0.35;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.55; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* --- Mascot --- */
.hero-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}
.hero-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  animation: spinSlow 60s linear infinite;
}
@keyframes spinSlow { to { transform: rotate(360deg); } }

.mascot {
  position: relative;
  width: min(420px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 45%, var(--paper) 0%, var(--paper) 55%, transparent 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(31,58,92,0.10));
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.01); }
}

.zzz {
  position: absolute;
  top: 18%;
  left: 28%;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink);
  pointer-events: none;
}
.zzz .z {
  display: inline-block;
  font-size: 28px;
  margin-right: 2px;
  opacity: 0;
  animation: zfloat 3.2s ease-in-out infinite;
}
.zzz .z1 { animation-delay: 0s; font-size: 22px; }
.zzz .z2 { animation-delay: 0.6s; font-size: 28px; }
.zzz .z3 { animation-delay: 1.2s; font-size: 34px; }
@keyframes zfloat {
  0% { opacity: 0; transform: translate(0, 0) rotate(-6deg); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(18px, -34px) rotate(8deg); }
}

.tape {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(232, 155, 60, 0.28);
  border: 1px dashed rgba(31, 58, 92, 0.35);
  color: var(--ink);
  padding: 6px 14px;
  z-index: 2;
  font-weight: 600;
}
.tape-1 { top: 6%; right: 4%; transform: rotate(6deg); }
.tape-2 { bottom: 8%; left: 0%; transform: rotate(-5deg); }

/* ============================================
   Projects section
   ============================================ */
.projects {
  padding: 40px 0 56px;
}
.section-head {
  text-align: center;
  margin-bottom: 56px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.eyebrow-bar {
  display: inline-block;
  width: 24px; height: 2px;
  background: var(--shiba);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3.6vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 14px;
  color: var(--ink);
}
.section-sub {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 24px 28px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 22px;
  text-align: center;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--card-accent);
  opacity: 0;
  transition: opacity .25s ease;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px -20px rgba(31, 58, 92, 0.25);
  border-color: var(--card-accent);
}
.project-card:hover::before { opacity: 1; }

.card-flask {
  width: 210px;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: transform .4s ease;
}
.project-card:hover .card-flask { transform: translateY(-4px); }

.card-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.card-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.card-desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 18px;
  min-height: 90px;
}
.lang-zh .card-desc, .lang-ja .card-desc { line-height: 1.75; }

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--cream-deep);
  transition: gap .2s ease, background .2s ease;
}
.project-card:hover .card-cta { gap: 14px; background: var(--ink); color: var(--paper); }

.card-host {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  opacity: 0.7;
}

/* More-soon */
.more-soon {
  margin-top: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px;
  border: 1.5px dashed var(--rule);
  border-radius: 20px;
  color: var(--ink-soft);
  font-size: 15px;
  background: rgba(251, 248, 238, 0.5);
}
.more-flask { flex-shrink: 0; opacity: 0.85; }
.more-soon p { margin: 0; max-width: 480px; }

/* ============================================
   Contact
   ============================================ */
.contact {
  padding: 64px 0 32px;
  border-top: 1px dashed var(--rule);
  margin-top: 32px;
}
.contact-inner { max-width: 880px; margin: 0 auto; }
.contact-head {
  text-align: center;
  margin-bottom: 40px;
}
.contact-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 22px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 18px;
  transition: border-color .2s, transform .2s;
}
.contact-card:hover {
  border-color: var(--card-hover, var(--ink-soft));
  transform: translateY(-2px);
}
.cc-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cc-icon-mail { background: rgba(232, 155, 60, 0.15); color: var(--shiba); }
.cc-icon-wechat { background: rgba(75, 174, 201, 0.15); color: var(--teal); }
.cc-body { flex: 1; min-width: 0; }
.cc-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.cc-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  word-break: break-all;
  text-decoration: none;
}
a.cc-value:hover { color: var(--teal); }
.cc-value-mono { font-family: var(--font-mono); letter-spacing: 0.05em; }
.cc-copy {
  font: inherit;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
  transition: all .2s;
}
.cc-copy:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  margin-top: 64px;
  padding: 24px 0;
  border-top: 1px dashed var(--rule);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}
.status { display: flex; align-items: center; gap: 10px; }
.status-dot-lg { width: 9px; height: 9px; }
.footer-mid { text-align: center; }
.footer-right { text-align: right; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 980px) {
  .page { padding: 20px 24px 36px; }
  .topbar { flex-wrap: wrap; gap: 16px; }
  .topnav { order: 3; width: 100%; gap: 20px; }
  .hero {
    grid-template-columns: 1fr;
    padding: 40px 0 56px;
    gap: 32px;
  }
  .hero-right { min-height: 320px; }
  .project-grid { grid-template-columns: 1fr; }
  .card-desc { min-height: auto; }
  .contact-cards { grid-template-columns: 1fr; }
  .site-footer {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-mid, .footer-right { text-align: center; }
}

@media (max-width: 640px) {
  .page { padding: 16px 18px 28px; }
  .topbar { gap: 12px; padding-bottom: 18px; }
  .brand-mark { width: 44px; height: 44px; border-radius: 12px; }
  .brand-text { font-size: 18px; }
  .topbar-tools { margin-left: auto; }
  .topnav { gap: 16px; font-size: 14px; justify-content: center; }
  .hero {
    padding: 28px 0 40px;
    gap: 24px;
  }
  .hero-title { font-size: clamp(34px, 9vw, 48px); margin: 16px 0 18px; }
  .hero-lede { font-size: 16px; }
  .hero-actions { gap: 16px; }
  .btn { padding: 12px 18px; font-size: 14px; }
  .hero-right { min-height: 260px; }
  .mascot { width: min(320px, 100%); }
  .tape { font-size: 10px; padding: 4px 10px; }
  .section-head { margin-bottom: 36px; }
  .section-title { font-size: clamp(24px, 6vw, 32px); }
  .section-sub { font-size: 15px; }
  .projects { padding: 24px 0 32px; }
  .project-card { padding: 22px 18px; }
  .card-flask { width: 180px; height: 180px; }
  .card-name { font-size: 22px; }
  .more-soon { flex-direction: column; text-align: center; padding: 22px; gap: 12px; }
  .contact { padding: 48px 0 24px; }
  .contact-card { padding: 16px; gap: 12px; flex-wrap: wrap; }
  .cc-body { flex-basis: calc(100% - 56px); }
  .cc-copy { margin-left: auto; }
  .cc-value { font-size: 15px; }
  .site-footer { font-size: 11px; gap: 8px; padding: 18px 0; }
}

@media (max-width: 380px) {
  .lang-btn { padding: 5px 9px; min-width: 30px; font-size: 13px; }
  .tt-track { width: 48px; }
  .theme-toggle.is-dark .tt-knob { transform: translateX(22px); }
}
