
/* WORDWISE — GLOBAL STYLES */

:root {
  --primary: #5058e8;
  --primary-dark: #383fc3;
  --primary-light: #eef0ff;
  --text: #19213a;
  --muted: #68728a;
  --background: #f7f8fc;
  --white: #ffffff;
  --border: #e5e8f1;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.6;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

section[id] {
  scroll-margin-top: 95px;
}

/* HEADER */

.site-header {
  position: relative;
  z-index: 10;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.nav {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--text);
}

.logo span {
  color: var(--primary);
}

.nav nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav nav a:hover {
  color: var(--primary);
}

/* HERO */

.hero {
  padding-top: 74px;
  padding-bottom: 48px;
  text-align: center;
}

.eyebrow,
.section-label {
  display: inline-block;
  padding: 8px 15px;
  border-radius: 100px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.hero h1 {
  margin: 24px 0 16px;
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 800;
  letter-spacing: -2.5px;
  line-height: 1.13;
}

.hero h1 span {
  color: var(--primary);
}

.hero > p {
  max-width: 650px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

/* WORKSPACE */

.workspace {
  padding-bottom: 80px;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 22px;
}

.workspace-header h2 {
  margin: 0 0 4px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -0.6px;
}

.workspace-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  min-height: 43px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-light {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}

.btn-light:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-dark {
  background: var(--text);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--primary);
}

/* EDITOR & STATISTICS LAYOUT */

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr);
  gap: 22px;
  align-items: stretch;
}

.editor-panel,
.stats-panel {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 35px rgba(31, 41, 90, 0.035);
}

.editor-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#textInput {
  width: 100%;
  min-height: 475px;
  flex: 1;
  padding: 30px;
  resize: vertical;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.9;
}

#textInput::placeholder {
  color: #9ba3b5;
}

.editor-panel:focus-within {
  border-color: #a9adf8;
  box-shadow: 0 0 0 3px rgba(80, 88, 232, 0.12);
}

.editor-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 17px 24px;
  border-top: 1px solid var(--border);
  background: #fcfcff;
  color: var(--muted);
  font-size: 12px;
}

#editorStatus {
  color: var(--primary);
  font-weight: 700;
}

/* STATISTICS PANEL */

.stats-panel {
  padding: 26px;
}

.stats-panel h3 {
  margin: 0 0 2px;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.stats-description {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-width: 0;
  min-height: 115px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  border-radius: 13px;
  background: var(--background);
  border: 1px solid var(--border);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stat-card strong {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  overflow-wrap: anywhere;
}

.primary-stat {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.primary-stat .stat-label {
  color: rgba(255, 255, 255, 0.85);
}

.time-estimates {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.time-estimates > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.time-estimates span {
  color: var(--muted);
  font-size: 13px;
}

.time-estimates strong {
  font-size: 14px;
  white-space: nowrap;
}

.action-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

/* ABOUT SECTION */

.about-section {
  padding-top: 64px;
  padding-bottom: 100px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.about-section h2 {
  margin: 20px 0 12px;
  font-size: clamp(29px, 4vw, 42px);
  letter-spacing: -1.5px;
  line-height: 1.2;
}

.about-section > p {
  max-width: 610px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 42px;
  text-align: left;
}

.feature-card {
  padding: 27px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature-card h3 {
  margin: 0 0 9px;
  font-size: 17px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

/* FOOTER */

.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
}

.footer-inner {
  min-height: 105px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-inner .logo {
  font-size: 22px;
}

.footer-inner p,
.footer-inner > span:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* ACCESSIBILITY */

.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;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* TABLET */

@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  #textInput {
    min-height: 380px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* MOBILE */

@media (max-width: 600px) {
  .container {
    width: calc(100% - 32px);
  }

  .nav {
    min-height: 70px;
  }

  .logo {
    font-size: 23px;
  }

  .nav nav {
    gap: 14px;
  }

  .nav nav a {
    font-size: 12px;
  }

  .hero {
    padding-top: 52px;
    padding-bottom: 40px;
  }

  .hero h1 {
    letter-spacing: -1.5px;
  }

  .hero > p {
    font-size: 14px;
  }

  .workspace-header {
    align-items: flex-start;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar .btn {
    flex: 1;
    padding: 10px 9px;
    font-size: 12px;
  }

  #textInput {
    min-height: 340px;
    padding: 20px;
    font-size: 15px;
  }

  .stats-panel {
    padding: 20px;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-card strong {
    font-size: 27px;
  }

  .about-section {
    padding-top: 55px;
    padding-bottom: 65px;
  }

  .feature-grid {
    margin-top: 28px;
    gap: 14px;
  }

  .footer-inner {
    flex-direction: column;
    justify-content: center;
    padding-block: 26px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .nav nav a {
    transition: none;
@media (max-width: 600px) {
  .stats-grid .stat-card:last-child {
    grid-column: 1 / -1;
    min-height: 90px;
  }
}
  }
}
