/* denyseallen.com — warm paper in light, warm dark at night.
   Typewriter for the writing, sans for headings and small print.
   Mobile first: everything below is phone-sized, and the one media
   query at the bottom is all that changes on a big screen. */

:root {
  --bg:      #faf7f1;   /* warm paper, never pure white */
  --panel:   #f1eae0;
  --ink:     #2b2620;
  --muted:   #7b7165;
  --accent:  #b0511d;
  --rule:    #e5ddd1;

  /* Swap these two lines to change the whole site's type. */
  --type: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Archivo", -apple-system, "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:     #16140f;
    --panel:  #1f1b15;
    --ink:    #e9e2d6;   /* slightly off-white, the way I like to type */
    --muted:  #988e80;
    --accent: #dd9550;
    --rule:   #2f2a22;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:     #16140f;
  --panel:  #1f1b15;
  --ink:    #e9e2d6;
  --muted:  #988e80;
  --accent: #dd9550;
  --rule:   #2f2a22;
  color-scheme: dark;
}

:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--type);
  font-size: 0.975rem;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

.site-header, main, .site-footer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  font-family: var(--sans);
}
.site-name { font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-header nav { display: flex; align-items: baseline; gap: 1rem; font-size: 0.95rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-name:hover { color: var(--accent); }

.theme-toggle {
  border: 0; background: none; cursor: pointer; padding: 0;
  font: inherit; font-size: 1rem; line-height: 1; color: var(--muted);
}
.theme-toggle::before { content: "◐"; }
.theme-toggle:hover { color: var(--accent); }

/* ---------- type ---------- */

h1, h2, h3 { font-family: var(--sans); font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 0.75rem; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 2.25rem 0 0.5rem; }
h3 { font-size: 1rem; margin: 1.75rem 0 0.4rem; font-weight: 500; }
p { margin: 0 0 1.25rem; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
blockquote {
  margin: 1.5rem 0; padding-left: 1.1rem;
  border-left: 2px solid var(--accent); color: var(--muted);
}
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 0.4rem; }

/* small print and metadata all sit in the sans, for contrast with the writing */
time, .tools, .updated, .more, .counter, .prompt-bar, .copy, .site-footer,
.field label, .field .hint, .related h2 {
  font-family: var(--sans);
}
time { color: var(--muted); font-size: 0.8rem; }

/* ---------- home ---------- */

.identity { margin-bottom: 3.5rem; }
.identity h1 { font-size: 2.2rem; margin-bottom: 1.5rem; }
.identity p { margin: 0 0 0.45rem; color: var(--muted); font-size: 0.95rem; line-height: 1.6; }
.identity a { color: var(--ink); }
.identity a:hover { color: var(--accent); }

/* ---------- logs ---------- */

.feed { display: flex; flex-direction: column; }
.log-card { padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--rule); }
.log-card:last-child { border-bottom: 0; }
.log-card h2 { margin: 0.3rem 0 0.75rem; font-size: 1.35rem; }
.log-card h2 a { color: var(--ink); text-decoration: none; }
.log-card h2 a:hover { color: var(--accent); }
.excerpt { color: var(--muted); }
.more { font-size: 0.85rem; text-decoration: none; }
.more:hover { text-decoration: underline; }

.page-intro { margin-bottom: 3rem; }
.prose > time { display: block; margin-bottom: 0.4rem; }

/* ---------- workflows ---------- */

.workflow-card { padding-bottom: 1.75rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--rule); }
.workflow-card:last-child { border-bottom: 0; }
.workflow-card h2 { margin: 0 0 0.4rem; }
.workflow-card h2 a { color: var(--ink); text-decoration: none; }
.workflow-card h2 a:hover { color: var(--accent); }
.summary { color: var(--muted); }
.tools { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; }
.updated { font-size: 0.78rem; color: var(--muted); }

.related { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.related h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 0; font-weight: 500; }
.workflow-links, .log-links { list-style: none; padding: 0; }
.log-links li { display: flex; flex-direction: column; margin-bottom: 0.75rem; }

/* ---------- images ----------
   No post images anywhere. Images live inside the writing only. */

img { max-width: 100%; height: auto; }

.figure { margin: 2rem 0; }
.figure img { display: block; border-radius: 4px; }
.figure--wide img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.figure--square img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
/* a scan or a drawing keeps its own proportions — never cropped */
.figure--scan img { max-height: 42rem; width: auto; margin: 0 auto; box-shadow: 0 1px 14px rgba(0,0,0,0.12); }
.figure figcaption { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin-top: 0.6rem; text-align: center; }

/* ---------- prompts and code ---------- */

.prompt, pre {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  margin: 1.75rem 0;
  overflow: hidden;
}
.prompt { padding: 0; }
.prompt-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.78rem; color: var(--muted);
}
.prompt-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy {
  flex: none; cursor: pointer; font-size: 0.72rem;
  color: var(--muted); background: none;
  border: 1px solid var(--rule); border-radius: 4px; padding: 0.15rem 0.5rem;
}
.copy:hover, .copy.done { color: var(--accent); border-color: var(--accent); }

.prompt pre { margin: 0; border: 0; border-radius: 0; background: none; }
pre { padding: 0.9rem; }
pre code {
  font-family: var(--type); font-size: 0.85rem; line-height: 1.65;
  white-space: pre-wrap;     /* prompts are prose — wrap instead of scrolling sideways */
  word-break: break-word;
}
:not(pre) > code {
  font-family: var(--type); font-size: 0.9em;
  background: var(--panel); border-radius: 3px; padding: 0.1em 0.35em;
}

.code-wrap { position: relative; }
.code-wrap .copy { position: absolute; top: 0.5rem; right: 0.5rem; background: var(--bg); }

/* ---------- form ---------- */

.form { margin-top: 2rem; }
.field { margin-bottom: 1.5rem; }
.field label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; }
.field .hint { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; }
.field input, .field textarea {
  width: 100%; font-family: var(--type); font-size: 1rem;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 5px;
  padding: 0.6rem 0.7rem;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field textarea { resize: vertical; min-height: 6rem; }
.counter { font-size: 0.72rem; color: var(--muted); text-align: right; margin-top: 0.25rem; }
.counter.over { color: var(--accent); }
.honey { position: absolute; left: -9999px; }
button.submit {
  font-family: var(--sans); font-size: 0.95rem; font-weight: 500; cursor: pointer;
  background: var(--accent); color: var(--bg);
  border: 0; border-radius: 5px; padding: 0.65rem 1.4rem;
}
button.submit:hover { opacity: 0.9; }
.privacy { font-size: 0.85rem; color: var(--muted); margin-top: 1rem; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 4rem; padding-top: 1.5rem; padding-bottom: 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted); font-size: 0.82rem;
}
.site-footer p { margin: 0 0 0.3rem; }
.site-footer a { color: var(--muted); }

/* ---------- bigger than a phone ---------- */

@media (min-width: 40rem) {
  body { font-size: 1.0125rem; }
  .site-header { padding-top: 3rem; padding-bottom: 4rem; }
  .identity h1 { font-size: 2.8rem; }
  .identity p { font-size: 1rem; }
  h1 { font-size: 2rem; }
  .log-links li { flex-direction: row; gap: 1rem; align-items: baseline; }
  .log-links time { flex: none; width: 7rem; }
}
