/* theme.css — Design tokens for "Carnet de bord" portfolio
   Light mode  : warm cream notebook, terra cuita ink, mustard highlights.
   Dark mode   : warm bogolan brown background, cream ink, glowing terra.
   No cold blacks — every dark surface keeps a clay/terra tint. */

:root {
  /* ─── Light mode (default) ─── */
  --bg:          #f5ecd6;            /* warm cream paper */
  --bg-soft:     #efe2bf;            /* slightly deeper paper for cards */
  --bg-elevated: #fffaf0;            /* white card */
  --ink:         #1f1410;            /* warm dark brown text */
  --ink-soft:    #4a342a;            /* secondary text */
  --ink-mute:    #7a5a48;            /* tertiary, captions */
  --rule:        rgba(31, 20, 16, 0.18);
  --rule-soft:   rgba(31, 20, 16, 0.10);

  --terra:       #a8482a;            /* primary accent — bogolan terra */
  --terra-soft:  #c46444;
  --terra-tint:  rgba(168, 72, 42, 0.10);

  --mustard:     #cf9a2e;            /* secondary accent */
  --mustard-tint:rgba(207, 154, 46, 0.18);

  --indigo:      #37486b;            /* cool accent */
  --leaf:        #6f8a4e;            /* green accent */
  --tape:        rgba(255, 219, 110, 0.55); /* taped sticker effect */

  /* Terminal colors — bogolan inspired warm dark palette */
  --term-bg:     #1c1310;
  --term-bg-2:   #261813;
  --term-fg:     #f1d99c;            /* warm cream */
  --term-cmd:    #f4b343;            /* mustard / amber */
  --term-accent: #e58247;            /* terra glow */
  --term-user:   #fff3d9;            /* user text */
  --term-dim:    #8a6750;
  --term-edge:   rgba(241, 217, 156, 0.15);

  --shadow-soft: 0 2px 6px rgba(31, 20, 16, 0.06);
  --shadow-card: 0 6px 24px rgba(31, 20, 16, 0.08), 0 1px 3px rgba(31, 20, 16, 0.06);
  --shadow-pop:  0 16px 48px rgba(31, 20, 16, 0.14), 0 2px 6px rgba(31, 20, 16, 0.08);

  --radius-xs: 4px;
  --radius-s:  8px;
  --radius-m:  14px;
  --radius-l:  22px;
  --radius-xl: 32px;
}

[data-theme="dark"] {
  --bg:          #1a110d;            /* deep clay brown */
  --bg-soft:     #221813;
  --bg-elevated: #2c1f18;            /* warm dark card */
  --ink:         #f1e3c8;            /* warm cream text */
  --ink-soft:    #d8c4a0;
  --ink-mute:    #a48a6b;
  --rule:        rgba(241, 227, 200, 0.18);
  --rule-soft:   rgba(241, 227, 200, 0.10);

  --terra:       #e58247;            /* brighter, glows in dark */
  --terra-soft:  #f29b62;
  --terra-tint:  rgba(229, 130, 71, 0.16);

  --mustard:     #e6b549;
  --mustard-tint:rgba(230, 181, 73, 0.20);

  --indigo:      #7a9bd0;
  --leaf:        #a3c47e;
  --tape:        rgba(230, 181, 73, 0.35);

  --term-bg:     #110a08;
  --term-bg-2:   #1d130e;
  --term-fg:     #f6e2b3;
  --term-cmd:    #f8c25a;
  --term-accent: #ff9a5c;
  --term-user:   #fff3d9;
  --term-dim:    #8a6750;
  --term-edge:   rgba(246, 226, 179, 0.18);

  --shadow-soft: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-pop:  0 16px 48px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* ─── Base ─── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  transition: background 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Decorative ruled paper background — visible in light, fades in dark */
.paper-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 35px, var(--rule-soft) 35px 36px);
  opacity: 0.6;
}
[data-theme="dark"] .paper-bg { opacity: 0.18; }

/* Notebook margin line */
.paper-bg::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 92px;
  width: 1px; background: var(--terra); opacity: 0.25;
}

/* Typography utilities */
.hand { font-family: 'Caveat', 'Patrick Hand', cursive; font-weight: 700; line-height: 1; }
.serif { font-family: 'Fraunces', Georgia, serif; }
.mono { font-family: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace; }

.kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terra);
  display: inline-flex; align-items: center; gap: 8px;
}
.kicker::before {
  content: ''; width: 22px; height: 1.5px; background: var(--terra);
}

.section-title { font-family: 'Caveat', cursive; font-weight: 700; line-height: 1; font-size: clamp(36px, 4.5vw, 60px); margin: 8px 0 28px; letter-spacing: -0.01em; }

/* CTA buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px; font-weight: 500; line-height: 1;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none; transition: transform 0.15s, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--terra); border-color: var(--terra); color: #fff8e8; }
.btn.primary:hover { background: var(--terra-soft); border-color: var(--terra-soft); color: #fff8e8; }
.btn.ghost { border-color: var(--rule); }
.btn.ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Tape sticker */
.tape {
  position: absolute; height: 18px; background: var(--tape);
  box-shadow: 1px 2px 0 rgba(0,0,0,0.08);
}

/* Card */
.card {
  background: var(--bg-elevated);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
}

/* Chip */
.chip {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: transparent; color: var(--ink);
}
.chip.soft { border-color: var(--rule); color: var(--ink-soft); }

/* Section layout */
.section { padding: 80px 96px; position: relative; }
@media (max-width: 1100px) { .section { padding: 60px 48px; } }
@media (max-width: 720px)  { .section { padding: 44px 20px; } }

/* Fade-in on scroll (kept subtle; default is visible) */
.reveal { opacity: 1; transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal-pending { opacity: 0; transform: translateY(20px); }
.reveal-pending.in { opacity: 1; transform: translateY(0); }

/* Animations */
@keyframes float-slow { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(3deg); } }
@keyframes float-fast { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-5deg); } }
@keyframes spin-slow  { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes pulse      { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: 0.85; } }
@keyframes blink      { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes draw       { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes scribble   { 0% { stroke-dashoffset: 200; } 60% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; } }

.f-float     { animation: float-slow 6s ease-in-out infinite; }
.f-float-fast{ animation: float-fast 4.5s ease-in-out infinite; }
.f-spin      { animation: spin-slow 24s linear infinite; transform-origin: center; }
.f-pulse     { animation: pulse 3s ease-in-out infinite; }
.f-blink     { animation: blink 1s steps(1) infinite; }

/* Link underline (handwritten wavy) */
.link-wavy {
  color: var(--terra); text-decoration: none; position: relative;
  background-image: linear-gradient(90deg, var(--terra), var(--terra));
  background-position: 0 100%; background-size: 100% 1.5px; background-repeat: no-repeat;
}
.link-wavy:hover { background-size: 100% 2.5px; }

/* Focus visible */
:focus-visible { outline: 2px solid var(--terra); outline-offset: 3px; border-radius: 4px; }

/* Selection */
::selection { background: var(--mustard); color: var(--ink); }

/* Scrollbar hint */
html { scrollbar-color: var(--terra) var(--bg-soft); scrollbar-width: thin; }
