/* ImageCraft AI — shared design tokens & primitives */

:root {
  /* Color tokens — dark mode first */
  --bg: oklch(0.16 0.005 270);
  --bg-2: oklch(0.20 0.006 270);
  --surface: oklch(0.22 0.006 270);
  --surface-2: oklch(0.25 0.007 270);
  --border: oklch(0.30 0.008 270);
  --border-strong: oklch(0.38 0.010 270);
  --fg: oklch(0.97 0.005 270);
  --fg-2: oklch(0.82 0.006 270);
  --muted: oklch(0.62 0.008 270);
  --muted-2: oklch(0.48 0.008 270);

  --accent: oklch(0.82 0.15 80);          /* warm amber */
  --accent-fg: oklch(0.20 0.04 80);
  --accent-soft: oklch(0.30 0.06 80);

  --positive: oklch(0.78 0.14 155);
  --danger: oklch(0.70 0.18 25);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.5);

  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* Subtle ambient backdrop — keeps the page feeling moody, image-forward */
body.ambient {
  background:
    radial-gradient(ellipse 800px 500px at 15% -10%, oklch(0.30 0.04 80 / .18), transparent 60%),
    radial-gradient(ellipse 700px 600px at 110% 20%, oklch(0.30 0.04 280 / .14), transparent 60%),
    var(--bg);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--fg);
}
h1 { font-size: clamp(40px, 5vw, 76px); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: 32px; line-height: 1.1; letter-spacing: -0.025em; }
h3 { font-size: 20px; line-height: 1.25; letter-spacing: -0.015em; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 500;
}

/* Layout */
.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Top nav (shared) */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid transparent;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 17px;
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background:
    linear-gradient(135deg, var(--accent), oklch(0.65 0.18 50)) padding-box;
  position: relative;
  display: grid;
  place-items: center;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 3px;
  background: var(--bg);
  background-image:
    repeating-linear-gradient(45deg, var(--accent) 0 2px, transparent 2px 5px);
  opacity: .9;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--fg-2); font-size: 14px; }
.nav-links a:hover { color: var(--fg); }
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* Buttons */
.btn {
  --b-bg: var(--surface);
  --b-fg: var(--fg);
  --b-border: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--b-bg);
  color: var(--b-fg);
  border: 1px solid var(--b-border);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  --b-bg: var(--accent);
  --b-fg: var(--accent-fg);
  --b-border: transparent;
  font-weight: 600;
}
.btn.primary:hover { background: oklch(0.86 0.15 80); border-color: transparent; }
.btn.ghost { --b-bg: transparent; --b-border: transparent; }
.btn.ghost:hover { background: var(--surface); border-color: var(--border); }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.icon-only { width: 40px; padding: 0; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Pills / badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-2);
}
.pill .dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--accent);
}

/* Card primitives */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.card-pad { padding: 24px; }

/* Image placeholder — striped */
.placeholder {
  position: relative;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(
      135deg,
      oklch(0.28 0.01 270) 0 8px,
      oklch(0.24 0.008 270) 8px 16px
    );
  border: 1px solid var(--border);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.placeholder::after {
  /* faint vignette */
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.35) 100%);
  pointer-events: none;
}
.placeholder span {
  position: relative;
  z-index: 1;
  background: oklch(0.18 0.005 270 / .85);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* Inputs */
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  background: var(--surface-2);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Footer */
.footer {
  margin-top: 96px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* Utility */
.row { display: flex; gap: 12px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }

/* Page-row preview helpers (used on screens that show desktop + mobile side-by-side) */
.preview-strip {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}
.preview-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 10px;
}
@media (max-width: 1100px) {
  .preview-strip { grid-template-columns: 1fr; }
}
