@import url("https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500&family=Geist+Mono&family=Shippori+Mincho&family=Noto+Sans+JP:wght@300&display=swap");

:root {
  --bone: #ede8db;
  --bone-2: #e4dfd1;
  --stone: #ccc7ba;
  --ink: #121212;
  --muted: #807d78;
  --red: #c7291f;
  --line: rgba(18, 18, 18, 0.12);
  --serif: "Shippori Mincho", Georgia, serif;
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bone); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.muted { color: var(--muted); }
.red { color: var(--red); }

/* Brand rail: the vertical NICODA with the ND seal, as in the identity. */
.rail { position: fixed; inset: 0 auto 0 0; width: 88px; display: flex; flex-direction: column; align-items: center; padding: 28px 0; gap: 56px; }
.seal { width: 36px; height: 36px; display: block; line-height: 0; }
.seal svg { width: 100%; height: 100%; }
.vertical { font: 300 22px/1.35 "Noto Sans JP", var(--sans); display: flex; flex-direction: column; align-items: center; }

.page { margin-left: 88px; padding: 32px 56px 80px 32px; min-height: 100%; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
h1 { font: 400 40px/1.1 var(--serif); margin: 6px 0 0; }
h2 { font: 400 24px/1.2 var(--serif); margin: 0; }

.btn { border: 1px solid var(--ink); background: transparent; padding: 10px 16px; cursor: pointer; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.btn:hover { background: var(--ink); color: var(--bone); }
.btn.solid { background: var(--ink); color: var(--bone); }
.btn.red { border-color: var(--red); color: var(--red); }
.btn.red:hover, .btn.red.on { background: var(--red); color: var(--bone); }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: var(--bone-2); color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

input[type="text"], input[type="password"], textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--ink); padding: 10px 0; outline: none;
}
textarea { border: 1px solid var(--line); padding: 12px; resize: vertical; min-height: 84px; background: #f4f0e6; }
textarea:focus { border-color: var(--ink); }

/* Contact sheet */
.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 40px 28px; }
.card { cursor: pointer; }
.card .frame { aspect-ratio: 4 / 3; background: var(--stone); overflow: hidden; position: relative; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.card:hover img { transform: scale(1.02); }
.card .meta { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; }
.badge { position: absolute; top: 10px; right: 10px; background: var(--red); color: var(--bone); font: 12px/1 var(--mono); padding: 6px 8px; }
.badge.ok { background: var(--ink); }
.empty { border: 1px dashed var(--muted); padding: 64px; text-align: center; }
.drop { outline: 2px solid var(--red); outline-offset: 8px; }

/* Viewer */
.viewer { position: fixed; inset: 0; background: var(--bone); display: grid; grid-template-columns: 1fr 400px; z-index: 10; }
.stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; gap: 16px; }
.canvas { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 8px 24px 24px; }
.shot { position: relative; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; min-width: 0; min-height: 0; flex: 1; height: 100%; justify-content: center; }
.shot .wrap { position: relative; max-width: 100%; max-height: calc(100% - 28px); line-height: 0; }
.shot img { max-width: 100%; max-height: calc(100vh - 140px); display: block; cursor: crosshair; user-select: none; -webkit-user-drag: none; }
.shot.prev img { cursor: default; }
.shot .cap { padding-top: 10px; }
.pin { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--red); color: var(--bone); font: 12px/26px var(--mono); text-align: center; box-shadow: 0 0 0 2px var(--bone); cursor: pointer; }
.pin.done { background: var(--ink); opacity: 0.55; }
.pin.draft { background: var(--bone); color: var(--red); box-shadow: 0 0 0 2px var(--red); }
.pin.hl { transform: scale(1.25); }

.panel { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #f2eee3; }
.panel-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.versions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 14px; }
.versions button { border: 1px solid var(--line); background: transparent; padding: 6px 10px; font: 12px var(--mono); cursor: pointer; }
.versions button.on { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.versions button .ok { color: var(--red); }
.comments { flex: 1; overflow: auto; padding: 8px 24px; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.comment .n { width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: var(--bone); font: 11px/24px var(--mono); text-align: center; }
.comment .n.general { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.comment.done .n { background: var(--ink); opacity: 0.5; }
.comment.done .body { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(18,18,18,0.35); }
.comment.studio .who::after { content: " · estudio"; color: var(--red); }
.comment .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.link { background: none; border: 0; padding: 0; cursor: pointer; font: 12px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.link:hover { color: var(--red); }
.composer { padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.hint { margin: 0 0 8px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bone); padding: 10px 16px; font: 12px var(--mono); z-index: 30; }

.modal { position: fixed; inset: 0; background: rgba(18, 18, 18, 0.35); display: grid; place-items: center; z-index: 20; }
.modal form { background: var(--bone); padding: 32px; width: min(420px, 92vw); display: grid; gap: 18px; }

@media (max-width: 900px) {
  .rail { display: none; }
  .page { margin-left: 0; padding: 20px; }
  .viewer { grid-template-columns: 1fr; grid-template-rows: 55vh 1fr; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .shot img { max-height: calc(55vh - 110px); }
}
.lead { font-size: 17px; line-height: 1.5; color: var(--muted); }

/* Symbol: the lens slides into the corner on load and stops cut by the frame. */
.seal .lens { animation: toCorner 1.8s cubic-bezier(0.2, 0.7, 0.1, 1) 0.4s both; }
@keyframes toCorner { from { transform: translate(-28px, -28px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .seal .lens { animation: none; } }
