/* 
  Hand-Drawn Design System - Global CSS
  Based on the "Hand-Drawn" Design Style Guide
*/

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Patrick+Hand&display=swap');

:root {
  /* --- Design Tokens --- */

  /* Colors (Single Palette - Light Mode) */
  --color-paper: #fdfbf7;        /* Warm Paper Background */
  --color-pencil: #2d2d2d;       /* Soft Pencil Black Foreground */
  --color-muted: #e5e0d8;        /* Old Paper / Erased Pencil */
  --color-accent: #ff4d4d;       /* Red Correction Marker */
  --color-secondary: #2d5da1;    /* Blue Ballpoint Pen */
  --color-postit: #fff9c4;       /* Post-it Yellow */
  --color-white: #ffffff;        /* Pure White */

  /* Typography */
  --font-heading: 'Kalam', cursive;
  --font-body: 'Patrick Hand', cursive;

  /* Font Weights */
  --fw-regular: 400;
  --fw-bold: 700;

  /* Font Sizes */
  --fs-display: 4.5rem;   /* ~72px */
  --fs-h1: 3.5rem;        /* ~56px */
  --fs-h2: 2.5rem;        /* ~40px */
  --fs-h3: 2rem;          /* ~32px */
  --fs-body-lg: 1.25rem;  /* ~20px */
  --fs-body: 1.125rem;    /* ~18px */
  --fs-small: 1rem;       /* ~16px */

  /* Borders & Radius */
  --border-width: 3px;
  --border-width-thick: 4px;
  /* Wobbly Radius Variables (to be used in combinations) */
  --radius-wobbly-1: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --radius-wobbly-2: 20px 225px 20px 225px / 225px 20px 225px 20px;
  --radius-wobbly-3: 15px 225px 15px 255px / 255px 15px 225px 15px;
  
  /* Shadows (Hard Offset, No Blur) */
  --shadow-base: 4px 4px 0px 0px var(--color-pencil);
  --shadow-hover: 2px 2px 0px 0px var(--color-pencil);
  --shadow-deep: 8px 8px 0px 0px var(--color-pencil);
  --shadow-none: 0px 0px 0px 0px transparent;

  /* Transitions */
  --transition-snappy: all 100ms ease-in-out;
  
  /* Spacing */
  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-4: 1rem;
  --spacing-6: 1.5rem;
  --spacing-8: 2rem;
  --spacing-12: 3rem;
  --spacing-16: 4rem;
}

/* --- Global Reset & Base Styles --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-paper);
  color: var(--color-pencil);
  line-height: 1.6;
  font-size: var(--fs-body);
  
  /* Authentic Texture: Dot Pattern */
  background-image: radial-gradient(var(--color-muted) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow-x: hidden;
}

/* --- Typography Utilities --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  margin-bottom: var(--spacing-4);
  /* Playful Rotation for headings */
  transform: rotate(-1deg);
  display: inline-block; /* Allows transform to work properly */
}

h1 { font-size: var(--fs-h1); transform: rotate(-2deg); }
h2 { font-size: var(--fs-h2); transform: rotate(1deg); }
h3 { font-size: var(--fs-h3); }

p {
  margin-bottom: var(--spacing-4);
  max-width: 65ch;
}

.marker-highlight {
  position: relative;
  z-index: 1;
}

.marker-highlight::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -0.2em;
  right: -0.2em;
  bottom: 0.1em;
  background-color: var(--color-postit); /* Highlighter yellow/post-it */
  opacity: 0.6;
  z-index: -1;
  transform: rotate(-1deg) skewX(-10deg);
  border-radius: 4px;
}

/* --- Layout Containers --- */
.container {
  max-width: 1024px; /* max-w-5xl */
  margin: 0 auto;
  padding: 0 var(--spacing-6);
}

.section {
  padding: var(--spacing-16) 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-8);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-8);
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* --- Components --- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--fs-body-lg);
  color: var(--color-pencil);
  background-color: var(--color-white);
  border: var(--border-width) solid var(--color-pencil);
  /* Irregular wobbly oval */
  border-radius: var(--radius-wobbly-1); 
  box-shadow: var(--shadow-base);
  cursor: pointer;
  transition: var(--transition-snappy);
  text-decoration: none;
  transform: rotate(-1deg);
}

.btn:hover {
  background-color: var(--color-accent);
  color: var(--color-white);
  box-shadow: var(--shadow-hover);
  transform: translate(2px, 2px) rotate(0deg);
}

.btn:active {
  box-shadow: var(--shadow-none);
  transform: translate(4px, 4px) rotate(1deg);
}

.btn-secondary {
  background-color: var(--color-muted);
}

.btn-secondary:hover {
  background-color: var(--color-secondary);
  color: var(--color-white);
}

/* Cards */
.card {
  background-color: var(--color-white);
  border: var(--border-width) solid var(--color-pencil);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; /* wobblyMd equivalent */
  padding: var(--spacing-8);
  box-shadow: 3px 3px 0px 0px rgba(45, 45, 45, 0.1);
  position: relative;
  transition: var(--transition-snappy);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: rotate(1deg);
  box-shadow: var(--shadow-base);
}

.card-postit {
  background-color: var(--color-postit);
  transform: rotate(2deg);
}

.card-postit:hover {
  transform: rotate(0deg);
}

/* Inputs */
.input-group {
  margin-bottom: var(--spacing-4);
}

.label {
  display: block;
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--fs-body);
  margin-bottom: var(--spacing-2);
}

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  background-color: var(--color-white);
  border: var(--border-width) solid var(--color-pencil);
  /* Wobbly border for input */
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  outline: none;
  transition: var(--transition-snappy);
}

.input:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 2px rgba(45, 93, 161, 0.2);
  transform: scale(1.01);
}

/* Decoration Elements */
.tape {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 100px;
  height: 30px;
  background-color: rgba(255, 255, 255, 0.4);
  border-left: 1px dashed rgba(0,0,0,0.1);
  border-right: 1px dashed rgba(0,0,0,0.1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  z-index: 10;
  backdrop-filter: blur(2px); /* Makes it look like tape */
}

.thumbtack {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background-color: var(--color-accent);
  border-radius: 50%;
  border: 2px solid var(--color-pencil);
  box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
  z-index: 10;
}

/* Scribbles & Lines */
.divider-dashed {
  border: 0;
  border-bottom: 3px dashed var(--color-pencil);
  margin: var(--spacing-8) 0;
  opacity: 0.3;
  transform: rotate(-0.5deg);
}

.arrow-doodle {
  width: 60px;
  height: 40px;
  border-bottom: 3px solid var(--color-pencil);
  border-right: 3px solid var(--color-pencil);
  transform: rotate(45deg);
  display: inline-block;
}

/* Utilities */
.rotate-1 { transform: rotate(1deg); }
.rotate-2 { transform: rotate(2deg); }
.rotate-neg-1 { transform: rotate(-1deg); }
.rotate-neg-2 { transform: rotate(-2deg); }

.text-accent { color: var(--color-accent); }
.text-secondary { color: var(--color-secondary); }

.speech-bubble {
  position: relative;
}
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 2rem;
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 15px solid var(--color-pencil); /* Outer border color */
  transform: rotate(-10deg);
}
.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -9px; /* adjust based on border width */
  left: 2.2rem;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid var(--color-white); /* Inner color matches card bg */
  transform: rotate(-10deg);
  z-index: 1;
}

/* Footer specific */
footer a {
  color: var(--color-pencil);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: var(--transition-snappy);
}
footer a:hover {
  border-bottom: 2px solid var(--color-accent); /* Line-through or underline effect */
  text-decoration-color: var(--color-accent);
}
