/* Shared foundations for every part of "Ma vie" (the main site, Voyages, Tableau noir).
   Apple's own font (SF Pro, official file from Apple, personal use) and Apple's system colours (light). */

@font-face {
  font-family: 'SF Pro';
  src: url('/fonts/sf-pro.woff2') format('woff2-variations'), url('/fonts/sf-pro.woff2') format('woff2');
  font-weight: 100 1000;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SF Pro';
  src: url('/fonts/sf-pro-italic.woff2') format('woff2-variations'), url('/fonts/sf-pro-italic.woff2') format('woff2');
  font-weight: 100 1000;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font: 'SF Pro', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --mono: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;

  /* text */
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --label-3: #86868b;
  --label-4: #aeaeb2;

  /* surfaces */
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --bg-3: #ebebef;
  --sidebar: #f0f0f3;
  --separator: rgba(60, 60, 67, 0.16);
  --separator-strong: rgba(60, 60, 67, 0.26);
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.08);
  --fill-3: rgba(120, 120, 128, 0.2);

  /* Apple system colours */
  --blue: #007aff;
  --blue-text: #0066cc;
  --red: #ff3b30;
  --red-text: #d70015;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --green: #34c759;
  --green-text: #248a3d;
  --mint: #00c7be;
  --teal: #30b0c7;
  --cyan: #32ade6;
  --indigo: #5856d6;
  --purple: #af52de;
  --pink: #ff2d55;
  --brown: #a2845e;
  --notes: #e5a800;
  --notes-select: #fde58a;

  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 14px;
  --radius-xl: 20px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 1px rgba(0, 0, 0, 0.04);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.12);

  /* surfaces for controls, cards, menus (redefined in dark) */
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-hover: #fafafa;
  --surface-press: #f0f0f0;
  --popover-bg: rgba(250, 250, 252, 0.94);
  --glass: rgba(255, 255, 255, 0.8);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --scrim: rgba(0, 0, 0, 0.22);
  --note-paper: #fffbea;
  --note-ink: #8a7440;
  --placeholder-wash: #f7f7f9;
  --shadow-color: 0, 0, 0;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.36, 0.64, 1);
}

/* Dark: Apple's dark system colours. Set by the shell on <html data-theme="dark">. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --label: #f5f5f7;
  --label-2: #a1a1a6;
  --label-3: #86868b;
  --label-4: #636366;

  --bg: #1c1c1e;
  --bg-2: #242426;
  --bg-3: #2c2c2e;
  --sidebar: #232325;
  --separator: rgba(255, 255, 255, 0.1);
  --separator-strong: rgba(255, 255, 255, 0.16);
  --fill: rgba(120, 120, 128, 0.24);
  --fill-2: rgba(120, 120, 128, 0.16);
  --fill-3: rgba(120, 120, 128, 0.32);

  --blue: #0a84ff;
  --blue-text: #4da3ff;
  --red: #ff453a;
  --red-text: #ff6961;
  --orange: #ff9f0a;
  --yellow: #ffd60a;
  --green: #30d158;
  --green-text: #4cd964;
  --mint: #63e6e2;
  --teal: #40c8e0;
  --cyan: #64d2ff;
  --indigo: #5e5ce6;
  --purple: #bf5af2;
  --pink: #ff375f;
  --brown: #ac8e68;
  --notes: #ffd60a;
  --notes-select: #5c4b12;

  --surface: #2c2c2e;
  --surface-2: #1f1f21;
  --surface-hover: #323234;
  --surface-press: #3a3a3c;
  --popover-bg: rgba(44, 44, 46, 0.94);
  --glass: rgba(40, 40, 42, 0.78);
  --glass-strong: rgba(48, 48, 50, 0.92);
  --scrim: rgba(0, 0, 0, 0.5);
  --note-paper: #2a2617;
  --note-ink: #c9b46a;
  --placeholder-wash: #232325;
  --shadow-color: 0, 0, 0;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 0 0.5px rgba(255, 255, 255, 0.12);
}
:root[data-theme='dark'] ::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.22);
}
:root[data-theme='dark'] ::selection {
  background: rgba(10, 132, 255, 0.4);
}

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

html {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

body {
  margin: 0;
  background: var(--bg);
}

::selection {
  background: rgba(0, 122, 255, 0.22);
}

:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.45);
  outline-offset: 1px;
  border-radius: 6px;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.22);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.36);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* Apple Color Emoji, drawn from Apple's own images */
img.emoji {
  width: 1.18em;
  height: 1.18em;
  vertical-align: -0.22em;
  margin: 0 0.04em;
  display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
