/* ==========================================================================
   Clear Thinking Tools — Dark-first main.css
   Primary experience is dark. Light mode is fallback.
   ========================================================================== */

/* ---------- Design tokens (DARK FIRST) ---------- */
:root {
  /* Core surfaces */
  --bg: #050816;
  --surface: #0b1020;
  --surface-2: #0e1530;
  --surface-3: #121a3a;

  /* Text */
  --text: #e6edf7;
  --muted: #a6b2c3;
  --muted-2: #93a3b8;

  /* Accent */
  --accent: #4f8cff;
  --accent-2: #9b7bff;
  --accent-soft: rgba(79, 140, 255, 0.18);

  /* Lines & shadows */
  --border: rgba(230, 237, 247, 0.10);
  --border-2: rgba(230, 237, 247, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md:
    0 24px 70px rgba(0, 0, 0, 0.45),
    0 6px 18px rgba(0, 0, 0, 0.35);

  /* Radius */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  /* Layout */
  --max-width: 1440px;
  --max-text-width: 760px;

  /* Typography */
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Focus */
  --focus: 0 0 0 4px rgba(79, 140, 255, 0.35);

  /* Embed */
  --embed-bg: #020617;
  --embed-border: rgba(230, 237, 247, 0.12);
}

/* ---------- Light fallback (explicit opt-in) ---------- */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fb;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --surface-3: #e8edf5;
    --text: #0b1220;
    --muted: #475569;
    --muted-2: #64748b;
    --border: rgba(15, 23, 42, 0.10);
    --border-2: rgba(15, 23, 42, 0.14);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.10);
    --embed-bg: #0b1220;
    --embed-border: rgba(15, 23, 42, 0.12);
  }
}

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

body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(79,140,255,0.18), transparent 60%),
    radial-gradient(900px 350px at 90% 0%, rgba(155,123,255,0.14), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(1rem, 2.2vw, 1.6rem);
}

main.container,
main > .container {
  padding-top: clamp(2rem, 4vw, 3.4rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(5, 8, 22, 0.9);
  border-bottom: 1px solid var(--border);
  color:white;
  --text : #e6edf7;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.brand {
  font-weight: 750;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px rgba(79,140,255,0.15),
              0 8px 24px rgba(79,140,255,0.45);
}

.brand a {
  color: var(--text);
  text-decoration: none;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.header-tagline {
  margin: 0;
  color: #d8deea;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 2vw, 1rem);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.4rem);
  font-weight: 650;
}

.primary-nav a {
  color: rgba(230, 237, 247, 0.9);
  padding: 0.35rem 0.55rem;
  border-radius: 12px;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.primary-nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

.primary-nav a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.95rem;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #050816;
  font-weight: 750;
  letter-spacing: -0.01em;
  box-shadow:
    0 18px 45px rgba(79,140,255,0.35),
    0 4px 14px rgba(0,0,0,0.25);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-cta:hover {
  transform: translateY(-1px);
  box-shadow:
    0 24px 55px rgba(79,140,255,0.45),
    0 6px 16px rgba(0,0,0,0.35);
  text-decoration: none;
}

.header-cta:focus-visible {
  outline: none;
  box-shadow:
    var(--focus),
    0 18px 45px rgba(79,140,255,0.35);
}

.header-cta:active {
  transform: translateY(0);
}

@media (max-width: 900px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .primary-nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 540px) {
  .header-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .primary-nav {
    width: 100%;
    gap: 0.65rem;
  }

  .header-cta {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 400px at 15% 0%, rgba(79,140,255,0.22), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: flex;
  align-items: center;
  align-items: flex-end;
  gap: clamp(1.4rem, 4vw, 2.6rem);
  flex-wrap: wrap;
}

.hero-copy {
  max-width: 720px;
  flex: 1 1 420px;
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
}

.hero p {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 680px;
}

.hero p.lead {
  font-size: 2rem;
  margin-bottom: 2rem;
  line-height: 1.2;
}

.hero-visual {
  display: flex;
  justify-content: flex-end;
  flex: 1 1 360px;
}

.hero-image-frame {
  width: min(100%, 640px);
  padding: clamp(0.7rem, 2.5vw, 1.2rem);
  border: 4px solid #ffffff;
  border-radius: 20px;
  box-shadow: 5px 5px 10px rgba(0,0,0,0.55);
  background: rgba(255,255,255,1);
}

.hero-image-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

@media (max-width: 880px) {
  .hero-visual {
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .hero-grid {
    flex-direction: column;
  }

  .hero-image-frame {
    margin: 0 auto;
  }
}
/* ---------- Typography ---------- */
h1, h2, h3 {
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  margin-top: 2.8rem;
}

h3 {
  font-size: 1.1rem;
  margin-top: 2rem;
}

p {
  margin: 0.7rem 0;
  max-width: var(--max-text-width);
  color: var(--muted);
}

strong {
  color: var(--text);
}

/* ---------- Links ---------- */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 10px;
}

/* ---------- Cards ---------- */
.card,
.tool {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
    var(--surface);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.card::before,
.tool::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(79,140,255,0.35),
    rgba(155,123,255,0.10)
  );
  mask: linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Embed wrapper ---------- */
.embed-wrapper {
  background:
    radial-gradient(900px 300px at 20% 0%, rgba(79,140,255,0.25), transparent 55%),
    radial-gradient(700px 260px at 90% 10%, rgba(155,123,255,0.18), transparent 55%),
    var(--embed-bg);
  border: 1px solid var(--embed-border);
  border-radius: 18px;
  padding: clamp(1rem, 2.4vw, 1.6rem);
  margin: 1.8rem 0 2.2rem;
  min-height: 46vh;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02),
              0 30px 80px rgba(0,0,0,0.55);
}

/* ---------- Footer ---------- */
footer {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-top: 1px solid var(--border);
  color: var(--muted);
}

footer nav a {
  color: var(--muted);
}

footer nav a:hover {
  color: var(--text);
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.cookie-inner {
  max-width: 960px;
  background: #ffffff;
  color: #0b1220;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: auto;
}

.cookie-inner button {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #050816;
  border: none;
  border-radius: 10px;
  font-weight: 750;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(79,140,255,0.25);
}

.cookie-inner p {
  margin: 0;
  font-size: 0.92rem;
  color: #0b1220;
}

.cookie-inner a {
  color: #0b1220;
  text-decoration: underline;
}

.cookie-banner.is-hidden {
  display: none;
}

@media (max-width: 640px) {
  .cookie-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .embed-wrapper {
    min-height: 55vh;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---------- Tools grid ---------- */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.2rem, 2.5vw, 2rem);
  margin-top: 1.6rem;
}

/* Tablet */
@media (max-width: 980px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}




/* ---------- Explorable tool card ---------- */

.tool-card {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  min-height: 100%;
}

.tool-card-inner {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)),
    var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
  position: relative;
  overflow: hidden;
  min-height: 100%;
}

/* Gradient edge (matches your card aesthetic) */
.tool-card-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(79,140,255,0.45),
    rgba(155,123,255,0.15)
  );
  mask: linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.tool-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.tool-card-header h3 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.tool-card-cta {
  font-weight: 700;
  color: var(--accent);
  opacity: 0.85;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.tool-card-description {
  margin-top: 0.6rem;
  color: var(--muted);
  max-width: 52ch;
}

.tool-card-meta {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted-2);
}

.tool-card:hover .tool-card-inner,
.tool-card:focus-visible .tool-card-inner {
  transform: translateY(-3px);
  box-shadow:
    0 40px 90px rgba(0,0,0,0.55),
    0 10px 24px rgba(79,140,255,0.25);
  border-color: var(--border-2);
}

.tool-card:hover .tool-card-cta,
.tool-card:focus-visible .tool-card-cta {
  transform: translateX(4px);
  opacity: 1;
}

.tool-card:focus-visible {
  outline: none;
}

/* ---------- Tool card media ---------- */

.tool-card-media {
  margin: 1rem 0 1.2rem;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: var(--surface-2);
}

/* Soft contrast lift so images don't disappear */
.tool-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.15),
    rgba(0,0,0,0.35)
  );
  pointer-events: none;
}

.tool-card-media img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.9;
  transform: scale(1.02);
}

/* ---------- Placeholder card ---------- */

.tool-card.placeholder {
  cursor: default;
}

.tool-card.placeholder .tool-card-inner {
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.03),
      rgba(255,255,255,0.01)
    ),
    var(--surface-2);
  border-style: dashed;
  box-shadow: none;
}

.placeholder-content {
  height: 100%;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
}

.placeholder-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.6rem;
  color: var(--accent);
  opacity: 0.8;
}

.placeholder-muted {
  font-size: 0.9rem;
  max-width: 26ch;
}


.tool-card.placeholder .tool-card-inner::after {
  content: "In development";
  position: absolute;
  bottom: 1rem;
  font-size: 0.75rem;
  color: var(--muted-2);
  opacity: 0.7;
}
