:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202733;
  background: #f4f5f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  --accent: #376fdb;
  --accent-dark: #2456b4;
  --muted: #697586;
  --border: #e3e7ed;
  --card-shadow: 0 28px 72px rgb(31 45 66 / 12%), 0 4px 14px rgb(31 45 66 / 6%);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 20%, rgb(219 230 250 / 55%), transparent 50%),
    #f4f5f7;
}

.page-shell {
  width: min(100% - 40px, 960px);
  min-height: 100vh;
  margin-inline: auto;
  padding: 34px 0 48px;
  display: flex;
  flex-direction: column;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: clamp(42px, 9vh, 88px);
}

.page-home-link {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
}

.page-home-link:focus-visible {
  outline: 3px solid rgb(55 111 219 / 70%);
  outline-offset: 4px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 16px rgb(55 111 219 / 24%);
}

.eyebrow,
h1,
.direction-label,
.card-count,
.interaction-hint,
.tap-hint,
.face-label,
.card-meta,
.empty-state p {
  margin: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  margin-top: 2px;
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.study-session {
  width: min(100%, 760px);
  margin-inline: auto;
}

.session-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.direction-label {
  color: #384455;
  font-size: 14px;
  font-weight: 650;
}

.direction-label span {
  padding-inline: 4px;
  color: var(--accent);
}

.card-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  margin-bottom: 22px;
  border-radius: 999px;
  background: #e1e5eb;
}

.progress-fill {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms ease;
}

.flashcard {
  width: 100%;
  min-height: 420px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  perspective: 1400px;
  -webkit-tap-highlight-color: transparent;
}

.flashcard:focus-visible {
  outline: 3px solid rgb(55 111 219 / 70%);
  outline-offset: 5px;
}

.flashcard-inner {
  position: relative;
  min-height: inherit;
  transform-style: preserve-3d;
  transition: transform 420ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

.flashcard.is-flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: clamp(28px, 6vw, 64px);
  border: 1px solid rgb(223 228 236 / 90%);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--card-shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  text-align: center;
}

.card-back {
  transform: rotateY(180deg);
}

.face-label {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.card-meta {
  min-height: 18px;
  margin-bottom: 14px;
  color: #8a94a3;
  font-size: 12px;
  font-weight: 550;
}

.front-text {
  max-width: 630px;
  color: #202733;
  font-size: clamp(27px, 5vw, 44px);
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.tap-hint {
  margin-top: auto;
  padding-top: 32px;
  color: #9aa3af;
  font-size: 12px;
  font-weight: 550;
}

.back-translation {
  max-width: 630px;
  color: #202733;
  font-size: clamp(24px, 4.5vw, 36px);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.back-details {
  width: min(100%, 570px);
  display: grid;
  gap: 17px;
  margin-top: 24px;
  text-align: left;
}

.detail-group {
  display: grid;
  gap: 5px;
}

.detail-label {
  color: #7b8796;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-item {
  display: block;
  color: #3f4a59;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.detail-group[data-kind="example"] .detail-item {
  font-style: italic;
}

.interaction-hint {
  margin-top: 20px;
  color: #808b99;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.empty-state {
  padding: 90px 20px;
  border: 1px dashed #cbd3df;
  border-radius: 22px;
  background: rgb(255 255 255 / 65%);
  color: var(--muted);
  text-align: center;
}

.empty-title {
  margin-bottom: 8px !important;
  color: #384455;
  font-size: 20px;
  font-weight: 650;
}

[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .page-shell {
    width: min(100% - 28px, 960px);
    padding-top: 22px;
  }

  .page-header {
    margin-bottom: 46px;
  }

  .flashcard {
    min-height: 450px;
  }

  .card-face {
    padding: 30px 22px;
  }

  .tap-hint {
    padding-top: 24px;
  }

  .interaction-hint {
    padding-inline: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
