@font-face {
  font-family: Pondashi;
  src: url("assets/ai-pondashi-font-v1.1.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --system-fonts: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  font: 100%/1.7 Pondashi, var(--system-fonts);
  font-synthesis: none;
  --paper: #fff8e3;
  --white: #fffdf5;
  --ink: #1b1d32;
  --muted: #454353;
  --blue: #1744c4;
  --dark-blue: #132d81;
  --light-blue: #e9edff;
  --red: #bf2a26;
  --blush: #ffe7dc;
  --yellow: #ffd65e;
  --light-yellow: #fff2c0;
  --rule: #706d7a;
  --star: polygon(50% 0%, 62% 33%, 98% 22%, 79% 54%, 100% 76%, 65% 73%, 56% 100%, 40% 77%, 5% 91%, 20% 59%, 0% 41%, 35% 35%);
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: .23em; }
button, input, select, textarea, option { font: inherit; }
button, summary, select { cursor: pointer; }
:focus-visible { outline: 3px solid #265ce7; outline-offset: 4px; }
section, #license { scroll-margin-top: 24px; }
h2, p, dl, dd, figure { margin: 0; }
h2 { font-size: clamp(1.85rem, 4.2vw, 3.45rem); line-height: 1.17; text-wrap: balance; }
.wrap { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.font { font-weight: 400; }
.skip {
  position: absolute;
  top: 0;
  left: 0;
  padding: 10px;
  background: var(--white);
  transform: translateY(-145%);
  z-index: 5;
}
.skip:focus { transform: none; }

.site-header {
  border-top: 5px solid var(--blue);
  border-bottom: 2px solid var(--ink);
  background: var(--white);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
}
.brand, nav a { color: var(--ink); text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: .58em; font-size: 1rem; }
.brand::before {
  content: "";
  flex: 0 0 .94em;
  height: .94em;
  background: var(--red);
  clip-path: var(--star);
  transform: rotate(10deg);
}
nav { display: flex; align-items: center; gap: clamp(12px, 2.1vw, 30px); }
nav a { font-size: .93rem; }
nav a:hover { text-decoration: underline; }
.nav-download {
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 2px 4px 3px 2px;
  padding: 5px 12px;
  box-shadow: 3px 3px 0 var(--ink);
  white-space: nowrap;
}
.nav-download:hover { background: var(--light-yellow); text-decoration: none; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, .85fr);
  gap: clamp(35px, 5.9vw, 84px);
  align-items: center;
  padding-block: clamp(61px, 7.3vw, 102px) clamp(62px, 6.9vw, 94px);
}
.hero-copy { min-width: 0; }
.eyebrow {
  width: fit-content;
  max-width: 100%;
  padding: .33em .8em .38em;
  background: var(--blue);
  color: var(--white);
  font-size: clamp(.85rem, 1.45vw, 1rem);
  line-height: 1.45;
  transform: rotate(-1.7deg);
  transform-origin: left center;
}
h1 {
  margin: .17em 0 .13em;
  font-size: clamp(3.4rem, 9.2vw, 8.2rem);
  line-height: .97;
}
h1 > span {
  display: block;
  white-space: nowrap;
  transform-origin: left center;
}
h1 > span:first-child { transform: rotate(-2.6deg); }
h1 > span:last-child {
  padding-inline-start: .085em;
  color: var(--blue);
  transform: rotate(-1.2deg);
}
h1 b { color: var(--red); font-weight: 400; }
.hero-lead { color: var(--muted); font-size: 1.04rem; max-width: 32em; text-wrap: balance; }
.hero-actions {
  display: flex;
  gap: 12px 23px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 23px;
}
.button {
  display: inline-block;
  color: var(--white);
  background: var(--red);
  border: 2px solid var(--ink);
  border-radius: 4px 5px 3px 7px;
  padding: 9px 17px;
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  text-align: center;
}
.button:hover { background: #a91f20; }
.button:active { box-shadow: 2px 2px 0 var(--ink); transform: translate(2px, 2px); }
.text-link { font-size: .94rem; text-decoration-thickness: 2px; }
.file-meta { color: var(--muted); margin-top: 12px; font-size: .875rem; }
.file-meta span { padding-inline: .21em; }

.hero-figure {
  position: relative;
  isolation: isolate;
  justify-self: center;
  width: min(84%, 365px);
}
.hero-figure::before, .hero-figure::after, .poster-mat::before {
  content: "";
  position: absolute;
  pointer-events: none;
}
.hero-figure::before {
  z-index: -1;
  inset: 2% -10% 8% -9%;
  background: radial-gradient(circle, #a55f2b66 1px, transparent 1.35px) 0 0 / 7px 7px, var(--yellow);
  clip-path: polygon(2% 3%, 96% 0, 100% 93%, 0 100%);
  transform: rotate(-7deg);
}
.hero-figure::after {
  z-index: 1;
  top: -6%;
  right: -12%;
  width: clamp(40px, 6.3vw, 89px);
  aspect-ratio: 1;
  background: var(--blue);
  clip-path: var(--star);
  transform: rotate(12deg);
}
.poster-mat {
  position: relative;
  border: 3px solid var(--ink);
  padding: 9px;
  background: var(--white);
  box-shadow: 7px 7px 0 var(--red);
  transform: rotate(4.5deg);
}
.poster-mat::before {
  width: 27%;
  height: clamp(13px, 2vw, 24px);
  top: -9px;
  left: 10%;
  background: #ffdf7f;
  clip-path: polygon(3% 0, 100% 4%, 96% 94%, 0 100%);
  transform: rotate(-11deg);
}
.poster-mat img { width: 100%; background: var(--paper); }
figcaption { color: var(--muted); font-size: .875rem; margin-top: 12px; }
.hero-figure figcaption { padding-top: 6px; text-align: center; }

.demo-section {
  background-color: var(--blue);
  background-image: radial-gradient(circle, #fff8e321 1.2px, transparent 1.6px);
  background-size: 12px 12px;
  border-block: 3px solid var(--ink);
  color: var(--white);
  padding-block: clamp(42px, 6vw, 76px) clamp(51px, 7.2vw, 86px);
}
.section-heading { display: grid; gap: 7px; margin-bottom: clamp(19px, 2.6vw, 31px); }
.section-heading p { color: var(--muted); }
.demo-section .section-heading p { color: var(--white); }
.demo-section h2::before {
  content: "";
  display: inline-block;
  width: .57em;
  height: .63em;
  margin-inline-end: .22em;
  background: var(--yellow);
  clip-path: var(--star);
  transform: rotate(-13deg);
}
.editor {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(285px, .85fr);
  border: 3px solid var(--ink);
  border-radius: 2px 4px 3px 5px;
  box-shadow: 8px 8px 0 var(--ink);
  color: var(--ink);
}
.stage {
  position: relative;
  min-height: 260px;
  display: grid;
  align-content: center;
  padding: 26px clamp(20px, 3vw, 39px);
  background: var(--white);
  min-width: 0;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px dashed #938b98;
  pointer-events: none;
}
#preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--size, 60px);
  line-height: 1.2;
  min-width: 0;
}
#preview:empty::before {
  content: "入力した文字がここに出ます";
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}
.controls {
  min-width: 0;
  padding: 18px 20px;
  border-left: 2px solid var(--ink);
  background: var(--light-yellow);
}
label { display: block; font-size: .94rem; }
textarea, input[type="search"], select {
  display: block;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
  padding: 7px 9px;
}
textarea { resize: vertical; margin: 5px 0 11px; min-height: 95px; }
.slider {
  display: grid;
  grid-template-columns: auto minmax(42px, 1fr) 51px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.slider input { accent-color: var(--blue); width: 100%; margin: 0; }
.slider output { font-size: .875rem; text-align: right; }
.presets { display: flex; flex-wrap: wrap; gap: 7px; }
.presets button, .paging button {
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--white);
  color: var(--dark-blue);
  padding: 5px 9px;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: .875rem;
}
.presets button:hover, .paging button:not(:disabled):hover { background: var(--light-blue); }
.paging button:disabled { opacity: .5; box-shadow: none; cursor: default; }
.missing-note {
  margin-top: 10px;
  color: var(--red);
  font-size: .875rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.unavailable {
  color: var(--red);
  font-family: var(--system-fonts);
  text-decoration: underline dotted;
  text-underline-offset: .13em;
}

.section { padding-block: clamp(44px, 6.4vw, 82px); }
#characters h2 { color: var(--blue); }
.coverage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(13px, 2.2vw, 28px);
}
.coverage > div {
  --card: var(--light-yellow);
  --offset: var(--red);
  min-width: 0;
  padding: 15px clamp(13px, 2vw, 25px) 18px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 3px 5px 2px 4px;
  box-shadow: 5px 5px 0 var(--offset);
}
.coverage > div:nth-child(2) { --card: var(--light-blue); --offset: var(--blue); }
.coverage > div:nth-child(3) { --card: var(--blush); --offset: var(--dark-blue); }
.coverage dt {
  width: fit-content;
  padding: 1px 7px;
  background: var(--ink);
  color: var(--white);
  font-size: .875rem;
  border-radius: 2px 1px 2px 1px;
}
.coverage dd { color: var(--muted); font-size: .94rem; }
.coverage dd.font {
  margin-block: 8px 3px;
  color: var(--blue);
  font-size: clamp(1.93rem, 3.8vw, 3.3rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

summary { color: var(--dark-blue); }
.lookup {
  margin-top: 26px;
  padding: 10px clamp(12px, 2vw, 20px);
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 4px 2px 5px 2px;
  box-shadow: 4px 4px 0 var(--blue);
}
.lookup-tools {
  margin-block: 10px;
  display: grid;
  grid-template-columns: minmax(156px, 32%) minmax(0, 1fr);
  gap: 10px;
}
select {
  appearance: none;
  padding-inline-end: 31px;
  background-image: linear-gradient(45deg, transparent 45%, var(--blue) 46% 61%, transparent 62%), linear-gradient(135deg, transparent 45%, var(--blue) 46% 61%, transparent 62%);
  background-position: calc(100% - 17px) 53%, calc(100% - 11px) 53%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.glyphs { display: grid; grid-template-columns: repeat(auto-fill, minmax(45px, 1fr)); gap: 5px; }
.glyphs span {
  min-height: 45px;
  display: grid;
  place-items: center;
  border: 1px solid #c8bb99;
  background: var(--paper);
  font-size: 1.5rem;
  border-radius: 2px;
}
.paging {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-block: 11px 3px;
  color: var(--muted);
  font-size: .9rem;
}

.story {
  border-block: 3px solid var(--ink);
  background: var(--light-yellow);
  background-image: repeating-linear-gradient(-26deg, transparent 0 11px, #ffd65e45 11px 13px);
}
.story-row {
  padding-block: clamp(42px, 6.4vw, 77px);
  display: grid;
  grid-template-columns: minmax(0, 1.19fr) minmax(260px, .81fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: center;
}
.story h2 { margin-bottom: 14px; }
.story p + p { margin-top: 9px; }
.source-links { font-size: .875rem; }
.comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding-inline: 5px; }
.comparison figure {
  padding: 7px 7px 8px;
  background: var(--white);
  border: 2px solid var(--ink);
}
.comparison figure:first-child { transform: rotate(-3deg); box-shadow: 4px 5px 0 var(--red); }
.comparison figure:last-child { transform: rotate(2.5deg); box-shadow: 4px 5px 0 var(--blue); }
.comparison figcaption { text-align: center; margin-top: 5px; }
.compare-box {
  height: clamp(95px, 12vw, 144px);
  display: grid;
  place-items: center;
  background: var(--paper);
  overflow: hidden;
}
.compare-box img { max-height: calc(clamp(95px, 12vw, 144px) - 12px); width: auto; max-width: calc(100% - 12px); }
.compare-box.font { font-size: clamp(5.4rem, 9vw, 7.65rem); line-height: 1; }

.release {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(21px, 4.6vw, 65px);
  align-items: start;
}
.release-download, .license-card {
  padding: clamp(17px, 2.8vw, 34px);
  border: 2px solid var(--ink);
  border-radius: 3px 5px 3px 4px;
}
.release-download { background: var(--yellow); box-shadow: 6px 6px 0 var(--ink); }
.release h2 { margin-bottom: 11px; }
.release-download .button { margin-top: 14px; }
.direct-file { margin-top: 7px; }
.install { margin-top: 12px; }
.install p { color: var(--muted); margin-top: 7px; }
.license-card { background: var(--white); box-shadow: 6px 6px 0 var(--blue); }
.license-card h2 { font-size: clamp(1.45rem, 2.8vw, 2.3rem); }
.license-card .source-links { margin-top: 13px; }

footer { background: var(--ink); border-top: 5px solid var(--red); color: var(--white); }
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding-block: 17px;
  font-size: .9rem;
}
.footer-row a { color: var(--yellow); }

@media (max-width: 910px) {
  .wrap { width: calc(100% - 58px); }
  .hero { grid-template-columns: minmax(0, 1.4fr) minmax(200px, .77fr); gap: 28px; }
  .editor { grid-template-columns: minmax(0, 1.3fr) minmax(245px, 1fr); }
  .stage { min-height: 218px; }
}

@media (max-width: 665px) {
  .wrap { width: calc(100% - 36px); }
  .header-row { min-height: 61px; gap: 9px; }
  .brand { font-size: .9rem; }
  nav a:not(.nav-download) { display: none; }
  .nav-download { font-size: .875rem; padding-inline: 8px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 28px 41px; }
  h1 { font-size: clamp(3.3rem, 15.1vw, 5.9rem); }
  .hero-figure { width: min(76%, 304px); }
  .hero-actions { margin-top: 17px; }
  .poster-mat { padding: 6px; box-shadow: 5px 5px 0 var(--red); }
  .hero-figure figcaption { margin-top: 8px; }
  .editor, .story-row, .release, .coverage, .lookup-tools { grid-template-columns: minmax(0, 1fr); }
  .editor { box-shadow: 5px 5px 0 var(--ink); }
  .stage { min-height: 180px; }
  .stage::before { inset: 8px; }
  .controls { border-left: 0; border-top: 2px solid var(--ink); padding-inline: 14px; }
  .coverage { gap: 15px; }
  .comparison { margin-inline: auto; width: min(100%, 395px); }
  .release-download { box-shadow: 5px 5px 0 var(--ink); }
  .license-card { box-shadow: 5px 5px 0 var(--blue); }
}
