/*
 * Four-up / wireframe edition
 *
 * A restrained technical-interface layer inspired by Euphony's compact
 * system typography, thin neutral borders, small radii, gray planes and
 * selective color rails. This file intentionally overrides the original
 * presentation without changing the editor's behavior.
 */

:root {
  --ink: #181916;
  --muted: #676a64;
  --soft-muted: #969a92;
  --paper: #fdfdfb;
  --canvas: #f1f2ee;
  --warm: #f6f6f1;
  --line: #d1d4cc;
  --line-strong: #aeb2aa;
  --blue: #5265ee;
  --blue-dark: #344bdc;
  --blue-soft: #e9ecff;
  --violet: #7651a8;
  --green: #5f8b5a;
  --navy: #23251f;
  --radius: 3px;
  --shadow: 8px 8px 0 rgba(24, 25, 22, 0.07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

body {
  background-color: var(--canvas);
  background-image:
    linear-gradient(rgba(24, 25, 22, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 25, 22, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
}

body::before {
  content: "";
  width: 5px;
  height: 5px;
  position: fixed;
  top: 74px;
  left: 15px;
  z-index: 20;
  border: 1px solid var(--ink);
  background: var(--canvas);
  pointer-events: none;
}

::selection {
  background: var(--blue);
  color: white;
}

.site-header {
  height: 56px;
  padding: 0 clamp(18px, 3.5vw, 54px);
  border-bottom: 1px solid var(--ink);
  background: rgba(247, 248, 244, 0.94);
  backdrop-filter: blur(18px);
}

.site-header::after {
  content: "ARCHIVE TOOL / 01";
  position: absolute;
  left: 50%;
  color: var(--soft-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  transform: translateX(-50%);
}

.brand {
  gap: 10px;
  font-size: 14px;
  font-weight: 670;
  letter-spacing: -0.015em;
}

.brand-mark {
  width: 29px;
  height: 29px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  transform: none;
}

.brand-mark::after {
  content: "";
  width: 3px;
  height: 3px;
  position: absolute;
  top: 5px;
  right: 5px;
  border-radius: 50%;
  background: var(--blue);
}

.header-meta {
  gap: 8px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.status-dot {
  width: 5px;
  height: 5px;
  background: var(--green);
  box-shadow: none;
}

.hero {
  max-width: 1540px;
  min-height: 610px;
  padding: clamp(74px, 8vw, 118px) clamp(24px, 5vw, 76px) 92px;
  grid-template-columns: minmax(0, 1.08fr) minmax(370px, 0.72fr);
  gap: clamp(60px, 10vw, 160px);
}

.hero::before {
  width: 460px;
  height: 460px;
  top: -338px;
  right: 14%;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: none;
  opacity: 0.65;
}

.hero::after {
  content: "+";
  position: absolute;
  top: 38px;
  right: 5vw;
  color: var(--line-strong);
  font-family: ui-monospace, monospace;
  font-size: 18px;
  font-weight: 300;
}

.eyebrow {
  max-width: 620px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 28px 0 28px;
  max-width: 840px;
  font-size: clamp(55px, 6.5vw, 101px);
  font-weight: 470;
  line-height: 0.91;
  letter-spacing: -0.068em;
}

.hero-lede {
  max-width: 570px;
  color: #555851;
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.55;
  letter-spacing: -0.018em;
}

.text-link {
  margin-top: 34px;
  gap: 24px;
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--line-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.text-link span {
  color: var(--blue);
  font-size: 14px;
}

.layout-spec {
  padding: 0;
  border: 1px solid var(--ink);
  background: rgba(253, 253, 251, 0.68);
  box-shadow: 6px 6px 0 rgba(24, 25, 22, 0.045);
  position: relative;
}

.layout-spec::before,
.layout-spec::after {
  content: "+";
  position: absolute;
  color: var(--blue);
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

.layout-spec::before { top: -8px; left: -5px; }
.layout-spec::after { right: -5px; bottom: -8px; }

.spec-heading {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 8px;
  font-weight: 550;
  letter-spacing: 0.08em;
}

.specs {
  gap: 0;
}

.spec {
  min-height: 92px;
  padding: 15px 17px;
  grid-template-columns: 118px 1fr;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.spec p {
  gap: 12px;
}

.spec strong {
  color: var(--violet);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 600;
}

.spec p span {
  font-size: 11px;
  font-weight: 560;
}

.mini-grid {
  gap: 3px;
  border: 0;
  border-radius: 1px;
  background: var(--line);
}

.mini-grid i,
.spec:nth-child(2) .mini-grid i:first-child,
.spec:nth-child(3) .mini-grid i:nth-child(2),
.spec:nth-child(3) .mini-grid i:nth-child(3) {
  border: 1px solid var(--ink);
  background: var(--paper);
}

.spec:nth-child(2) .mini-grid i:first-child,
.spec:nth-child(3) .mini-grid i:nth-child(2),
.spec:nth-child(3) .mini-grid i:nth-child(3) {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.spec-note {
  margin: 0;
  padding: 14px 17px 16px;
  border-top: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 9px;
  line-height: 1.6;
}

.composer-shell {
  width: min(1510px, calc(100% - clamp(24px, 5vw, 78px)));
  margin-bottom: clamp(94px, 10vw, 150px);
  grid-template-columns: 390px minmax(0, 1fr);
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: var(--shadow);
  position: relative;
}

.composer-shell::before {
  content: "WORKSPACE / ACTIVE";
  position: absolute;
  top: -19px;
  left: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.control-panel {
  min-height: 805px;
  padding: 27px 24px 28px;
  border-right: 1px solid var(--ink);
  background: rgba(247, 248, 244, 0.82);
}

.panel-heading {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.step-label {
  margin-bottom: 7px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 8px;
  font-weight: 550;
  letter-spacing: 0.1em;
}

.step-label--blue {
  color: var(--blue-dark);
}

.panel-heading h2,
.preview-toolbar h2 {
  font-size: 21px;
  font-weight: 570;
  letter-spacing: -0.035em;
}

.photo-count {
  min-width: 50px;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink);
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 500;
}

.drop-zone {
  min-height: 170px;
  margin-top: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 2px;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(24,25,22,.05) 50%, transparent calc(50% + .5px)),
    linear-gradient(transparent calc(50% - 0.5px), rgba(24,25,22,.05) 50%, transparent calc(50% + .5px)),
    rgba(253, 253, 251, 0.72);
  box-shadow: none;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--blue);
  background-color: var(--blue-soft);
  box-shadow: inset 0 0 0 1px var(--blue);
  transform: none;
}

.upload-icon {
  width: 37px;
  height: 37px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--blue-dark);
}

.drop-title {
  font-size: 12px;
  font-weight: 650;
}

.drop-copy {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 8px;
}

.demo-button {
  height: 44px;
  margin-top: 9px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 9px;
  font-weight: 550;
}

.demo-button:hover {
  border-color: var(--line);
  background: var(--paper);
}

.demo-swatch {
  border: 1px solid var(--line-strong);
  border-radius: 1px;
}

.photo-list-wrap,
.crop-controls {
  margin-top: 21px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.subheading-row {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 8px;
  font-weight: 550;
  letter-spacing: 0.055em;
}

.photo-list {
  gap: 5px;
}

.photo-row {
  height: 56px;
  grid-template-columns: 19px 43px minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(253, 253, 251, 0.8);
}

.photo-row:hover {
  border-color: var(--line-strong);
  background: white;
}

.photo-row.is-selected {
  border-color: var(--ink);
  background: var(--paper);
  box-shadow: inset 3px 0 0 var(--violet);
}

.row-number,
.row-name span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
}

.row-number {
  font-size: 8px;
}

.row-thumb {
  width: 43px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 1px;
}

.row-name strong {
  font-size: 10px;
  font-weight: 600;
}

.row-name span {
  font-size: 8px;
}

.icon-button {
  width: 23px;
  height: 23px;
  border-radius: 1px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.icon-button:hover:not(:disabled) {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.add-more {
  height: 38px;
  border-color: var(--line-strong);
  border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 9px;
  font-weight: 550;
}

.add-more:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.reset-button {
  color: var(--violet);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 8px;
}

.zoom-icon {
  border-color: var(--line-strong);
  border-radius: 2px;
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

input[type="range"] {
  height: 2px;
  border-radius: 0;
  background: linear-gradient(90deg, var(--violet) var(--range-progress, 0%), var(--line) var(--range-progress, 0%));
}

input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid var(--paper);
  background: var(--violet);
  box-shadow: 0 0 0 1px var(--ink);
}

.crop-hint {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 8px;
}

.crop-hint span {
  color: var(--violet);
}

.preview-toolbar {
  min-height: 82px;
  padding: 23px clamp(26px, 3.5vw, 45px) 18px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.preview-legend {
  gap: 15px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.055em;
}

.preview-legend i {
  width: 5px;
  height: 5px;
  border-radius: 0;
  background: var(--violet);
}

.tweet-stage {
  min-height: 585px;
  padding: clamp(42px, 5vw, 72px);
  background-color: #eceee9;
  background-image:
    linear-gradient(rgba(24, 25, 22, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 25, 22, 0.055) 1px, transparent 1px);
  background-size: 24px 24px;
}

.tweet-stage::before,
.tweet-stage::after {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  color: var(--line-strong);
  font-family: ui-monospace, monospace;
  font-size: 15px;
}

.tweet-stage::before { content: "+"; top: 16px; left: 18px; }
.tweet-stage::after { content: "+"; right: 18px; bottom: 14px; }

.tweet-card {
  width: min(100%, 760px);
  padding: clamp(22px, 3vw, 33px);
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
  box-shadow: 8px 8px 0 rgba(24, 25, 22, 0.08);
  position: relative;
}

.tweet-card::before {
  content: "TIMELINE / DESKTOP";
  position: absolute;
  top: -19px;
  right: -1px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 8px;
  letter-spacing: 0.07em;
}

.avatar {
  width: 40px;
  height: 40px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background:
    linear-gradient(135deg, transparent 49%, var(--line) 50% 51%, transparent 52%),
    #f1f2ee;
  color: var(--ink);
}

.avatar span {
  font-size: 13px;
  font-weight: 650;
  text-shadow: none;
}

.author-copy strong {
  font-size: 13px;
  font-weight: 650;
}

.author-copy span,
.tweet-date {
  color: var(--soft-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 9px;
}

.tweet-more {
  color: var(--line-strong);
  font-family: ui-monospace, monospace;
}

.tweet-copy {
  margin: 12px 0 14px;
  font-size: 13px;
}

.classic-grid {
  gap: 5px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
}

.empty-cell {
  background:
    linear-gradient(135deg, transparent calc(50% - .5px), rgba(24,25,22,.07) 50%, transparent calc(50% + .5px)),
    #e5e8e3;
  color: var(--soft-muted);
}

.empty-cell:nth-child(2) { background-color: #e8e8e1; }
.empty-cell:nth-child(3) { background-color: #e8e4e5; }
.empty-cell:nth-child(4) { background-color: #e6e4e8; }

.empty-cell span {
  width: 31px;
  height: 31px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.photo-cell::before {
  transition: none;
}

.photo-cell.is-selected::before {
  box-shadow: inset 0 0 0 2px var(--violet);
}

.cell-number {
  width: 21px;
  height: 21px;
  top: 7px;
  left: 7px;
  border: 1px solid var(--paper);
  border-radius: 2px;
  background: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
}

.tweet-date {
  padding: 13px 0 11px;
  border-color: var(--line);
}

.tweet-actions {
  color: var(--line-strong);
}

.export-bar {
  min-height: 104px;
  padding: 21px clamp(26px, 3.5vw, 45px);
  border-top: 1px solid var(--ink);
  background: var(--paper);
}

.export-copy strong {
  font-size: 12px;
  font-weight: 650;
}

.export-copy p span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 8px;
}

.format-select select {
  height: 40px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 9px;
}

.format-select::after {
  top: 10px;
}

.export-button {
  height: 40px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 9px;
  font-weight: 560;
}

.export-button:hover:not(:disabled) {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  transform: none;
}

.export-button:disabled {
  border-color: var(--line-strong);
  background: var(--line-strong);
}

.research-note {
  width: min(1370px, calc(100% - 48px));
  margin-bottom: 96px;
  padding: 0;
  grid-template-columns: 78px minmax(250px, 0.78fr) 1.22fr;
  gap: 0;
  border: 1px solid var(--ink);
  background: rgba(253, 253, 251, 0.65);
}

.research-index {
  width: auto;
  height: 100%;
  min-height: 190px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  color: var(--violet);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.research-note > div:nth-child(2) {
  padding: 33px clamp(25px, 4vw, 54px);
  border-right: 1px solid var(--line);
}

.research-note h2 {
  max-width: 430px;
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 480;
  line-height: 1.01;
  letter-spacing: -0.055em;
}

.research-body {
  padding: 34px clamp(25px, 4vw, 53px);
  gap: 31px;
}

.research-body p {
  font-size: 11px;
  line-height: 1.68;
}

.site-footer {
  min-height: 68px;
  padding: 20px clamp(18px, 3.5vw, 54px);
  border-top: 1px solid var(--ink);
  color: var(--muted);
  background: rgba(247, 248, 244, 0.8);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.07em;
}

.toast {
  padding: 10px 14px;
  border: 1px solid var(--paper);
  border-radius: 2px;
  background: rgba(24, 25, 22, 0.96);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 9px;
  font-weight: 500;
}

@media (max-width: 1050px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .layout-spec {
    max-width: 620px;
  }

  .composer-shell {
    grid-template-columns: 330px minmax(0, 1fr);
  }

  .control-panel {
    padding: 25px 20px;
  }

  .research-note {
    grid-template-columns: 64px 1fr;
  }

  .research-index {
    grid-row: 1 / 3;
  }

  .research-note > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .research-body {
    grid-column: 2;
  }
}

@media (max-width: 780px) {
  body::before,
  .site-header::after {
    display: none;
  }

  .site-header {
    height: 52px;
  }

  .hero {
    padding-top: 68px;
  }

  .composer-shell {
    display: flex;
  }

  .control-panel {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .preview-toolbar {
    min-height: 76px;
    padding: 20px;
  }

  .tweet-stage {
    padding: 36px 14px 28px;
  }

  .tweet-card {
    padding: 17px;
    box-shadow: 5px 5px 0 rgba(24, 25, 22, 0.07);
  }

  .export-bar {
    padding: 20px;
  }

  .research-note {
    grid-template-columns: 1fr;
  }

  .research-index {
    min-height: 50px;
    grid-row: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .research-note > div:nth-child(2),
  .research-body {
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  .hero h1 {
    font-size: clamp(49px, 14.5vw, 70px);
  }

  .spec {
    grid-template-columns: 91px 1fr;
  }

  .mini-grid {
    width: 91px;
    height: 45.5px;
  }

  .classic-grid {
    gap: 3px;
    border-radius: 1px;
  }

  .research-body {
    grid-template-columns: 1fr;
  }
}
