/* ==========================================================================
   1. DESIGN SYSTEM & VARIABLES (Tailwind v4 + Custom)
   ========================================================================== */
:root {
  /* Theme Fonts */
  --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --default-font-family: var(--font-sans);
  --default-mono-font-family: var(--font-mono);

  /* Color Palette (Oklch & Hex) */
  --color-red-50: oklch(97.1% 0.013 17.38);
  --color-red-200: oklch(88.5% 0.062 18.334);
  --color-red-700: oklch(50.5% 0.213 27.518);
  --color-blue-600: oklch(54.6% 0.245 262.881);
  --color-gray-300: oklch(87.2% 0.01 258.338);
  --color-gray-400: oklch(70.7% 0.022 261.325);
  --color-gray-500: oklch(55.1% 0.027 264.364);
  --color-gray-600: oklch(44.6% 0.03 256.802);
  --color-gray-700: oklch(37.3% 0.034 259.733);
  --color-gray-800: oklch(27.8% 0.033 256.848);
  --color-white: #fff;
  
  /* Custom Brand Colors */
  --color-brand: #dfeeff;
  --color-brand-dark: #b8d9ff;
  --color-accent: #ff8fa3;
  --color-accent-dark: #e5617a;

  /* Layout & Sizing */
  --spacing: 0.25rem;
  --container-xs: 20rem;
  --container-sm: 24rem;
  --container-md: 28rem;
  --container-lg: 32rem;
  --container-2xl: 42rem;
  --container-4xl: 56rem;
  --container-5xl: 64rem;
  --container-6xl: 72rem;

  /* Typography Sizes & Line Heights */
  --text-xs: 0.75rem;
  --text-xs--line-height: calc(1 / 0.75);
  --text-sm: 0.875rem;
  --text-sm--line-height: calc(1.25 / 0.875);
  --text-base: 1rem;
  --text-base--line-height: 1.5;
  --text-lg: 1.125rem;
  --text-lg--line-height: calc(1.75 / 1.125);
  --text-xl: 1.25rem;
  --text-xl--line-height: calc(1.75 / 1.25);
  --text-2xl: 1.5rem;
  --text-2xl--line-height: calc(2 / 1.5);
  --text-3xl: 1.875rem;
  --text-3xl--line-height: 1.2;
  --text-4xl: 2.25rem;
  --text-4xl--line-height: calc(2.5 / 2.25);
  --text-5xl: 3rem;
  --text-5xl--line-height: 1;
  --text-6xl: 3.75rem;
  --text-6xl--line-height: 1;

  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  --leading-tight: 1.25;
  --leading-relaxed: 1.625;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;

  /* Transitions */
  --default-transition-duration: 0.15s;
  --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. CSS HOUDINI PROPERTIES (Fixed & Structured)
   ========================================================================== */
@property --tw-scale-x { syntax: "<number> | <percentage>"; inherits: false; initial-value: 100%; }
@property --tw-scale-y { syntax: "<number> | <percentage>"; inherits: false; initial-value: 100%; }
@property --tw-scale-z { syntax: "<number> | <percentage>"; inherits: false; initial-value: 100%; }
@property --tw-border-style { syntax: "*"; inherits: false; initial-value: solid; }
@property --tw-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
@property --tw-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
@property --tw-inset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
@property --tw-inset-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
@property --tw-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
@property --tw-inset-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
@property --tw-ring-offset-width { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --tw-ring-offset-color { syntax: "*"; inherits: false; initial-value: #fff; }
@property --tw-ring-offset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
@property --tw-outline-style { syntax: "*"; inherits: false; initial-value: solid; }
@property --tw-drop-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }

/* ==========================================================================
   3. BASE / RESET STYLES
   ========================================================================== */
*, ::after, ::before, ::backdrop {
  box-sizing: border-box;
  border: 0 solid;
  margin: 0;
  padding: 0;
}

body {
  -webkit-font-smoothing: antialiased;
  color: #2d2d2d;
  background-color: #fafcff;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, :host {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  line-height: 1.5;
  font-family: var(--default-font-family);
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: bolder; }
ol, ul, menu { list-style: none; }
hr { height: 0; color: inherit; border-top-width: 1px; }

img, svg, video, canvas, audio, iframe, embed, object {
  vertical-align: middle;
  display: block;
}
img, video { max-width: 100%; height: auto; }

code, kbd, samp, pre {
  font-family: var(--default-mono-font-family);
  font-size: 1em;
}

/* Forms & Buttons */
button, input, select, optgroup, textarea, ::file-selector-button {
  font: inherit;
  color: inherit;
  background-color: transparent;
  border-radius: 0;
}

button, input:where([type=button],[type=reset],[type=submit]), ::file-selector-button {
  appearance: button;
}

::placeholder { opacity: 1; color: currentColor; }
@supports (color: color-mix(in lab, red, red)) {
  ::placeholder { color: color-mix(in oklab, currentcolor 50%, transparent); }
}

textarea { resize: vertical; }
[hidden]:where(:not([hidden=until-found])) { display: none !important; }

/* ==========================================================================
   4. UTILITY CLASSES
   ========================================================================== */
/* Display & Position */
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.table { display: table; }

.fixed { position: fixed; }
.static { position: static; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.start { inset-inline-start: var(--spacing); }
.top-0 { top: 0; }
.z-50 { z-index: 50; }

/* Flexbox / Grid Alignments */
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

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

/* Spacing (Gaps, Margins, Paddings) */
.gap-1 { gap: calc(var(--spacing) * 1); }
.gap-2 { gap: calc(var(--spacing) * 2); }
.gap-3 { gap: calc(var(--spacing) * 3); }
.gap-4 { gap: calc(var(--spacing) * 4); }
.gap-6 { gap: calc(var(--spacing) * 6); }
.gap-8 { gap: calc(var(--spacing) * 8); }

.mx-auto { margin-inline: auto; }
.mt-0\.5 { margin-top: calc(var(--spacing) * 0.5); }
.mt-1 { margin-top: calc(var(--spacing) * 1); }
.mt-2 { margin-top: calc(var(--spacing) * 2); }
.mt-3 { margin-top: calc(var(--spacing) * 3); }
.mt-4 { margin-top: calc(var(--spacing) * 4); }
.mt-16 { margin-top: calc(var(--spacing) * 16); }

.mb-0\.5 { margin-bottom: calc(var(--spacing) * 0.5); }
.mb-1 { margin-bottom: calc(var(--spacing) * 1); }
.mb-2 { margin-bottom: calc(var(--spacing) * 2); }
.mb-3 { margin-bottom: calc(var(--spacing) * 3); }
.mb-4 { margin-bottom: calc(var(--spacing) * 4); }
.mb-5 { margin-bottom: calc(var(--spacing) * 5); }
.mb-6 { margin-bottom: calc(var(--spacing) * 6); }
.mb-8 { margin-bottom: calc(var(--spacing) * 8); }
.mb-10 { margin-bottom: calc(var(--spacing) * 10); }
.ml-1 { margin-left: calc(var(--spacing) * 1); }

.p-3 { padding: calc(var(--spacing) * 3); }
.p-4 { padding: calc(var(--spacing) * 4); }
.p-5 { padding: calc(var(--spacing) * 5); }
.p-6 { padding: calc(var(--spacing) * 6); }
.p-12 { padding: calc(var(--spacing) * 12); }

.px-1 { padding-inline: calc(var(--spacing) * 1); }
.px-2 { padding-inline: calc(var(--spacing) * 2); }
.px-3 { padding-inline: calc(var(--spacing) * 3); }
.px-4 { padding-inline: calc(var(--spacing) * 4); }
.px-5 { padding-inline: calc(var(--spacing) * 5); }
.px-6 { padding-inline: calc(var(--spacing) * 6); }

.py-0\.5 { padding-block: calc(var(--spacing) * 0.5); }
.py-1\.5 { padding-block: calc(var(--spacing) * 1.5); }
.py-2 { padding-block: calc(var(--spacing) * 2); }
.py-2\.5 { padding-block: calc(var(--spacing) * 2.5); }
.py-3 { padding-block: calc(var(--spacing) * 3); }
.py-4 { padding-block: calc(var(--spacing) * 4); }
.py-8 { padding-block: calc(var(--spacing) * 8); }
.py-12 { padding-block: calc(var(--spacing) * 12); }
.py-14 { padding-block: calc(var(--spacing) * 14); }
.py-16 { padding-block: calc(var(--spacing) * 16); }
.py-20 { padding-block: calc(var(--spacing) * 20); }

/* Sizing Adjustments */
.h-4 { height: calc(var(--spacing) * 4); }
.h-6 { height: calc(var(--spacing) * 6); }
.h-7 { height: calc(var(--spacing) * 7); }
.h-10 { height: calc(var(--spacing) * 10); }
.h-14 { height: calc(var(--spacing) * 14); }
.h-28 { height: calc(var(--spacing) * 28); }
.h-36 { height: calc(var(--spacing) * 36); }
.h-44 { height: calc(var(--spacing) * 44); }
.h-64 { height: calc(var(--spacing) * 64); }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.w-4 { width: calc(var(--spacing) * 4); }
.w-7 { width: calc(var(--spacing) * 7); }
.w-14 { width: calc(var(--spacing) * 14); }
.w-auto { width: auto; }
.w-full { width: 100%; }

.max-w-xs { max-width: var(--container-xs); }
.max-w-sm { max-width: var(--container-sm); }
.max-w-md { max-width: var(--container-md); }
.max-w-lg { max-width: var(--container-lg); }
.max-w-2xl { max-width: var(--container-2xl); }
.max-w-4xl { max-width: var(--container-4xl); }
.max-w-5xl { max-width: var(--container-5xl); }
.max-w-6xl { max-width: var(--container-6xl); }

/* Typography Formatting */
.text-center { text-align: center; }
.text-left { text-align: left; }
.underline { text-decoration-line: underline; }
.break-words { overflow-wrap: break-word; }
.whitespace-nowrap { white-space: nowrap; }
.line-clamp-2 { -webkit-line-clamp: 2; -webkit-box-orient: vertical; display: -webkit-box; overflow: hidden; }

.text-xs { font-size: var(--text-xs); line-height: var(--tw-leading, var(--text-xs--line-height)); }
.text-sm { font-size: var(--text-sm); line-height: var(--tw-leading, var(--text-sm--line-height)); }
.text-base { font-size: var(--text-base); line-height: var(--tw-leading, var(--text-base--line-height)); }
.text-lg { font-size: var(--text-lg); line-height: var(--tw-leading, var(--text-lg--line-height)); }
.text-xl { font-size: var(--text-xl); line-height: var(--tw-leading, var(--text-xl--line-height)); }
.text-2xl { font-size: var(--text-2xl); line-height: var(--tw-leading, var(--text-2xl--line-height)); }
.text-3xl { font-size: var(--text-3xl); line-height: var(--tw-leading, var(--text-3xl--line-height)); }
.text-4xl { font-size: var(--text-4xl); line-height: var(--tw-leading, var(--text-4xl--line-height)); }
.text-5xl { font-size: var(--text-5xl); line-height: var(--tw-leading, var(--text-5xl--line-height)); }
.text-6xl { font-size: var(--text-6xl); line-height: var(--tw-leading, var(--text-6xl--line-height)); }

.leading-tight { --tw-leading: var(--leading-tight); line-height: var(--leading-tight); }
.leading-relaxed { --tw-leading: var(--leading-relaxed); line-height: var(--leading-relaxed); }

.font-medium { --tw-font-weight: var(--font-weight-medium); font-weight: var(--font-weight-medium); }
.font-semibold { --tw-font-weight: var(--font-weight-semibold); font-weight: var(--font-weight-semibold); }
.font-bold { --tw-font-weight: var(--font-weight-bold); font-weight: var(--font-weight-bold); }
.font-extrabold { --tw-font-weight: var(--font-weight-extrabold); font-weight: var(--font-weight-extrabold); }

/* Color Theme Mappings */
.text-white { color: var(--color-white); }
.text-blue-600 { color: var(--color-blue-600); }
.text-red-700 { color: var(--color-red-700); }
.text-gray-300 { color: var(--color-gray-300); }
.text-gray-400 { color: var(--color-gray-400); }
.text-gray-500 { color: var(--color-gray-500); }
.text-gray-600 { color: var(--color-gray-600); }
.text-gray-700 { color: var(--color-gray-700); }
.text-gray-800 { color: var(--color-gray-800); }

.bg-white { background-color: var(--color-white); }
.bg-red-50 { background-color: var(--color-red-50); }

/* Borders & Shadows */
.border { border-style: var(--tw-border-style); border-width: 1px; }
.border-2 { border-style: var(--tw-border-style); border-width: 2px; }
.border-t { border-top-style: var(--tw-border-style); border-top-width: 1px; }
.border-red-200 { border-color: var(--color-red-200); }

.rounded { border-radius: .25rem; }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: 9999px; }

.shadow-sm {
  --tw-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
  box-shadow: var(--tw-inset-shadow), var(--tw-shadow);
}
.shadow-xl {
  --tw-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  box-shadow: var(--tw-inset-shadow), var(--tw-shadow);
}
.outline { outline-style: var(--tw-outline-style); outline-width: 1px; }

/* Utilities & Miscellaneous */
.object-cover { object-fit: cover; }
.cursor-pointer { cursor-pointer: pointer; }
.select-none { user-select: none; -webkit-user-select: none; }
.opacity-70 { opacity: .7; }
.disabled\:cursor-wait:disabled { cursor: wait; }
.disabled\:opacity-40:disabled { opacity: .4; }
.disabled\:opacity-50:disabled { opacity: .5; }

/* Transitions & Animation Base */
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: var(--default-transition-timing-function); transition-duration: var(--default-transition-duration); }
.transition-opacity { transition-property: opacity; transition-timing-function: var(--default-transition-timing-function); transition-duration: var(--default-transition-duration); }
.transition-shadow { transition-property: box-shadow; transition-timing-function: var(--default-transition-timing-function); transition-duration: var(--default-transition-duration); }
.transition-transform { transition-property: transform, scale, rotate; transition-timing-function: var(--default-transition-timing-function); transition-duration: var(--default-transition-duration); }
.duration-300 { transition-duration: .3s; }

/* ==========================================================================
   5. INTERACTIVE & PSEUDO-STATES (Hover & Focus)
   ========================================================================== */
@media (hover: hover) {
  .hover\:scale-105:hover { transform: scale(1.05); }
  .group-hover\:scale-105:is(:where(.group):hover *) { transform: scale(1.05); }
  .hover\:bg-white:hover { background-color: var(--color-white); }
  .hover\:underline:hover, .group-hover\:underline:is(:where(.group):hover *) { text-decoration-line: underline; }
  .hover\:opacity-90:hover { opacity: .9; }
  .hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1); }
  .hover\:bg-white\/60:hover { background-color: rgba(255, 255, 255, 0.6); }
}

.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--color-blue-600); }
.focus\:outline-none:focus { outline: none; }

/* ==========================================================================
   6. RESPONSIVE BREAKPOINTS (Mobile-First Media Queries)
   ========================================================================== */
/* Small Devices (40rem / 640px) */
@media (min-width: 40rem) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:flex-row { flex-direction: row; }
}

/* Medium Devices (48rem / 768px) */
@media (min-width: 48rem) {
  .md\:w-1\/2 { width: 50%; }
  .md\:w-52 { width: calc(var(--spacing) * 52); }
  .md\:max-w-sm { max-width: var(--container-sm); }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:flex-row { flex-direction: row; }
  .md\:text-5xl { font-size: var(--text-5xl); line-height: var(--tw-leading, var(--text-5xl--line-height)); }
}

/* Large Devices (64rem / 1024px) */
@media (min-width: 64rem) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   7. CUSTOM SITE SPECIFIC COMPONENTS / PROSE / ANIMATIONS
   ========================================================================== */
@keyframes subtle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.link-bounce { animation: 1.4s ease-in-out infinite subtle-bounce; display: inline-block; }
.btn-bounce-hover { transition: transform .1s; display: inline-flex; }
.btn-bounce-hover:hover { animation: .5s ease-in-out infinite subtle-bounce; }

/* Article Typography Structure */
.prose p { margin-bottom: 1em; }
.prose h2 { margin: 1.5em 0 .5em; font-size: 1.4rem; font-weight: 700; }
.prose h3 { margin: 1.2em 0 .4em; font-size: 1.2rem; font-weight: 600; }
.prose ul { margin-bottom: 1em; padding-left: 1.5em; list-style: outside; }
.prose li { margin-bottom: .3em; }