@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";
@import "@fontsource-variable/geist";

@custom-variant dark (&:is(.dark *));

/* Custom fonts */
@font-face {
  font-family: 'Cocogoose';
  src: url('/fonts/Cocogoose-Classic-Medium-trial.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geoform';
  src: url('/fonts/Geoform-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geoform';
  src: url('/fonts/Geoform.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@theme {
  /* Cachet brand palette — calibrated to logo */
  --color-brand-dark:    #314732;  /* Dark Green — primary headings, nav */
  --color-brand-mid:     #7a8876;  /* Light Green — accents, borders */
  --color-brand-light:   #f0f4ef;  /* Very light green tint — backgrounds */
  --color-brand-50:      #f0f4ef;
  --color-brand-100:     #d6e2d4;
  --color-brand-200:     #b8cdb5;
  --color-brand-300:     #97b393;
  --color-brand-400:     #7a8876;  /* Light Green */
  --color-brand-500:     #5a6e58;
  --color-brand-600:     #314732;  /* Dark Green — CTA buttons */
  --color-brand-700:     #263a27;  /* Hover state */
  --color-brand-800:     #1c2c1d;
  --color-brand-900:     #131f13;

  /* Neutral palette */
  --color-gray-light:    #b7b6b6;
  --color-gray-dark:     #444445;

  /* Typography */
  --font-display: 'Cocogoose', system-ui, sans-serif;
  --font-body:    'Geoform', system-ui, sans-serif;
  --font-sans:    'Geoform', system-ui, sans-serif;
}

/* Base layer */
@layer base {
  html {
    scroll-behavior: smooth;
    @apply font-sans;
  }

  body {
    font-family: var(--font-body);
    color: var(--color-gray-dark);
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    @apply bg-background text-foreground;
  }

  h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--color-brand-600);
    font-weight: 500;
    line-height: 1.15;
  }

  h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--color-brand-600);
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  img {
    max-width: 100%;
    height: auto;
  }
  * {
    @apply border-border outline-ring/50;
  }
}

/* Component layer */
@layer components {
  .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background-color: var(--color-brand-600);
    color: #ffffff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: background-color 0.2s ease, transform 0.1s ease;
    cursor: pointer;
    text-decoration: none;
  }

  .btn-primary:hover {
    background-color: var(--color-brand-700);
    transform: translateY(-1px);
  }

  .btn-primary:active {
    transform: translateY(0);
  }

  .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background-color: transparent;
    color: var(--color-brand-600);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    border-radius: 4px;
    border: 2px solid var(--color-brand-600);
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    text-decoration: none;
  }

  .btn-outline:hover {
    background-color: var(--color-brand-600);
    color: #ffffff;
  }

  .btn-outline-white {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background-color: transparent;
    color: #ffffff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    text-decoration: none;
  }

  .btn-outline-white:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
  }

  .section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--color-brand-600);
    font-weight: 500;
  }

  .section-subtitle {
    font-family: var(--font-body);
    font-size: 1.125rem;
    color: var(--color-gray-dark);
    opacity: 0.8;
    margin-top: 0.5rem;
  }

  .container-site {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .form-label {
    display: block;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--color-brand-600);
    margin-bottom: 0.375rem;
    letter-spacing: 0.02em;
  }

  .form-input {
    width: 100%;
    padding: 0.6875rem 1rem;
    border: 1.5px solid var(--color-brand-mid);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-gray-dark);
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
  }

  .form-input:focus {
    border-color: var(--color-brand-600);
    box-shadow: 0 0 0 3px rgba(49, 71, 50, 0.12);
  }

  .form-input::placeholder {
    color: var(--color-gray-light);
  }
}

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.809 0.105 251.813);
  --chart-2: oklch(0.623 0.214 259.815);
  --chart-3: oklch(0.546 0.245 262.881);
  --chart-4: oklch(0.488 0.243 264.376);
  --chart-5: oklch(0.424 0.199 265.638);
  --radius: 0.625rem;
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.809 0.105 251.813);
  --chart-2: oklch(0.623 0.214 259.815);
  --chart-3: oklch(0.546 0.245 262.881);
  --chart-4: oklch(0.488 0.243 264.376);
  --chart-5: oklch(0.424 0.199 265.638);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}

@theme inline {
  --font-sans: 'Geist Variable', sans-serif;
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --color-foreground: var(--foreground);
  --color-background: var(--background);
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
  --radius-3xl: calc(var(--radius) * 2.2);
  --radius-4xl: calc(var(--radius) * 2.6);
}