:root {
  --ink: #17221d;
  --muted: #66736d;
  --paper: #f7f5ef;
  --card: #fffdf8;
  --line: #deddd4;
  --green: #276749;
  --green-soft: #e2f0e7;
  --amber: #b66a1c;
  --amber-soft: #fff0d9;
  --red: #a7443e;
  --red-soft: #f9e5e2;
  --blue: #315b6d;
  --shadow: 0 18px 50px rgba(41, 50, 45, .08);
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 12% 0%, #eef5e9 0, transparent 28rem), var(--paper); }
a { color: inherit; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.site-header { height: 76px; max-width: 1240px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 760; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 17px; background: var(--ink); color: white; font-weight: 800; letter-spacing: -.04em; }
.brand-mark.small { width: 37px; height: 37px; border-radius: 12px; font-size: .83rem; }
nav { display: flex; align-items: center; gap: 24px; font-size: .93rem; }
nav a, .link-button { border: 0; padding: 5px 0; background: transparent; color: var(--muted); text-decoration: none; }
nav a:hover, .link-button:hover { color: var(--ink); }
nav form { margin: 0; }

.container { width: min(1160px, calc(100% - 40px)); margin: 28px auto 80px; }
.hero { padding: 52px 54px; display: flex; justify-content: space-between; align-items: end; gap: 32px; border: 1px solid var(--line); border-radius: 30px; background: rgba(255,253,248,.86); box-shadow: var(--shadow); }
.hero h1, .section-heading h1, .section-heading h2 { margin: 3px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.15rem, 5vw, 4.1rem); font-weight: 500; letter-spacing: -.045em; }
.section-heading h1, .section-heading h2 { font-size: clamp(2rem, 4vw, 3rem); }
.eyebrow { margin: 0 0 7px; color: var(--green); text-transform: uppercase; letter-spacing: .13em; font-size: .76rem; font-weight: 800; }
.muted, .hint { color: var(--muted); line-height: 1.6; }
.hero .muted { max-width: 610px; margin-bottom: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions form { margin: 0; }
.button { min-height: 46px; border: 1px solid transparent; border-radius: 14px; padding: 11px 19px; display: inline-flex; align-items: center; justify-content: center; font-weight: 720; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--ink); color: white; box-shadow: 0 8px 22px rgba(23,34,29,.15); }
.button.secondary { border-color: var(--line); background: white; color: var(--ink); }
.button.wide { width: 100%; }

.stats { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 14px; margin: 18px 0 58px; }
.stats article { padding: 22px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.stats strong { display: block; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.stats strong span { color: #98a19d; font-size: 1.1rem; }
.stats p { margin: 6px 0 0; color: var(--muted); font-size: .88rem; }
.stats .known { background: var(--green-soft); border-color: #cce1d3; }
.stats .review { background: var(--amber-soft); border-color: #f0d9b9; }
.stats .unknown { background: var(--red-soft); border-color: #ecd0cc; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-heading .muted { margin: 0; }
.exports { display: flex; gap: 8px; }
.exports a { padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); text-decoration: none; font-size: .86rem; background: var(--card); }
.group-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.group-card { min-height: 224px; padding: 23px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.group-card.complete { border-color: #bfd7c7; }
.group-top, .group-meta { display: flex; justify-content: space-between; align-items: center; }
.group-id { color: var(--green); font-size: .8rem; font-weight: 800; letter-spacing: .08em; }
.done { border-radius: 999px; padding: 5px 9px; color: var(--green); background: var(--green-soft); font-size: .72rem; font-weight: 750; }
.group-card h3 { flex: 1; margin: 16px 0 20px; font-family: Georgia, serif; font-size: 1.28rem; font-weight: 500; line-height: 1.25; }
.progress { height: 6px; overflow: hidden; border-radius: 99px; background: #ebeae3; }
.progress span { height: 100%; display: block; border-radius: inherit; background: var(--green); }
.group-meta { margin: 8px 0 15px; color: var(--muted); font-size: .76rem; }
.group-card form { margin-top: auto; }
.card-link { width: 100%; padding: 0; display: flex; justify-content: space-between; border: 0; background: transparent; color: var(--ink); font-weight: 700; }
.card-link span { color: var(--green); }

.checkup-head { max-width: 760px; margin: 40px auto 18px; display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.back-link { color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--ink); }
.study-card { max-width: 760px; min-height: 510px; margin: 0 auto; padding: clamp(32px, 7vw, 68px); display: flex; flex-direction: column; justify-content: center; text-align: center; border: 1px solid var(--line); border-radius: 30px; background: var(--card); box-shadow: var(--shadow); }
.term, .task { margin: 18px 0 12px; font-family: Georgia, serif; font-size: clamp(2.7rem, 8vw, 5.4rem); font-weight: 500; line-height: 1.06; letter-spacing: -.045em; }
.task { font-size: clamp(1.75rem, 5vw, 3rem); line-height: 1.2; }
.translation { margin: 7px 0 32px; color: var(--green); font-family: Georgia, serif; font-size: clamp(1.7rem, 4vw, 2.6rem); }
.hint { max-width: 520px; margin: 6px auto 34px; }
.rating-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.rating-actions .reveal { grid-column: 1 / -1; background: var(--ink); color: white; }
.known-button { color: var(--green); background: var(--green-soft); border-color: #c5dfce; }
.review-button { color: #895019; background: var(--amber-soft); border-color: #edd2ab; }
.unknown-button { color: var(--red); background: var(--red-soft); border-color: #e8c5c1; }
.card-nav { grid-column: 1 / -1; margin-top: 16px; display: flex; justify-content: space-between; }
.quiet-button { border: 0; padding: 8px 2px; background: transparent; color: var(--muted); }
.empty-state { max-width: 680px; margin: 90px auto; text-align: center; }
.empty-state h1 { font-family: Georgia, serif; font-size: 3rem; font-weight: 500; margin: 16px 0 0; }
.empty-state .hero-actions { justify-content: center; margin-top: 28px; }
.celebration { width: 78px; height: 78px; margin: auto; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 2rem; }

.profile-form { max-width: 820px; display: grid; gap: 18px; }
.profile-form label { display: grid; gap: 8px; font-weight: 700; }
textarea, input[type=password] { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; color: var(--ink); background: white; outline: none; }
textarea { resize: vertical; line-height: 1.5; font-weight: 400; }
textarea:focus, input[type=password]:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(39,103,73,.1); }
.profile-form .button { justify-self: start; }

.login-shell { min-height: 100vh; padding: 24px; display: grid; place-items: center; }
.login-card { width: min(440px, 100%); padding: 46px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,253,248,.95); box-shadow: var(--shadow); }
.login-card h1 { margin: 17px 0 7px; font-family: Georgia, serif; font-size: 2.55rem; font-weight: 500; letter-spacing: -.04em; }
.login-form { display: grid; gap: 9px; margin-top: 30px; }
.login-form label { font-size: .86rem; font-weight: 750; }
.login-form .button { margin-top: 8px; }
.notice { max-width: 1160px; margin: 0 auto 18px; border: 1px solid #cbdccf; border-radius: 13px; padding: 12px 15px; color: var(--green); background: var(--green-soft); }
.login-card .notice { margin-top: 20px; }
.notice.error { border-color: #e6c5c2; color: var(--red); background: var(--red-soft); }

@media (max-width: 850px) {
  .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero { align-items: start; flex-direction: column; padding: 38px; }
}

@media (max-width: 560px) {
  .site-header { height: 64px; padding: 0 16px; }
  .brand > span:last-child { display: none; }
  nav { gap: 15px; font-size: .87rem; }
  .container { width: min(100% - 24px, 1160px); margin-top: 14px; }
  .hero { padding: 28px 24px; border-radius: 23px; }
  .hero-actions, .hero-actions form, .hero-actions .button { width: 100%; }
  .stats { gap: 8px; margin-bottom: 42px; }
  .stats article { padding: 17px; border-radius: 16px; }
  .stats strong { font-size: 1.55rem; }
  .section-heading { align-items: start; flex-direction: column; }
  .group-grid { grid-template-columns: 1fr; }
  .group-card { min-height: 205px; }
  .study-card { min-height: calc(100vh - 150px); padding: 32px 20px; border-radius: 23px; }
  .rating-actions { grid-template-columns: 1fr; }
  .card-nav { grid-column: auto; }
  .login-card { padding: 32px 24px; }
}
