@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400&family=DM+Sans:ital,wght@0,400;0,500;1,400&family=DM+Serif+Display:ital,wght@0,400;1,400&family=Noto+Sans+TC:wght@200;400&family=Noto+Serif+TC:wght@400;500&display=swap');

@font-face {
  font-family: 'C059';
  src: url('../fonts/C059-Roman.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'C059';
  src: url('../fonts/C059-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'C059';
  src: url('../fonts/C059-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'C059';
  src: url('../fonts/C059-BdIta.otf') format('opentype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg-primary: #FFFFFF;
  --bg-surface: #f7f6f2;
  --highlight: #FF5A78;
  --text-primary: #000000;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-light: #e8e6e1;
  --border-card: #000000;

  --font-title: 'C059', serif;
  --font-title-weight: 400;
  --font-body: 'DM Sans', sans-serif;
  --font-body-weight: 400;
  --font-body-ls: 0.005em;
  --font-body-label-ls: 0.3em;
  --font-body-ui-ls: 0.15em;
  --font-body-caption-ls: 0.05em;
  --font-mono: 'DM Mono', monospace;
  --font-mono-weight: 400;
  --font-prose: 'C059', serif;
  --font-prose-weight: 400;
  --font-prose-ls: 0.02em;
  --font-title-tc: 'Noto Serif TC', serif;
  --font-title-tc-weight: 500;
  --font-title-tc-ls: 0.08em;
  --font-body-tc: 'Noto Sans TC', sans-serif;
  --font-body-tc-weight: 200;
  --font-body-tc-ls: 0.05em;
  --font-prose-tc: 'Noto Serif TC', serif;
  --font-prose-tc-weight: 400;
  --font-prose-tc-ls: 0.05em;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  letter-spacing: var(--font-body-ls);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* Button style */
.btn {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-primary);
  background: none;
  border: 1px solid var(--text-primary);
  padding: 6px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.btn:hover {
  color: var(--highlight);
  border-color: var(--highlight);
}

/* Category pill bar (shared between articles + photography) */
.category-menu-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 80px 16px;
  position: relative;
}

.article-count {
  position: absolute;
  right: 80px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.category-menu {
  display: inline-flex;
  position: relative;
  border: 1px solid #aaa;
  border-radius: 999px;
  padding: 4px;
}

.category-menu .pill-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: var(--pill-left, 0);
  width: var(--pill-width, 0);
  background: var(--text-primary);
  border-radius: 999px;
  transition: left 0.3s ease, width 0.3s ease;
  z-index: 0;
  pointer-events: none;
}

.category-menu a {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #aaa;
  white-space: nowrap;
  padding: 6px 16px;
  border-radius: 999px;
  transition: color 0.2s;
}

.category-menu a:hover {
  color: var(--text-primary);
}

.category-menu a.active {
  color: #fff;
}

/* Category dropdown (mobile) */
.category-dropdown {
  display: none;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: none;
  border-bottom: 1px solid var(--border-light);
  padding: 14px 16px;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
  outline: none;
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .category-menu-wrap {
    padding: 12px 16px;
  }
}

@media (max-width: 768px) {
  .category-menu-wrap {
    display: none;
  }

  .category-dropdown {
    display: block;
    position: sticky;
    top: 56px;
    z-index: 50;
    background: var(--bg-primary);
  }
}

/* ── Cursor rings (desktop only) ── */
@media (pointer: fine) {
  .cursor-ring {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.25s, height 0.25s, border-color 0.25s;
    will-change: left, top;
  }
  .cursor-outer {
    width: 32px; height: 32px;
    border: 1.2px solid var(--highlight);
  }
  .cursor-inner {
    width: 16px; height: 16px;
    border: 1px solid var(--highlight);
  }
  .cursor-outer.hover {
    width: 48px; height: 48px;
  }
  .cursor-inner.hover {
    width: 24px; height: 24px;
  }
  .cursor-outer.click {
    width: 20px; height: 20px;
  }
  .cursor-inner.click {
    width: 6px; height: 6px;
    border-width: 2px;
  }
}

/* ── Loading indicator (shared) ── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-indicator {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 10;
}

.loading-indicator svg {
  width: 24px;
  height: 24px;
  animation: spin 0.9s linear infinite;
}
