:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --text: #1a1d21;
  --text-sub: #6b7178;
  --line: #e3e5e8;
  --accent: #1a1d21;
  --wip: #b7791f;
  --wip-bg: #fdf3e0;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.12em;
}
.brand-sub {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--text-sub);
}
.header-note {
  font-size: 11px;
  color: var(--text-sub);
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 8px;
}

.container {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px;
  flex: 1;
}

.intro h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.intro-note {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-sub);
}

.project-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s ease, transform .2s ease;
}
.project-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.card-thumb {
  height: 160px;
  background: linear-gradient(135deg, #eceef1, #dfe2e7);
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-placeholder {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.3em;
  color: #b6bac1;
}
.card-body { padding: 16px 18px 18px; }
.card-status {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.06em;
  border-radius: 4px;
  padding: 3px 8px;
  margin-bottom: 8px;
}
.status-wip { background: var(--wip-bg); color: var(--wip); }
.status-review { background: #e8f0fd; color: #2b6cb0; }
.card-body h2 { font-size: 17px; font-weight: 700; }
.card-meta { margin-top: 6px; font-size: 12px; color: var(--text-sub); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 24px;
  text-align: center;
  font-size: 11px;
  color: var(--text-sub);
}

/* ===== preview page ===== */
.viewer-wrap {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 48px;
  flex: 1;
}
.viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.viewer-head h1 { font-size: 20px; font-weight: 700; letter-spacing: 0.04em; }
.back-link {
  font-size: 13px;
  color: var(--text-sub);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  background: var(--surface);
}
.back-link:hover { color: var(--text); }

.viewer-frame {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
model-viewer {
  width: 100%;
  height: min(72vh, 720px);
  background:
    radial-gradient(ellipse at 50% 30%, #f2f3f5 0%, #e7e9ec 100%);
  --poster-color: transparent;
}
.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-sub);
}
.viewer-toolbar .hint { letter-spacing: 0.03em; }

.viewer-note {
  margin-top: 18px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-sub);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.viewer-note strong { color: var(--text); }

.progress-bar {
  position: absolute;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  transition: width .2s ease;
  z-index: 5;
}

.load-error {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #b00;
  background: rgba(255,255,255,.92);
  z-index: 6;
}
.load-error.show { display: flex; }
