/* =====================================================
   Field Notes — IT · Clean Theme
   ===================================================== */

:root {
  --bg:            #f4f5f7;
  --surface:       #ffffff;
  --surface-2:     #fafbfc;
  --border:        #e6e8ec;
  --border-strong: #d4d7de;
  --ink:           #0f172a;
  --ink-soft:      #334155;
  --ink-mute:      #64748b;
  --ink-faint:     #94a3b8;

  --accent:        #f5a623;
  --accent-soft:   #fff4de;
  --accent-deep:   #c9851a;

  --danger:        #ef4444;
  --ok:            #10b981;

  --header-bg:     #0b0f19;
  --header-ink:    #e5e7eb;
  --header-mute:   #9ca3af;

  --radius:        14px;
  --radius-sm:     10px;
  --radius-lg:     18px;

  --shadow-sm:     0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:        0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-lg:     0 4px 12px rgba(15, 23, 42, 0.08), 0 20px 40px -20px rgba(15, 23, 42, 0.15);

  --sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display:"Plus Jakarta Sans", "Inter", sans-serif;
  --mono:   "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ========== HEADER ========== */
.masthead {
  background: var(--header-bg);
  border-bottom: 1px solid #111827;
}
.masthead-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--header-ink);
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent);
  color: #0b0f19;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: #fff;
}
.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--header-mute);
  margin-top: 2px;
}
.masthead-meta { display: none; }
.rule { display: none; }

/* ========== MAIN ========== */
.page { position: relative; }
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 28px 60px;
}

/* ========== TYPOGRAPHY ========== */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
}

h1.display, .display {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  color: var(--ink);
}
h1.display .accent { color: var(--accent); }

h2.section {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--ink);
}

.crumbs {
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.crumbs a { color: var(--ink-mute); text-decoration: none; }
.crumbs a:hover { color: var(--accent-deep); }
.crumbs .sep { margin: 0 6px; color: var(--ink-faint); }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-faint); }
.btn-primary {
  background: var(--accent);
  color: #1a1005;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn-dark {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn-dark:hover { background: #1e293b; border-color: #1e293b; }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink-soft);
  box-shadow: none;
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: #fecaca;
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* Header-mounted New Task button */
.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #1a1005;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.header-btn:hover { background: #ffb84d; transform: translateY(-1px); }

/* ========== INPUTS ========== */
.field { display: flex; flex-direction: column; gap: 8px; }
.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}
.input, .textarea {
  font-family: var(--sans);
  font-size: 15px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 11px 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  border-radius: var(--radius-sm);
  width: 100%;
}
.input:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}
.textarea { resize: vertical; min-height: 100px; line-height: 1.5; font-family: var(--sans); }

.file-input {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-mute);
}
.file-input::file-selector-button {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  margin-right: 12px;
  cursor: pointer;
  color: var(--ink);
  border-radius: 8px;
}
.file-input::file-selector-button:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ========== SEARCH ========== */
.search {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}
.search::before {
  content: "";
  width: 18px;
  height: 18px;
  margin: 0 6px 0 14px;
  background: no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2.2'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>");
  flex-shrink: 0;
}
.search input {
  flex: 1;
  font-family: var(--sans);
  font-size: 15px;
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 8px;
  color: var(--ink);
}
.search input::placeholder { color: var(--ink-faint); }
.search button {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 0 20px;
  align-self: stretch;
  cursor: pointer;
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}
.search button:hover { background: #1e293b; }
.search .clear {
  font-size: 13px;
  color: var(--ink-mute);
  padding: 0 14px;
  text-decoration: none;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.search .clear:hover { color: var(--ink); }

/* ========== PAGE HEADER ========== */
.issue-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.issue-header .actions { display: flex; gap: 8px; }

/* ========== CATEGORY GRID (card style) ========== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.cat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  box-shadow: var(--shadow-sm);
  min-height: 160px;
}
.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.cat-card .name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.cat-card .num { display: none; }
.cat-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: auto;
}
.cat-card .count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.cat-card .arrow {
  color: var(--ink-faint);
  transition: transform 0.2s, color 0.2s;
}
.cat-card:hover .arrow { color: var(--accent); transform: translateX(3px); }
.cat-card .del-form {
  position: absolute;
  top: 14px;
  right: 14px;
}
.cat-card .del-form button {
  background: transparent;
  border: none;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.cat-card .del-form button:hover { color: var(--danger); background: #fee2e2; }

/* ========== ISSUE LIST ========== */
.issue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.issue-list li {
  border-bottom: 1px solid var(--border);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  transition: background 0.15s;
}
.issue-list li:last-child { border-bottom: none; }
.issue-list li:hover { background: var(--surface-2); }
.issue-list .num { display: none; }
.issue-list .body a.title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.3;
  display: inline-block;
}
.issue-list .body a.title:hover { color: var(--accent-deep); }
.issue-list .body p {
  margin: 4px 0 0;
  color: var(--ink-mute);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 70ch;
}
.issue-list .body .cat-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-deep);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
  text-decoration: none;
}
.issue-list .stamp {
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ========== EMPTY ========== */
.empty {
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 60px 30px;
  text-align: center;
  font-size: 15px;
  color: var(--ink-mute);
}

/* ========== ISSUE PAGE ========== */
.description {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 28px;
  white-space: pre-wrap;
  max-width: 75ch;
  box-shadow: var(--shadow-sm);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.media-grid .media {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.media-grid .media:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.media-grid .media img,
.media-grid .media video {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: #0b0f19;
}
.media-grid .media .del { position: absolute; top: 8px; right: 8px; }
.media-grid .media .del button {
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  border: none;
  font-size: 12px;
  padding: 4px 9px;
  cursor: pointer;
  border-radius: 6px;
}
.media-grid .media .del button:hover { background: var(--danger); }

/* ========== STEPS ========== */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.steps li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.steps li:hover { box-shadow: var(--shadow); }
.steps .step-num {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
}
.steps .step-num::before { display: none; }
.steps .step-body p {
  margin: 4px 0 14px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  max-width: 72ch;
}
.steps .step-body .media-grid { margin: 0; }
.steps .step-body .media-grid img,
.steps .step-body .media-grid video { height: 150px; }

/* ========== FORM ========== */
.form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 820px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 20px;
}

.steps-editor { margin-top: 6px; }
.steps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.steps-list { display: flex; flex-direction: column; gap: 12px; }

.step-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 16px;
  align-items: start;
  transition: border-color 0.15s, background 0.15s;
}
.step-row:focus-within { border-color: var(--accent); background: var(--surface); }
.step-row .step-number {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
}
.step-row textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 70px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.step-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}
.step-row .body { display: flex; flex-direction: column; gap: 10px; }
.step-row .preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.step-row .preview img,
.step-row .preview video {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0b0f19;
}
.step-row .remove-step {
  background: transparent;
  border: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-mute);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  align-self: start;
}
.step-row .remove-step:hover { background: #fee2e2; color: var(--danger); border-color: #fecaca; }

.add-step-bottom {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

/* ========== COLOPHON ========== */
.colophon {
  padding: 30px 28px;
  text-align: center;
}
.colophon .rule { display: none; }
.colophon p {
  font-size: 12px;
  color: var(--ink-faint);
  margin: 0;
}

/* ========== LINKS ========== */
.inline-link {
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 133, 26, 0.35);
  word-break: break-all;
  transition: border-color 0.15s, background 0.15s;
  padding: 0 1px;
}
.inline-link:hover { border-bottom-color: var(--accent-deep); background: var(--accent-soft); }

/* ========== ANIMATIONS ========== */
.fade-up {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.fade-up:nth-child(1) { animation-delay: 0.03s; }
.fade-up:nth-child(2) { animation-delay: 0.06s; }
.fade-up:nth-child(3) { animation-delay: 0.09s; }
.fade-up:nth-child(4) { animation-delay: 0.12s; }
.fade-up:nth-child(5) { animation-delay: 0.15s; }
.fade-up:nth-child(6) { animation-delay: 0.18s; }
.fade-up:nth-child(7) { animation-delay: 0.21s; }
.fade-up:nth-child(8) { animation-delay: 0.24s; }
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .main { padding: 24px 18px 40px; }
  .masthead-inner { padding: 12px 18px; }
  .form { padding: 20px; }
  .steps li { grid-template-columns: 40px 1fr; gap: 14px; padding: 18px; }
  .step-row { grid-template-columns: 34px 1fr; }
  .step-row .remove-step { grid-column: 2; justify-self: start; }
  .issue-list li { grid-template-columns: 1fr; }
  .issue-list .stamp { text-align: left; }
}
