@font-face {
  font-family: "Source Code Pro";
  src: url("assets/fonts/SourceCodePro-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Code Pro";
  src: url("assets/fonts/SourceCodePro-Semibold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --pine: #16251d;
  --chalk: #f2f6f1;
  --phosphor: #b8ed8a;
  --sage: #b1c4b4;
  --rule: #3b4b3c;
  --display-size: clamp(48px, 5.9vw, 100px);
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-weight: 400;
  background: var(--pine);
  color: var(--chalk);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; }
::selection { background: var(--phosphor); color: var(--pine); }

.page {
  width: min(100%, 1800px);
  min-height: 100svh;
  margin-inline: auto;
  padding: max(24px, calc(var(--display-size) * 0.327)) 64px 0;
  display: flex;
  flex-direction: column;
}

.masthead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.logo {
  /* The supplied artwork has 2727 canvas units per 341.6193-unit font em. */
  --logo-width: calc(var(--display-size) * 7.98256965);
  display: block;
  width: var(--logo-width);
  height: auto;
  margin-left: calc(var(--logo-width) * -0.055616);
  /* Trim the blank canvas around the wordmark without changing its paths. */
  margin-top: calc(var(--logo-width) * -0.09931);
  margin-bottom: calc(var(--logo-width) * -0.11033);
  flex: none;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: start;
  flex: 1;
  min-height: 520px;
  padding-block: 8px 48px;
}

.hero-copy { position: relative; z-index: 1; pointer-events: none; }

h1 {
  margin: 0;
  font-size: var(--display-size);
  font-weight: 600;
  line-height: 1.16;
}
h1 span { color: var(--phosphor); }

.artwork {
  position: absolute;
  top: 50%;
  right: -1%;
  width: 59%;
  height: calc(100% - 32px);
  margin: 0;
  transform: translateY(-50%);
}

.artwork-fallback, .artwork-canvas {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  inset: 0;
}
.artwork-canvas {
  visibility: hidden;
  cursor: grab;
  touch-action: none;
  border-radius: 4px;
}
.artwork.is-dragging .artwork-canvas { cursor: grabbing; }
.artwork-canvas:focus-visible { outline: none; }
.artwork-canvas:focus-visible ~ .field-controls .field-hint {
  outline: 2px solid var(--phosphor);
  outline-offset: 8px;
  border-radius: 2px;
}
.artwork-fallback { object-fit: contain; }
.artwork.is-ready .artwork-canvas { visibility: visible; }
.artwork.is-ready .artwork-fallback { visibility: hidden; }

.field-controls {
  position: absolute;
  z-index: 2;
  inset: auto 24px 4px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--sage);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}
.field-controls[hidden] { display: none; }
.field-hint { display: flex; align-items: center; gap: 10px; }
.drag-icon { width: 18px; height: 18px; flex: none; color: var(--phosphor); }
.reset-view {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px;
  color: var(--sage);
  border: 0;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  font-weight: 600;
}
.reset-view:hover { color: var(--phosphor); }
.reset-view:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; }
.reset-icon { width: 16px; height: 16px; flex: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.footer {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 88px;
  border-top: 1px solid var(--rule);
  color: var(--sage);
  font-size: 12px;
  line-height: 1.6;
}
.footer p { margin: 0; }
.footer-note { margin-left: auto !important; }
.motion-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  margin: 0 -12px 0 24px;
  padding: 8px 12px;
  color: var(--sage);
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}
.motion-control[hidden] { display: none; }
.motion-control:hover { color: var(--phosphor); border-color: var(--rule); }
.motion-control:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 4px; }
.motion-icon { display: flex; justify-content: center; gap: 3px; width: 10px; height: 10px; }
.motion-icon span { width: 2px; background: currentColor; }
.motion-control[data-paused="true"] .motion-icon { display: block; }
.motion-control[data-paused="true"] .motion-icon span:first-child {
  display: block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
  background: none;
}
.motion-control[data-paused="true"] .motion-icon span:last-child { display: none; }

@media (min-width: 1800px) {
  .hero { min-height: 720px; }
}

@media (max-width: 1100px) {
  :root { --display-size: 5.9vw; }
  .page { padding-inline: 40px; }
  .hero { min-height: 500px; }
}

@media (max-width: 760px) {
  :root { --display-size: clamp(32px, 7.6vw, 58px); }
  .page { padding: max(12px, calc(var(--display-size) * 0.327)) 24px 0; }
  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding-block: 8px 16px;
  }
  .artwork {
    position: relative;
    top: auto;
    right: auto;
    width: min(112%, 480px);
    max-width: calc(100vw - 16px);
    height: auto;
    aspect-ratio: 1 / 1.08;
    margin: 16px 0 0;
    align-self: center;
    transform: none;
  }
  .field-controls { inset-inline: 16px; bottom: 0; }
  .footer { min-height: 88px; gap: 8px; flex-wrap: wrap; }
  .footer-note { display: none; }
  .motion-control { margin-left: auto; }
}

@media (max-width: 359px) {
  :root { --display-size: 30px; }
  .page { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
