@charset "UTF-8";
/* ==========================================================================
   Accidental 7 — theme
   Dark editorial theme shared by the index gallery and every sketch page.
   ========================================================================== */

:root {
  --paper: #0E0F12;
  --paper-2: #16181C;
  --paper-3: #1B1E23;
  --ink: #ECE7DB;
  --ink-soft: #C8C2B5;
  --mute: #7E7A72;
  --rule: #21242A;
  --rule-soft: #181B20;
  --accent: #FF8A66;
  --accent-q: #D7B98A;
  --selection: #3A2E26;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html, body {
  background: var(--paper) !important;
  color: var(--ink-soft);
  font-family: var(--sans);
}

body { -webkit-font-smoothing: antialiased; }

::selection { background: var(--selection); color: var(--ink); }

a { color: var(--accent); }

/* -------------------------------------------------------------------------
   Shared site header (index + every sketch page)
   ------------------------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-header .header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.site-header .brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.site-header .brand:hover { color: var(--accent); }
.site-header nav.site-nav a {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--mute);
  text-decoration: none;
  margin-right: 24px;
}
.site-header nav.site-nav a:last-child { margin-right: 0; }
.site-header nav.site-nav a:hover { color: var(--ink); }
.site-header .header-meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mute);
}
.site-header .back-link {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.site-header .back-link:hover { color: var(--accent); }
.site-header .sketch-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* -------------------------------------------------------------------------
   Index: hero
   ------------------------------------------------------------------------- */

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 32px 48px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--mute);
  margin-bottom: 28px;
}
.eyebrow .rule { width: 28px; height: 1px; background: var(--rule); display: inline-block; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5.2vw, 4.2rem);
  line-height: 1.08;
  color: var(--ink);
  margin: 0 0 28px;
  max-width: 16ch;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.hero p.lede {
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 32px;
}
.hero .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-size: 0.85rem;
  color: var(--mute);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.hero .meta-row strong { color: var(--ink-soft); font-weight: 600; }

/* -------------------------------------------------------------------------
   Index: sketch list
   ------------------------------------------------------------------------- */

.sketches {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 32px 96px;
}
.sketches-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.sketches-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.8rem;
  color: var(--ink);
  margin: 0;
}
.sketches-head h2 em { font-style: italic; color: var(--mute); font-weight: 400; }
.sketches-head .count {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mute);
}

.sketch-list { list-style: none; margin: 0; padding: 0; }

.sketch-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 220px;
  gap: 24px;
  padding: 28px 16px;
  border-bottom: 1px solid var(--rule);
  align-items: start;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.sketch-row:hover { background: var(--paper-2); }

.sketch-row .row-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--accent);
  padding-top: 2px;
}

.row-main h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  margin: 0 0 4px;
}
.row-main h3 .file {
  color: var(--mute);
  font-weight: 400;
}
.row-main h3 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
}
.row-main p {
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--mute);
  margin: 0;
  max-width: 64ch;
}

.row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  text-align: right;
}
.row-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.row-tags span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.view-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.sketch-row:hover .view-link { text-decoration: underline; }

@media (max-width: 720px) {
  .sketch-row {
    grid-template-columns: 32px 1fr;
  }
  .row-meta {
    grid-column: 2;
    align-items: flex-start;
    text-align: left;
  }
  .row-tags { justify-content: flex-start; }
}

/* -------------------------------------------------------------------------
   Index: footer
   ------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 28px 32px;
}
.site-footer .footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--mute);
}
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* -------------------------------------------------------------------------
   Sketch pages — restyle the legacy Processing/p5 control bar to match
   ------------------------------------------------------------------------- */

.proc_ui {
  background: var(--paper-2) !important;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 4% !important;
}
.proc_ui p {
  font-family: var(--sans) !important;
  color: var(--ink-soft) !important;
  text-transform: none !important;
  float: none !important;
  width: auto !important;
  flex: 1 1 auto;
  margin: 0 !important;
  line-height: 1.4 !important;
}
.proc_ui .ui-button,
input[type=button] {
  background: transparent !important;
  border: 1px solid var(--rule) !important;
  color: var(--ink-soft) !important;
  font-family: var(--sans) !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 3px !important;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  float: none !important;
  width: auto !important;
  min-width: 0;
  max-width: none !important;
  height: 34px !important;
  padding: 0 14px !important;
  margin: 0 !important;
  box-sizing: border-box;
  white-space: nowrap;
  flex: 0 0 auto;
}
.proc_ui .ui-button:hover,
input[type=button]:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
input[type=text] {
  background: var(--paper-3) !important;
  border: 1px solid var(--rule) !important;
  color: var(--ink) !important;
  border-radius: 3px !important;
  padding: 0 10px !important;
  box-sizing: border-box;
}
.control_label, .textlabel {
  font-family: var(--sans) !important;
  color: var(--mute) !important;
}
.proc_overlay {
  background: rgba(22, 24, 28, 0.92) !important;
  border: 1px solid var(--rule);
  width: auto !important;
  min-width: 220px;
  max-width: 320px;
}
.proc_overlay input[type=text] {
  font-size: 0.85rem !important;
  width: 100% !important;
  margin: 8px 0 !important;
}
.proc_overlay .labeledslider { box-sizing: border-box; width: 100% !important; }
.box_head, .box_desc {
  background: rgba(14, 15, 18, 0.85) !important;
}
.box_head h1 { color: var(--ink) !important; }
.box_desc p { color: var(--ink-soft) !important; }

/* -------------------------------------------------------------------------
   Sidebar sketch layout — controls panel to the left, canvas stage to the
   right, so the panel never overlaps the drawing (used by sketch_ex14.html).
   ------------------------------------------------------------------------- */

body.sketch-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.sketch-page .site-header { flex: 0 0 auto; }

.sketch-layout {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

.sketch-panel {
  flex: 0 0 300px;
  width: 300px;
  box-sizing: border-box;
  background: var(--paper-2);
  border-right: 1px solid var(--rule);
  padding: 28px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.panel-hint {
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}
.panel-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.panel-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mute);
}
.panel-group input[type=text] {
  width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box;
}
.sketch-panel .uislider {
  display: block !important;
  width: 100% !important;
  height: 6px;
  margin: 6px 0 !important;
}
.sketch-panel .control_label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  margin: 0 !important;
  height: auto !important;
}
.sketch-panel .textlabel {
  font-size: 0.85rem !important;
  height: auto !important;
}
.panel-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.panel-actions .ui-button {
  flex: 1 1 auto;
}

.sketch-stage {
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
}
.sketch-stage .stage-canvas {
  width: 100%;
  height: 100%;
}
.sketch-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.sketch-stage .stage-canvas > svg {
  display: block;
  width: 100%;
  height: 100%;
}
.stage-status {
  text-align: center;
  padding: 48px 0;
  color: var(--mute) !important;
  font-family: var(--sans) !important;
}

/* Right-hand variant of the controls panel (asset libraries). */
.sketch-panel--right {
  border-right: none;
  border-left: 1px solid var(--rule);
}

.panel-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.panel-count {
  font-family: var(--sans);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.asset-chip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.asset-chip:hover { border-color: var(--mute); }
.asset-chip.is-selected {
  border-color: var(--accent);
  background: rgba(255, 138, 102, 0.08);
}
.asset-thumb {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--ink);
  border-radius: 3px;
  overflow: hidden;
}
.asset-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  line-height: 17px;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink);
  background: rgba(14, 15, 18, 0.55);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.asset-remove:hover,
.asset-remove:focus-visible {
  background: var(--accent);
  color: var(--paper);
  outline: none;
}
.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.asset-name {
  font-family: var(--sans);
  font-size: 0.65rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-chip.is-selected .asset-name { color: var(--ink-soft); }

.asset-bulk {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}
.link-button {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mute);
  cursor: pointer;
}
.link-button:hover { color: var(--accent); }

.upload-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upload-row input[type=file] { display: none; }
.upload-button {
  display: inline-block;
  text-align: center;
  padding: 9px 12px;
  border: 1px dashed var(--rule);
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.upload-button:hover { border-color: var(--accent); color: var(--accent); }
.upload-note {
  font-family: var(--sans);
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--mute);
  margin: 0;
}
.upload-error {
  font-family: var(--sans);
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--accent);
  margin: 0;
}
.upload-error[hidden] { display: none; }

@media (max-width: 720px) {
  .sketch-layout { flex-direction: column; }
  .sketch-panel {
    flex: 0 0 auto;
    width: 100%;
    max-height: 55vh;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .sketch-panel--right {
    border-left: none;
    border-bottom: none;
    border-top: 1px solid var(--rule);
  }
  .sketch-stage { min-height: 320px; }
}
