* {
  box-sizing: border-box;
}

.siteFooter {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: clamp(48px, 8vw, 96px) auto 0;
  padding: 18px 22px;
  color: var(--muted-ink);
  font-size: clamp(0.76rem, 1.15vw, 0.9rem);
  line-height: 1.65;
}

.siteFooter::before {
  position: absolute;
  inset: 1px;
  z-index: -1;
  content: "";
  pointer-events: none;
  border-style: solid;
  border-width: 5px 1px 2px 1px;
  border-color: #3d4b5c #526174 #303d4d #596778;
  transform: rotate(0.1deg);
}

.siteFooter p {
  margin: 0;
}

.siteFooter p + p {
  margin-top: 0.45em;
}

.siteFooter a,
.backLink {
  color: var(--link-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(38, 63, 86, 0.65);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.siteFooter a:hover,
.siteFooter a:focus-visible,
.backLink:hover,
.backLink:focus-visible {
  color: var(--accent-ink);
  text-decoration-color: currentColor;
}

.licensePage {
  max-width: 960px;
  margin: 0 auto;
}

.licenseContent {
  position: relative;
  margin-top: clamp(32px, 6vw, 72px);
  padding: clamp(24px, 5vw, 56px);
  line-height: 1.75;
}

.contentFrame {
  position: relative;
  isolation: isolate;
}

.contentFrame::before,
.tile::before {
  position: absolute;
  inset: 2px;
  content: "";
  pointer-events: none;
  border-style: solid;
  border-width: 3px 1px 2px 2px;
  border-color: #3d4b5c #526174 #303d4d #596778;
  transform: rotate(-0.15deg);
}

.contentFrame::before {
  z-index: -1;
}

.licenseContent h1 {
  margin: 0 0 1.2em;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.licenseContent p {
  margin: 1.25em 0 0;
}

.toolPage {
  max-width: 960px;
  margin: 0 auto;
}

.toolContent {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px);
}

.toolContent h1 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 5vw, 2.625rem);
  line-height: 1.1;
}

.toolContent p {
  line-height: 1.6;
}

.toolContent .note {
  margin: 0 0 24px;
  color: var(--muted-ink);
}

.toolContent .controls {
  display: grid;
  gap: 16px;
}

.toolContent .dropZone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 150px;
  padding: 24px;
  border: 2px dashed var(--connector);
  color: var(--link-ink);
  background: rgba(106, 137, 171, 0.06);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.toolContent .dropZone:hover,
.toolContent .dropZone:focus-within,
.toolContent .dropZone.dragging {
  border-color: var(--accent-ink);
  color: var(--accent-ink);
  background: rgba(140, 62, 52, 0.1);
}

.toolContent .dropZone.selected {
  border-style: solid;
}

.toolContent .dropZone.error {
  border-style: dashed;
  border-color: #a33b3b;
  color: #8f2f2f;
  background: rgba(163, 59, 59, 0.08);
}

.toolContent .dropZone.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.toolContent .dropTitle {
  font-size: 1.125rem;
  font-weight: 600;
}

.toolContent .dropHint {
  color: var(--muted-ink);
  font-size: 0.875rem;
}

.toolContent .fileCheck {
  margin-right: 6px;
  color: #2f7d4a;
  font-weight: 600;
}

.toolContent .fileError {
  margin-right: 6px;
  color: #a33b3b;
  font-weight: 600;
}

.toolContent #status.error {
  color: #8f2f2f;
}

.toolContent input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: inherit;
}

.toolContent button,
.toolContent .download {
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.toolContent button {
  color: var(--canvas);
  background: #4e6f95;
}

.toolContent button:not(:disabled):hover {
  background: #3f5f82;
}

.toolContent button.error {
  background: #a33b3b;
}

.toolContent button:focus-visible,
.toolContent .download:focus-visible {
  outline: 3px solid rgba(78, 111, 149, 0.3);
  outline-offset: 3px;
}

.toolContent button.error:focus-visible {
  outline-color: rgba(163, 59, 59, 0.3);
}

.toolContent button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.toolContent progress {
  width: 100%;
  height: 14px;
  accent-color: #4e6f95;
}

.toolContent #status {
  min-height: 26px;
  margin: 16px 0 0;
  color: var(--muted-ink);
  overflow-wrap: anywhere;
}

.toolContent #result {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--connector);
}

.toolContent #preview {
  display: block;
  max-width: 100%;
  max-height: 480px;
  margin: 0 auto 16px;
  border: 1px solid var(--connector);
  background-image:
    linear-gradient(45deg, rgba(106, 137, 171, 0.18) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(106, 137, 171, 0.18) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(106, 137, 171, 0.18) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(106, 137, 171, 0.18) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.toolContent .download {
  display: block;
  color: var(--canvas);
  background: var(--link-ink);
}

.toolContent .details {
  margin: 12px 0 0;
  color: var(--muted-ink);
  font-size: 0.875rem;
}

.toolPage .siteFooter {
  max-width: 720px;
}

:root {
  --canvas: #f4f6f8;
  --connector: #4e5f72;
  --grid-line: rgba(106, 137, 171, 0.14);
  --grid-line-restore: rgba(78, 111, 149, 0.5);
  --grid-size: 32px;
  --grid-offset-x: 0px;
  --grid-offset-y: 0px;
  --connection-min-endpoint-offset: 12px;
  --ink: #1f2d3d;
  --link-ink: #263f56;
  --muted-ink: #3c4a58;
  --accent-ink: #8c3e34;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--canvas);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  background-position: var(--grid-offset-x) var(--grid-offset-y);
  background-attachment: fixed;
  font-family: "Klee One", "Yu Kyokasho", "Yu Gothic UI", "Hiragino Sans", system-ui, sans-serif;
}

/* The original CSS borders remain as a fallback until the pen-drawn strokes are ready. */
.handDrawnFrames {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  transition: opacity 160ms linear;
}

body.handDrawnFramesReady .profileLinks a::before,
body.handDrawnFramesReady .profileLinks button::before,
body.handDrawnFramesReady .blogLinks::before,
body.handDrawnFramesReady .tile::before,
body.handDrawnFramesReady .siteFooter::before,
body.handDrawnFramesReady .contentFrame::before {
  opacity: 0;
}

a {
  text-decoration: none;
}

.boxConnections {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

.page {
  position: relative;
  min-height: 100vh;
  padding: clamp(20px, 3vw, 40px) clamp(16px, 3vw, 40px);
}

.profileLinks {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 clamp(16px, 2vw, 28px);
  font-size: clamp(0.83rem, 1.4vw, 1rem);
  line-height: 1.45;
}

.profileLinks a,
.profileLinks button {
  position: relative;
  isolation: isolate;
  width: fit-content;
  padding: 8px 12px 8px 16px;
  color: var(--link-ink);
  font-weight: 600;
  white-space: nowrap;
  text-decoration-color: rgba(38, 63, 86, 0.65);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.profileLinks button {
  margin: 0;
  border: 0;
  font: inherit;
  background: transparent;
  cursor: pointer;
}

.profileLinks a::before,
.profileLinks button::before {
  position: absolute;
  inset: 1px;
  z-index: -1;
  content: "";
  pointer-events: none;
  border-style: solid;
  border-width: 2px 1px 2px 5px;
  border-color: #3d4b5c #526174 #303d4d #596778;
  transform: rotate(-0.15deg);
}

.profileLinks a:hover,
.profileLinks a:focus-visible,
.profileLinks button:hover,
.profileLinks button:focus-visible,
.profileLinks button[aria-expanded="true"] {
  color: var(--accent-ink);
  text-decoration-color: currentColor;
}

.toolsMenu {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(14px, 1.8vw, 22px);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto clamp(24px, 3vw, 36px);
}

.toolsMenu[hidden] {
  display: none;
}

.toolsMenu .blogLinks::before {
  border-width: 2px 1px 5px 1px;
}

.blogLinks {
  position: relative;
  isolation: isolate;
  z-index: 2;
  width: fit-content;
  max-width: 100%;
  padding: 8px 16px 8px 12px;
  color: var(--link-ink);
  font-weight: 600;
  font-size: clamp(0.83rem, 1.4vw, 1rem);
  line-height: 1.45;
}

.blogLinks::before {
  position: absolute;
  inset: 1px;
  z-index: -1;
  content: "";
  pointer-events: none;
  border-style: solid;
  border-width: 2px 5px 2px 1px;
  border-color: #3d4b5c #596778 #303d4d #526174;
  transform: rotate(0.15deg);
}

.blogLinks a {
  color: inherit;
  text-decoration-color: rgba(38, 63, 86, 0.65);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.blogLinks:hover,
.blogLinks:focus-within {
  color: var(--accent-ink);
}

.blogLinks:hover a,
.blogLinks a:focus-visible {
  text-decoration-color: currentColor;
}

.gallery {
  --gallery-gap: clamp(24px, 3vw, 36px);
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-areas:
    "feature wide-one"
    "feature wide-two";
  grid-template-columns: var(
    --image-gallery-columns,
    minmax(0, 0.74fr) minmax(0, 1fr)
  );
  align-items: start;
  gap: var(--gallery-gap);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.blogGallery {
  --gallery-gap: clamp(14px, 1.8vw, 22px);
  grid-template-areas: none;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  align-items: start;
  margin-top: clamp(40px, 6vw, 84px);
}

.tile {
  position: relative;
  --photo-margin: 14px;
  width: 100%;
  padding: var(--photo-margin);
  overflow: visible;
  background: transparent;
}

.tile:nth-child(1) {
  grid-area: feature;
  transform: translateY(clamp(8px, 1.2vw, 16px));
}

.tile:nth-child(2) {
  grid-area: wide-one;
}

.tile:nth-child(3) {
  grid-area: wide-two;
  transform: translate(
    clamp(12px, 1.6vw, 22px),
    clamp(8px, 1vw, 14px)
  );
}

.tile::before {
  z-index: 3;
}

.image {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
}

.photoNote {
  position: relative;
  display: inline-block;
  z-index: 5;
  max-width: 100%;
  margin: 10px 0 0;
  color: var(--muted-ink);
  font-family: inherit;
  font-size: clamp(0.78rem, 1.3vw, 0.95rem);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.tile:nth-child(even) .photoNote {
  right: 0;
  left: auto;
  text-align: right;
}

@media (max-width: 760px) {
  .gallery {
    --gallery-gap: 36px;
    grid-template-areas: none;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gallery-gap);
    max-width: 560px;
  }

  .tile:nth-child(n) {
    grid-area: auto;
    transform: none;
  }

}

@media (max-width: 600px) {
  .page {
    padding: 32px 16px;
  }

  .gallery {
    --gallery-gap: 32px;
  }
}

