:root {
  --bg: #f6f1e8;
  --card: #fffaf2;
  --ink: #1f1a16;
  --muted: #6f655c;
  --accent: #d86f4a;
  --line: #d6cabd;
  --shadow: 0 12px 30px rgba(31, 26, 22, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f5efe6 0%, #efe5d8 100%);
  color: var(--ink);
}

.site-header {
  padding: 28px 20px 10px;
  max-width: 1240px;
  margin: 0 auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(2rem, 3vw, 3.5rem);
  margin: 0 0 10px;
  line-height: 1;
}

.intro {
  max-width: 720px;
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 18px;
}

.nav-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-button,
button,
.upload-label {
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: white;
  padding: 12px 18px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.tab-button:hover,
button:hover,
.upload-label:hover {
  transform: translateY(-1px);
}

.tab-button.active,
button.active,
.mode-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

button.secondary,
.upload-label.secondary,
.tab-button:not(.active),
.mode-button.secondary {
  background: transparent;
  color: var(--ink);
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px 40px;
}

.view { display: none; }
.view.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

.help-text,
.form-message,
.person-location,
.person-artist,
ol,
.notice,
.inline-code {
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: white;
  color: var(--ink);
}

input[type="range"] {
  padding: 0;
}

.input-mode-toggle {
  display: flex;
  gap: 10px;
  margin: 14px 0 16px;
  flex-wrap: wrap;
}

.mode-button {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.95rem;
}

.input-panel {
  display: none;
}

.input-panel.active {
  display: block;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 14px;
  flex-wrap: wrap;
}

.canvas-wrap,
.photo-preview-wrap {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    #fff;
  background-size: 24px 24px;
}

canvas,
.photo-preview {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.photo-preview {
  object-fit: cover;
  background: white;
}

.photo-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  background: rgba(255,255,255,0.72);
}

.file-picker input[type="file"] {
  padding: 10px;
}

.wall-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.wall-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.wall-actions input[type="search"] {
  width: min(280px, 80vw);
}

.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.wall-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: white;
  min-height: 380px;
  box-shadow: 0 6px 18px rgba(31, 26, 22, 0.05);
}

.wall-card-content {
  padding: 16px 16px 18px;
  display: grid;
  gap: 8px;
}

.portrait-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: white;
  border-bottom: 1px solid var(--line);
}

.person-name {
  margin: 0;
  font-size: 1.2rem;
}

.person-location,
.person-line,
.person-artist {
  margin: 0;
}

.person-line {
  font-size: 1.05rem;
  line-height: 1.45;
}

.empty-state {
  text-align: center;
  padding: 40px 20px 20px;
}

.hidden {
  display: none !important;
}

.about-card code {
  display: inline-block;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 6px;
  word-break: break-all;
}

.notice {
  background: #fff3df;
  border: 1px solid #f0d6a9;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 18px 0;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}
