/* Dictly website. Colors follow lib/core/theme/app_colors.dart. */

:root {
  --primary: #4f46e5;
  --on-primary: #ffffff;
  --primary-container: #e0e7ff;
  --on-primary-container: #312e81;
  --secondary: #f97316;
  --secondary-container: #ffedd5;
  --on-secondary-container: #7c2d12;
  --tertiary-container: #fae8ff;
  --on-tertiary-container: #701a75;
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #efeff6;
  --text: #18172a;
  --text-2: #5c5b75;
  --border: #e4e4ee;
  --success: #15803d;
  --success-container: #dcfce7;
  --error: #dc2626;
  --error-container: #fee2e2;
  --on-error-container: #7f1d1d;
  --info-container: #cffafe;
  --on-info-container: #164e63;
  --note-paper: #fff8ec;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(24 23 42 / 6%), 0 8px 24px rgb(24 23 42 / 6%);
  --max: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
    "Noto Sans Devanagari", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #8b93fa;
    --on-primary: #1e1b4b;
    --primary-container: #3730a3;
    --on-primary-container: #e0e7ff;
    --secondary: #fb923c;
    --secondary-container: #7c2d12;
    --on-secondary-container: #ffedd5;
    --tertiary-container: #86198f;
    --on-tertiary-container: #fae8ff;
    --bg: #111024;
    --surface: #1c1b33;
    --surface-2: #2e2c4a;
    --text: #eeeef8;
    --text-2: #a6a5c0;
    --border: #2e2c4a;
    --success: #4ade80;
    --success-container: #14532d;
    --error: #f87171;
    --error-container: #991b1b;
    --on-error-container: #fee2e2;
    --info-container: #155e75;
    --on-info-container: #cffafe;
    --note-paper: #2a2236;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

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

a {
  color: var(--primary);
  text-underline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
}

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

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.site-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 8px;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%2383829B' d='M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z'/%3E%3C/svg%3E")
    no-repeat right 10px center / 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 30px 7px 12px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .site-nav {
    display: none;
  }
  .lang-select {
    margin-left: auto;
  }
}

/* Phosphor icons (inline SVG, https://phosphoricons.com, MIT) */

.ph {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  border-radius: 12px;
  padding: 12px 20px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn .ph {
  width: 18px;
  height: 18px;
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  filter: brightness(1.08);
}
.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

/* Official Google Play badge artwork (trimmed of its transparent margin).
   Google asks that the badge is not altered and is at least as tall as
   other store badges; keep clear space around it. */
.play-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 10px;
}
.play-badge img {
  height: 56px;
  width: auto;
}
.ios-soon {
  font-size: 0.95rem;
  color: var(--text-2);
}

/* Landing page */

.hero {
  padding: 64px 0 56px;
  overflow: hidden;
}
.hero .container > * {
  min-width: 0;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--on-primary-container);
  background: var(--primary-container);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.hero h1 .accent {
  color: var(--primary);
}
.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-2);
  margin: 0 0 28px;
  max-width: 34em;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 0.95rem;
}
.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-facts .ph {
  width: 16px;
  height: 16px;
  color: var(--success);
}

/* Phone mockup with a dictation sentence */

.phone {
  position: relative;
  width: min(320px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 10px solid #18172a;
  border-radius: 40px;
  box-shadow: var(--shadow), 0 30px 60px rgb(79 70 229 / 18%);
  padding: 22px 18px 26px;
}
.phone::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 70px;
  height: 6px;
  margin-left: -35px;
  border-radius: 6px;
  background: var(--surface-2);
}
.phone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-2);
  margin: 8px 0 14px;
}
.phone-progress {
  height: 6px;
  border-radius: 6px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 18px;
}
.phone-progress span {
  display: block;
  width: 62%;
  height: 100%;
  background: var(--primary);
}
.phone-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  font-size: 1.02rem;
  line-height: 1.9;
  min-height: 118px;
}
.w {
  padding: 1px 4px;
  border-radius: 5px;
}
.w-ok {
  color: var(--success);
  background: var(--success-container);
}
.w-bad {
  color: var(--error);
  background: var(--error-container);
  text-decoration: line-through;
}
.w-todo {
  color: var(--text-2);
  border-bottom: 2px dashed var(--border);
  border-radius: 0;
}
.caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  vertical-align: -0.2em;
  background: var(--primary);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .caret {
    animation: none;
  }
}
.phone-translation {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-2);
}
.phone-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}
.phone-controls span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 700;
}
.phone-controls .ph {
  width: 18px;
  height: 18px;
}
.phone-controls span.play .ph {
  width: 24px;
  height: 24px;
}
.phone-controls span.play {
  width: 58px;
  height: 58px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 1.2rem;
}

/* Sections */

.section {
  padding: 64px 0;
}
.section-tight {
  padding-top: 0;
}
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-head {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.section-head p {
  color: var(--text-2);
  margin: 0;
  font-size: 1.05rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}
.steps li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  margin-bottom: 12px;
}
.steps h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.steps p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.95rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.feature:nth-child(3n + 1) .feature-icon {
  background: var(--primary-container);
}
.feature:nth-child(3n + 2) .feature-icon {
  background: var(--secondary-container);
}
.feature:nth-child(3n) .feature-icon {
  background: var(--tertiary-container);
}
.feature-icon .ph {
  width: 24px;
  height: 24px;
}
.feature:nth-child(3n + 1) .feature-icon {
  color: var(--on-primary-container);
}
.feature:nth-child(3n + 2) .feature-icon {
  color: var(--on-secondary-container);
}
.feature:nth-child(3n) .feature-icon {
  color: var(--on-tertiary-container);
}
.feature h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.feature p {
  margin: 0;
  color: var(--text-2);
}

.topics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
.topic {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.topic:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
@media (prefers-reduced-motion: reduce) {
  .topic {
    transition: none;
  }
  .topic:hover {
    transform: none;
  }
}
.topic-cover {
  position: relative;
  aspect-ratio: 1;
  background: #e0e7ff;
}
/* Covers are square: height: auto overrides the height attribute, so the
   whole picture shows at the card width. */
.topic-cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.topic-level {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #312e81;
  background: rgb(255 255 255 / 92%);
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgb(24 23 42 / 15%);
}
.topic figcaption {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
  text-align: left;
}
.topic-name {
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--text);
}
.topic-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-2);
}
.topic-meta .ph {
  width: 16px;
  height: 16px;
  color: var(--secondary);
}

.audience {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.audience .feature {
  background: var(--bg);
}

.cta {
  text-align: center;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 24px;
  padding: 48px 24px;
}
.cta h2 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}
.cta p {
  margin: 0 0 24px;
  opacity: 0.9;
}

@media (max-width: 960px) {
  .hero .container {
    grid-template-columns: 1fr;
  }
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .features,
  .audience {
    grid-template-columns: repeat(2, 1fr);
  }
  .topics {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .hero {
    padding-top: 40px;
  }
  .steps,
  .features,
  .audience {
    grid-template-columns: 1fr;
  }
  .topics {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Document pages (privacy, terms, delete account) */

.doc {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}
.doc h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.doc .meta {
  color: var(--text-2);
  margin: 0 0 28px;
  font-size: 0.95rem;
}
.doc h2 {
  font-size: 1.3rem;
  margin: 40px 0 12px;
  padding-top: 8px;
}
.doc h3 {
  font-size: 1.05rem;
  margin: 24px 0 8px;
}
.doc p,
.doc li {
  color: var(--text);
}
.doc ul,
.doc ol {
  padding-left: 1.4em;
}
.doc li {
  margin-bottom: 6px;
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.95rem;
}
.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.doc th {
  background: var(--surface-2);
  font-weight: 600;
}
.table-wrap {
  overflow-x: auto;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 0 0 8px;
}
.toc strong {
  display: block;
  margin-bottom: 6px;
}
.toc ol {
  margin: 0;
  columns: 2;
  column-gap: 32px;
}
.toc li {
  margin-bottom: 2px;
  break-inside: avoid;
}
@media (max-width: 560px) {
  .toc ol {
    columns: 1;
  }
}

.callout {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  border: 1px solid var(--border);
  background: var(--surface);
}
.callout p:first-child {
  margin-top: 0;
}
.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 0;
}
.callout-info {
  background: var(--primary-container);
  border-color: transparent;
}
.callout-info,
.callout-info p,
.callout-info li {
  color: var(--on-primary-container);
}
.callout-warn {
  background: var(--error-container);
  border-color: transparent;
}
.callout-warn,
.callout-warn p,
.callout-warn li {
  color: var(--on-error-container);
}

.doc .step-list {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 16px 0;
}
.step-list > li {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px 16px 68px;
  margin-bottom: 12px;
}
.step-list > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}
.step-list strong.ui {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
.option-grid .callout {
  margin: 0;
}
@media (max-width: 640px) {
  .option-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  color: var(--text-2);
  font-size: 0.92rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-links a {
  color: var(--text-2);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}
.site-footer p {
  margin: 0 0 4px;
}

/* 404 */

.not-found {
  text-align: center;
  padding: 96px 20px;
}
.not-found h1 {
  font-size: 4rem;
  margin: 0;
  color: var(--primary);
}
