/* akanesway.com website pages on a wide screen (docs/54 section 12).
   Linked after site.css by the website pages only; the app does not load it. Every rule is inside a min-width media
   query, so a phone sees none of it. Pages are told apart by a class on <body> (page-how, page-home, ...). */

/* ---------- every page: header, footer, and the content column ---------- */
@media (min-width: 1024px) {
  :root { --site-w: 1240px; --gut: 32px; --col-w: 1176px; }

  /* the brand and the links line up with the page's column, however wide the screen */
  header.top { gap: 24px; padding: 16px max(var(--gut), calc((100% - var(--site-w)) / 2 + var(--gut))); }
  header.top .brand { gap: 12px; font-size: 18px; }
  header.top .brand img { width: 36px; height: 36px; border-radius: 9px; }
  header.top nav { align-items: center; gap: 26px; font-size: 16px; }
  header.top nav a { padding: 6px 0; }
  header.top nav a:hover { text-decoration: underline; text-decoration-color: var(--accent2); text-underline-offset: 7px; }
  header.top.over { padding-top: 22px; }

  /* site.css pulls every <main class="wrap"> up by 40px for the landing page's hero; only the landing wants that */
  body:not(.landing) > main.wrap { margin-top: 0; }

  footer { max-width: var(--site-w); margin: 32px auto 0; padding: 26px var(--gut) 48px; border-top: 1px solid var(--line); font-size: 14px; }
}

/* ---------- the landing page ---------- */
@media (min-width: 1024px) {
  .wrap.wide { max-width: var(--site-w); padding: 16px var(--gut); }

  /* the hero: the words on the left, the drawing kanji beside them, the picture showing through on the right */
  .hero-art { min-height: clamp(620px, 86vh, 940px); padding: 112px var(--gut) 104px; text-align: left; }
  .hero-art::after {
    background: linear-gradient(90deg, rgba(13,15,18,.8) 0%, rgba(13,15,18,.6) 36%, rgba(13,15,18,.1) 66%, rgba(13,15,18,0) 100%),
                linear-gradient(180deg, rgba(13,15,18,.28) 0%, rgba(13,15,18,0) 22%, rgba(13,15,18,0) 58%, rgba(13,15,18,.72) 86%, #0d0f12 100%);
  }
  .hero-inner { width: 100%; max-width: var(--col-w); display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
    column-gap: clamp(48px, 7vw, 120px); align-items: center; }
  .hero-text { order: 1; }
  .hero-stage { order: 2; }
  .hero-inner .kicker { margin: 0 0 12px; font-size: 13px; }
  .hero-inner h1 { font-size: clamp(48px, 4.8vw, 76px); line-height: 1.06; margin: 0 0 20px; }
  .hero-inner .lead { font-size: 20px; line-height: 1.62; max-width: 33em; margin: 0; }
  .hero-cta { justify-content: flex-start; gap: 14px; }
  .hero-cta .button { margin-top: 26px; padding: 14px 30px; font-size: 17px; }
  .hero-inner .promise { margin: 28px 0 0; max-width: 540px; font-size: 16px; text-align: left; }
  .hero-inner .stage { width: min(100%, 400px); border-radius: 32px; background: rgba(13,15,18,.3); }
  .hero-inner .caption { margin-top: 18px; font-size: 16px; text-align: center; }

  /* sign up and sign in side by side, kept to a width a form can use */
  .auth-grid { max-width: 1000px; margin: 0 auto; gap: 28px; }
  .auth-grid > .card { margin: 0; padding: 30px 32px; }
  #welcome { max-width: 1000px; margin: 0 auto; padding: 28px 32px; }

  /* sections */
  .band { margin: 80px 0; }
  .band > h2 { margin: 0 0 10px; font-size: 34px; text-align: center; }
  .band > .lede { max-width: 640px; margin: 0 auto 26px; font-size: 18px; text-align: center; }
  .band > .more { margin-top: 18px; font-size: 17px; text-align: center; }

  /* the lesson screens in one row */
  .shots { gap: 28px; margin-top: 34px; }
  .shot .phone { padding: 6px; border-radius: 32px; }
  .shot .phone img { border-radius: 26px; }
  .shot figcaption { margin-top: 14px; font-size: 15px; line-height: 1.5; }
  .shot figcaption b { margin-bottom: 4px; font-size: 17px; }

  /* the four things you learn, in one row */
  .features.four { gap: 20px; margin-top: 30px; }
  .feature { padding: 26px 24px; }
  .feature .glyph { margin-bottom: 14px; font-size: 44px; }
  .feature h3 { margin-bottom: 8px; font-size: 19px; }
  .feature p { font-size: 16px; }

  /* words in one column, screens in the other; the flipped ones put the screens on the left */
  .split { grid-template-columns: minmax(0, 520px) 300px; justify-content: center; gap: clamp(56px, 8vw, 112px); max-width: none; }
  .split.flip { grid-template-columns: 300px minmax(0, 520px); }
  .split.flip.pairs { grid-template-columns: minmax(0, 540px) minmax(0, 460px); }
  .split .shot { width: 300px; }
  .split h2 { margin-bottom: 14px; font-size: 34px; line-height: 1.2; }
  .split p { font-size: 18px; line-height: 1.6; }
  .split .pair { max-width: none; gap: 22px; }

  .split:has(> .shot.no-img), .split.flip:has(> .shot.no-img) { grid-template-columns: minmax(0, 640px); }

  /* two lighter sections side by side, each a card: the words, then the screen below them */
  .duo { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 80px 0; }
  .duo > .band { margin: 0; padding: 40px 40px 36px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; }
  .duo .split, .duo .split.flip { grid-template-columns: 1fr; grid-template-rows: 1fr auto; justify-content: stretch; gap: 28px; align-items: start; height: 100%; }
  .duo .split.flip .shot { order: 0; }
  .duo .split .shot { width: 260px; }
  .duo .split h2 { font-size: 30px; }
  .duo .split p { font-size: 17px; }
  .quest { padding: 22px 24px; }
  .quest h3 { font-size: 20px; }
  .quest p { font-size: 16px; }

  /* free and private: one centred card, the four ticks in a square */
  .band .freecard { max-width: 860px; margin: 0 auto; padding: 48px 56px; text-align: center; }
  .band .freecard h2 { font-size: 34px; }
  .band .freecard .ticks { grid-template-columns: 1fr 1fr; gap: 14px 32px; max-width: 720px; margin: 26px auto; text-align: left; }
  .freecard .ticks li { font-size: 18px; }
  .band .freecard .button { margin-top: 18px; padding: 14px 32px; font-size: 17px; }

  /* the stored-data notice sits in the corner instead of across the middle */
  .consent { left: 28px; right: auto; bottom: 28px; width: 440px; max-width: calc(100vw - 56px); margin: 0; }
}

/* ---------- how it works ---------- */
@media (min-width: 1024px) {
  .page-how .wrap > .kicker, .page-how .wrap > h1, .page-how .wrap > .lead { text-align: center; }
  .page-how .wrap > h1 { margin-bottom: 14px; font-size: 46px; line-height: 1.12; }
  .page-how .wrap > .lead { max-width: 700px; margin: 0 auto 30px; font-size: 19px; }
  .page-how .freecard { max-width: 760px; margin: 0 auto; padding: 22px 32px; text-align: center; }
  .page-how .freecard p.big { font-size: 19px; }
  .page-how .band > h2 { margin-bottom: 36px; }

  /* each step: the screens in one column, the words in the other; every second step swaps sides */
  .how-step { grid-template-columns: minmax(240px, 280px) minmax(0, 1fr); gap: clamp(36px, 5vw, 72px); align-items: center;
    margin: 0 0 24px; padding: 36px 44px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; }
  .how-step.pairs { grid-template-columns: minmax(340px, 44%) minmax(0, 1fr); }
  .how-step .shot { width: 100%; }
  .how-step .pair { max-width: none; gap: 20px; }
  .how-step h3 { margin-bottom: 10px; font-size: 24px; line-height: 1.25; }
  .how-step p { font-size: 17px; line-height: 1.65; }
  .how-step .num { min-width: 32px; height: 32px; margin-right: 12px; font-size: 16px; line-height: 32px; }
  .how-step > div:not(.pair) { max-width: 560px; }
  .how-step:nth-of-type(even) { grid-template-columns: minmax(0, 1fr) minmax(240px, 280px); }
  .how-step.pairs:nth-of-type(even) { grid-template-columns: minmax(0, 1fr) minmax(340px, 44%); }
  .how-step:nth-of-type(even) > .shot, .how-step:nth-of-type(even) > .pair { order: 2; }
  .how-step:nth-of-type(even) > div:not(.pair) { justify-self: end; }
  .how-step:has(> .shot.no-img), .how-step.pairs:not(:has(.pair .shot:not(.no-img))) { grid-template-columns: minmax(0, 1fr); }
  .how-step:has(> .shot.no-img) > div, .how-step.pairs:not(:has(.pair .shot:not(.no-img))) > div:not(.pair) { justify-self: start; max-width: none; }
  .how-step.pairs:not(:has(.pair .shot:not(.no-img))) > .pair { display: none; }

  /* the short answers in two columns */
  .faq { max-width: 1040px; margin-left: auto; margin-right: auto; column-count: 2; column-gap: 72px; }
  .faq > h2 { column-span: all; }
  .faq h3 { margin: 0 0 4px; padding-top: 26px; font-size: 18px; break-after: avoid; }
  .faq p { margin: 0; font-size: 16.5px; line-height: 1.6; break-inside: avoid; }
  .band.cta { margin: 64px 0 24px; }
  .band.cta .button { padding: 15px 36px; font-size: 18px; }
}

/* ---------- the account pages: home, settings, install ---------- */
@media (min-width: 1024px) {
  /* home: the update banner and the picture across the top, the course card and the study card side by side */
  .page-home .wrap { max-width: 1040px; padding: 28px var(--gut) 48px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 24px; align-content: start; }
  .page-home .wrap > #update-banner, .page-home .wrap > .banner, .page-home .wrap > .row { grid-column: 1 / -1; }
  .page-home #update-banner .awu-banner { margin: 0 0 24px; }
  .page-home .banner img { margin: 0 0 24px; aspect-ratio: 3 / 1; border-radius: 20px; }
  .page-home .wrap > .card { margin: 0 0 24px; padding: 28px 30px; }
  .page-home h2#who { overflow-wrap: anywhere; font-size: 26px; }
  .page-home .wrap > .row { gap: 14px; }
  .page-home .wrap > .row .button { margin-top: 0; }

  /* settings: the cards flow down two columns */
  .page-settings .wrap { max-width: 1120px; padding: 28px var(--gut) 56px; column-count: 2; column-gap: 28px; }
  .page-settings .wrap > .kicker, .page-settings .wrap > h1 { column-span: all; }
  .page-settings .wrap > .kicker { margin-top: 0; }
  .page-settings .wrap > h1 { margin-bottom: 18px; font-size: 38px; }
  .page-settings .wrap > .card { break-inside: avoid; margin: 0 0 24px; padding: 24px 28px; }

  /* install: the words beside the screen, then the cards in a grid */
  .page-install .wrap { max-width: var(--site-w); padding: 28px var(--gut) 56px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; }
  .page-install .intro-text { grid-column: 1 / 5; grid-row: 1; align-self: center; padding-right: 24px; }
  .page-install .intro-text .kicker { margin-top: 0; }
  .page-install .intro-text h1 { margin-bottom: 14px; font-size: 46px; line-height: 1.1; }
  .page-install .intro-text .lead { max-width: 32em; font-size: 19px; }
  .page-install .wrap > .shot { grid-column: 5 / 7; grid-row: 1; align-self: center; width: min(220px, 100%) !important; margin: 0 auto !important; }
  .page-install .wrap > .card { margin: 0; padding: 28px 30px; }
  .page-install .wrap > .card:nth-of-type(1) { grid-column: 1 / -1; grid-row: 2; }
  .page-install .wrap > .card:nth-of-type(2) { grid-column: 1 / 4; grid-row: 3; }
  .page-install .wrap > .card:nth-of-type(3) { grid-column: 4 / 7; grid-row: 3; }
  .page-install .wrap > .card:nth-of-type(4) { grid-column: 1 / 4; grid-row: 4; }
  .page-install .wrap > .card:nth-of-type(5) { grid-column: 1 / 4; grid-row: 5; }
  .page-install .wrap > .card:nth-of-type(6) { grid-column: 4 / 7; grid-row: 4 / 6; }
  .page-install #device .awu { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 32px; align-items: start; }
  .page-install #device .awu > .awu-act:last-child { grid-column: 1 / -1; }
}

/* ---------- reading pages: privacy, agreement, password, setup, 404, and the admin ---------- */
@media (min-width: 1024px) {
  body.read .wrap { max-width: 720px; padding: 48px 32px 80px; }
  body.read h1 { font-size: 38px; line-height: 1.15; text-wrap: balance; }
  :lang(ja) body.read h1, :lang(ja) .agreement h1 { word-break: auto-phrase; }
  body.read .card { padding: 30px 34px; }
  .agreement p.lead { font-size: 18px; }
  .agreement h2 { margin: 30px 0 8px; font-size: 20px; }
  .agreement li { font-size: 16.5px; line-height: 1.6; }

  /* the 404 page is one picture and two lines, centred in the window */
  body.page-404 main.wrap { max-width: 720px; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 16px !important; }
  body.page-404 main img { width: min(400px, 100%) !important; }
  body.page-404 h1 { font-size: 40px; }

  /* the admin needs room for its tables: the form beside the help requests, the list of everyone across the page */
  .page-admin .wrap { max-width: 1180px; padding: 28px var(--gut) 56px; }
  .page-admin .wrap > h1 { font-size: 38px; }
  .page-admin #admin { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 24px; align-items: start; }
  .page-admin #admin > .card { margin: 0; padding: 26px 28px; }
  .page-admin #admin > .card:nth-child(3) { grid-column: 1 / -1; }
  .page-admin table.list label.row { flex-wrap: nowrap; white-space: nowrap; }
}

/* ---------- a larger screen: a wider column and room around it ---------- */
@media (min-width: 1680px) {
  :root { --site-w: 1360px; --col-w: 1296px; }
  .shots { gap: 36px; }
}
