:root {
  color-scheme: dark;
  --bg: #050b13;
  --ink: #f6f8ff;
  --muted: #b8c3d8;
  --line: rgba(255, 255, 255, 0.14);
  --glass: rgba(10, 20, 34, 0.62);
  --blue: #63a7ff;
  --cyan: #3be4ff;
  --green: #19e681;
  --red: #ff4d67;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 52% 21%, rgba(83, 156, 255, 0.38), transparent 24rem),
    radial-gradient(circle at 8% 43%, rgba(255, 174, 86, 0.28), transparent 19rem),
    linear-gradient(180deg, #11233c 0%, #06111e 55%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(5, 11, 19, 0.18), rgba(5, 11, 19, 0.72)),
    url("./assets/istanbul-market-backdrop.svg") center bottom / cover no-repeat;
}

button,
input {
  font: inherit;
}

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

.shell {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 0 36px 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 74px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: 0;
}

.brand span,
h1 span {
  background: linear-gradient(135deg, var(--blue), #b06cff);
  -webkit-background-clip: text;
  color: transparent;
}

.navlinks {
  display: flex;
  gap: clamp(18px, 3vw, 44px);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
}

.primary-action,
.ghost-action,
.ask-box button,
.feature-card button {
  border: 1px solid rgba(166, 199, 255, 0.5);
  color: #eef4ff;
  background: rgba(120, 164, 255, 0.18);
  border-radius: 999px;
  cursor: pointer;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-action {
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.08);
}

.primary-action {
  padding: 14px 22px;
  background: #e8efff;
  color: #113cff;
  font-weight: 800;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 280px minmax(380px, 1fr) 390px;
  align-items: center;
  min-height: 560px;
  gap: 28px;
}

.glass,
.feature-card {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.weather-card,
.market-panel {
  align-self: start;
  margin-top: 40px;
  border-radius: 10px;
  padding: 20px;
}

.weather-card strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 2.3rem;
}

.market-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(246, 248, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  font-weight: 800;
}

.status-light {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 14px rgba(255, 77, 103, 0.8);
}

.market-status.open .status-light {
  background: var(--green);
  box-shadow: 0 0 16px rgba(25, 230, 129, 0.85);
}

.market-status.closed .status-light {
  background: var(--red);
  box-shadow: 0 0 14px rgba(255, 77, 103, 0.8);
}

.eyebrow,
.weather-card small {
  color: var(--muted);
}

.hero-copy {
  position: relative;
  text-align: center;
  padding-top: 70px;
}

.orb {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: -1;
  width: min(48vw, 570px);
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 43% 42%, rgba(255, 255, 255, 0.18), transparent 23%),
    radial-gradient(circle at 50% 50%, rgba(58, 128, 255, 0.32), transparent 58%),
    linear-gradient(135deg, rgba(21, 38, 64, 0.5), rgba(2, 9, 18, 0.75));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset -36px -30px 90px rgba(0, 0, 0, 0.5), 0 0 90px rgba(82, 158, 255, 0.28);
}

.orb::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: repeating-linear-gradient(105deg, transparent 0 18px, rgba(255, 255, 255, 0.05) 19px 20px);
  mask-image: radial-gradient(circle, #000 50%, transparent 71%);
}

h1 {
  margin: 0;
  font-size: clamp(4.3rem, 8vw, 7rem);
  line-height: 0.95;
}

.tagline {
  margin: 16px 0 8px;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.subline {
  color: var(--muted);
}

.ask-box {
  display: flex;
  width: min(690px, 100%);
  margin: 34px auto 14px;
  padding: 8px;
  border: 1px solid rgba(185, 211, 255, 0.45);
  border-radius: 999px;
  background: rgba(8, 24, 43, 0.82);
}

.ai-answer {
  display: none;
  width: min(690px, 100%);
  margin: 0 auto 18px;
  padding: 16px 18px;
  border-radius: 10px;
  text-align: left;
}

.ai-answer.active,
.ai-answer:not(:empty) {
  display: block;
}

.ai-answer strong {
  display: block;
  margin: 6px 0 8px;
}

.ai-answer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.ask-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  padding: 0 18px;
}

.ask-box button {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  font-size: 1.5rem;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.quick-prompts button {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #eef4ff;
  background: rgba(255, 255, 255, 0.12);
  padding: 10px 18px;
}

.panel-title,
.asset-head,
.source-table div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-title {
  margin-bottom: 14px;
  text-transform: uppercase;
  font-size: 0.9rem;
  font-weight: 800;
}

.live-dot {
  color: var(--green);
  text-transform: none;
}

.asset-change {
  color: var(--green);
  font-weight: 800;
}

.asset-change.negative {
  color: var(--red);
}

.compact-widget {
  height: 126px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(5, 12, 22, 0.36);
}

.bist-quote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bist-card {
  min-height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(5, 12, 22, 0.5);
  padding: 11px;
}

.bist-card.loading,
.bist-card.error {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.bist-symbol {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: rgba(246, 248, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
}

.bist-price {
  margin-top: 7px;
  font-size: 1.08rem;
  font-weight: 900;
}

.bist-change {
  margin-top: 4px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
}

.bist-change.negative {
  color: var(--red);
}

.market-widget-stack {
  display: grid;
  gap: 10px;
}

.widget-label {
  color: rgba(246, 248, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.legacy-widget {
  display: none;
}

.asset-source,
.asset-status {
  display: block;
  color: rgba(184, 195, 216, 0.72);
  font-size: 0.78rem;
  line-height: 1.35;
}

.ticker-grid,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

.asset-card,
.feature-card,
.source-panel,
.auth-card {
  border-radius: 10px;
}

.asset-card {
  min-height: 122px;
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 20, 34, 0.88), rgba(7, 17, 28, 0.72));
}

.asset-name {
  color: var(--muted);
}

.asset-price {
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 800;
}

.asset-source {
  margin-top: 4px;
}

.asset-status {
  margin-top: 16px;
  padding: 10px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sparkline {
  width: 100%;
  height: 34px;
  margin-top: 10px;
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 28px;
}

.feature-card {
  min-height: 214px;
  padding: 24px;
  overflow: hidden;
}

.feature-card h2 {
  margin: 12px 0 10px;
}

.feature-card p,
.data-section p,
.source-table span {
  color: var(--muted);
  line-height: 1.55;
}

.feature-card button {
  padding: 10px 16px;
  margin-top: 12px;
}

.icon {
  color: #8ebdff;
  font-size: 1.5rem;
}

.source-table {
  display: grid;
  gap: 6px;
}

.source-table div {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.source-table strong {
  white-space: nowrap;
  font-size: 0.82rem;
}

.source-table span {
  text-align: right;
}

.source-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(246, 248, 255, 0.78);
  background: rgba(5, 12, 22, 0.74);
  backdrop-filter: blur(16px);
  padding: 9px 13px;
  font-size: 0.78rem;
  cursor: pointer;
}

.source-panel {
  position: fixed;
  right: 18px;
  bottom: 62px;
  z-index: 21;
  width: min(360px, calc(100vw - 36px));
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.source-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.source-panel p {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.panel-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 4, 12, 0.68);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.auth-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.feature-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 4, 12, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.feature-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.feature-modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  border-radius: 10px;
  padding: 28px;
}

.feature-modal-card h2 {
  margin: 10px 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.feature-modal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.feature-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.feature-modal-grid div {
  min-height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: rgba(246, 248, 255, 0.92);
  background: rgba(255, 255, 255, 0.07);
  padding: 14px;
  line-height: 1.45;
}

.auth-card {
  position: relative;
  width: min(430px, 100%);
  padding: 26px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-tab {
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  padding: 10px 14px;
  cursor: pointer;
}

.link-action {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
}

.auth-tab.active {
  color: var(--ink);
  background: rgba(99, 167, 255, 0.28);
}

.auth-card h2 {
  margin: 0 0 8px;
}

.auth-copy,
.auth-form small {
  color: var(--muted);
  line-height: 1.45;
}

.auth-feedback.success {
  color: var(--green);
}

.auth-feedback.error {
  color: var(--red);
}

.auth-form {
  display: none;
  gap: 14px;
  margin-top: 20px;
}

.auth-form.active {
  display: grid;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: rgba(246, 248, 255, 0.88);
  font-size: 0.92rem;
}

.auth-form input {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(5, 12, 22, 0.74);
  padding: 0 14px;
  outline: 0;
}

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

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

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
    padding-bottom: 24px;
  }

  .weather-card,
  .market-panel {
    width: min(100%, 560px);
    margin: 20px auto 0;
  }

  .ticker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 0 18px 30px;
  }

  .topbar {
    height: auto;
    padding: 18px 0;
    flex-wrap: wrap;
  }

  .navlinks {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .auth-actions {
    margin-left: auto;
  }

  .hero-copy {
    padding-top: 38px;
  }

  .ticker-grid,
  .feature-grid,
  .data-section {
    grid-template-columns: 1fr;
  }

  .feature-modal-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 4rem;
  }
}
