/* ==========================================================================
   Joy and Capital — shared styles (EN + 繁中)
   ========================================================================== */

:root {
  --paper: #f5f2ea;
  --paper-2: #ece7db;
  --ink: #15171b;
  --ink-2: #4b5058;
  --line: #d9d2c3;
  --accent: #b83d26;
  --accent-soft: rgba(184, 61, 38, 0.08);

  --night: #121417;
  --night-2: #0c0d10;
  --on-night: #ede9df;
  --on-night-2: #a9adb4;
  --night-line: rgba(237, 233, 223, 0.14);
  --accent-night: #ee7356;

  --font-display: "Fraunces", "Noto Serif TC", Georgia, "Songti TC", serif;
  --font-body: "Inter", "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;

  --gutter: clamp(16px, 4vw, 32px);
  --max: 1200px;
  --header-h: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

::selection {
  background: var(--accent);
  color: var(--paper);
}

.container {
  width: min(var(--max), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Type ---------- */

.display,
.h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  line-height: 1.04;
  text-wrap: balance;
}

.display {
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
}

.h2 {
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  line-height: 1.08;
}

.display em,
.h2 em {
  font-style: italic;
  color: var(--accent);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 36em;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn--solid {
  background: var(--ink);
  color: var(--paper);
}

.btn--solid:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(245, 242, 234, 0.94);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand__mark {
  width: 34px;
  height: 34px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  letter-spacing: -0.01em;
}

.brand__name em {
  font-style: italic;
  color: var(--accent);
}

.brand__sub {
  margin-top: 3px;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__list {
  display: flex;
  gap: 28px;
}

.nav__list a {
  position: relative;
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-2);
  transition: color 0.2s var(--ease);
}

.nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.nav__list a:hover,
.nav__list a.is-active {
  color: var(--ink);
}

.nav__list a:hover::after,
.nav__list a.is-active::after {
  transform: scaleX(1);
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.lang-switch a {
  padding: 5px 11px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-2);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.lang-switch a[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
}

.lang-switch a:not([aria-current="true"]):hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--ink);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  margin: 6px auto;
  background: currentColor;
  transition: transform 0.3s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(3.75px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  transform: translateY(-3.75px) rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(48px, 8vw, 104px) clamp(64px, 9vw, 120px);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.hero__copy .eyebrow {
  margin-bottom: 28px;
}

.hero__copy .lead {
  margin-top: 28px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.venn {
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
}

.venn__orbit {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: 0.22;
  stroke-dasharray: 2 7;
  transform-origin: 260px 266px;
  animation: spin 80s linear infinite;
}

.venn__orbit-dot {
  fill: var(--accent);
}

.venn__ring {
  fill: var(--accent-soft);
  stroke: var(--ink);
  stroke-width: 1.2;
  mix-blend-mode: multiply;
}

.venn__label {
  font-family: var(--font-display);
  font-size: 19px;
  fill: var(--ink);
}

.venn__label--small {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  fill: var(--ink-2);
}

.venn__core {
  fill: var(--accent);
}

.venn__amp {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 40px;
  fill: var(--paper);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(72px, 10vw, 136px);
}

.section--alt {
  background: var(--paper-2);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px clamp(32px, 5vw, 72px);
  margin-bottom: clamp(40px, 5vw, 72px);
}

.section-head .eyebrow {
  padding-top: 0.9em;
  align-self: start;
}

.section-head .lead {
  margin-top: 24px;
}

/* About: three focus areas */

.focus-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}

.focus {
  padding: 32px clamp(20px, 3vw, 40px) 0 0;
}

.focus + .focus {
  padding-left: clamp(20px, 3vw, 40px);
  border-left: 1px solid var(--line);
}

.focus__num {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.focus__title {
  margin: 16px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 400;
  line-height: 1.15;
}

.focus p {
  color: var(--ink-2);
}

/* Ventures */

.venture-list {
  border-top: 1px solid var(--ink);
}

.venture {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 24px;
  padding: clamp(24px, 3vw, 36px) 0;
  border-bottom: 1px solid var(--line);
}

.venture__num {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.venture__name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.venture__name a {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.venture__name a svg {
  width: 0.4em;
  height: 0.4em;
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}

.venture__name a:hover {
  color: var(--accent);
}

.venture__name a:hover svg {
  transform: translate(3px, -3px);
}

.venture__desc {
  margin-top: 10px;
  color: var(--ink-2);
  max-width: 40em;
}

.venture__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.tag {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

/* ---------- Contact ---------- */

.contact {
  position: relative;
  padding-block: clamp(80px, 12vw, 160px);
  background: var(--night);
  color: var(--on-night);
  overflow: hidden;
}

.contact::before {
  content: "";
  position: absolute;
  right: -12vw;
  top: -18vw;
  width: 52vw;
  height: 52vw;
  max-width: 760px;
  max-height: 760px;
  border-radius: 50%;
  border: 1px solid var(--night-line);
  box-shadow: 0 0 0 7vw rgba(237, 233, 223, 0.025), 0 0 0 14vw rgba(237, 233, 223, 0.018);
  pointer-events: none;
}

.contact .eyebrow {
  color: var(--on-night-2);
}

.contact .h2 {
  margin-top: 28px;
  font-size: clamp(2.6rem, 7vw, 6rem);
  max-width: 12em;
}

.contact .h2 em {
  color: var(--accent-night);
}

.contact .lead {
  margin-top: 28px;
  color: var(--on-night-2);
}

.contact__mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 56px;
}

.contact__email {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease);
  overflow-wrap: anywhere;
}

.contact__email:hover {
  background-size: 100% 1px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--night-line);
  border-radius: 999px;
  background: transparent;
  color: var(--on-night-2);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.copy-btn:hover,
.copy-btn.is-copied {
  color: var(--on-night);
  border-color: var(--on-night-2);
}

.copy-btn svg {
  width: 15px;
  height: 15px;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 36px;
  background: var(--night-2);
  color: var(--on-night-2);
  font-size: 0.88rem;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px 48px;
}

.site-footer .disclaimer {
  margin-top: 8px;
  max-width: 62em;
  font-size: 0.8rem;
  line-height: 1.6;
  opacity: 0.8;
}

.site-footer .lang-switch {
  border-color: var(--night-line);
}

.site-footer .lang-switch a {
  color: var(--on-night-2);
}

.site-footer .lang-switch a[aria-current="true"] {
  background: var(--on-night);
  color: var(--night);
}

/* ---------- Motion ---------- */

/* Hero entrance: CSS only, so the hero never depends on JS */
[data-enter] {
  animation: enter 1s var(--ease) both;
  animation-delay: var(--delay, 0s);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

/* Reveal on scroll: main.js adds .js, so content stays visible without it */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0s);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Traditional Chinese typography ---------- */

body:lang(zh-Hant) {
  line-height: 1.85;
  letter-spacing: 0.02em;
}

:lang(zh-Hant) .display,
:lang(zh-Hant) .h2 {
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.28;
}

:lang(zh-Hant) .display {
  font-size: clamp(2rem, 5.6vw, 4.6rem);
  text-wrap: wrap;
}

:lang(zh-Hant) .h2 {
  font-size: clamp(1.85rem, 3.8vw, 3.1rem);
}

:lang(zh-Hant) .contact .h2 {
  font-size: clamp(2.3rem, 6vw, 5rem);
}

:lang(zh-Hant) em {
  font-style: normal;
}

:lang(zh-Hant) .focus__title {
  font-weight: 600;
}

:lang(zh-Hant) .eyebrow {
  letter-spacing: 0.2em;
}

:lang(zh-Hant) .lead {
  line-height: 1.85;
}

:lang(zh-Hant) .brand__name {
  font-weight: 700;
  letter-spacing: 0.12em;
}

:lang(zh-Hant) .brand__sub {
  letter-spacing: 0.14em;
}

:lang(zh-Hant) .venn__label {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.06em;
}

:lang(zh-Hant) .venn__label--small {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3em;
}

:lang(zh-Hant) .venn__amp {
  font-family: "Noto Serif TC", serif;
  font-style: normal;
  font-weight: 700;
  font-size: 30px;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero__inner,
  .section-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .venn {
    max-width: 360px;
  }

  .section-head .eyebrow {
    padding-top: 0;
  }

  .focus-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .focus,
  .focus + .focus {
    padding: 28px 0;
    border-left: 0;
  }

  .focus + .focus {
    border-top: 1px solid var(--line);
  }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 64px;
  }

  .nav-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding: 16px var(--gutter) 28px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -28px rgba(21, 23, 27, 0.4);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }

  .nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    gap: 0;
  }

  .nav__list a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--ink);
  }

  .nav__list a::after {
    display: none;
  }

  .lang-switch {
    align-self: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 1rem;
  }

  .brand__name {
    font-size: 1.12rem;
  }

  .hero__actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .venture {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .venture__tags {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
