:root {
  --navy: #29356f;
  --navy-dark: #222b5a;
  --ink: #1c2340;
  --muted: #68718b;
  --quiet: #697186;
  --line: #e6e9f0;
  --line-strong: #d9dee9;
  --canvas: #f7f8fb;
  --white: #ffffff;
  --focus: #6875c4;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Catamaran", "Segoe UI", sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: #dfe3f5;
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--canvas);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 22px 16px 18px;
  background: var(--white);
  border-right: 1px solid var(--line);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 0 8px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--navy);
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 28px;
  object-fit: contain;
}

.brand-ai {
  padding-left: 7px;
  border-left: 1px solid #dde0e9;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-close {
  display: none;
  color: var(--muted);
}

.new-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  margin-top: 26px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  box-shadow: 0 4px 12px rgba(43, 53, 108, 0.14);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.new-chat:hover {
  background: var(--navy-dark);
  box-shadow: 0 5px 14px rgba(43, 53, 108, 0.2);
}

.new-chat svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.nav-block {
  margin-top: 30px;
}

.nav-label {
  margin: 0 0 9px;
  padding: 0 11px;
  color: var(--quiet);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 39px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #505972;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
}

.nav-item + .nav-item {
  margin-top: 2px;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.is-active {
  background: #f0f2f9;
  box-shadow: inset 2px 0 0 var(--navy);
  color: var(--navy);
  font-weight: 600;
}

.nav-item-muted {
  color: #656d82;
  cursor: default;
}

.nav-item small {
  margin-left: auto;
  color: var(--quiet);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-empty {
  margin-top: 28px;
  padding: 20px 11px 0;
  border-top: 1px solid var(--line);
}

.empty-rule {
  display: block;
  width: 22px;
  height: 1px;
  margin-bottom: 12px;
  background: #c8cdda;
}

.sidebar-empty p {
  margin: 0 0 3px;
  color: #596178;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-empty > span:last-child {
  display: block;
  max-width: 172px;
  color: var(--quiet);
  font-size: 11.5px;
  line-height: 1.45;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: #edf0f7;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}

.account-name {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.account-name strong {
  color: #414962;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
}

.account-name small {
  color: var(--quiet);
  font-size: 10.5px;
  line-height: 1.4;
}

.account-dot {
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: #b3b9c9;
}

.main {
  height: 100dvh;
  min-width: 0;
  overflow-y: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: 66px;
  padding: 0 clamp(24px, 4vw, 48px);
  border-bottom: 1px solid rgba(226, 229, 238, 0.8);
  background: rgba(247, 248, 251, 0.9);
  backdrop-filter: blur(14px);
}

.menu-button,
.mobile-wordmark {
  display: none;
}

.topbar-path {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #5c647b;
  font-size: 12.5px;
  font-weight: 500;
}

.topbar-path span:last-child {
  color: var(--quiet);
  font-weight: 400;
}

.path-separator {
  color: #b7bdcc;
}

.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid #dfe3ec;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #646c83;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.015em;
}

.chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--navy);
}

.canvas {
  position: relative;
  display: grid;
  min-height: calc(100dvh - 66px);
  place-items: center;
  overflow: hidden;
  padding: 40px clamp(24px, 5vw, 64px) 56px;
  background: #f2f7fa;
}

.water-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.water-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.welcome {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 880px;
}

.hero {
  text-align: center;
}

h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(42px, 4.1vw, 58px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0;
}

.lede {
  max-width: 540px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
}

.composer-wrap {
  max-width: 860px;
  margin: 30px auto 0;
}

.glass {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(128deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.18) 41%, rgba(236, 245, 250, 0.3) 74%, rgba(255, 255, 255, 0.43));
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    0 0 0 1px rgba(104, 124, 153, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(54, 76, 112, 0.12),
    inset 1px 0 0 rgba(255, 255, 255, 0.45),
    0 30px 55px -40px rgba(41, 53, 111, 0.6),
    0 12px 30px -24px rgba(41, 53, 111, 0.35);
  -webkit-backdrop-filter: blur(0.35px) saturate(1.1);
  backdrop-filter: blur(0.35px) saturate(1.1);
}

.glass::before,
.glass::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.glass::before {
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.16) 23%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.14) 78%, rgba(255, 255, 255, 0.38) 100%);
}

.glass::after {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    inset 0 16px 30px -26px rgba(255, 255, 255, 0.95),
    inset 0 -18px 34px -30px rgba(105, 135, 166, 0.45);
}

.glass > :not(.sr-only) {
  position: relative;
  z-index: 1;
}

.composer {
  border-radius: 18px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.composer:focus-within {
  border-color: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 0 0 1px rgba(76, 97, 148, 0.46),
    0 0 0 4px rgba(104, 117, 196, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(54, 76, 112, 0.14),
    0 30px 60px -38px rgba(41, 53, 111, 0.58);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 91px;
  padding: 20px 20px 3px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.5;
  resize: none;
}

.composer textarea::placeholder {
  color: #6b7388;
  opacity: 1;
}

.composer-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 55px;
  padding: 8px 13px 12px 20px;
}

.composer-status {
  min-width: 0;
  margin: 0;
  color: #6b7388;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.3;
}

.send-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.send-button:hover {
  background: var(--navy-dark);
  transform: translateY(-1px);
}

.send-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.starters {
  max-width: 860px;
  margin: 0 auto;
}

.starter-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 27px 0 10px;
}

.starter-heading p {
  margin: 0;
  color: var(--quiet);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.starter-heading span {
  height: 1px;
  flex: 1;
  background: #e7e9f0;
}

.starter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.starter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 8px;
  min-height: 112px;
  padding: 15px 15px 14px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.starter:hover {
  border-color: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 0 0 1px rgba(104, 124, 153, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(54, 76, 112, 0.14),
    0 24px 38px -30px rgba(41, 53, 111, 0.5);
}

.starter-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--navy);
}

.starter-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.starter-arrow {
  align-self: center;
  color: #9ca2b2;
  transition: color 160ms ease, transform 160ms ease;
}

.starter-arrow svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.starter:hover .starter-arrow {
  color: var(--navy);
  transform: translate(1px, -1px);
}

.starter-text {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.starter-text strong {
  color: #303953;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}

.starter-text span {
  color: #6b7388;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.42;
}

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(22, 28, 52, 0.3);
}

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

@media (max-width: 860px) {
  .app {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(84vw, 304px);
    transform: translateX(-101%);
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 22px 0 60px rgba(22, 28, 52, 0.13);
  }

  .sidebar-close,
  .menu-button {
    display: inline-grid;
  }

  .mobile-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--navy);
    line-height: 1;
  }

  .mobile-wordmark .brand-logo {
    height: 20px;
  }

  .mobile-wordmark .brand-ai {
    padding-left: 5px;
    font-size: 9px;
  }

  .nav-open {
    overflow: hidden;
  }

  .main {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .topbar {
    gap: 8px;
    height: 60px;
    padding: 0 14px;
  }

  .menu-button {
    width: 36px;
    height: 36px;
    color: #4d5670;
  }

  .topbar-path {
    display: none;
  }

  .preview-chip {
    height: 27px;
    margin-left: auto;
    padding: 0 9px;
    font-size: 10px;
  }

  .canvas {
    min-height: calc(100dvh - 60px);
    place-items: start center;
    padding: 31px 18px 42px;
  }

  h1 {
    font-size: clamp(31px, 8vw, 41px);
    line-height: 1.1;
  }

  .lede {
    max-width: 330px;
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.5;
  }

  .composer-wrap {
    margin-top: 24px;
  }

  .composer {
    border-radius: 16px;
  }

  .composer textarea {
    min-height: 84px;
    padding: 16px 16px 2px;
    font-size: 15px;
  }

  .composer-foot {
    min-height: 51px;
    padding: 7px 10px 10px 16px;
  }

  .composer-status {
    font-size: 10px;
  }

  .starter-heading {
    margin: 23px 0 9px;
  }

  .starter-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .starter {
    grid-template-columns: 30px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 11px;
    min-height: 0;
    padding: 12px 13px;
  }

  .starter-icon {
    grid-column: 1;
    grid-row: 1;
  }

  .starter-text {
    grid-column: 2;
    grid-row: 1;
    gap: 1px;
  }

  .starter-arrow {
    grid-column: 3;
    grid-row: 1;
  }

  .starter-text strong {
    font-size: 13px;
  }

  .starter-text span {
    font-size: 11px;
  }
}

@media (max-width: 390px) {
  .preview-chip {
    font-size: 9.5px;
    padding: 0 8px;
  }

  .canvas {
    padding-inline: 16px;
  }

  .composer-status {
    max-width: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .starter:hover .starter-arrow,
  .send-button:hover {
    transform: none;
  }
}
