/* Sweetheart CSS
   A tiny cute UI framework for personal sites and hobby projects
   ------------------------------------------------------------- */

:root {
  --sh-font-sans: Arial, Helvetica, sans-serif;
  --sh-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --sh-bg: #fff7fb;
  --sh-surface: #ffffff;
  --sh-surface-soft: #fff0f6;
  --sh-surface-tint: #ffe3ef;

  --sh-text: #4f3140;
  --sh-text-soft: #7e6170;
  --sh-heading: #cf4f8b;

  --sh-primary: #ff6cab;
  --sh-primary-hover: #ef599a;
  --sh-primary-soft: #ffd4e5;
  --sh-secondary: #f8bfd1;
  --sh-border: #f6c7d9;
  --sh-focus: rgba(255, 108, 171, 0.25);

  --sh-success: #7bc47f;
  --sh-warning: #f3b25e;
  --sh-danger: #ee7a8d;
  --sh-info: #87c7ea;

  --sh-radius-xs: 8px;
  --sh-radius-sm: 12px;
  --sh-radius-md: 18px;
  --sh-radius-lg: 26px;
  --sh-radius-pill: 999px;

  --sh-shadow-xs: 0 2px 6px rgba(137, 81, 109, 0.08);
  --sh-shadow-sm: 0 8px 20px rgba(137, 81, 109, 0.1);
  --sh-shadow-md: 0 12px 30px rgba(137, 81, 109, 0.14);

  --sh-space-1: 0.25rem;
  --sh-space-2: 0.5rem;
  --sh-space-3: 0.75rem;
  --sh-space-4: 1rem;
  --sh-space-5: 1.5rem;
  --sh-space-6: 2rem;
  --sh-space-7: 3rem;

  --sh-container-sm: 720px;
  --sh-container-md: 960px;
  --sh-container-lg: 1200px;
}

/* Reset-ish */
* {
  box-sizing: border-box;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--sh-bg);
  color: var(--sh-text);
  font-family: var(--sh-font-sans);
}

img,
picture,
svg,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Base typography */
a {
  color: var(--sh-primary);
  text-decoration: none;
}

a:hover {
  color: var(--sh-primary-hover);
  text-decoration: underline;
}

p,
ul,
ol,
blockquote,
pre,
table {
  margin-top: 0;
  margin-bottom: var(--sh-space-4);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: var(--sh-space-3);
  color: var(--sh-heading);
  line-height: 1.15;
}

h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.3rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
h5,
h6 { font-size: 1rem; }

small,
.sh-text-soft {
  color: var(--sh-text-soft);
}

code,
kbd,
samp,
pre {
  font-family: var(--sh-font-mono);
}

/* Layout */
.sh-container,
.sh-container-md,
.sh-container-sm,
.sh-container-lg {
  width: min(100% - 2rem, var(--sh-container-md));
  margin-inline: auto;
}

.sh-container-sm { max-width: var(--sh-container-sm); }
.sh-container-md { max-width: var(--sh-container-md); }
.sh-container-lg { max-width: var(--sh-container-lg); }

.sh-section {
  padding-block: var(--sh-space-6);
}

.sh-stack > * + * {
  margin-top: var(--sh-space-4);
}

.sh-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sh-space-3);
  align-items: center;
}

.sh-grid {
  display: grid;
  gap: var(--sh-space-4);
}

.sh-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sh-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sh-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 820px) {
  .sh-grid-2,
  .sh-grid-3,
  .sh-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Surfaces */
.sh-card,
.sh-panel,
.sh-box {
  background: var(--sh-surface);
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius-md);
  box-shadow: var(--sh-shadow-sm);
}

.sh-card,
.sh-panel {
  padding: var(--sh-space-5);
}

.sh-panel-soft {
  background: var(--sh-surface-soft);
}

.sh-inset {
  background: var(--sh-surface-tint);
  border-radius: var(--sh-radius-sm);
  padding: var(--sh-space-4);
}

/* Navigation */
.sh-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sh-space-2);
  align-items: center;
}

.sh-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.65rem 1rem;
  background: var(--sh-surface);
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius-pill);
  box-shadow: var(--sh-shadow-xs);
  color: var(--sh-text);
  font-weight: 700;
  text-decoration: none;
}

.sh-nav a:hover,
.sh-nav a[aria-current="page"] {
  background: var(--sh-primary-soft);
  border-color: #f2a7c4;
  color: #9d3566;
}

/* Buttons */
.sh-btn,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--sh-radius-pill);
  background: var(--sh-primary);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.sh-btn:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  background: var(--sh-primary-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.sh-btn:focus-visible,
button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible,
.sh-input:focus,
.sh-select:focus,
.sh-textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--sh-focus);
  outline-offset: 2px;
}

.sh-btn-secondary {
  background: var(--sh-secondary);
  color: #8d335d;
}

.sh-btn-secondary:hover {
  background: #f5adc3;
  color: #7e2e54;
}

.sh-btn-ghost {
  background: transparent;
  border-color: var(--sh-border);
  color: var(--sh-primary-hover);
}

.sh-btn-ghost:hover {
  background: var(--sh-primary-soft);
}

/* Forms */
.sh-label {
  display: inline-block;
  margin-bottom: var(--sh-space-2);
  color: var(--sh-heading);
  font-weight: 700;
}

.sh-input,
.sh-select,
.sh-textarea,
input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius-sm);
  background: #fff;
  color: var(--sh-text);
  box-shadow: inset 0 1px 2px rgba(122, 77, 99, 0.04);
}

.sh-textarea,
textarea {
  min-height: 8rem;
  resize: vertical;
}

.sh-field {
  margin-bottom: var(--sh-space-4);
}

/* Tables */
.sh-table-wrap {
  overflow-x: auto;
}

table,
.sh-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--sh-surface);
  border-radius: var(--sh-radius-sm);
  overflow: hidden;
}

th,
td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #f6d8e4;
  text-align: left;
}

th {
  background: var(--sh-primary);
  color: #fff;
}

tr:nth-child(even) td {
  background: #fff7fb;
}

/* Alerts / badges */
.sh-alert {
  padding: 0.95rem 1rem;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius-sm);
  background: var(--sh-surface-soft);
}

.sh-alert-info {
  background: #eef8fe;
  border-color: #c5e6f6;
}

.sh-alert-success {
  background: #eef9ee;
  border-color: #cdebcf;
}

.sh-alert-warning {
  background: #fff8ec;
  border-color: #f8deaa;
}

.sh-alert-danger {
  background: #fff0f3;
  border-color: #f3c3cd;
}

.sh-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--sh-radius-pill);
  background: var(--sh-primary-soft);
  color: #98365f;
  font-size: 0.9rem;
  font-weight: 700;
}

/* Hero */
.sh-hero {
  padding: var(--sh-space-6);
  background: linear-gradient(135deg, #ff9fc7, #ffd3e3);
  border: 1px solid #f7b7d1;
  border-radius: var(--sh-radius-lg);
  box-shadow: var(--sh-shadow-md);
  color: #fff;
}

.sh-hero h1,
.sh-hero h2,
.sh-hero h3,
.sh-hero p,
.sh-hero a {
  color: inherit;
}

/* Utilities */
.sh-text-center { text-align: center; }
.sh-text-left { text-align: left; }
.sh-text-right { text-align: right; }
.sh-rounded-sm { border-radius: var(--sh-radius-sm); }
.sh-rounded-md { border-radius: var(--sh-radius-md); }
.sh-rounded-lg { border-radius: var(--sh-radius-lg); }
.sh-shadow-none { box-shadow: none; }
.sh-shadow-sm { box-shadow: var(--sh-shadow-sm); }
.sh-shadow-md { box-shadow: var(--sh-shadow-md); }
.sh-bg-surface { background: var(--sh-surface); }
.sh-bg-soft { background: var(--sh-surface-soft); }
.sh-bg-tint { background: var(--sh-surface-tint); }
.sh-m-0 { margin: 0; }
.sh-mt-0 { margin-top: 0; }
.sh-mt-4 { margin-top: var(--sh-space-4); }
.sh-mb-0 { margin-bottom: 0; }
.sh-mb-4 { margin-bottom: var(--sh-space-4); }
.sh-p-0 { padding: 0; }
.sh-p-4 { padding: var(--sh-space-4); }
.sh-p-5 { padding: var(--sh-space-5); }
.sh-w-full { width: 100%; }

/* Optional cute extras */
.sh-dotted {
  border-style: dashed;
}

.sh-floaty:hover {
  transform: translateY(-2px);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
