/* Drawing of the day: one line drawing a day, drawn in stroke by stroke, and the archive */
.dw-page .nav { background: rgba(var(--bg-rgb), 0.55); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 1px solid var(--line); }
.dw-page .nav nav a[aria-current="page"] { color: var(--maya); }
.dw-page .nav .icon-btn { margin-left: 4px; }
.dw { position: relative; z-index: 2; max-width: 1080px; margin: 0 auto; padding: 0 28px 40px; }

.dw-hero { padding: 130px 0 22px; max-width: 760px; }
.dw-hero h1 { margin-bottom: 16px; }
.dw-hero h1 em { color: var(--maya); }
.dw-hero .lede { max-width: 640px; margin-bottom: 0; }

/* the sheet: a drafting board with a faint grid */
.dw-sheet { margin: 18px 0 18px; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--card); box-shadow: inset 0 1px 0 var(--glass-edge), 0 30px 80px -40px rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.dw-paper { position: relative; aspect-ratio: 8 / 5; color: var(--text-2); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 40px 40px; background-position: -1px -1px; }
.dw-paper::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 40%, transparent 40%, rgba(var(--bg-rgb), 0.55)); }
.dw-paper svg { position: relative; z-index: 1; display: block; width: 100%; height: 100%; }
.dw-miss { margin: 0; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font: 12px var(--mono); }
.dw-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.dw-no { display: inline-flex; align-items: center; gap: 8px; font: 11.5px var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.dw-no .ic { width: 16px; height: 16px; }
.dw-acts { display: flex; gap: 8px; }
.dw-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font: 11.5px var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); transition: border-color 0.2s, color 0.2s; }
.dw-btn .ic { width: 16px; height: 16px; }
.dw-btn:hover, .dw-btn:focus-visible { border-color: var(--maya); color: var(--text); }

/* drawn in: each group of strokes in turn, then the labels */
/* (visibility and fill-opacity, not opacity, so the faint .f strokes keep their own opacity) */
.dw-paper .dotd path { stroke-dasharray: 1 1; stroke-dashoffset: 1; visibility: hidden; }
.dw-paper .dotd text { fill-opacity: 0; }
.dw-paper.drawn .dotd path { animation: dw-draw 1.5s var(--ease) calc(var(--i, 0) * 0.2s) forwards; }
.dw-paper.drawn .dotd text { animation: dw-ink 0.6s ease calc(var(--i, 0) * 0.2s + 0.6s) forwards; }
@keyframes dw-draw { 0% { stroke-dashoffset: 1; visibility: hidden; } 1%, 100% { visibility: visible; } 100% { stroke-dashoffset: 0; } }
@keyframes dw-ink { to { fill-opacity: 1; } }
/* once drawn, the coral strokes breathe a little */
.dw-paper.drawn .dotd path.c { animation: dw-draw 1.5s var(--ease) calc(var(--i, 0) * 0.2s) forwards, dw-glow 4s ease-in-out calc(var(--i, 0) * 0.2s + 2s) infinite; }
@keyframes dw-glow { 50% { filter: drop-shadow(0 0 3px rgba(255, 106, 61, 0.55)); } }

/* the story it was drawn after */
.dw-after { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 18px; border-radius: 18px; border: 1px solid rgba(255, 106, 61, 0.3); background: linear-gradient(180deg, rgba(255, 106, 61, 0.06), transparent), var(--card); box-shadow: inset 0 1px 0 var(--glass-edge); margin-bottom: 54px; }
.dw-after-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--maya); }
.dw-after-ic .ic { width: 20px; height: 20px; }
.dw-after-k { display: block; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--maya); margin-bottom: 4px; }
.dw-after > div > a { color: var(--text); text-decoration: none; font-weight: 500; font-size: 16px; line-height: 1.4; }
.dw-after > div > a:hover { color: var(--maya); }
.dw-after-s { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font: 11px var(--mono); color: var(--muted); margin-top: 4px; }
.dw-ai { display: inline-flex; align-items: center; gap: 4px; }
.dw-ai .ic { width: 16px; height: 16px; color: var(--maya); }
.dw-after p { margin: 8px 0 0; color: var(--text-2); font-size: 14px; }
.dw-more { align-self: center; display: inline-flex; align-items: center; gap: 6px; font: 11px var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.dw-more .ic { width: 16px; height: 16px; }
.dw-more:hover { color: var(--maya); }

.dw-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-bottom: 16px; }
.dw-sec-head h2 { font-size: clamp(28px, 3.4vw, 44px); margin: 0; }
.dw-sec-head p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 620px; }

/* how it draws */
.dw-how { margin-bottom: 60px; }
.dw-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: st; }
.dw-steps li { position: relative; padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); box-shadow: inset 0 1px 0 var(--glass-edge); counter-increment: st; }
.dw-steps li::after { content: '0' counter(st); position: absolute; top: 16px; right: 18px; font: 11px var(--mono); color: var(--dim); }
.dw-step-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--maya); margin-bottom: 12px; }
.dw-step-ic .ic { width: 20px; height: 20px; }
.dw-steps b { display: block; font-weight: 500; margin-bottom: 4px; }
.dw-steps p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* the archive */
.dw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.dw-card { all: unset; box-sizing: border-box; cursor: pointer; display: grid; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--card); box-shadow: inset 0 1px 0 var(--glass-edge); transition: border-color 0.25s, transform 0.35s var(--ease); }
.dw-card:hover, .dw-card:focus-visible { border-color: var(--line-2); transform: translateY(-3px); }
.dw-card[aria-current="true"] { border-color: rgba(255, 106, 61, 0.55); }
.dw-thumb { display: block; aspect-ratio: 8 / 5; color: var(--text-2); border-bottom: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 20px 20px; }
.dw-thumb svg { display: block; width: 100%; height: 100%; }
.dw-card-t { display: grid; gap: 2px; padding: 10px 12px 12px; }
.dw-card-t b { font-weight: 500; font-size: 14px; }
.dw-card-t span { font: 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dw-next { cursor: default; border-style: dashed; }
.dw-next:hover { transform: none; border-color: var(--line); }
.dw-next .dw-thumb { display: grid; place-items: center; background-image: none; }
.dw-blank { display: grid; justify-items: center; gap: 8px; color: var(--dim); font: 11px var(--mono); text-transform: uppercase; letter-spacing: 0.05em; }
.dw-blank .ic { width: 20px; height: 20px; animation: dw-pen 2.4s ease-in-out infinite; }
@keyframes dw-pen { 50% { transform: translate(4px, -3px) rotate(-8deg); } }

@media (max-width: 900px) {
  .dw { padding: 0 16px 30px; }
  .dw-hero { padding-top: 104px; }
  .dw-steps { grid-template-columns: minmax(0, 1fr); }
  .dw-page .nav-draw { font-size: 0; line-height: 0; width: var(--bar-btn); height: var(--bar-btn); border-radius: 999px; display: flex !important; align-items: center; justify-content: center; gap: 0 !important; padding: 0; border: 1px solid var(--line); background: var(--glass-weak); }
  .dw-page .nav nav a.nav-draw .ic { display: block; width: var(--ic-bar); height: var(--ic-bar); opacity: 1; color: var(--maya); }
  .dw-page .nav nav a.nav-res .ic { color: var(--text-2); }
}
@media (max-width: 560px) {
  .dw-sheet { margin-left: -6px; margin-right: -6px; border-radius: 16px; }
  .dw-after { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .dw-more { grid-column: 1 / -1; }
  .dw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dw-card-t b { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .dw-paper .dotd path, .dw-paper .dotd text { stroke-dasharray: none; visibility: visible; fill-opacity: 1; animation: none !important; }
  .dw-blank .ic { animation: none; }
}

/* each step drawn, beside its icon */
.dw-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: start; }
.dw-step-ic { grid-column: 1; grid-row: 1; }
.dw-step-pic { grid-column: 2; grid-row: 1; display: block; max-width: 180px; justify-self: end; margin: -6px 18px 4px 0; }
.dw-step-pic .mini { width: 100%; }
.dw-steps b, .dw-steps p { grid-column: 1 / -1; }
