/* Finceryn website. Tokens follow the app's semantic colors (Finceryn/DesignSystem/Tokens.swift)
   and the North Star icon palette. Base styles are the phone layout; wider screens add space, not structure. */

:root {
  color-scheme: light dark;

  --canvas: #f6f7f5;
  --surface: #ffffff;
  --surface-raised: #eef1ee;
  --hairline: #dfe3df;
  --text: #11181c;
  --text-secondary: #4f5b62;
  --accent: #0f6f68;
  --accent-hover: #0a5751;
  --focus: #0f6f68;

  /* The hero keeps the icon's deep ink in both appearances, so its text is fixed too. */
  --hero-start: #123540;
  --hero-end: #0a222b;
  --hero-text: #ffffff;
  --hero-text-secondary: #cfdcdf;
  --hero-rule: #e9a23f;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --radius-card: 20px;
  --radius-hero: 28px;
  --page-max: 68rem;
  --measure: 40rem;

  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --focus-width: 3px;
  --rule-width: 2px;
  --radius-small: 4px;
  --radius-chip: 8px;
  --radius-control: 10px;
  --target-min: 44px;
  --icon-brand: 32px;
  --icon-hero: 72px;
  --icon-hero-radius: 17px;
  --icon-hero-wide: 88px;
  --icon-hero-wide-radius: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0b0f14;
    --surface: #171b22;
    --surface-raised: #252b35;
    --hairline: #2a303a;
    --text: #f2f4f5;
    --text-secondary: #b0b9c0;
    --accent: #7fd1c1;
    --accent-hover: #a6e3d6;
    --focus: #7fd1c1;
    --hero-start: #1a3647;
    --hero-end: #0d1d26;
  }
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

a:focus-visible {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--focus-width);
  border-radius: var(--radius-small);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-chip);
  z-index: 10;
}

.skip-link:focus {
  top: 0.75rem;
}

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--hairline);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: var(--icon-brand);
  height: var(--icon-brand);
  border-radius: var(--radius-chip);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.625rem 0.75rem;
  min-height: var(--target-min);
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* Homepage */

.hero {
  margin: 1.25rem 0 0;
  padding: 2rem 1.25rem 2.25rem;
  border-radius: var(--radius-hero);
  background: linear-gradient(160deg, var(--hero-start) 0%, var(--hero-end) 100%);
  color: var(--hero-text);
}

.hero-icon {
  width: var(--icon-hero);
  height: var(--icon-hero);
  border-radius: var(--icon-hero-radius);
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hero-text-secondary);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.25rem;
  height: var(--rule-width);
  margin-right: 0.5rem;
  vertical-align: middle;
  background: var(--hero-rule);
}

.hero h1 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.hero .lede {
  margin: 1rem 0 0;
  max-width: 34rem;
  font-size: 1.125rem;
  color: var(--hero-text-secondary);
}

.hero .status {
  margin: 1.5rem 0 0;
  font-size: 0.9375rem;
  color: var(--hero-text);
}

.section {
  padding: 2.5rem 0 0;
}

.section h2,
.legal h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.section > p {
  max-width: var(--measure);
  margin: 0 0 1rem;
  color: var(--text-secondary);
}

.features {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
}

.features h3 {
  margin: 0 0 0.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.features p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

.not-list {
  max-width: var(--measure);
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hairline);
}

.not-list li {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--hairline);
}

.not-list strong {
  font-weight: 600;
}

/* Legal pages */

.legal {
  max-width: var(--measure);
  padding: 2rem 0 0;
}

.legal h1,
.notfound h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.legal .meta {
  margin: 0 0 2rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.legal h2 {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

.legal h3 {
  margin: 1.5rem 0 0.375rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.legal p,
.legal li {
  margin: 0 0 0.875rem;
}

.legal ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.legal .summary {
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
}

.legal .summary p:last-child,
.legal .summary ul:last-child {
  margin-bottom: 0;
}

.token {
  font-family: var(--font-mono);
  font-size: 0.9375em;
  padding: 0.05em 0.3em;
  border-radius: var(--radius-small);
  background: var(--surface-raised);
}

.notfound {
  padding: 3rem 0 0;
  max-width: var(--measure);
}

.notfound p {
  color: var(--text-secondary);
}

/* Footer */

.site-footer {
  margin-top: 3.5rem;
  border-top: 1px solid var(--hairline);
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.site-footer p {
  margin: 0 0 0.5rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-block;
  padding: 0.5rem 0;
  min-height: var(--target-min);
}

/* Wider screens */

@media (min-width: 48rem) {
  :root {
    --gutter: 32px;
  }

  .hero {
    margin-top: 2rem;
    padding: 3.5rem 3rem 3.75rem;
  }

  .hero h1 {
    font-size: 3.25rem;
  }

  .hero .lede {
    font-size: 1.25rem;
  }

  .hero-icon {
    width: var(--icon-hero-wide);
    height: var(--icon-hero-wide);
    border-radius: var(--icon-hero-wide-radius);
  }

  .section {
    padding-top: 3.5rem;
  }

  .section h2 {
    font-size: 1.625rem;
  }

  .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .legal {
    padding-top: 3rem;
  }

  .legal h1,
  .notfound h1 {
    font-size: 2.5rem;
  }
}

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