/*
 * Fabled Sword home page for Fabled-Git.
 * Values come from the FabledSword house design system (Grimoire design
 * system 1). Everything is scoped to .fs-home, so the rest of Gitea keeps its
 * own theme. Fonts are served from this instance; nothing loads from outside.
 */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/fraunces-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* House tokens, dark first. */
.fs-home {
  --fs-surface-page: #14171A;
  --fs-surface-raised: #1E2228;
  --fs-surface-hover: #2C313A;
  --fs-border-color: #3F4651;
  --fs-text-primary: #E8E4D8;
  --fs-text-secondary: #C2BFB4;
  --fs-text-tertiary: #9C9A92;
  --fs-text-on-action: #E8E4D8;
  --fs-action-primary: #4A5D3F;
  --fs-action-primary-hover: color-mix(in srgb, var(--fs-action-primary) 88%, white);
  --fs-plate: #14171A; /* marks carry parchment ink, so they always sit on obsidian */

  --fs-font-display: 'Fraunces', Georgia, serif;
  --fs-font-body: 'Inter', system-ui, sans-serif;
  --fs-radius-md: 8px;
  --fs-radius-lg: 12px;
  --fs-ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --fs-dur-fast: 120ms;
  --fs-shadow-2: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* Light mode: Gitea's light theme, or its auto theme on a light-preferring device. */
html[data-theme="gitea-light"] .fs-home {
  --fs-surface-page: #F5F1E8;
  --fs-surface-raised: #FBF8F0;
  --fs-surface-hover: #EFEAE0;
  --fs-border-color: #D9D6CE;
  --fs-text-primary: #14171A;
  --fs-text-secondary: #5A5852;
  --fs-text-tertiary: #9A9890;
  --fs-shadow-2: 0 4px 12px rgba(0, 0, 0, 0.12);
}
@media (prefers-color-scheme: light) {
  html[data-theme="gitea-auto"] .fs-home {
    --fs-surface-page: #F5F1E8;
    --fs-surface-raised: #FBF8F0;
    --fs-surface-hover: #EFEAE0;
    --fs-border-color: #D9D6CE;
    --fs-text-primary: #14171A;
    --fs-text-secondary: #5A5852;
    --fs-text-tertiary: #9A9890;
    --fs-shadow-2: 0 4px 12px rgba(0, 0, 0, 0.12);
  }
}

.page-content.fs-home {
  flex: 1 0 auto;
  margin: 0;
  padding: 64px 16px 96px;
  background: var(--fs-surface-page);
  color: var(--fs-text-primary);
  font-family: var(--fs-font-body);
  font-size: 15px;
  line-height: 1.5;
}

.fs-hero {
  max-width: 720px;
  margin: 0 auto 64px;
  text-align: center;
}
.fs-hero-mark {
  display: block;
  margin: 0 auto 24px;
  width: 120px;
  height: 120px;
}
.fs-home .fs-hero-title {
  margin: 0 0 12px;
  font-family: var(--fs-font-display);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--fs-text-primary);
}
.fs-hero-lede {
  margin: 0 auto 32px;
  max-width: 34em;
  font-size: 18px;
  color: var(--fs-text-secondary);
  text-wrap: balance;
}
.fs-home .fs-cta {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--fs-radius-md);
  background: var(--fs-action-primary);
  color: var(--fs-text-on-action);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--fs-dur-fast) var(--fs-ease);
}
.fs-home .fs-cta:hover,
.fs-home .fs-cta:focus-visible {
  background: var(--fs-action-primary-hover);
  color: var(--fs-text-on-action);
}

.fs-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.fs-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 0.5px solid var(--fs-border-color);
  border-radius: var(--fs-radius-lg);
  background: var(--fs-surface-raised);
  transition: box-shadow var(--fs-dur-fast) var(--fs-ease), border-color var(--fs-dur-fast) var(--fs-ease);
}
.fs-card:hover {
  border-color: color-mix(in srgb, var(--fs-text-secondary) 30%, transparent);
  box-shadow: var(--fs-shadow-2);
}
.fs-card-plate {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin-bottom: 20px;
  border-radius: var(--fs-radius-lg);
  background: var(--fs-plate);
}
.fs-card-plate img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.fs-home .fs-card-title {
  margin: 0 0 8px;
  font-family: var(--fs-font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--fs-text-primary);
}
.fs-card-desc {
  flex: 1;
  margin: 0 0 20px;
  color: var(--fs-text-secondary);
}
.fs-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fs-home .fs-card-links a {
  color: var(--fs-text-primary);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--fs-border-color);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--fs-dur-fast) var(--fs-ease);
}
.fs-home .fs-card-links a:hover {
  text-decoration-color: currentColor;
}

.fs-footnote {
  max-width: 720px;
  margin: 64px auto 0;
  text-align: center;
  font-size: 13px;
  color: var(--fs-text-tertiary);
}

.fs-home a:focus-visible {
  outline: 2px solid var(--fs-text-primary);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .page-content.fs-home { padding-top: 40px; }
  .fs-home .fs-hero-title { font-size: 32px; }
  .fs-hero-lede { font-size: 15px; }
}
