:root {
  color-scheme: light;
  font-family:
    Inter,
    "Noto Sans JP",
    "Yu Gothic UI",
    system-ui,
    -apple-system,
    sans-serif;
  color: #1b211f;
  background: #e9e8e2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #1b211f;
  --muted: #68716d;
  --line: #d8d8d1;
  --paper: #fffefa;
  --soft: #f6f5ef;
  --accent: #e95b3d;
  --mint: #79f2c0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 86% 0, rgb(121 242 192 / 12%), transparent 24rem),
    linear-gradient(180deg, #f4f2ec 0, #e9e8e2 46rem);
}

button,
input,
textarea {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 30;
  padding: 0.7rem 1rem;
  color: white;
  background: var(--ink);
  transform: translateY(-110%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
footer,
main {
  width: min(96rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header,
footer,
.brand,
.site-header nav,
.brand-mark,
.workspace-intro,
.intro-mark,
.panel-header,
.preview-header,
.export-bar,
.ratio-switch,
.tag-input-row,
.accent-row {
  display: flex;
  align-items: center;
}

.site-header {
  min-height: 3.5rem;
  justify-content: space-between;
  border-bottom: 1px solid rgb(27 33 31 / 12%);
}

.brand {
  gap: 0.58rem;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 1.55rem;
  height: 1.2rem;
  justify-content: center;
}

.brand-mark i,
.brand-mark b {
  position: absolute;
  display: block;
  width: 0.8rem;
  height: 1rem;
  border: 2px solid var(--ink);
  border-radius: 0.2rem;
  transform: rotate(-7deg);
}

.brand-mark b {
  margin-left: 0.7rem;
  border-color: #4aa983;
  transform: rotate(7deg);
}

.site-header nav,
footer nav {
  display: flex;
  gap: 1rem;
  color: #515a56;
  font-size: 0.72rem;
}

.site-header nav a,
footer a {
  text-decoration-color: transparent;
  text-underline-offset: 0.2rem;
}

.site-header nav a:hover,
footer a:hover {
  text-decoration-color: currentColor;
}

main {
  padding-block: 0.8rem 3rem;
}

.workspace-intro {
  min-height: 3.5rem;
  gap: 0.8rem;
}

.intro-mark {
  position: relative;
  width: 3.9rem;
  height: 2rem;
  justify-content: center;
}

.intro-mark i,
.intro-mark b,
.intro-mark em {
  position: absolute;
  display: block;
  width: 1.5rem;
  height: 1.9rem;
  border: 2px solid var(--ink);
  border-radius: 0.28rem;
  background: #f4f2ec;
  box-shadow: 0 0.22rem 0.5rem rgb(27 33 31 / 7%);
}

.intro-mark i {
  margin-left: -1.7rem;
  transform: rotate(-10deg);
}

.intro-mark b {
  z-index: 2;
  border-color: #3f9573;
}

.intro-mark em {
  margin-left: 1.7rem;
  border-color: #4f6eb8;
  transform: rotate(10deg);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: -0.025em;
}

.workspace-intro h1 {
  margin: 0 0 0.14rem;
  font-size: 1.16rem;
  line-height: 1.2;
}

.workspace-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.local-badge {
  padding: 0.34rem 0.55rem;
  margin-left: auto;
  color: #356254;
  background: #e3eee9;
  border: 1px solid #c5dad2;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
}

.frame-workbench {
  display: grid;
  overflow: hidden;
  min-height: 42rem;
  margin-top: 0.65rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 1.3rem 3.6rem rgb(48 42 28 / 9%);
  grid-template-columns: 19rem minmax(34rem, 1fr) 18rem;
}

.edit-panel,
.preview-panel,
.detail-panel {
  min-width: 0;
  padding: 0.95rem;
}

.edit-panel {
  background: var(--soft);
  border-right: 1px solid var(--line);
}

.preview-panel {
  background:
    linear-gradient(rgb(255 254 250 / 76%), rgb(255 254 250 / 76%)),
    repeating-linear-gradient(0deg, transparent, transparent 25px, rgb(27 33 31 / 4%) 26px);
}

.detail-panel {
  display: grid;
  align-content: start;
  background: #f4f5f2;
  border-left: 1px solid var(--line);
  gap: 0.7rem;
}

.panel-header,
.preview-header {
  min-height: 1.7rem;
  justify-content: space-between;
  gap: 0.6rem;
}

.panel-header h2,
.preview-header h2 {
  margin: 0;
  font-size: 0.78rem;
}

.panel-header output,
.panel-header span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 750;
}

fieldset {
  padding: 0;
  margin: 0.9rem 0 0;
  border: 0;
}

legend,
.identity-fields label > span,
.text-detail label > span {
  margin-bottom: 0.42rem;
  color: #4f5753;
  font-size: 0.65rem;
  font-weight: 850;
}

legend small {
  margin-left: 0.25rem;
  color: #7b827e;
  font-size: 0.53rem;
  font-weight: 700;
}

.style-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
}

.style-options label,
.image-slots label,
.activity-options label,
.contact-options label {
  position: relative;
}

.style-options input,
.image-slots input,
.activity-options input,
.contact-options input {
  position: absolute;
  opacity: 0;
}

.image-slots input {
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.style-options span {
  display: block;
  overflow: hidden;
  min-height: 3.65rem;
  padding: 0.28rem;
  background: white;
  border: 1px solid #d6d6cf;
  border-radius: 0.48rem;
  cursor: pointer;
}

.style-options i {
  display: block;
  height: 1.95rem;
  border-radius: 0.27rem;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 7%);
}

.style-options b {
  display: block;
  margin-top: 0.27rem;
  font-size: 0.5rem;
  text-align: center;
}

.style-midnight i {
  background: linear-gradient(120deg, #101722 45%, #79f2c0 46% 53%, #182334 54%);
}

.style-dawn i {
  background: linear-gradient(120deg, #fff0e8 45%, #ff8d7b 46% 53%, #fff9f4 54%);
}

.style-paper i {
  background: linear-gradient(120deg, #f1efe8 45%, #9db7ff 46% 53%, #fffef9 54%);
}

.style-options input:checked + span {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.identity-fields {
  display: grid;
  margin-top: 0.9rem;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.48rem;
}

.identity-fields label,
.text-detail label {
  display: grid;
  min-width: 0;
}

.wide-field {
  grid-column: 1 / -1;
}

.identity-fields input,
.tag-input-row input,
.text-detail textarea {
  width: 100%;
  min-width: 0;
  padding: 0.52rem 0.57rem;
  color: var(--ink);
  background: white;
  border: 1px solid #cbcfc9;
  border-radius: 0.45rem;
  font-size: 0.67rem;
}

.identity-fields input {
  min-height: 2.15rem;
}

.image-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
}

.image-slots span {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 4.5rem;
  align-content: center;
  justify-items: center;
  background: #ebece7;
  background-image: var(--thumb);
  background-position: center;
  background-size: cover;
  border: 1px dashed #bfc4be;
  border-radius: 0.52rem;
  cursor: pointer;
}

.image-slots span::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgb(17 23 34 / 24%);
  opacity: 0;
}

.image-slots i,
.image-slots b {
  z-index: 1;
}

.image-slots i {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  margin-bottom: 0.23rem;
  color: #69716d;
  background: white;
  border: 1px solid #c7cbc5;
  border-radius: 50%;
  font-size: 0.54rem;
  font-style: normal;
  font-weight: 900;
  place-items: center;
}

.image-slots b {
  overflow: hidden;
  max-width: 5.2rem;
  padding-inline: 0.2rem;
  color: #626a66;
  font-size: 0.51rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-slots .has-image span::after {
  opacity: 1;
}

.image-slots .has-image b {
  color: white;
}

.image-slots .is-active span {
  border-color: var(--ink);
  box-shadow:
    inset 0 0 0 2px white,
    0 0 0 2px var(--ink);
}

.image-controls {
  display: grid;
  padding: 0.55rem;
  margin-top: 0.45rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.52rem;
  gap: 0.35rem;
}

.image-controls label {
  display: grid;
  align-items: center;
  grid-template-columns: 2.5rem 1fr;
}

.image-controls label span {
  color: #67706b;
  font-size: 0.55rem;
  font-weight: 750;
}

input[type="range"] {
  width: 100%;
  accent-color: #3b8b6c;
}

.image-controls button {
  justify-self: end;
  padding: 0.2rem 0;
  color: #8d4b3f;
  background: transparent;
  border: 0;
  font-size: 0.52rem;
  text-decoration: underline;
  cursor: pointer;
}

.tag-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
}

.tag-input-row input {
  border-radius: 0.44rem 0 0 0.44rem;
}

.tag-input-row button {
  padding-inline: 0.65rem;
  color: white;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0 0.44rem 0.44rem 0;
  font-size: 0.58rem;
  font-weight: 800;
  cursor: pointer;
}

.suggestion-row,
.selected-tags {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.4rem;
  gap: 0.25rem;
}

.suggestion-row button,
.selected-tags button {
  min-height: 1.65rem;
  padding: 0.25rem 0.42rem;
  background: white;
  border: 1px solid #d2d3cd;
  border-radius: 999px;
  color: #5b645f;
  font-size: 0.51rem;
  font-weight: 750;
  cursor: pointer;
}

.selected-tags button {
  color: #235a47;
  background: #e2f1e9;
  border-color: #9ec5b4;
}

.selected-tags span {
  margin-left: 0.2rem;
}

.preview-header {
  min-height: 2.3rem;
}

.preview-header > div:first-child > span {
  color: #a7432c;
  font-size: 0.48rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.preview-header h2 {
  margin-top: 0.08rem;
}

.ratio-switch {
  padding: 0.2rem;
  background: #e9e9e4;
  border-radius: 0.42rem;
  gap: 0.1rem;
}

.ratio-switch button {
  min-height: 1.65rem;
  padding-inline: 0.55rem;
  background: transparent;
  border: 0;
  border-radius: 0.3rem;
  color: #68706c;
  font-size: 0.54rem;
  font-weight: 800;
  cursor: pointer;
}

.ratio-switch button[aria-pressed="true"] {
  color: var(--ink);
  background: white;
  box-shadow: 0 0.15rem 0.35rem rgb(27 33 31 / 10%);
}

.canvas-stage {
  display: grid;
  min-height: 34rem;
  padding: clamp(1rem, 3vw, 2.6rem);
  place-items: center;
}

#profile-canvas {
  display: block;
  width: 100%;
  max-width: 58rem;
  height: auto;
  background: #101722;
  border-radius: 0.78rem;
  box-shadow:
    0 1.4rem 3rem rgb(27 33 31 / 17%),
    0 0 0 1px rgb(27 33 31 / 9%);
}

#profile-canvas.is-square {
  width: min(34rem, 88%);
}

.export-bar {
  min-height: 3.7rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  gap: 0.45rem;
}

.export-bar > div {
  min-width: 10rem;
  margin-right: auto;
}

.export-bar span,
.export-bar small {
  display: block;
}

.export-bar span {
  font-size: 0.63rem;
  font-weight: 850;
}

.export-bar small {
  margin-top: 0.16rem;
  color: var(--muted);
  font-size: 0.49rem;
}

.export-bar button {
  min-height: 2.3rem;
  padding-inline: 0.75rem;
  border-radius: 0.47rem;
  font-size: 0.62rem;
  font-weight: 850;
  cursor: pointer;
}

.copy-button {
  background: white;
  border: 1px solid #c8cac4;
}

.download-button {
  color: white;
  background: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: 0 0.24rem 0 #b23d25;
}

.detail-card,
.data-card {
  padding: 0.72rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.activity-options {
  display: grid;
  margin-top: 0.48rem;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.28rem;
}

.activity-options span {
  display: grid;
  min-height: 3.1rem;
  padding: 0.38rem;
  align-items: center;
  background: #f7f7f3;
  border: 1px solid #deded8;
  border-radius: 0.45rem;
  cursor: pointer;
  grid-template-columns: auto 1fr;
}

.activity-options i {
  width: 0.48rem;
  height: 0.48rem;
  margin-right: 0.35rem;
  border: 1px solid #929994;
  border-radius: 50%;
  grid-row: 1 / 3;
}

.activity-options strong,
.activity-options small {
  display: block;
}

.activity-options strong {
  font-size: 0.59rem;
}

.activity-options small {
  color: #7a817d;
  font-size: 0.47rem;
}

.activity-options input:checked + span {
  color: #164b38;
  background: #e0f1e8;
  border-color: #91c2aa;
}

.activity-options input:checked + span i {
  background: #3c936c;
  border-color: #3c936c;
  box-shadow: inset 0 0 0 2px white;
}

.contact-options {
  display: grid;
  margin-top: 0.48rem;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.28rem;
}

.contact-options span {
  display: grid;
  min-height: 2rem;
  padding: 0.35rem;
  color: #646c68;
  background: #f8f8f4;
  border: 1px solid #deded8;
  border-radius: 0.42rem;
  font-size: 0.54rem;
  font-weight: 800;
  cursor: pointer;
  place-items: center;
}

.contact-options input:checked + span {
  color: white;
  background: #25322e;
  border-color: #25322e;
}

.text-detail {
  display: grid;
  gap: 0.65rem;
}

.text-detail textarea {
  min-height: 4.25rem;
  resize: vertical;
  line-height: 1.5;
}

.accent-row {
  margin-top: 0.5rem;
  justify-content: space-between;
}

.accent-row button {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  background: var(--swatch);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #c9cac4;
  cursor: pointer;
}

.accent-row button[aria-pressed="true"] {
  box-shadow:
    0 0 0 2px var(--ink),
    0 0 0 4px white;
}

.data-card p {
  margin: 0;
  color: #6d7571;
  font-size: 0.52rem;
  line-height: 1.55;
}

.data-card button {
  padding: 0.28rem 0;
  margin-top: 0.42rem;
  color: #805247;
  background: transparent;
  border: 0;
  font-size: 0.52rem;
  font-weight: 750;
  text-decoration: underline;
  cursor: pointer;
}

.prose,
.not-found {
  width: min(46rem, 100%);
  padding: clamp(1.3rem, 4vw, 2.3rem);
  margin: 1.5rem auto 4rem;
  background: rgb(255 254 250 / 92%);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}

.prose h1,
.not-found h1 {
  margin-bottom: 1.6rem;
  font-size: 1.22rem;
}

.prose h2 {
  margin: 1.5rem 0 0.35rem;
  font-size: 0.82rem;
}

.prose p,
.not-found p {
  color: #59625d;
  font-size: 0.78rem;
  line-height: 1.85;
}

.not-found {
  text-align: center;
}

.not-found > span {
  display: block;
  margin-bottom: 1rem;
  color: #3d9671;
  letter-spacing: 0.5em;
}

.not-found a {
  display: inline-flex;
  min-height: 2.3rem;
  padding-inline: 0.8rem;
  align-items: center;
  color: white;
  background: var(--ink);
  border-radius: 0.45rem;
  font-size: 0.68rem;
  font-weight: 850;
  text-decoration: none;
}

footer {
  min-height: 4.5rem;
  justify-content: space-between;
  color: #616965;
  border-top: 1px solid rgb(27 33 31 / 12%);
  font-size: 0.67rem;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
input:focus-visible + span,
label:focus-within {
  outline: 3px solid #eaa04b;
  outline-offset: 2px;
}

button:hover,
.style-options label:hover span,
.activity-options label:hover span,
.contact-options label:hover span {
  border-color: #8f9691;
}

@media (max-width: 74rem) {
  .frame-workbench {
    grid-template-columns: 19rem minmax(0, 1fr);
  }

  .detail-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
    grid-column: 1 / -1;
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 50rem) {
  .site-header,
  footer,
  main {
    width: min(100% - 1rem, 48rem);
  }

  .site-header {
    min-height: 3rem;
  }

  .site-header nav a:first-child {
    display: none;
  }

  main {
    padding-top: 0.5rem;
  }

  .workspace-intro {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .workspace-intro h1 {
    font-size: 1.02rem;
  }

  .workspace-intro p {
    font-size: 0.65rem;
  }

  .local-badge {
    display: none;
  }

  .frame-workbench {
    overflow: visible;
    grid-template-columns: 1fr;
  }

  .preview-panel {
    order: 1;
  }

  .edit-panel {
    order: 2;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .detail-panel {
    order: 3;
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .canvas-stage {
    min-height: 17rem;
    padding: 1rem 0;
  }

  #profile-canvas.is-square {
    width: min(26rem, 94%);
  }

  .export-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .export-bar > div {
    grid-column: 1 / -1;
  }

  .export-bar button {
    width: 100%;
  }

  footer {
    padding-block: 1.2rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
