/* RiceIsLife — Design System
   Inspired by Japanese aesthetics: Ma (間) — negative space, stillness, clarity
*/

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600&family=Syne:wght@400;600;700&display=swap');

/* ── Custom properties ─────────────────────────────────────── */
:root {
  --ink:       #1c1917;
  --ink-2:     #44403c;
  --ink-3:     #a8a29e;
  --paper:     #f7f5f2;
  --paper-2:   #efece8;
  --paper-3:   #e5e0d8;
  --red:       #b5281c;   /* torii red, muted */
  --red-soft:  #e8d5d2;
  --gold:      #c9a96e;
  --gold-soft: #f0e6d3;

  /* Dark equivalents */
  --dark-bg:   #111110;
  --dark-2:    #1c1b1a;
  --dark-3:    #2a2926;
  --dark-ink:  #e8e4de;
  --dark-ink-2:#a8a29e;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* ── Zen background ─────────────────────────────────────────── */
/*  Light: warm off-white, very subtle washi paper grain        */
.bg-zen {
  background-color: var(--paper);
  background-image:
    /* Très subtil grain */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/*  Dark: deep charcoal, almost sumi ink                        */
.dark .bg-zen {
  background-color: var(--dark-bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ── Typographie ────────────────────────────────────────────── */
.font-display {
  font-family: 'Syne', sans-serif;
  letter-spacing: -0.02em;
}

.text-xs   { font-size: 0.7rem;  line-height: 1.5; }
.text-sm   { font-size: 0.825rem; line-height: 1.6; }
.text-base { font-size: 1rem;    line-height: 1.75; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; letter-spacing: -0.01em; }
.text-3xl  { font-size: 1.875rem; letter-spacing: -0.02em; }
.text-4xl  { font-size: 2.25rem; letter-spacing: -0.025em; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--paper-3);
  border-radius: 3px;
}
.dark ::-webkit-scrollbar-thumb { background: var(--dark-3); }

/* ── Recipe card ────────────────────────────────────────────── */
.recipe-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}
.recipe-card:hover {
  transform: translateY(-3px);
}

/* ── Zen divider — thin brushstroke feel ───────────────────── */
.divider-zen {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0.4;
  border: none;
  margin: 0;
}
.dark .divider-zen {
  opacity: 0.2;
}

/* ── Step number ────────────────────────────────────────────── */
.step-number {
  font-family: 'Syne', sans-serif;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Placeholder image ──────────────────────────────────────── */
.placeholder-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-2);
  font-size: 3.5rem;
}
.dark .placeholder-image {
  background: var(--dark-3);
}

/* ── Skeleton loading ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 50%, var(--paper-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease infinite;
  border-radius: 6px;
}
.dark .skeleton {
  background: linear-gradient(90deg, var(--dark-2) 25%, var(--dark-3) 50%, var(--dark-2) 75%);
  background-size: 200% 100%;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Fade-in ────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-up {
  animation: fadeUp 0.35s ease forwards;
}

/* ── Focus ──────────────────────────────────────────────────── */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}
.dark button:focus-visible,
.dark a:focus-visible,
.dark input:focus-visible {
  outline-color: var(--gold);
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  body { background: white !important; color: black !important; }
}
