:root {
  --bg: #08111d;
  --bg-strong: #101c2d;
  --panel: rgba(17, 25, 39, 0.9);
  --panel-strong: rgba(22, 33, 49, 0.96);
  --line: rgba(136, 165, 255, 0.25);
  --text: #edf7ff;
  --muted: #9fb8d6;
  --cyan: #72e9ff;
  --blue: #82a8ff;
  --green: #8ee9b0;
  --purple: #b39cff;
  --orange: #ffca7a;
  --shadow: rgba(7, 12, 20, 0.6);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(130, 168, 255, 0.18), transparent 32%),
    linear-gradient(180deg, var(--bg) 0%, #0a1624 100%);
  color: var(--text);
  font-family: 'Segoe UI', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: none;
}

::placeholder {
  color: rgba(159, 184, 214, 0.7);
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #06111a;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(114, 233, 255, 0.25);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.6rem, 2vw, 2.4rem);
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18rem;
  color: var(--cyan);
  text-transform: uppercase;
  opacity: 0.9;
}

.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.96rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(17, 25, 39, 0.95), rgba(20, 32, 49, 0.82));
  box-shadow: 0 24px 60px var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.hero-copy h2 {
  font-size: clamp(2.3rem, 4vw, 4rem);
  letter-spacing: -0.06em;
  line-height: 1.08;
}

.hero-copy p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.04rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 0 18px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.todo-form .button,
.ai-input-row .button {
  min-width: 110px;
  flex-shrink: 0;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, var(--cyan), var(--green));
  color: #08131d;
  box-shadow: 0 12px 24px rgba(114, 233, 255, 0.2);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--text);
}

.button.full {
  width: 100%;
}

.hero-panel {
  display: grid;
  gap: 16px;
}

.mini-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px;
}

.mini-stat span {
  color: var(--muted);
}

.mini-stat strong {
  font-size: 1.6rem;
}

.mini-stat.accent {
  background: linear-gradient(135deg, rgba(114, 233, 255, 0.08), rgba(179, 156, 255, 0.08));
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 26px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 18px 42px rgba(4, 8, 18, 0.35);
}

.full-card {
  grid-column: 1 / -1;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-head h3 {
  font-size: 1.3rem;
}

.card-head span {
  color: var(--cyan);
  font-size: 0.72rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}

.calculator {
  display: grid;
  gap: 16px;
}

.calc-display {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  font-size: clamp(1.8rem, 2vw, 2.4rem);
  background: rgba(8, 14, 22, 0.75);
  overflow: hidden;
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.calc-btn {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.calc-btn.op {
  background: rgba(114, 233, 255, 0.08);
}

.calc-btn.equal {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #07131d;
  font-weight: 800;
}

.calc-btn.wide {
  grid-column: span 2;
}

.form-group {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

label {
  color: var(--muted);
  font-size: 0.94rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 10, 17, 0.7);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.result-box {
  margin-top: 16px;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(142, 233, 176, 0.12);
  border: 1px solid rgba(142, 233, 176, 0.3);
  color: var(--green);
  font-weight: 700;
}

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

.stats-row div {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}

.stats-row span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 6px;
}

.unit-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
  margin-bottom: 12px;
}

.todo-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.todo-form input {
  flex: 1;
  min-width: 0;
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.todo-item input[type='checkbox'] {
  width: 18px;
  height: 18px;
}

.todo-item span {
  flex: 1;
  color: var(--text);
}

.remove-btn {
  border: none;
  background: rgba(255, 118, 118, 0.12);
  color: #ffd5d5;
  padding: 7px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.ai-card {
  grid-column: 1 / -1;
}

.ai-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 8px;
}

.message {
  max-width: 80%;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.6;
}

.message.bot {
  align-self: flex-start;
  background: rgba(114, 233, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  color: #07131d;
  font-weight: 700;
}

.ai-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.ai-input-row input {
  flex: 1;
  min-width: 0;
}

.ai-input-row .button {
  width: 94px;
  min-width: 94px;
  height: 54px;
  border-radius: 999px;
}

@media (max-width: 840px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .todo-form,
  .unit-row,
  .ai-input-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .todo-form .button,
  .ai-input-row .button {
    width: 100%;
    min-width: 100%;
  }
}
