/* ==========================================================================
   Blog listing (temporary, under construction)
   Light "drafting paper" theme: white page, faint grid, blue pencil lines,
   amber used only for construction signals.
   Delete or replace this file when the real blog page is ready.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;

  --paper: #ffffff;
  --grid: #e9eef4;
  --ink: #14202b;
  --muted: #4f5e6c;
  --rule: #d8e0e7;
  --dash: #b4c2d0;

  --accent: #1b5faa;
  --accent-wash: #e6eff8;

  --amber: #f2b233;
  --amber-deep: #e19f1c;
  --amber-wash: #fff3d6;
  --amber-ink: #6b4200;

  --font-body: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --page: 52rem;
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Faint drafting grid that fades out down the page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: 4px;
  font: 500 0.95rem var(--font-ui);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.1rem, 4vw, 2rem) 4rem;
}

/* ---------- 3. Masthead ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.35rem 0.85rem 0.35rem 0.7rem;
  background: var(--amber-wash);
  color: var(--amber-ink);
  border: 1px solid var(--amber);
  border-radius: 999px;
  font: 500 0.85rem/1.2 var(--font-ui);
}

.status__dot {
  width: 0.55rem;
  height: 0.55rem;
  background: var(--amber-deep);
  border-radius: 50%;
}

h1 {
  margin: 1.1rem 0 1.25rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: clamp(2.6rem, 1.6rem + 5vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

/* Architect-style dimension line under the title */
.dimension {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 3rem;
  color: var(--muted);
  font: 500 0.8rem/1.4 var(--font-mono);
}

.dimension span {
  flex: 0 1 auto;
  text-align: center;
}

.dimension::before,
.dimension::after {
  content: "";
  flex: 1 1 1rem;
  height: 9px;
  border: solid var(--muted);
  border-width: 0 1px;
  background: linear-gradient(var(--muted), var(--muted)) center / 100% 1px no-repeat;
}

.dimension::before {
  transform-origin: left center;
  animation: draw-line 0.9s 0.15s ease-out both;
}

.dimension::after {
  transform-origin: right center;
  animation: draw-line 0.9s 0.15s ease-out both;
}

@keyframes draw-line {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ---------- 4. Article cards ---------- */
.posts {
  display: grid;
  gap: 1.25rem;
}

.post {
  position: relative;
  padding: 1.5rem 1.6rem 1.4rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.post:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px -12px rgba(20, 32, 43, 0.4);
}

.post h2 {
  margin: 0 0 0.5rem;
  font: 600 1.45rem/1.25 var(--font-ui);
  letter-spacing: -0.01em;
}

.post p {
  margin: 0 0 1rem;
}

.post__link {
  color: var(--accent);
  font: 500 0.98rem var(--font-ui);
  text-underline-offset: 0.2em;
}

/* Make the whole card clickable */
.post__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.post__link:focus-visible {
  outline: none;
}

.post__link:focus-visible::after {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.post--draft {
  border-style: dashed;
  border-color: var(--dash);
}

.tag {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.15rem 0.55rem;
  background: var(--amber-wash);
  color: var(--amber-ink);
  border: 1px solid var(--amber);
  border-radius: 4px;
  font: 500 0.78rem/1.4 var(--font-ui);
}

/* ---------- 5. Drawing board ---------- */
.workshop {
  margin-top: 3.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.workshop h2 {
  margin: 0 0 0.4rem;
  font: 600 1.6rem/1.25 var(--font-ui);
  letter-spacing: -0.012em;
}

.workshop__intro {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* Progress meter with a construction-stripe fill */
.meter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.meter {
  flex: 1;
  height: 10px;
  overflow: hidden;
  background: var(--amber-wash);
  border-radius: 999px;
}

.meter__fill {
  display: block;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(-45deg, var(--amber) 0 9px, var(--amber-deep) 9px 18px);
  border-radius: inherit;
  transition: width 0.45s ease;
}

.meter__text {
  color: var(--muted);
  font: 500 0.85rem/1.2 var(--font-mono);
  white-space: nowrap;
}

/* Sketch slots */
.slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 420px) {
  .slots {
    grid-template-columns: minmax(0, 1fr);
  }
}

.slot {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
  background: #fff;
  color: inherit;
  border: 2px dashed var(--dash);
  border-radius: 10px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.slot:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.slot[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--accent);
}

.slot__name {
  font: 600 1rem/1.3 var(--font-ui);
}

.slot__art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
}

.slot__art::before {
  content: "+";
  color: #9fb0c0;
  font: 300 2.4rem/1 var(--font-ui);
}

.slot[aria-pressed="true"] .slot__art::before {
  content: none;
}

.slot__state {
  color: var(--muted);
  font: 400 0.85rem/1.3 var(--font-ui);
}

/* Pencil sketch that draws itself when a slot is switched on */
.sketch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ink {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: stroke-dashoffset 0.4s ease, opacity 0s 0.4s;
}

.slot[aria-pressed="true"] .ink {
  stroke-dashoffset: 0;
  opacity: 1;
  transition: stroke-dashoffset 0.6s ease var(--delay, 0s), opacity 0s;
}

.ink:nth-child(2) { --delay: 0.15s; }
.ink:nth-child(3) { --delay: 0.3s; }
.ink:nth-child(4) { --delay: 0.45s; }
.ink:nth-child(5) { --delay: 0.6s; }
.ink:nth-child(6) { --delay: 0.75s; }

/* Completion message and buttons */
.workshop__done {
  margin: 1.25rem 0 0;
  padding: 0.9rem 1.1rem;
  background: var(--accent-wash);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 1rem;
}

.workshop__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  padding: 0.55rem 1rem;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font: 500 0.92rem/1.2 var(--font-ui);
  cursor: pointer;
}

.btn:hover {
  background: #26394b;
}

.btn--ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--dash);
}

.btn--ghost:hover {
  background: var(--accent-wash);
  border-color: var(--accent);
}

/* ---------- 6. Footer note ---------- */
.site-note {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font: 400 0.92rem/1.5 var(--font-ui);
}

.site-note p {
  margin: 0;
}

/* ---------- 7. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
