:root {
  --color-salmon: #EF4D4D;
  --color-chopsticks: #EACA44;
}

body {
  background-color: Canvas;
  color: CanvasText;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  body {
    header {
      background-color: #303030 !important;
    }

    .active {
      background-color: #919191 !important;
      color: #bababa;
    }

    footer {
      background-color: #323232 !important;
    }
  }
}

.hidden {
	display: none !important;
}

#loading {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.8);
	z-index: 9999;
	display: flex;
  flex-direction: column;
	justify-content: center;
	align-items: center;
	color: white;
	// font-family: 'Press Start 2P', cursive;
	font-size: 24px;

  animation: grayPulse 2s ease-in-out infinite;
  /* ensure the filter animates smoothly */
  will-change: transform, filter;
}

  /* keyframes to pulse grayscale (gray scale emphasis) */
  @keyframes grayPulse {
    0%   { filter: grayscale(1) brightness(0.2); }
    50%  { filter: grayscale(0.1) brightness(1.08); }
    100% { filter: grayscale(1) brightness(0.2); }
  }
body {
  // font-family: "M PLUS 1p", sans-serif;
  font-family: Meiryo;
  margin: 0;


  &:has(.menu-open) main {
    margin-top: 17rem;
  }

  .backdrop {
    position: fixed;
    width: 100%;
    height: 100vh;
    z-index: 9;
  }
  .backdrop:has(~ .zoom-menu) {
    height: 85vh;
  }

  .open-dialog {
    cursor: pointer;
  }
  
  dialog {
    text-align: center;
    text-indent: 0;

    .kanji-furigana {
      font-size: 18px;
      font-weight: bold;
    }

    ul.kanji-meaning {
      writing-mode: horizontal-tb;
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      justify-content: center;

      li:last-child::after {
        display: none;
      }
      

      li ~ li {
        border-left: 1px solid;
        padding-left: .2rem;
        margin-left: .2rem;
      }
    }
  }

  .kanji-dialog {
    
    .JLPT-level {
      position: absolute;
      right: 2px;
      top: 3px;
      font-size: 8px;
      outline: 1px solid;
      width: 2.5rem;
      border-radius: 4px;
    }

    .kanji-details {
      /* font-family: 'ＭＳ Ｐゴシック'; */
      /* font-family: 'MS PGothic'; */
      /* font-family: 'メイリオ'; */
      /* font-family: Meiryo, sans-serif; */
      /* font-family: Hiragino Kaku Gothic Pro; */
      /* font-family: "ヒラギノ角ゴ ProN W3"; */
      /* font-family: "HiraKakuProN-W3"; */
      /* font-family: 'Droid Sans Japanese'; */
      /* font-family: 'TakaoExゴシック'; */
      /* font-family: '游ゴシック体'; */
      // font-family: 'Yu Gothic';
      font-family: "Zen Antique Soft", serif;
      font-weight: 400;
      font-style: normal;
      font-size: 3rem;
      line-height: 3rem;
      margin: 2rem 0;
    }
  }

  header {
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1.3rem 0 0 1rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    justify-content: center;
    
    &:not(:has(> ul)) {
      height: 2.7rem;
    }

    > .title {
      margin-bottom: 1.2rem;
      display: flex;
      justify-content: space-between;
      padding-right: 5rem;
      align-items: center;
    }

    .info {
      position: absolute;
      right: 5rem;
      top: 28px;
    }
    
    .header-content {
      display: flex;
      gap: 10px;
    }
  }
  
  .icon-button {
    height: 32px;
    width: 32px;
    cursor: pointer;
    background-image: url(./images/question-file.svg);
    background-size: contain;
  }
  .kanji-icon {
    background-image: url(./images/kanji-study.svg);
  }
  .katakana-icon {
    background-image: url(./images/katakana.svg);
  }
  .hiragana-icon {
    background-image: url(./images/hiragana.svg);
  }
  .keyboard-icon {
    background-image: url(./images/keyboard.svg);
  }
  .check-icon {
    background-image: url(./images/options-tick.svg);
  }
  .books-icon {
    background-image: url(./images/books.svg);
  }

  &.index .articles-wrapper {
    padding: .5rem;
    padding-bottom: 4.5rem;
  }

  main {
    transition: margin 1s;
    margin-top: 4rem;
    
    gap: .5rem;
    display: flex;
    flex-direction: column;

    article {
      gap: .5rem;
      padding: 1rem;
      outline: 1px solid gray;

      &.selected {
        outline: 1px solid rgb(255, 255, 255);
        background-color: light-dark(#d0d0d0, rgb(28, 28, 28));
        /*color: light-dark(#333333, #f5f5f5);*/
      }
    }
  }

  .actions {
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    align-items: center;
    gap: 1rem;

    button {
      padding: 1rem;
      cursor: pointer;
    }

  }

  .zoom-menu {
    background-color: light-dark(#d0d0d0, rgb(28, 28, 28));;
    position: fixed;
    bottom: 0;
    z-index: 1;
    width: calc(100% - 2rem);
    display: flex;
    padding: 1rem;
    gap: 8px;
    align-items: center;

    .zoom-level {
      flex: 1;
      display: flex;

      input {
        flex: 1;
      }
    }
    button {
      width: 3rem;
      height: 3rem;
      cursor: pointer;
    }
  }
  footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #f0f0f0;
    text-align: center;
    padding: 2px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  }

  .list-of-items {
    tr > * {
      outline: 1px solid light-dark(#f3f3f3, #434343);
      padding: .5rem 1rem;
    }
    th {
      background-color: light-dark(#e0e0e0, #1a1a1a);
    }
  }
}

.icon-menu {
  position: fixed;
  right: 1rem;
  top: 1rem;
  height: 32px;
  width: 32px;
  cursor: pointer;
  background-image: url(./images/sushi.svg);

  &:hover {
    filter: drop-shadow(1px 3px 2px black);
  }

  .open {
    filter: grayscale(1);
  }
}

.menu-index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 2rem;

  hr {
    width: 15rem;
    border-color: light-dark(#ffffff, #303030);
  }
  li {
    margin-bottom: 10px;

    a {
      text-decoration: none;
      color: #337ab7;
      transition: color 0.2s ease;

      &:hover {
        color: #23527c;
      }
    }

    &.active a {
      color: #23527c;
    }
  }
}

#dialog-kana {
  .tables {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    font-size: x-large;
    flex-direction: column;
    align-content: center;

    td {
      outline: 1px solid;
      padding: 0 3px;
    }
  }
}

.close-btn {
  cursor: pointer;
}

.common-phrases {
  main {
    margin: 5rem 1rem;

    .filters {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: .75rem;
      max-width: 40rem;
      margin: 0 auto 1.5rem;

      input[type="search"] {
        flex: 1 1 100%;
        padding: .6rem;
        font-size: large;
      }
    }

    .level-filter,
    .filters .favorites-toggle {
      display: flex;
      gap: .35rem;
    }

    .level-filter button,
    .favorites-toggle {
      border: 1px solid light-dark(#d0d0d0, #303030);
      background: light-dark(#fff, #1c1c1c);
      border-radius: 999px;
      padding: .3rem .8rem;
      cursor: pointer;
      font-size: .8rem;
    }

    .level-filter button.active,
    .favorites-toggle.active {
      background: var(--color-salmon);
      color: white;
      border-color: var(--color-salmon);
    }

    .phrase-list {
      list-style: none;
      margin: 0 auto;
      padding: 0;
      max-width: 40rem;
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .phrase-preview {
      display: flex;
      align-items: flex-start;
      gap: .5rem;
      border: 1px solid light-dark(#d0d0d0, #303030);
      border-radius: 8px;
      padding: 1rem 1.25rem;
      transition: background-color 0.15s ease;
    }

    .phrase-preview:hover {
      background-color: light-dark(#f0f0f0, #1c1c1c);
    }

    .phrase-preview-content {
      cursor: pointer;
      flex: 1;
    }

    .phrase-preview-title {
      margin: 0;
      font-size: 1.1rem;
    }

    .phrase-preview-subtitle {
      margin: .3rem 0 0;
      color: #58635e;
      font-size: .9rem;
    }

    .phrase-back {
      display: block;
      margin: 0 auto 1rem;
      cursor: pointer;
    }

    .phrase-detail-header {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: .75rem;

      .title { margin: 0; }
    }

    .phrase-refs {
      list-style: none;
      margin: 1rem 0 0;
      padding: 0;
      font-size: .85rem;
      color: #58635e;
    }

    .related-phrases {
      max-width: 40rem;
      margin: 2rem auto 0;
      border-top: 1px solid light-dark(#d0d0d0, #303030);
      padding-top: 1rem;

      h3 { margin: 0 0 .75rem; }

      ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: .5rem;
      }

      li {
        cursor: pointer;
        border: 1px solid light-dark(#d0d0d0, #303030);
        border-radius: 8px;
        padding: .6rem .9rem;
      }

      li:hover {
        background-color: light-dark(#f0f0f0, #1c1c1c);
      }

      .related-title { font-weight: 600; }
      .related-english { display: block; color: #58635e; font-size: .85rem; margin-top: .2rem; }
    }
  }

  .star-button {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: light-dark(#ccc, #444);
  }

  .star-button.starred { color: #f5a623; }
  .star-button.large { font-size: 1.8rem; }

  .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .5rem;
  }

  .tag {
    font-size: .7rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: light-dark(#e0e0e0, #303030);
    color: light-dark(#333333, #d0d0d0);
  }

  .tag-jlpt {
    background: var(--color-salmon);
    color: white;
  }
}


.book-translations {
  header {
    .title {
      .page-info {
        display: flex;
        gap: 1rem;
        
        .chapter {
          border-bottom: 1px solid;
          padding-left: 2rem;
        }
      }
    }
  }

  main {
    position: absolute;
    height: calc(100% - 4rem - 8px);
    width: 100%;
    
    article {
      overflow: auto;
      flex: 1;

      .title {
        font-size: 2rem;
      }

      .title,
      .subtitle {
        text-align: center;
      }

      .page-number {
        position: absolute;
        right: 1rem;
        top: 1rem;
      }

      .translation {
        font-size: 1rem;
        line-height: 1.5;
      }

      &.main {
        justify-content: center;
        align-items: center;
      }

      &.index {
        ul {
          list-style: none;
          padding-left: 1rem;
          width: calc(100% - 1rem);

          .index-item {
            cursor: pointer;
            width: max-content;
          }
        }
      }

      &.content {
        overflow: auto;
        padding: 1rem;

        .chapter-title {
          position: static;
          font-weight: bold;
          font-size: larger;
          white-space: nowrap;
        }

        .chapter-number {
          padding: 1rem;
        }

        &:not(.tategaki) {
          .chapter-title {
            border-bottom: 1px solid;
            padding: 0 3rem 0 1rem;
            width: auto;
          }

          &:has(.chapter-title) {
            > .phrase {
              margin-top: 2rem;
              
              ~ .phrase {
                margin-top: unset;
              }
            }
          }
        }

        &.tategaki {
          padding: .5rem 1rem;
          writing-mode: vertical-rl;
          text-orientation: upright;
          
          .chapter-title {
            border-right: 1px solid;
            height: fit-content;
            padding-bottom: 4rem;
          }

          &:has(.chapter-title) {
            > .phrase {
              margin-right: 2rem;

              ~ .phrase {
                margin-right: unset;
              }
            }
          }

          .kanji-details {
            margin: 0 1rem;
          }
          
          .kanji-meaning {
            flex-direction: column;
            height: 100%;
            
            li ~ li {
              border-top: 1px solid;
              padding-top: .2rem;
              margin-top: .2rem;
            }
          }
        }

        > div.phrase {
          line-height: 28px;

          text-indent: 1rem;
        }
      }

      &.unknown {
        align-items: center;
        
        button {
          
          width: max-content;
        }
      }
    }
    
    .actions {
      display: flex;
      justify-content: space-between;
      padding: 0 1rem;
      align-items: center;
      gap: 1rem;

      button {
        padding: 1rem;
        cursor: pointer;
      }

      .lang-actions {
        display: flex;
        // gap: 1rem;

        .active {
          background-color: #f0f0f0;
          border: 1px solid #ccc;
        }
      }
    }
  }

  .disclaimer {
    text-align: center;
  } 

  .book-list {
    padding: 1rem;

    .title { text-align: center; }
    .subtitle { text-align: center; color: #58635e; margin-bottom: 2rem; }
  }

  .book-grid {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 40rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .book-item {
    cursor: pointer;
    border: 1px solid light-dark(#d0d0d0, #303030);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    transition: background-color 0.15s ease;

    &:hover {
      background-color: light-dark(#f0f0f0, #1c1c1c);
    }

    .book-title {
      font-size: 1.2rem;
      font-family: "Zen Antique Soft", serif;
    }

    .book-subtitle {
      color: #58635e;
      margin-top: 0.2rem;
    }

    .book-eng-title {
      font-size: 0.8rem;
      color: #888;
      margin-top: 0.3rem;
    }
  }

  .book-back {
    display: block;
    margin: 1rem auto 0;
  }
}

.kana-keyboard {

  h1 {
    text-align: center;
  }

  .card {
    border: 1px solid #ddd;
    border-radius: 14px;
    padding: 20px;
  }

  .prompt {
    font-size: 72px;
    text-align: center;
    margin: 20px 0;
  }

  .status {
    text-align: center;
    margin: 10px 0;
    min-height: 1.5em;
  }

  .ok { color: #0a7; font-weight: 600; }
  .bad { color: #c33; font-weight: 600; }

  .row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
  }

  button {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #ccc;
    background: #fafafa;
    cursor: pointer;
    font-size: 14px;
    color: black;
  }

  .stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  }

  /* Hidden IME capture */
  #capture {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .input-mode-toggle button.active {
    background: #8e44ad;
    color: white;
  }

  .memory-bar {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 8px 0;
  }

  .memory-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    border: 1px solid #ccc;

    &.filled {
      background: #f5a623;
      border-color: #d38a12;
    }
  }

  .memory-stats {
    margin-top: 4px;
    font-weight: 600;
  }

  .choice-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 16px 0;
  }

  .verb-choice-grid {
    grid-template-columns: 1fr;
  }

  .choice-button {
    padding: 14px;
    font-size: 18px;
    border-radius: 10px;
    border: 1px solid #ccc;
    background: #fafafa;
    cursor: pointer;

    &:hover {
      background: #eee;
    }

    &:active {
      background: #ddd;
    }
  }

  .verb-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }

  .filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;

    button.active {
      background: #0a7;
      color: white;
    }
  }

  .verb-meaning {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
  }

  .verb-prompt {
    font-size: 56px;
  }

  .verb-target-label {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
  }

  .verb-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 20px;
    padding: 10px;
    text-align: center;
  }

  .session-history {
    max-width: 480px;
    margin: 24px auto 0;

    h3 {
      text-align: center;
      font-size: 14px;
      color: #666;
      margin-bottom: 8px;
    }

    ul {
      list-style: none;
      margin: 0;
      padding: 0;
      max-height: 240px;
      overflow-y: auto;
      border: 1px solid #ddd;
      border-radius: 10px;
    }

    li {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
      padding: 6px 10px;
      font-size: 13px;
      border-bottom: 1px solid #eee;

      &:last-child {
        border-bottom: none;
      }

      &.history-bad {
        background: #fff5f5;
        
        .history-prompt {
          color: black;
        }
      }
    }

    .history-prompt {
      font-weight: 600;
    }

    .history-chosen {
      color: #555;
    }

    .history-correct {
      color: #c33;
      font-weight: 600;
    }
  }
}

.topics {
  main {
    margin: 5rem 1rem;

    .filters {
      position: fixed;
      padding: 1rem;
      background: light-dark(#ffffffd6, #141414e8);
      right: 1rem;

      input {
        padding: .6rem;
        font-size: large;
      }
    }

    .topic-list {
      list-style: none;
      margin: 0 auto;
      padding: 0;
      max-width: 40rem;
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .topic-preview {
      cursor: pointer;
      border: 1px solid light-dark(#d0d0d0, #303030);
      border-radius: 8px;
      padding: 1rem 1.25rem;
      transition: background-color 0.15s ease;

      &:hover {
        background-color: light-dark(#f0f0f0, #1c1c1c);
      }
    }

    .topic-preview-title {
      margin: 0;
      font-size: 1.1rem;
    }

    .topic-preview-subtitle {
      margin: .3rem 0 0;
      color: #58635e;
      font-size: .9rem;
    }

    .topic-back {
      display: block;
      margin: 0 auto 1rem;
      cursor: pointer;
    }

    .related-topics {
      max-width: 40rem;
      margin: 2rem auto 0;
      border-top: 1px solid light-dark(#d0d0d0, #303030);
      padding-top: 1rem;

      h3 {
        margin: 0 0 .75rem;
      }

      ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: .5rem;
      }

      li {
        cursor: pointer;
        border: 1px solid light-dark(#d0d0d0, #303030);
        border-radius: 8px;
        padding: .6rem .9rem;

        &:hover {
          background-color: light-dark(#f0f0f0, #1c1c1c);
        }
      }

      .related-title {
        font-weight: 600;
      }
    }
  }

  .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .5rem;
  }

  .tag {
    font-size: .7rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: light-dark(#e0e0e0, #303030);
    color: light-dark(#333333, #d0d0d0);
  }

  .tag-jlpt {
    background: var(--color-salmon);
    color: white;
  }

  .sources {
    display: flex;
    gap: 0.5rem;
  }
}

.keyboard-toolbar-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;

  .toolbar-group {
    display: flex;
    gap: 6px;
  }

  button {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fafafa;
    cursor: pointer;
    color: black;

    &.active {
      background: #3498db;
      color: white;
      border-color: #3498db;
    }
  }
}

@media (max-width: 420px) {
  .tategaki-button {
    writing-mode: vertical-rl;
  }
}


@media screen and (max-width: 700px) {
  .topics {
    main {
      .filters {

        display: flex;
        flex-direction: column;
        right: 0;
        bottom: 0;

        input {
            padding: .2rem;
            font-size: small;
        }
      }
    }
  }
  
  .common-phrases main .filters {
    flex-direction: column;
    align-items: stretch;
  }
}

@keyframes hear-anim {
  from {
    filter: drop-shadow(0 0 0 white)
  }
  to {
    filter: drop-shadow(2px 4px 4px white)
  }
}

.print-buttons {
  display: flex;
  gap: .25rem;
  
  button {
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    padding: .3rem .75rem;

    &:active {
      transform: background 0.1s ease-in-out;
      background: #273f3a;
    }
  }
  .print-button {
    border: 1px solid #a9a196;
    background: var(--color-salmon);
    border-color: var(--color-salmon);
  }
  

  .refresh-button {
    border: 1px solid #a9a196;
    background: var(--color-chopsticks);
    border-color: var(--color-chopsticks);
    color: black;
  }
}
.print-practice {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: #f6f3ec;
  color: #1d2523;
  min-height: calc(100vh - 4rem);

  .print-toolbar {
    width: 40rem;
    margin: 0 auto 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    border-bottom: 1px solid #c9c2b5;
    padding-bottom: 1rem;
  }

  .print-heading {
    .eyebrow {
      margin: 0 0 .3rem;
      color: var(--color-salmon);
      font-size: .75rem;
      font-weight: 700;
      letter-spacing: .08em;
      text-transform: uppercase;
    }

    h1 {
      margin: 0;
      font-family: "Zen Antique Soft", serif;
      font-size: clamp(1.8rem, 4vw, 3.3rem);
      font-weight: 400;
    }

    p:last-child {
      margin: .35rem 0 0;
      color: #58635e;
    }
  }

  .print-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .6rem;
  }

  .segmented-control,
  .level-control {
    display: flex;
    gap: .25rem;
    align-items: center;
  }

  .segmented-control button,
  .level-control button {
    border: 1px solid #a9a196;
    background: #fffdf8;
    color: #27312e;
    padding: .3rem .75rem;
    cursor: pointer;
    font: inherit;
  }
  .level-control button {
    padding: .15rem .5rem;
    font-size: .8rem;
  }

  .segmented-control button:first-child { border-radius: 4px 0 0 4px; }
  .segmented-control button:last-child { border-radius: 0 4px 4px 0; }

  .segmented-control button.active,
  .level-control button.active {
    background: #273f3a;
    color: #fffdf8;
    border-color: #273f3a;
  }

  .level-control span {
    font-size: .75rem;
    font-weight: 700;
    color: #58635e;
    margin-right: .25rem;
  }

  .practice-sheet {
    display: block;
    width: 100%;
    max-width: 72rem;
    height: auto;
    margin: 0 auto;
    background: white;
    /*background: #fffdf8;*/
    border: 1px solid #c9c2b5;
  }
}

.home-welcome main {
  padding: 1rem 1rem 3rem;
  max-width: 48rem;
  margin: 4rem auto 0;
}

.home-welcome main section {
  margin-bottom: 2.5rem;
}

.home-welcome h1,
.home-welcome h2 {
  font-family: "Zen Antique Soft", serif;
  font-weight: 400;
}

.home-welcome .hero {
  text-align: center;
}

.home-welcome .hero .eyebrow {
  color: var(--color-salmon);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 .5rem;
}

.home-welcome .hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.home-welcome .hero .lead {
  color: #58635e;
  max-width: 38rem;
  margin: 0 auto;
}

.home-welcome .why p,
.home-welcome .jlpt p {
  line-height: 1.6;
}

.home-welcome .jlpt-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.home-welcome .jlpt-list li {
  border: 1px solid light-dark(#d0d0d0, #303030);
  border-radius: 8px;
  padding: .6rem .9rem;
}

.home-welcome .section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.home-welcome .section-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid light-dark(#d0d0d0, #303030);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  transition: background-color .15s ease;
}

.home-welcome .section-card:hover {
  background-color: light-dark(#f0f0f0, #1c1c1c);
}

.home-welcome .section-card h3 {
  margin: 0 0 .35rem;
  font-size: 1.05rem;
}

.home-welcome .section-card p {
  margin: 0;
  color: #58635e;
  font-size: .9rem;
}

@media (max-width: 700px) {
  .print-button {
    width: 100%;
  }

  .print-practice {
    padding: .75rem;

    .print-toolbar {
      align-items: stretch;
      flex-direction: column;
    }

    .print-controls {
      align-items: stretch;
    }

    .segmented-control,
    .level-control {
      justify-content: center;
    }


  }
}

@media print {
  body {
    background: white;
  }

  header,
  footer,
  .print-toolbar {
    display: none !important;
  }

  body main.print-practice {
    margin: 0;
    padding: 0;
    background: white;
  }

  .print-practice .practice-sheet {
    max-width: none;
    border: 0;
  }

  .print-practice .practice-sheet:not(:last-child) {
    break-after: page;
    page-break-after: always;
  }
}