/* ==========================================================================
   Home — hero, converter, tense picker, results, history
   ========================================================================== */

.home-page main.shell {
  padding-bottom: var(--space-7);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  align-items: center;
  gap: clamp(32px, 6vw, 82px);
  padding: clamp(44px, 7vw, 88px) 0 clamp(38px, 5vw, 66px);
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0 0 var(--space-5);
  font-size: var(--text-display);
  line-height: 0.99;
  letter-spacing: -0.065em;
  font-weight: 800;
}

.gradient-text {
  background: linear-gradient(105deg, var(--primary) 8%, #8b5cf6 48%, #d946ef 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

html[data-theme="dark"] .gradient-text {
  background: linear-gradient(105deg, #a5b4fc 8%, #c4b5fd 48%, #f0abfc 96%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 7px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--primary-soft) 70%, transparent);
  color: var(--primary);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.hero-copy .hero-text {
  max-width: 620px;
  margin-bottom: var(--space-6);
  font-size: 1.03rem;
}

.hero-copy .hero-text strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--space-6);
}

.hero-actions .primary-button,
.hero-actions .secondary-button {
  min-height: 46px;
  padding-inline: 20px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--muted);
  font-size: 0.76rem;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hero-meta span + span::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  margin-right: 10px;
  background: var(--line-strong);
}

.hero-meta strong {
  color: var(--ink-soft);
  font-weight: 750;
}

/* Preview card */
.hero-preview {
  position: relative;
  min-width: 0;
}

.preview-window {
  position: relative;
  z-index: 1;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--radius-2xl);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-soft) 82%, transparent));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    var(--shadow-xl);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  transform: rotate(-1.2deg);
  transition: transform var(--duration-slow) var(--ease-spring), box-shadow var(--duration-slow) ease;
}

.hero-preview:hover .preview-window {
  transform: rotate(0deg) translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 44px 120px rgba(79, 70, 229, 0.16);
}

html[data-theme="dark"] .preview-window {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    var(--shadow-xl);
}

.preview-glow {
  position: absolute;
  inset: 8% 4% -4%;
  border-radius: 50%;
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.38), rgba(217, 70, 239, 0.24));
  filter: blur(70px);
  opacity: 0.65;
  z-index: 0;
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 3px 15px;
  border-bottom: 1px solid var(--line);
}

.preview-dots {
  display: inline-flex;
  gap: 5px;
}

.preview-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.preview-dots i:first-child { background: #f87171; }
.preview-dots i:nth-child(2) { background: #fbbf24; }
.preview-dots i:nth-child(3) { background: #34d399; }

.preview-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.preview-status span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent);
}

.preview-line,
.preview-result {
  padding: 16px 14px;
  border-radius: var(--radius-md);
}

.preview-line {
  margin-top: 14px;
  background: var(--surface-soft);
}

.preview-result {
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 86%, transparent), color-mix(in srgb, var(--surface) 90%, transparent));
}

.preview-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.preview-result .preview-label {
  color: var(--primary);
}

.preview-line p,
.preview-result p {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.preview-result p {
  font-size: 1.15rem;
  font-weight: 750;
}

.preview-result code {
  display: block;
  margin-top: 8px;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 0.67rem;
}

.preview-arrow {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  margin: -1px auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
  font-size: 0.8rem;
  box-shadow: var(--shadow-sm);
}

.preview-note {
  display: flex;
  gap: 9px;
  margin-top: 13px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warning-soft) 78%, transparent);
}

.preview-note p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.75rem;
  line-height: 1.5;
}

.preview-note strong {
  color: var(--ink-soft);
}

.preview-spark {
  color: var(--warning);
  font-size: 0.84rem;
}

/* --------------------------------------------------------------------------
   Section heading
   -------------------------------------------------------------------------- */
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: var(--space-6) 0 var(--space-4);
}

.section-heading .eyebrow {
  margin-bottom: 3px;
}

.section-heading h2 {
  margin: 0;
  font-size: var(--text-h2);
  letter-spacing: -0.045em;
}

.section-hint {
  color: var(--muted);
  font-size: 0.76rem;
}

/* --------------------------------------------------------------------------
   Converter
   -------------------------------------------------------------------------- */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 20px;
  align-items: stretch;
  scroll-margin-top: 90px;
}

.input-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.input-card {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-heading h3 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -0.025em;
}

.card-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.textarea-wrap {
  position: relative;
}

textarea {
  width: 100%;
  min-height: 138px;
  resize: vertical;
  padding: 15px 15px 34px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--ink);
  line-height: 1.6;
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), background var(--duration-fast);
}

textarea:hover {
  border-color: var(--line-strong);
}

textarea:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
}

textarea::placeholder {
  color: var(--muted);
  opacity: 0.72;
}

.char-count {
  position: absolute;
  right: 11px;
  bottom: 9px;
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0 17px;
}

.examples-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.example-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted-strong);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  font-size: 0.69rem;
  transition: 160ms ease;
}

.example-chip:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

/* Tense trigger */
.tense-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}

.tense-trigger:hover {
  border-color: color-mix(in srgb, var(--primary) 48%, var(--line));
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.tense-trigger:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
}

.tense-trigger-orb {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 850;
  box-shadow: var(--shadow-primary);
}

.tense-trigger-copy {
  min-width: 0;
  display: grid;
  gap: 0;
}

.tense-trigger-eyebrow {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.tense-trigger-copy strong {
  overflow: hidden;
  font-size: 0.93rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tense-trigger-copy small {
  color: var(--muted);
  font-size: 0.7rem;
}

.tense-trigger-group {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.62rem;
  font-weight: 800;
}

.tense-trigger.tone-past .tense-trigger-orb {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.22);
}

.tense-trigger.tone-past .tense-trigger-group {
  background: var(--warning-soft);
  color: var(--warning);
}

.tense-trigger.tone-future .tense-trigger-orb {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
}

.tense-trigger.tone-future .tense-trigger-group {
  background: #e0f2fe;
  color: #0369a1;
}

html[data-theme="dark"] .tense-trigger.tone-future .tense-trigger-group {
  background: #122f47;
  color: #7dd3fc;
}

.tense-trigger-chevron {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform var(--duration-normal) var(--ease-out);
}

.tense-trigger[aria-expanded="true"] .tense-trigger-chevron {
  transform: rotate(180deg);
}

.submit-button {
  width: 100%;
  min-height: 47px;
}

.spinner {
  width: 16px;
  height: 16px;
  display: none;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.primary-button.is-loading .spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 0.8rem;
}

.keyboard-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.67rem;
  text-align: center;
}

.keyboard-hint kbd {
  display: inline-block;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted-strong);
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Result card
   -------------------------------------------------------------------------- */
.result-card {
  min-height: 490px;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.empty-state {
  margin: auto;
  max-width: 365px;
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
}

.empty-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.empty-bubble {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.empty-bubble.bubble-b {
  background: var(--primary-soft);
  color: var(--primary);
}

.empty-arrow {
  color: var(--muted);
  font-size: 1.05rem;
}

.empty-state h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.empty-state p {
  margin: 0 0 14px;
  font-size: 0.85rem;
}

.empty-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary);
  font-size: 0.79rem;
  font-weight: 700;
  text-decoration: none;
}

.empty-link:hover {
  text-decoration: underline;
}

.loading-state {
  padding-top: 8px;
}

.skeleton {
  border-radius: 9px;
  background: linear-gradient(90deg, var(--surface-soft) 25%, var(--surface) 50%, var(--surface-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.skeleton-title { width: 42%; height: 25px; margin-bottom: 24px; }
.skeleton-line { width: 100%; height: 14px; margin-bottom: 10px; }
.skeleton-line.short { width: 68%; }
.skeleton-box { width: 100%; height: 190px; margin-top: 27px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.result-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: page-in 280ms var(--ease-out) both;
}

.result-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.result-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-top h2 {
  margin: 0;
  font-size: 1.32rem;
  letter-spacing: -0.035em;
}

.language-badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 0.65rem;
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 3px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.tab {
  flex: 1;
  border: 0;
  border-radius: 9px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 700;
  transition: 160ms ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  animation: fade-in 200ms ease both;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.sentence-block {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.sentence-block:first-child { padding-top: 0; }
.sentence-block:last-child { border-bottom: 0; }

.sentence-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.sentence-label {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.copy-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 0.69rem;
  font-weight: 700;
  padding: 2px;
}

.copy-button:hover {
  text-decoration: underline;
}

.sentence {
  margin: 0;
  font-size: clamp(1.08rem, 2.2vw, 1.34rem);
  line-height: 1.48;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.sentence.english { font-weight: 750; }
.sentence.turkish { color: var(--muted-strong); }

.structure-box {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px dashed color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary-soft) 54%, transparent);
}

.structure-label {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.structure-box code {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.structure-note,
.explanation-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.65;
}

.explanation-summary {
  margin-bottom: 14px;
  color: var(--ink-soft);
}

.keyword-list {
  display: grid;
  gap: 8px;
}

.keyword-card {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.keyword-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 2px;
}

.keyword-term {
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
}

.keyword-role {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.keyword-card p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.78rem;
  line-height: 1.55;
}

.no-keywords {
  color: var(--muted);
  font-size: 0.82rem;
}

.result-error {
  margin: auto;
  max-width: 360px;
  text-align: center;
}

.result-error h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.result-error p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.84rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

/* --------------------------------------------------------------------------
   Tense picker overlay
   -------------------------------------------------------------------------- */
.tense-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.tense-modal[hidden] { display: none; }

.tense-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 12%, rgba(79, 70, 229, 0.24), transparent 29%),
    radial-gradient(circle at 82% 82%, rgba(217, 70, 239, 0.16), transparent 27%),
    rgba(9, 11, 22, 0.58);
  -webkit-backdrop-filter: blur(13px) saturate(112%);
  backdrop-filter: blur(13px) saturate(112%);
  animation: tense-fade 200ms ease both;
}

.tense-sheet {
  position: relative;
  width: min(1040px, 100%);
  max-height: min(92vh, 900px);
  overflow-y: auto;
  padding: 28px 30px 23px;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: var(--radius-2xl);
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 70, 239, 0.07), transparent 32%),
    radial-gradient(circle at 0% 0%, rgba(79, 70, 229, 0.1), transparent 32%),
    var(--surface);
  box-shadow: var(--shadow-xl);
  animation: tense-sheet-in 420ms var(--ease-out) both;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.tense-sheet::-webkit-scrollbar { width: 6px; }
.tense-sheet::-webkit-scrollbar-thumb { border-radius: 99px; background: var(--line-strong); }

.tense-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.tense-sheet-kicker {
  margin: 0 0 3px;
  color: var(--primary);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.17em;
}

.tense-sheet-head h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3.1vw, 2.02rem);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.tense-sheet-lead {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.tense-sheet-close {
  flex: 0 0 auto;
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 200ms ease, border-color 180ms, color 180ms;
}

.tense-sheet-close:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(90deg);
}

.tense-selected-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, color-mix(in srgb, var(--primary-soft) 76%, transparent), var(--surface));
}

.tense-selected-preview span {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 700;
}

.tense-selected-preview strong {
  color: var(--primary);
  font-size: 0.79rem;
  text-align: right;
}

.tense-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tense-group {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-soft) 55%, transparent);
  animation: tense-group-in 360ms var(--ease-out) both;
}

.tense-group:nth-child(2) { animation-delay: 55ms; }
.tense-group:nth-child(3) { animation-delay: 110ms; }

.tense-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 1px 3px 9px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.tense-group-heading h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 0.8rem;
}

.tense-group-heading h3::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
}

.tense-group.tone-past .tense-group-heading h3::before {
  background: var(--warning);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 14%, transparent);
}

.tense-group.tone-future .tense-group-heading h3::before {
  background: #0ea5e9;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.tense-group-heading span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 650;
}

.tense-group-list {
  display: grid;
  gap: 6px;
}

.tense-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  padding: 10px 11px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition:
    border-color 170ms ease,
    box-shadow 190ms ease,
    transform 170ms ease,
    background 170ms ease;
}

.tense-option:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.tense-option:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.tense-option.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), var(--surface));
  box-shadow: var(--shadow-sm);
}

.tense-option-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tense-option-names {
  display: grid;
  gap: 0;
}

.tense-option-names strong {
  font-size: 0.82rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.tense-option-names small {
  color: var(--muted);
  font-size: 0.67rem;
}

.tense-option-check {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  transition: 170ms ease;
}

.tense-option.selected .tense-option-check {
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: var(--shadow-primary);
}

.tense-option-form {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.tense-option-desc {
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.tense-sheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 19px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.tense-sheet-footer > span {
  color: var(--muted);
  font-size: 0.69rem;
}

.tense-sheet-footer kbd {
  display: inline-block;
  min-width: 19px;
  margin: 0 2px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted-strong);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 700;
  text-align: center;
}

body.tense-picker-open {
  overflow: hidden;
}

@keyframes tense-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tense-sheet-in {
  from { opacity: 0; transform: translateY(24px) scale(0.965); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes tense-group-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--primary) 0%, transparent); }
}

/* --------------------------------------------------------------------------
   Lessons / CTA
   -------------------------------------------------------------------------- */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.lesson-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.lesson-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  box-shadow: var(--shadow-md);
}

.lesson-symbol {
  flex: 0 0 auto;
  min-width: 42px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
}

.lesson-card h3 {
  margin: 0 0 2px;
  font-size: 0.81rem;
}

.lesson-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.practice-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 26px 0;
  padding: 25px 28px;
  border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--line));
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 70, 239, 0.12), transparent 36%),
    linear-gradient(120deg, color-mix(in srgb, var(--primary-soft) 72%, transparent), var(--surface));
  box-shadow: var(--shadow-sm);
}

.practice-cta .eyebrow { margin-bottom: 2px; }
.practice-cta h2 { margin: 0 0 3px; font-size: 1.23rem; letter-spacing: -0.035em; }
.practice-cta p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.practice-cta .primary-button { flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   History
   -------------------------------------------------------------------------- */
.history-section {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface) 54%, transparent);
}

.history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.history-heading .eyebrow { margin-bottom: 2px; }
.history-heading h2 { margin: 0; font-size: 1.08rem; letter-spacing: -0.03em; }
.history-heading p:not(.eyebrow) { margin: 2px 0 0; color: var(--muted); font-size: 0.78rem; }

.history-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.history-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.history-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  transition: border-color 160ms, transform 160ms, box-shadow 160ms;
}

.history-item:hover {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.history-item.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent);
}

.history-item.active .history-dot {
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
}

.history-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.history-copy { min-width: 0; }

.history-source {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 0.69rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-result {
  margin: 0;
  color: var(--ink);
  font-size: 0.79rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-tense {
  display: inline-block;
  margin-top: 3px;
  color: var(--primary);
  font-size: 0.62rem;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .home-hero {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .hero-preview {
    max-width: 620px;
    width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .result-card {
    min-height: 400px;
  }

  .lesson-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .tense-groups {
    grid-template-columns: 1fr;
  }

  .tense-sheet {
    max-height: 94vh;
  }
}

@media (max-width: 700px) {
  .hero-copy h1 {
    letter-spacing: -0.055em;
  }

  .hero-meta span + span::before {
    display: none;
  }

  .hero-meta {
    gap: 7px 14px;
  }

  .section-heading {
    display: block;
  }

  .section-hint {
    display: block;
    margin-top: 5px;
  }

  .practice-cta {
    display: block;
  }

  .practice-cta .primary-button {
    margin-top: 14px;
  }

  .history-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .gradient-text {
    white-space: normal;
  }

  .home-hero {
    padding-top: 30px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .primary-button,
  .hero-actions .secondary-button {
    width: 100%;
  }

  .input-card,
  .result-card {
    padding: 18px;
    border-radius: var(--radius-lg);
  }

  .preview-window {
    transform: none;
  }

  .tense-modal {
    padding: 9px;
  }

  .tense-sheet {
    padding: 21px 17px 18px;
    border-radius: var(--radius-xl);
  }

  .tense-selected-preview {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .tense-selected-preview strong {
    text-align: left;
  }

  .tense-sheet-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .tense-sheet-footer .primary-button {
    width: 100%;
  }

  .tense-trigger-group {
    display: none;
  }

  .history-section {
    padding: 17px;
  }

  .practice-cta {
    padding: 20px;
  }
}

/* reduced-motion bypassed by product requirement */
