/* Type, colour and grid from tommytrinh.me (米/src/styles/global.css): ABC Areal at 13px,
   a faint label column with the value beside it, hairline rules, sage as the one accent. */
@font-face {
  font-family: 'ABC Areal';
  src: url('/fonts/ABCArealVariable.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: 'ABC Areal Mono';
  src: url('/fonts/ABCArealMonoVariable.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --text: #343c3c;
  --text-muted: #5e6666;
  --text-faint: #8d9393;
  --line: rgba(52, 60, 60, 0.22);
  --accent: #abb495;
  --wash: rgba(171, 180, 149, 0.1);
  --error: #a4553f;
  --font-sans: 'ABC Areal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'ABC Areal Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --label-col: 7.5rem;
  --fast: 150ms ease;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
button, input, textarea, select { font: inherit; letter-spacing: inherit; color: inherit; }
[hidden] { display: none !important; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

::selection { background: var(--accent); color: var(--bg); }

/* The status light from tommytrinh.me's home page: the macOS traffic lights, with a soft blur
   that breathes. Green approved, amber in review (slower), red capacity reached (still). */
.orb {
  --glow: 40, 200, 64;
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.65em;
  border-radius: 50%;
  vertical-align: middle;
  position: relative;
  top: -0.1em;
  background: rgb(var(--glow));
  box-shadow: 0 0 3px 1px rgba(var(--glow), 0.7), 0 0 9px 3px rgba(var(--glow), 0.35);
  animation: glow 3.2s ease-in-out infinite;
}
.orb[data-status="review"] { --glow: 254, 188, 46; animation-duration: 6s; }
.orb[data-status="full"] { --glow: 255, 95, 87; animation: none; box-shadow: 0 0 2px 0.5px rgba(var(--glow), 0.5); }
@keyframes glow {
  0%, 100% { box-shadow: 0 0 2px 1px rgba(var(--glow), 0.55), 0 0 6px 2px rgba(var(--glow), 0.2); }
  50% { box-shadow: 0 0 4px 1.5px rgba(var(--glow), 0.9), 0 0 12px 4px rgba(var(--glow), 0.4); }
}
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }

/* Thin sage scrollbars, as on tommytrinh.me. */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }
html { scrollbar-color: var(--accent) rgba(0, 0, 0, 0.1); }
* { scrollbar-width: thin; }

main {
  max-width: 850px;
  padding: 1.5rem 1.5rem 6rem;
}

a { color: inherit; text-underline-offset: 2px; transition: color var(--fast); }
a:hover { color: var(--accent); }

/* Rows: label in the first column, everything else in the second. */
.row {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  align-items: baseline;
  padding: 0.125rem 0;
}
.row > .label { color: var(--text-faint); }
.row.stack { align-items: start; }
.row > .value { min-width: 0; }
.gap { height: 2rem; }
.gap-sm { height: 1rem; }

.faint { color: var(--text-faint); }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0; }
.error { color: var(--error); font-size: 12px; }
.title { font-weight: 500; }

/* Fields: a hairline under the text, sage when focused (the journal gate's field). */
.field {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.25rem 0 0.25rem;
  outline: none;
  transition: border-color var(--fast);
}
.field:focus { border-bottom-color: var(--accent); }
.field[aria-invalid="true"] { border-bottom-color: var(--error); }
.check input[aria-invalid="true"] { border-color: var(--error); }
.field::placeholder { color: var(--text-faint); opacity: 1; }
textarea.field { resize: none; overflow: hidden; min-height: 1.5rem; line-height: 1.5; }
.field + .field { margin-top: 0.5rem; }

/* iOS would zoom into these 13px fields: app.js caps the viewport's scale on iOS instead
   (pinch zoom still works there), so fields keep the page's size. */

/* Phones choose, desktops drop. */
.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .touch-only { display: inline; }
  .desk-only { display: none; }
}

.check {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  cursor: pointer;
}
.check input {
  appearance: none;
  flex: none;
  width: 10px;
  height: 10px;
  border: 1px solid var(--text);
  border-radius: 2px;
  position: relative;
  top: 1px;
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast);
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.check + .check { margin-top: 0.25rem; }

/* Buttons read as links. */
.btn {
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color var(--fast);
}
.btn:hover { color: var(--accent); }
.btn:disabled { color: var(--text-faint); text-decoration: none; cursor: default; }
.btn.quiet { color: var(--text-faint); }
.btn.quiet:hover { color: var(--accent); }
.actions { display: flex; gap: 1.25rem; align-items: baseline; flex-wrap: wrap; }

/* The drop box. */
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 15rem;
  padding: 2rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 2px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast);
}
.drop:hover, .drop.over { border-color: var(--accent); }
.drop.over { background: var(--wash); }
.drop:focus-visible { outline: none; border-color: var(--accent); border-style: solid; }
.drop u { text-underline-offset: 2px; }

/* A photo being described, before it goes up. */
.draft {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.draft:first-child { padding-top: 1.5rem; }
.thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: left top;
  display: block;
}
.thumb.none {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text-faint);
  font-size: 12px;
  padding: 0.5rem;
  text-align: center;
  word-break: break-word;
}
.draft .fields > * + * { margin-top: 0.5rem; }
.draft .meta { margin-top: 0.25rem !important; }
.draft .actions { margin-top: 1rem !important; }
.progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 200ms ease;
}

/* Photos already up. */
.done { list-style: none; }
.done li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.375rem 0;
}
.done img, .done .thumb.none { width: 3rem; height: 3rem; aspect-ratio: auto; object-fit: cover; border-radius: 1px; }
.done .thumb.none { font-size: 9px; padding: 0.125rem; }
.done .text { min-width: 0; }
.done .text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A photo that just went up glows sage for a moment. */
.done li.fresh { animation: fresh 2.5s ease-out; }
@keyframes fresh { from { background: var(--wash); } to { background: transparent; } }

/* Names, handles and links can be one long unbroken string. */
#who, #status, .error, .why, .desc, figcaption { overflow-wrap: anywhere; }
#who { min-width: 0; }
.handle { margin-left: 0.35em; }

@media (max-width: 600px) {
  :root { --label-col: 6.5rem; }
  main { padding: 1.5rem 1rem 4rem; }
  .draft { grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; }
  .drop { min-height: 11rem; }
}

/* On a narrow phone the photo work takes the full width, labels above. */
@media (max-width: 480px) {
  .row.stack { grid-template-columns: minmax(0, 1fr); }
  .row.stack > .label { margin-bottom: 0.5rem; }
}
