/* Tech Solution — design tokens */
:root {
  --paper: #F6F7FB;
  --surface: #FFFFFF;
  --ink: #13203B;
  --slate: #5A6479;
  --line: #DCE1EC;
  --cobalt: #2E55E6;
  --cobalt-deep: #1E3FB8;
  --amber: #F2A93B;
  --danger: #C8372D;
  --ok: #1F8A5B;
  --radius-lg: 18px;
  --radius-sm: 8px;
  --font-display: "Sora", "Hind Siliguri", system-ui, sans-serif;
  --font-body: "Hind Siliguri", "Sora", system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--cobalt); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 247, 251, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a { color: var(--slate); text-decoration: none; font-size: .98rem; }
.nav a:hover { color: var(--ink); }
@media (max-width: 720px) { .nav .nav-link { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: 0 1.25rem;
  border: 1px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-deep); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { min-height: 38px; padding: 0 .95rem; font-size: .92rem; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  line-height: 1.15; letter-spacing: -.025em; font-weight: 700;
  margin: 0 0 1rem; max-width: 16ch;
}
.hero-lede { color: var(--slate); font-size: 1.15rem; max-width: 46ch; margin: 0 0 1.75rem; }

.composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: .75rem;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(19, 32, 59, .35);
}
.composer textarea {
  width: 100%; min-height: 110px; resize: vertical;
  border: 0; padding: .6rem .7rem; background: transparent;
  font-size: 1.05rem; line-height: 1.55;
}
.composer textarea:focus { outline: none; }
.composer:focus-within { border-color: var(--cobalt); }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .25rem .25rem 0; flex-wrap: wrap; }
.hint { color: var(--slate); font-size: .9rem; }

.examples { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chip {
  border: 1px dashed #B9C2D6; background: transparent; border-radius: 999px;
  padding: .35rem .85rem; font-size: .92rem; color: var(--slate); cursor: pointer;
}
.chip:hover { border-style: solid; border-color: var(--cobalt); color: var(--cobalt); }

/* The one memorable element: a fanned deck that deals itself once on load */
.deck { position: relative; overflow: visible; margin-block: 1rem; aspect-ratio: 4 / 3.3; width: 100%; max-width: 520px; margin-inline: auto; }
.slide {
  position: absolute; inset: 12% 17% 14% 17%;
  border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px -28px rgba(19, 32, 59, .45);
  padding: 7% 8%;
  display: flex; flex-direction: column; gap: 6%;
  transform-origin: 50% 110%;
  animation: deal .9s cubic-bezier(.2, .8, .2, 1) both;
}
.slide:nth-child(1) { --r: -9deg; --x: -24%; animation-delay: .05s; }
.slide:nth-child(2) { --r: -1deg; --x: 0%; animation-delay: .18s; }
.slide:nth-child(3) { --r: 7deg; --x: 24%; animation-delay: .31s; background: var(--ink); color: #fff; border-color: var(--ink); }
.slide { transform: translateX(var(--x)) rotate(var(--r)); }
@keyframes deal {
  from { transform: translateY(18%) rotate(0deg); opacity: 0; }
  to { transform: translateX(var(--x)) rotate(var(--r)); opacity: 1; }
}
.slide .s-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1rem, 2.4vw, 1.45rem); line-height: 1.2; }
.slide .s-bars { display: flex; align-items: flex-end; gap: 6%; flex: 1; }
.slide .s-bars span { flex: 1; border-radius: 4px 4px 0 0; background: var(--cobalt); }
.slide .s-bars span:nth-child(2) { background: var(--amber); }
.slide .s-meta { display: flex; justify-content: space-between; font-size: .8rem; opacity: .7; }
.slide .s-lines { display: grid; gap: .5rem; }
.slide .s-lines i { display: block; height: 8px; border-radius: 4px; background: var(--line); }
@media (prefers-reduced-motion: reduce) {
  .slide { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.section h2 {
  font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  letter-spacing: -.02em; line-height: 1.2; margin: 0 0 .75rem; max-width: 22ch;
}
.section .intro { color: var(--slate); max-width: 58ch; margin: 0 0 2.5rem; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; counter-reset: step; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.steps li { padding: 1.25rem 1.5rem 1.25rem 0; counter-increment: step; position: relative; }
.steps li + li { border-left: 1px solid var(--line); padding-left: 1.5rem; }
@media (max-width: 820px) { .steps li + li { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; } }
.steps li::before {
  content: counter(step);
  display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem;
  border-radius: 50%; background: var(--ink); color: #fff;
  font-family: var(--font-display); font-weight: 700; margin-bottom: .9rem;
}
.steps h3 { margin: 0 0 .35rem; font-size: 1.15rem; }
.steps p { margin: 0; color: var(--slate); }

.uses { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.use {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 1.1rem 1.2rem; cursor: pointer;
}
.use:hover { border-color: var(--cobalt); }
.use strong { display: block; font-size: 1.05rem; margin-bottom: .2rem; }
.use span { color: var(--slate); font-size: .95rem; }

.after { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 820px) { .after { grid-template-columns: 1fr; } }
.after dl { margin: 0; }
.after dt { font-weight: 700; margin-top: 1.1rem; }
.after dt:first-child { margin-top: 0; }
.after dd { margin: .15rem 0 0; color: var(--slate); }

.cta-band { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3.5rem); display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0; }
.cta-band .btn-primary { background: var(--amber); color: var(--ink); }
.cta-band .btn-primary:hover { background: #FFC060; }

.site-footer { padding: 2rem 0 2.5rem; color: var(--slate); font-size: .92rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Dialog ---------- */
dialog {
  border: 0; border-radius: var(--radius-lg); padding: 0; width: min(420px, 100% - 2rem);
  box-shadow: 0 30px 80px -30px rgba(19, 32, 59, .6);
}
dialog::backdrop { background: rgba(19, 32, 59, .5); }
.dialog-body { padding: 1.75rem; }
.dialog-body h2 { font-family: var(--font-display); margin: 0 0 .35rem; font-size: 1.4rem; }
.dialog-body p { margin: 0 0 1.25rem; color: var(--slate); }
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .95rem; }
.input {
  width: 100%; min-height: 46px; padding: .55rem .8rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(46, 85, 230, .15); }
.form-error { color: var(--danger); font-size: .95rem; min-height: 1.4em; margin: 0 0 .75rem; }
.dialog-actions { display: flex; gap: .6rem; justify-content: flex-end; }

/* ---------- App (dashboard) ---------- */
.app-main { padding: 2rem 0 4rem; }
.app-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1.75rem; align-items: start; }
@media (max-width: 960px) { .app-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.2rem, 3vw, 1.75rem); }
.panel h1, .panel h2 { font-family: var(--font-display); margin: 0 0 .3rem; letter-spacing: -.015em; }
.panel h1 { font-size: 1.6rem; }
.panel h2 { font-size: 1.2rem; }
.panel .sub { color: var(--slate); margin: 0 0 1.25rem; }
.big-textarea { min-height: 190px; resize: vertical; line-height: 1.55; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }
.row .field { flex: 1 1 200px; margin: 0; }
.counter { font-size: .88rem; color: var(--slate); text-align: right; margin-top: .3rem; }
.actions { display: flex; justify-content: flex-end; margin-top: 1.25rem; }

.status { margin-top: 1.25rem; padding: 1rem 1.1rem; border-radius: var(--radius-sm); display: none; }
.status.show { display: block; }
.status.loading { background: #EEF2FE; color: var(--cobalt-deep); }
.status.error { background: #FCEDEC; color: var(--danger); }
.status.success { background: #EAF6F0; color: var(--ok); }
.status h3 { margin: 0 0 .25rem; font-size: 1.05rem; color: var(--ink); }
.status .links { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px; margin-right: .5rem; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 1rem 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; padding-top: .25rem; }
.history .h-title { font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.history .h-meta { color: var(--slate); font-size: .88rem; margin: .1rem 0 .6rem; }
.history .h-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.empty { color: var(--slate); padding: 1.5rem 0 .5rem; }
.note { font-size: .9rem; color: var(--slate); margin-top: 1rem; }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 150%);
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 999px;
  font-size: .95rem; transition: transform .25s; z-index: 50; max-width: calc(100% - 2rem);
}
.toast.show { transform: translate(-50%, 0); }
.slide .s-lines i.w80 { width: 80%; } .slide .s-lines i.w65 { width: 65%; } .slide .s-lines i.w72 { width: 72%; }
.slide .s-lines i.dk { background: #34456B; }
.slide .s-bars span.h45 { height: 45%; } .slide .s-bars span.h70 { height: 70%; } .slide .s-bars span.h92 { height: 92%; }
[hidden] { display: none !important; }
.hero { overflow-x: clip; }
@media (max-width: 600px) {
  .slide:nth-child(1) { --x: -16%; } .slide:nth-child(3) { --x: 16%; }
  .deck { max-width: 360px; }
}
