/* Cookanion design system ("réimaginé · système v2", from the Claude Design project).
   Linen paper (light) by default, Burnt (dark) when the device asks for it.
   Classes only: the CSP (`style-src 'self'`) blocks `style` attributes. */

/* ===== Fonts (self-hosted, SIL OFL 1.1, see fonts/LICENSE-*.txt) ===== */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Caveat";
  src: url("/fonts/caveat-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ===== Tokens ===== */

:root {
  color-scheme: light dark;

  --ck-font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ck-font-hand: "Caveat", "Segoe Script", cursive;
  --ck-font-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;

  --ck-r-xs: 6px;
  --ck-r-sm: 10px;
  --ck-r-md: 14px;
  --ck-r-lg: 20px;
  --ck-r-pill: 999px;

  /* Linen paper */
  --bg: #f4eee2;
  --bg-deep: #ece3d2;
  --surface: #fbf7ee;
  --surface-2: #f1e9d7;
  --line: #e1d5bd;
  --line-2: #c9b998;
  --ink: #1f1a12;
  --ink-2: #4b4131;
  --ink-3: #8a7a5f;
  --accent: #c0431f;
  --accent-2: #e96434;
  --accent-ink: #fff6ec;
  --sage: #2d6b5f;
  --shadow-1: 0 1px 0 rgba(31, 26, 18, 0.04), 0 4px 14px -8px rgba(31, 26, 18, 0.18);
  --paper-grain:
    radial-gradient(rgba(120, 90, 40, 0.05) 1px, transparent 1px) 0 0 / 3px 3px,
    radial-gradient(rgba(80, 60, 30, 0.04) 1px, transparent 1px) 1px 2px / 4px 4px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Burnt */
    --bg: #14110c;
    --bg-deep: #0d0a06;
    --surface: #1e1a13;
    --surface-2: #28221a;
    --line: #2f2820;
    --line-2: #463a2b;
    --ink: #f1e7d2;
    --ink-2: #b6a98e;
    --ink-3: #7a6d54;
    --accent: #e37449;
    --accent-2: #f08f5f;
    --accent-ink: #1a1107;
    --sage: #7cb4a1;
    --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.4), 0 8px 22px -12px rgba(0, 0, 0, 0.65);
    --paper-grain:
      radial-gradient(rgba(255, 210, 150, 0.025) 1px, transparent 1px) 0 0 / 3px 3px,
      radial-gradient(rgba(255, 200, 140, 0.018) 1px, transparent 1px) 1px 2px / 4px 4px;
  }
}

/* ===== Base ===== */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper-grain), var(--bg);
  color: var(--ink);
  font-family: var(--ck-font-sans);
  font-size: 1rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

h1,
h2,
p {
  margin: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 2.75rem;
  padding: 10px 18px;
  border-radius: var(--ck-r-pill);
  border: 1px solid transparent;
  font-family: var(--ck-font-sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.1px;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}

.btn.small {
  flex: none;
  min-height: 2.25rem;
  padding: 6px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--ck-r-pill);
  display: grid;
  place-items: center;
}

/* ===== Header ===== */

.header {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 40rem;
  margin: 0 auto;
  padding: 14px 20px 10px;
}

.wordmark {
  font-family: var(--ck-font-hand);
  font-weight: 700;
  font-size: 32px;
  line-height: 0.9;
  letter-spacing: -0.5px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark .accent {
  color: var(--accent);
}

.header .wordmark {
  margin-right: auto;
}

.member {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--ck-r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--ck-font-hand);
  font-size: 18px;
  color: var(--ink-2);
}

.member-name {
  font-family: var(--ck-font-hand);
  font-size: 19px;
  line-height: 1;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Pages ===== */

.page {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 8px 20px 32px;
}

.page-head {
  padding: 6px 0 4px;
}

.eyebrow {
  font-family: var(--ck-font-mono);
  font-size: 10px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--ink-3);
}

.page-title {
  font-family: var(--ck-font-sans);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.5px;
  line-height: 1;
  margin-top: 6px;
  color: var(--ink);
}

.page-sub {
  font-family: var(--ck-font-hand);
  font-size: 19px;
  line-height: 1;
  margin-top: 6px;
  color: var(--ink-3);
}

.status {
  padding: 12px 0;
  font-family: var(--ck-font-hand);
  font-size: 20px;
  color: var(--ink-3);
}

.empty {
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px dashed var(--line-2);
  border-radius: var(--ck-r-sm);
  font-family: var(--ck-font-hand);
  font-size: 19px;
  color: var(--ink-3);
}

.hand-link {
  font-family: var(--ck-font-hand);
  font-size: 19px;
  color: var(--accent);
  text-decoration: none;
}

.hand-link:hover {
  text-decoration: underline;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--ck-r-md);
  box-shadow: var(--shadow-1);
}

.error {
  margin: 16px 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--ck-r-md);
  color: var(--ink);
}

.error p {
  margin-bottom: 10px;
}

/* ===== Sign in ===== */

.login {
  max-width: 24rem;
  padding-top: 15vh;
}

.wordmark.large {
  font-size: 52px;
  letter-spacing: -1px;
}

.tagline {
  font-family: var(--ck-font-hand);
  font-size: 22px;
  line-height: 1;
  margin-top: 6px;
  color: var(--ink-3);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
  padding: 18px 16px;
}

.label {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-3);
}

.label + .field {
  margin-bottom: 6px;
}

.field {
  width: 100%;
  min-height: 2.75rem;
  padding: 10px 14px;
  border-radius: var(--ck-r-md);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}

.field:focus {
  border-color: var(--accent);
  outline: none;
}

.form-error {
  font-family: var(--ck-font-hand);
  font-size: 19px;
  line-height: 1.1;
  color: var(--accent);
}

.login-form .btn {
  margin-top: 8px;
  min-height: 3rem;
  font-size: 15px;
}

/* ===== Recipe list ===== */

.recipe-list {
  list-style: none;
  margin: 14px -8px 0;
  padding: 0;
}

.recipe-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: var(--ck-r-md);
  color: inherit;
  text-decoration: none;
}

.recipe-row:hover {
  background: var(--surface);
}

.thumb {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: var(--ck-r-sm);
}

.row-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.row-title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.1px;
  line-height: 1.15;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-author {
  font-family: var(--ck-font-hand);
  font-size: 17px;
  line-height: 1;
  color: var(--ink-2);
}

.row-date {
  flex: none;
  font-family: var(--ck-font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--ink-3);
}

/* ===== Recipe page ===== */

.hero {
  position: relative;
  display: block;
  margin: 4px 0 0;
  aspect-ratio: 16 / 11;
  border-radius: var(--ck-r-lg);
  overflow: hidden;
}

.hero-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 8, 4, 0.78) 0%, rgba(10, 8, 4, 0.2) 45%, transparent 75%);
}

.hero-back {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  background: rgba(20, 17, 12, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fbf7ee;
}

.hero-meta {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  color: #fbf7ee;
}

.hero-eyebrow {
  font-family: var(--ck-font-hand);
  font-size: 19px;
  line-height: 1;
  /* A lighter terracotta than --accent-2, which is hard to read over the red and brown
     placeholders (the design pairs it with darker food photos). */
  color: #f7c3a6;
}

.hero-title {
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.4px;
  line-height: 1.06;
  margin-top: 4px;
}

.hero-row {
  margin-top: 8px;
  font-family: var(--ck-font-mono);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 22px 0 6px;
}

.section-label h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink-3);
}

.section-label .more {
  font-family: var(--ck-font-hand);
  font-size: 17px;
  color: var(--accent);
}

.ingredients {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ing-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
}

.ing-row:last-child {
  border-bottom: none;
}

.qty {
  flex: 0 0 64px;
  font-family: var(--ck-font-mono);
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--accent);
}

.ing {
  flex: 1;
  font-size: 15px;
  color: var(--ink);
}

.note {
  font-family: var(--ck-font-hand);
  font-size: 18px;
  color: var(--ink-2);
}

.back {
  margin-top: 20px;
}

/* ===== Photo placeholders (until recipes have photos) ===== */

.ph {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #b1773a, #6b3a18);
}

.ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(150% 80% at 20% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    radial-gradient(80% 60% at 90% 100%, rgba(0, 0, 0, 0.35), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 6px);
}

.ph-choco { background: linear-gradient(135deg, #5b3a22, #2b1a10); }
.ph-fromage { background: linear-gradient(135deg, #e0b35e, #8a5a1e); }
.ph-viande { background: linear-gradient(135deg, #a8472b, #4a1c10); }
.ph-pates { background: linear-gradient(135deg, #e2b66c, #9e6c28); }
.ph-legume { background: linear-gradient(135deg, #708d3c, #2c3a14); }
.ph-boulang { background: linear-gradient(135deg, #c79154, #6b3d18); }
.ph-fruit { background: linear-gradient(135deg, #c7423c, #5e1718); }
.ph-creme { background: linear-gradient(135deg, #ddbf86, #846226); }

/* ===== Narrow phones: the header keeps the member's name readable ===== */

@media (max-width: 25rem) {
  .header {
    padding-left: 16px;
    padding-right: 16px;
  }

  .header .wordmark {
    font-size: 28px;
  }

  .header .avatar {
    display: none;
  }
}

/* ===== Wider screens ===== */

@media (min-width: 48rem) {
  .page-title {
    font-size: 34px;
  }

  .hero-title {
    font-size: 32px;
  }
}
