/* im0dev theme — adapted from chanhdai portfolio design language
   (zinc blueprint / screen-lines / Geist). No personal branding copied. */

@import url("https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-sans/style.min.css");
@import url("https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-mono/style.min.css");

:root {
  --background: #ffffff;
  --foreground: #09090b;
  --primary: #09090b;
  --primary-foreground: #fafafa;
  --secondary: #f4f4f5;
  --secondary-foreground: #09090b;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --card: #ffffff;
  --card-foreground: #09090b;
  --accent: #f4f4f5;
  --accent-foreground: #18181b;
  --border: #e4e4e7;
  --line: color-mix(in srgb, var(--border) 64%, var(--background));
  --input: #e4e4e7;
  --ring: #a1a1aa;
  --info: #3b82f6;
  --success: #22c55e;
  --destructive: #dc2626;
  --link: #1d4ed8;
  --surface: #fafafa;
  --surface-foreground: #09090b;

  /* aliases used across tools */
  --bg: var(--background);
  --fg: var(--foreground);
  --dim: #a1a1aa;
  --ok: var(--success);
  --err: var(--destructive);
  --warn: #ca8a04;
  --focus: var(--ring);
  --checker-a: #e4e4e7;
  --checker-b: #fafafa;

  --font-sans: "Geist Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font: var(--font-sans);
  --font-display: var(--font-sans);

  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 24px;
  --text-2xl: 36px;
  --text-3xl: 40px;

  --lh-tight: 1.15;
  --lh: 1.5;
  --lh-loose: 1.65;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 40px;
  --space-7: 64px;

  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;

  --shadow-sm: none;
  --shadow: none;
  --shadow-hover: none;

  --max: 48rem;
  --max-narrow: 48rem;
  --max-wide: 48rem;

  --trans: 150ms ease;
  --header-h: 56px;
  --pattern-foreground: color-mix(in srgb, var(--line) 56%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #09090b;
    --foreground: #fafafa;
    --primary: #fafafa;
    --primary-foreground: #09090b;
    --secondary: #27272a;
    --secondary-foreground: #fafafa;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    --card: #18181b;
    --card-foreground: #fafafa;
    --accent: #27272a;
    --accent-foreground: #fafafa;
    --border: #27272a;
    --line: color-mix(in srgb, var(--border) 64%, var(--background));
    --input: rgba(255, 255, 255, 0.15);
    --ring: #71717a;
    --link: #3b82f6;
    --surface: #18181b;
    --surface-foreground: #fafafa;
    --destructive: #b91c1c;
    --checker-a: #27272a;
    --checker-b: #18181b;
    --dim: #71717a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" on, "cv11" on;
}

a {
  color: inherit;
}

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

::selection {
  background: var(--foreground);
  color: var(--background);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Full-bleed hairline */
.screen-line,
.screen-line-top,
.screen-line-bottom {
  position: relative;
}

.screen-line-top::before,
.im0-chrome::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100vw;
  z-index: -1;
  height: 1px;
  width: 200vw;
  background: var(--line);
}

.screen-line-bottom::after,
.im0-chrome::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -100vw;
  z-index: -1;
  height: 1px;
  width: 200vw;
  background: var(--line);
}

/* Diagonal stripe band */
.im0-stripe {
  position: relative;
  height: 2rem;
  border: 0;
}

.im0-stripe::before {
  content: "";
  position: absolute;
  inset: 0 -100vw;
  z-index: -1;
  background-image: repeating-linear-gradient(
    315deg,
    var(--pattern-foreground) 0,
    var(--pattern-foreground) 1px,
    transparent 0,
    transparent 50%
  );
  background-size: 10px 10px;
}

/* Centered blueprint column */
.im0-frame {
  width: min(var(--max), calc(100% - 1rem));
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--background);
}

.im0-root {
  padding: 0 0.5rem;
  overflow-x: clip;
}

/* Header */
.im0-chrome {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-h);
  width: min(var(--max), calc(100% - 1rem));
  margin: 0 auto;
  padding: 0 1rem;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.im0-chrome__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  text-decoration: none;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.im0-chrome__brand:hover .im0-chrome__mark {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.im0-chrome__mark {
  font-weight: 600;
}

.im0-chrome__sep {
  color: var(--border);
  font-weight: 400;
  user-select: none;
}

.im0-chrome__tool {
  color: var(--muted-foreground);
  font-weight: 450;
}

.im0-chrome__meta {
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 450;
  text-decoration: none;
  transition: color var(--trans);
}

.im0-chrome__meta:hover {
  color: var(--foreground);
}

.im0-discord {
  font: inherit;
}

/* Typography helpers */
.im0-kicker {
  margin: 0;
  padding: 0.75rem 1rem 0.5rem;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.im0-title {
  margin: 0;
  padding: 0.85rem 1rem;
  font-size: clamp(2rem, 6vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: var(--lh-tight);
  text-wrap: balance;
}

.im0-lede {
  margin: 0;
  padding: 1rem;
  max-width: 52ch;
  color: var(--muted-foreground);
  font-size: 15px;
  line-height: var(--lh-loose);
  text-wrap: pretty;
}

.im0-meta {
  margin: 0;
  padding: 0 1rem 1rem;
  color: var(--dim);
  font-size: 13px;
  font-weight: 450;
}

.im0-shell {
  width: 100%;
  margin: 0;
  padding: 0;
}

.im0-shell--narrow {
  width: 100%;
}

.im0-panel {
  background: var(--card);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.im0-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 36px;
  padding: 0.5em 0.9em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--trans), background var(--trans), color var(--trans), border-color var(--trans);
}

.im0-btn:hover {
  opacity: 0.9;
}

.im0-btn:active {
  opacity: 0.82;
}

.im0-btn--accent {
  background: var(--primary);
  color: var(--primary-foreground);
}

.im0-btn--ghost {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.im0-btn--ghost:hover {
  background: var(--muted);
  opacity: 1;
}

.im0-link {
  color: var(--foreground);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: text-decoration-color var(--trans), color var(--trans);
}

.im0-link:hover {
  text-decoration-color: currentColor;
}

.im0-footer {
  margin: 0;
  padding: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: baseline;
  color: var(--muted-foreground);
  font-size: 13px;
}

.im0-footer a {
  color: var(--muted-foreground);
  text-decoration: none;
}

.im0-footer a:hover {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
}

code,
.im0-code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  font-feature-settings: "ss11" 1, "zero" 1, "tnum" 1;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--muted) 50%, transparent);
  border-radius: 6px;
  padding: 1px 6px;
}
