/* Shared brand system. z-index: nav 40, overlay 45, grain 50, toast 60.
   Radius: pills for buttons, 2rem shells / concentric inner cores for frames. */
:root {
  --paper: #f7f8f4;
  --paper-2: #eceee8;
  --surface: #fcfcfa;
  --ink: #161916;
  --muted: #5c6158;
  --line: rgba(22, 25, 22, 0.08);
  --accent: #2c5a3d;
  --accent-hover: #234830;
  --on-accent: #f4f6f1;
  --forest-soft: rgba(44, 90, 61, 0.12);
  --radius-shell: 2rem;
  --radius-pad: 0.375rem;
  --radius-inner: calc(2rem - 0.375rem);
  --radius-btn: 999px;
  --font: "Outfit", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --z-nav: 40;
  --z-overlay: 45;
  --z-grain: 50;
  --z-toast: 60;
  --shadow-soft: 0 28px 80px rgba(22, 25, 22, 0.08);
  --container: 1240px;
}

* { box-sizing: border-box; }
html {
  color-scheme: light;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; color: inherit; }
svg { display: block; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 70;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 600;
}
.skip-link:focus {
  top: 1rem;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bezel {
  padding: var(--radius-pad);
  border-radius: var(--radius-shell);
  background: rgba(22, 25, 22, 0.045);
  box-shadow: 0 0 0 1px var(--line);
}
.bezel__core {
  border-radius: var(--radius-inner);
  background: var(--surface);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: var(--radius-btn);
  padding: 0.85rem 0.4rem 0.85rem 1.35rem;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  background: none;
  transition: transform 0.7s var(--ease), background 0.7s var(--ease), border-color 0.7s var(--ease), color 0.7s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 14px; height: 14px; }
.btn__orb {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  transition: transform 0.7s var(--ease);
  flex-shrink: 0;
}
.btn:hover .btn__orb {
  transform: translate(3px, -1px) scale(1.05);
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost .btn__orb {
  background: var(--forest-soft);
  color: var(--accent);
}
.btn-block { width: 100%; }
.btn-sm { padding: 0.65rem 0.35rem 0.65rem 1.1rem; font-size: 13px; }
.btn-sm .btn__orb { width: 1.7rem; height: 1.7rem; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.link-btn:hover { color: var(--accent); }

.island {
  position: sticky;
  top: 1.15rem;
  z-index: var(--z-nav);
  display: flex;
  justify-content: center;
  pointer-events: none;
  margin-bottom: -4.25rem;
}
.island__bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  flex: 0 0 auto;
  height: 58px;
  padding: 0.3rem 0.35rem 0.3rem 0.85rem;
  border-radius: var(--radius-btn);
  background: rgba(250, 251, 248, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 18px 50px rgba(22, 25, 22, 0.08);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.brand__mark {
  width: 2rem;
  height: 2rem;
  border-radius: 11px;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.brand__name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.island__links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}
.island__links a:hover,
.island__links a.is-active {
  color: var(--ink);
}
.island__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.4rem;
}

.nav-toggle {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--forest-soft);
  position: relative;
  cursor: pointer;
  display: none;
  flex-shrink: 0;
}
.nav-toggle span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.7s var(--ease);
}
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 24px; }
.nav-toggle.is-open span:first-child {
  top: 20.5px;
  transform: rotate(45deg);
}
.nav-toggle.is-open span:last-child {
  top: 20.5px;
  transform: rotate(-45deg);
}

body.nav-open .island {
  z-index: calc(var(--z-overlay) + 1);
}
body.nav-open .island__bar {
  background: rgba(250, 251, 248, 0.94);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(18, 20, 18, 0.78);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
}
.nav-overlay[hidden] { display: none; }
.nav-overlay nav {
  display: grid;
  gap: 0.35rem;
  padding: 1.5rem 0 2.5rem;
}
.nav-overlay a,
.nav-overlay .link-btn {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  color: #eef0ec;
  text-align: left;
  line-height: 1.2;
  padding: 0.2rem 0;
}
.nav-overlay a.is-active { color: #8fbf9c; }

@media (prefers-reduced-motion: no-preference) {
  .nav-overlay:not([hidden]) a,
  .nav-overlay:not([hidden]) .link-btn {
    opacity: 0;
    transform: translateY(2.5rem);
    animation: rise 0.8s var(--ease) forwards;
    animation-delay: calc(var(--i, 0) * 90ms);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.75rem;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-btn);
  font-size: 14px;
  z-index: var(--z-toast);
  box-shadow: var(--shadow-soft);
}

[data-reveal] { }

@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(3.5rem);
  }
  [data-reveal].is-in {
    opacity: 1;
    transform: none;
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  }
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-footer {
  padding: 3rem 1.5rem 2.5rem;
}
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-footer__links {
  display: flex;
  gap: 1.25rem;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.site-footer__links a:hover { color: var(--ink); }

.empty-state {
  max-width: var(--container);
  margin: 3rem auto;
  padding: 0 1.5rem;
  color: var(--muted);
}
.empty-state .btn { margin-top: 1rem; }

@media (max-width: 767px) {
  .island__links { display: none; }
  .island__actions .btn-ghost {
    display: inline-flex;
    padding: 0.5rem 0.8rem;
    font-size: 13px;
  }
  .nav-toggle { display: block; }
  .brand__name { display: none; }
  .island__bar {
    width: calc(100vw - 2rem);
    justify-content: space-between;
    gap: 0.45rem;
    padding-left: 0.55rem;
  }
  .island__actions { gap: 0.25rem; }
  .island__actions .btn-sm .btn__orb { display: none; }
  .island__actions .btn-sm { padding: 0.5rem 0.9rem; }
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .island__bar {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn,
  .btn__orb,
  .nav-toggle span { transition: none; }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

