/* KrutiDev Typing Tutor — website theme (mirrors app mint brand) */
:root {
  --brand: #80ff80;
  --brand-dark: #3dcc5a;
  --brand-soft: #b8ffb8;
  --brand-glow: #e6ffe6;
  --accent: #0f7a32;
  --accent-deep: #0a5c25;
  --ink: #0a2e14;
  --ink-muted: #1f5a32;
  --surface: #f3fff3;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(10, 46, 20, 0.12);
  --radius: 14px;
  --max: 920px;
  --font: "Segoe UI", "Trebuchet MS", "Gill Sans", sans-serif;
  --display: "Segoe UI Semibold", "Segoe UI", "Trebuchet MS", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #ffffffaa, transparent 50%),
    radial-gradient(ellipse 70% 40% at 100% 0%, #b8ffb866, transparent 45%),
    linear-gradient(165deg, var(--brand) 0%, var(--brand-soft) 45%, var(--brand-glow) 100%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.shell {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
  animation: kd-fade-up 0.45s ease both;
}

@keyframes kd-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.brand {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.brand span {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-links a {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(15, 122, 50, 0.12);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--white);
  background: var(--accent);
  border-color: var(--accent);
}

.chip {
  display: inline-block;
  margin: 0.35rem auto 1rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 122, 50, 0.15);
}

.page-title {
  margin: 0 0 0.35rem;
  text-align: center;
  font-family: var(--display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  color: var(--ink);
}

.site-logo {
  display: block;
  width: min(220px, 58vw);
  height: auto;
  margin: 0.35rem auto 0.85rem;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(10, 46, 20, 0.18);
}

.page-sub {
  margin: 0 auto 1.5rem;
  max-width: 36rem;
  text-align: center;
  color: var(--ink-muted);
  line-height: 1.5;
}

.menu {
  display: grid;
  gap: 0.7rem;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.4rem;
  padding: 0.85rem 1.1rem;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--white);
  background: var(--accent);
  box-shadow: 0 4px 0 var(--accent-deep);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--accent-deep);
}

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 3px 0 rgba(15, 122, 50, 0.2);
}

.btn-ghost:hover {
  background: var(--white);
}

.hero-card {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 300px;
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(160deg, rgba(10, 46, 20, 0.2), rgba(10, 46, 20, 0.62)),
    linear-gradient(135deg, #145a2c, #0f7a32 42%, #3dcc5a);
  box-shadow: var(--shadow);
  color: var(--white);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(10, 46, 20, 0.22);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -35deg,
      transparent,
      transparent 14px,
      rgba(255, 255, 255, 0.04) 14px,
      rgba(255, 255, 255, 0.04) 28px
    );
  pointer-events: none;
}

.hero-card .label {
  position: absolute;
  left: 1.1rem;
  bottom: 1.1rem;
  z-index: 1;
  font-size: 1.7rem;
  font-weight: 800;
}

.hero-card .hint {
  position: absolute;
  left: 1.1rem;
  bottom: 3.4rem;
  z-index: 1;
  max-width: 18rem;
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.4;
}

.panel {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 122, 50, 0.12);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.panel p,
.panel li {
  color: var(--ink-muted);
  line-height: 1.55;
}

.download-app {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(232, 255, 232, 0.95));
}

.download-app p {
  margin: 0 0 1rem;
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: auto;
  min-width: 200px;
  padding: 0.65rem 1.1rem;
  background: #111;
  box-shadow: 0 4px 0 #000;
  color: #fff;
}

.btn-play:hover {
  background: #222;
}

.btn-play .play-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: #80ff80;
  color: #0a2e14;
  font-size: 0.85rem;
  font-weight: 800;
}

.btn-play .play-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}

.btn-play .play-text small {
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.btn-play .play-text strong {
  font-size: 1.05rem;
  font-weight: 800;
}

.seo-copy p {
  margin: 0 0 0.75rem;
}

.seo-copy p:last-child {
  margin-bottom: 0;
}

.steps {
  display: grid;
  gap: 0.85rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 122, 50, 0.12);
}

.step-num {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  font-weight: 800;
  color: var(--white);
  background: var(--accent);
}

.footer-note {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 46, 20, 0.45);
  backdrop-filter: blur(4px);
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: min(100%, 420px);
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid rgba(15, 122, 50, 0.15);
  box-shadow: var(--shadow);
}

.modal h3 {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 1.25rem;
}

.modal .btn {
  margin-bottom: 0.55rem;
}

.modal .btn:last-child {
  margin-bottom: 0;
}

/* Editor */
.editor-shell {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 122, 50, 0.12);
}

.editor-toolbar .tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.editor-toolbar select,
.editor-toolbar button {
  min-height: 2.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 122, 50, 0.2);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.editor-area {
  min-height: 55vh;
  padding: 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 122, 50, 0.15);
  background: var(--white);
  box-shadow: var(--shadow);
  font-size: 1.25rem;
  line-height: 1.6;
  outline: none;
  white-space: pre-wrap;
}

.editor-area.font-krutidev {
  font-family: krutidev, "Kruti Dev 010", sans-serif;
  font-size: 1.55rem;
}

.editor-area.font-english {
  font-family: "Consolas", "Courier New", monospace;
}

.layout-top .editor-toolbar {
  order: -1;
}

.layout-bottom {
  display: flex;
  flex-direction: column;
}

.layout-bottom .editor-toolbar {
  order: 2;
}

.layout-default .editor-toolbar {
  order: 0;
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-card {
    min-height: 220px;
  }
}
