/* Project Falcon Toolkit: launch page styles. */

:root {
  color-scheme: light dark;

  --brand: #f96302;
  --brand-strong: #d45200;
  --on-brand: #1a1205;

  --page: #f6f5f3;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --ink: #17191c;
  --muted: #5d636b;
  --line: #e4e1dc;
  --glow: rgb(249 99 2 / 0.12);
  --shadow: 0 1px 2px rgb(20 16 10 / 0.05), 0 8px 24px -12px rgb(20 16 10 / 0.18);
  --shadow-lift: 0 2px 4px rgb(20 16 10 / 0.06), 0 22px 44px -18px rgb(20 16 10 / 0.32);
  --focus: #0b5fff;

  --radius: 20px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-strong: #ff8a3d;
    --page: #0f1113;
    --surface: #17191c;
    --surface-2: #1c1f23;
    --ink: #f2f1ef;
    --muted: #a3a8ae;
    --line: #2a2e33;
    --glow: rgb(249 99 2 / 0.2);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.6);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.4), 0 24px 48px -18px rgb(0 0 0 / 0.8);
    --focus: #7aa7ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--glow), transparent 70%),
    var(--page);
  background-attachment: fixed;
  line-height: 1.55;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1 { text-wrap: balance; }
p { text-wrap: pretty; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 20;
  background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 12px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

/* ---------- Test-copy banner (added by the Worker on staging only) ---------- */

.stage-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px;
  padding: 8px 16px; text-align: center; font-size: 0.9rem;
  color: #1a1205; background: repeating-linear-gradient(-45deg, #ffd23f 0 14px, #ffc61a 14px 28px);
}
.stage-banner strong {
  padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; letter-spacing: 0.08em;
  color: #ffd23f; background: #1a1205;
}
.stage-banner a { color: inherit; font-weight: 700; }

/* ---------- Header ---------- */

.bar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--page) 72%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.bar-inner, main, .foot { width: 100%; max-width: 1000px; margin-inline: auto; padding-inline: 24px; }
.bar-inner { display: flex; align-items: center; gap: 10px; padding-block: 12px; }

.brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 10px;
  color: #fff;
  background: linear-gradient(140deg, #ff8a3d, var(--brand) 55%, #c94a00);
  box-shadow: 0 4px 12px -4px rgb(249 99 2 / 0.6), inset 0 1px 0 rgb(255 255 255 / 0.3);
}
.brand-name { font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Hero ---------- */

main { flex: 1; padding-block: clamp(48px, 9vw, 96px) 56px; }

.hero { max-width: 42rem; }
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  line-height: 1.05; letter-spacing: -0.035em; font-weight: 800;
}
.lede { margin: 0; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.2rem); max-width: 34em; }

/* ---------- Tool cards ---------- */

.tools { margin-top: clamp(40px, 6vw, 56px); }

.status { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; margin: 0; color: var(--muted); }
.status.message { display: block; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--line); }
.skeleton {
  display: block; height: 220px; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%;
  border: 1px solid var(--line);
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -150% 0; } }

.tool-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}

.tool {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; gap: 18px;
  min-height: 220px; padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  animation: rise 0.5s var(--ease) both;
}
.tool:nth-child(2) { animation-delay: 0.06s; }
.tool:nth-child(3) { animation-delay: 0.12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.tool::before {
  content: ""; position: absolute; inset: auto -30% -60% auto; z-index: -1;
  width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent);
  opacity: 0.6; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.tool:hover, .tool:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}
.tool:hover::before, .tool:focus-within::before { opacity: 1; transform: scale(1.15); }

.tool-icon {
  display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 16px;
  color: var(--brand-strong);
  background: color-mix(in srgb, var(--brand) 11%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
}
.tool-icon svg { width: 30px; height: 30px; }

.tool-body h2 { margin: 0 0 6px; font-size: 1.3rem; line-height: 1.25; letter-spacing: -0.015em; }
.tool-body p { margin: 0; color: var(--muted); }

.tool-cta {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 11px 18px; border-radius: 999px;
  font-weight: 700; color: var(--on-brand); text-decoration: none;
  background: var(--brand);
  box-shadow: 0 6px 16px -8px rgb(249 99 2 / 0.9);
  transition: background-color 0.2s ease, gap 0.25s var(--ease);
}
.tool-cta svg { transition: transform 0.25s var(--ease); }
.tool:hover .tool-cta { background: #ff7a26; gap: 12px; }
.tool:hover .tool-cta svg { transform: translate(2px, -2px); }

/* The whole card is clickable: the link's hit area covers the card. */
.tool-cta::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tool-cta:focus-visible { outline: none; }
.tool:has(.tool-cta:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---------- Footer ---------- */

.foot { padding-block: 28px 36px; color: var(--muted); font-size: 0.9rem; }
.foot p { margin: 0; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .bar-inner, main, .foot { padding-inline: 16px; }
  .tool { min-height: 0; padding: 22px; }
  .tool-cta { align-self: stretch; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tool:hover, .tool:focus-within { transform: none; }
}
