@font-face { font-family: 'PY Jost'; src: url('../fonts/py-jost-400.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'PY Jost'; src: url('../fonts/py-jost-500.woff2') format('woff2'); font-weight: 500; font-display: block; }
@font-face { font-family: 'PY Poiret One'; src: url('../fonts/py-poiret-one-400.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'PY Courier Prime'; src: url('../fonts/py-courier-prime-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'PY Sacramento'; src: url('../fonts/py-sacramento-400.woff2') format('woff2'); font-weight: 400; font-display: block; }

:root {
  --py-ink: #3a3145;
  --py-muted: #8c81a0;
  --py-violet: #7a5ce0;
  --py-violet-dark: #6b4fa8;
  --py-magenta: #be47b8;
  --py-rose: #e0559a;
  --py-lilac: #cbb3e8;
  --py-lilac-soft: #efe8f8;
  --py-mist: #faf4f7;
  --py-blush: #e6dae4;
  --py-white: #ffffff;
  --py-grad: linear-gradient(95deg, var(--py-violet), var(--py-rose));
  --shadow-button: 0 4px 16px rgba(107, 79, 168, 0.22);
  --shadow-card: 0 20px 50px -34px rgba(90, 60, 140, 0.45);
  --radius-field: 14px;
  --radius-card: 24px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--py-mist);
  color: var(--py-ink);
  font: 400 16px/1.6 'PY Jost', system-ui, sans-serif;
}

h1, h2 {
  margin: 0;
  font-family: 'PY Poiret One', serif;
  font-weight: 700;
  line-height: 1.15;
}

h1 { font-size: 40px; }
h2 { font-size: 24px; margin-bottom: 16px; }

.page-header {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 8px;
}

.page-logo { width: 180px; height: auto; }

.overline {
  margin: 0;
  font-family: 'PY Sacramento', cursive;
  font-size: 30px;
  line-height: 1;
  color: var(--py-magenta);
}

.panel {
  background: var(--py-white);
  border: 1px solid var(--py-blush);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
  min-width: 0;
}

.button-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.file-actions { margin-top: 16px; }

.button-primary, .button-secondary {
  padding: 10px 22px;
  border-radius: 999px;
  font: 500 15px/1.2 'PY Jost', sans-serif;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.button-primary { width: 100%; border: 0; background: var(--py-grad); color: var(--py-white); box-shadow: var(--shadow-button); }
.button-primary:hover:not(:disabled) { filter: brightness(1.1) saturate(1.05); transform: translateY(-1px); }
.button-primary:disabled { opacity: 0.5; cursor: default; }

.button-secondary { border: 0; background: var(--py-white); color: var(--py-violet); box-shadow: inset 0 0 0 1px var(--py-lilac); }
.button-secondary:hover { color: var(--py-rose); box-shadow: inset 0 0 0 1px var(--py-rose); }

.button-link {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--py-violet);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.button-link:hover { color: var(--py-rose); }
.button-link.danger { color: var(--py-muted); }

button:focus-visible, label:focus-within > .button-link, .chip:focus-within span, .check:focus-within span { outline: 2px solid var(--py-violet); outline-offset: 3px; }

.hint { margin: 8px 0 0; font-size: 14px; color: var(--py-muted); text-align: center; }
.hint.left { text-align: left; }
.sync-status { margin: 0 0 0 auto; padding: 6px 12px; border-radius: 999px; font-size: 14px; color: var(--py-muted); background: var(--py-white); box-shadow: inset 0 0 0 1px var(--py-blush); }
.sync-status::before { content: '●'; margin-right: 6px; color: var(--py-lilac); }
.sync-status[data-kind='saved']::before { color: var(--py-violet); }
.sync-status[data-kind='saving']::before { color: var(--py-lilac); }
.sync-status[data-kind='offline']::before, .sync-status[data-kind='warning']::before { color: var(--py-rose); }
.sync-status[data-kind='error'] { color: var(--py-violet-dark); }
.sync-status[data-kind='error']::before { color: var(--py-rose); }
@media (max-width: 720px) { .sync-status { margin: 0; } }

@media (max-width: 720px) {
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .page-logo { width: 150px; }
  h1 { font-size: 32px; }
  .panel { padding: 16px; }
}

.home-link { color: inherit; text-decoration: none; }
.home-link:hover { color: var(--py-rose); }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

.tile { display: grid; gap: 6px; color: var(--py-ink); text-decoration: none; transition: transform 0.18s ease, border-color 0.18s ease; }
.tile:hover, .tile:focus-visible { border-color: var(--py-lilac); transform: translateY(-2px); outline: none; }
.tile-kind { font-family: 'PY Courier Prime', monospace; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--py-violet); }
.tile-title { font-family: 'PY Poiret One', serif; font-weight: 700; font-size: 26px; line-height: 1.15; }
.tile-text { color: var(--py-muted); font-size: 15px; }
