/* AICreator — "the gallery": warm paper, ink type, one vermilion accent.
   Artifacts are exhibits; every viewer sits in a mat-and-frame with a caption
   plate. Type carries the design: Fraunces display over Karla body. */

:root {
  --paper: #f5efe3;
  --paper-deep: #ede4d2;
  --panel: #fffdf7;
  --ink: #221d14;
  --ink-soft: #4a4234;
  --muted: #7d7362;
  --line: #ddd2ba;
  --line-strong: #b9ac8f;
  --accent: #c8451b;
  --accent-deep: #99320f;
  --ok: #3f6b35;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Karla", "Helvetica Neue", sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
  --frame-shadow: 0 1px 0 rgba(34, 29, 20, 0.06), 0 10px 30px -12px rgba(34, 29, 20, 0.25);
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 253, 247, 0.9), rgba(255, 253, 247, 0) 60%),
    linear-gradient(var(--paper), var(--paper-deep));
  background-attachment: fixed;
}

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.13 0 0 0 0 0.11 0 0 0 0 0.08 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent-deep); text-decoration-color: rgba(200, 69, 27, 0.4); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

code { font-family: var(--mono); font-size: 0.86em; background: rgba(34, 29, 20, 0.07); padding: 0.1em 0.35em; border-radius: 4px; }

/* ---------- chrome ---------- */

header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem clamp(1.2rem, 4vw, 3rem) 1.2rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand::after { content: "."; color: var(--accent); }

header.site nav { display: flex; align-items: baseline; gap: 1.2rem; font-size: 0.95rem; }
header.site nav a { color: var(--ink-soft); text-decoration: none; }
header.site nav a:hover { color: var(--accent); }

main {
  flex: 1;
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1.2rem, 4vw, 3rem) 4rem;
}

footer.site {
  border-top: 1px solid var(--line);
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.88rem;
}
footer.site .fbrand { font-family: var(--serif); color: var(--ink-soft); }
footer.site .fbrand::after { content: "."; color: var(--accent); }
footer.site code { background: none; padding: 0; color: var(--ink-soft); }

/* ---------- hero ---------- */

.hero { padding: clamp(2rem, 7vw, 4.5rem) 0 1.5rem; max-width: 46rem; }

.hero h1 {
  font-family: var(--serif);
  font-weight: 550;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 1.1rem;
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero h1 em { font-style: italic; color: var(--accent); }

.hero p {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 38rem;
  margin: 0;
  animation: rise 0.6s 0.08s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.kinds {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
  animation: rise 0.6s 0.16s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.kinds li {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  background: var(--panel);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- cards ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--frame-shadow);
  padding: 1.6rem 1.8rem;
  margin: 1.6rem 0;
}
.card.narrow { max-width: 26rem; margin: 14vh auto 0; }
.card h1, .card h2 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.015em;
  margin: 0 0 0.7rem;
}
.card h2 { font-size: 1.25rem; }
.card.highlight { border-color: var(--accent); border-width: 1.5px; }

/* the CLI pitch — a dark terminal slab */
.cli-card {
  background: #24201a;
  color: #efe7d6;
  border: 1px solid #24201a;
  border-radius: 10px;
  box-shadow: var(--frame-shadow);
  padding: 1.5rem 1.8rem;
  margin: 1.6rem 0;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.7;
  overflow-x: auto;
}
.cli-card .lede {
  font-family: var(--sans);
  color: #b6ab93;
  font-size: 0.92rem;
  margin: 0 0 0.7rem;
}
.cli-card .prompt { color: var(--accent); user-select: none; }
.cli-card .out { color: #b6ab93; }
.cli-card a { color: #efe7d6; }

/* ---------- forms & buttons ---------- */

input[type="text"], input[type="email"] {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0.6rem 0.85rem;
  width: 100%;
  max-width: 30rem;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

button, .button {
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 7px;
  padding: 0.55rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.12s ease, background 0.12s ease;
}
button:hover, .button:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--paper); transform: translateY(-1px); }

button.danger { background: none; color: var(--accent-deep); border: 1px solid var(--line-strong); font-weight: 500; }
button.danger:hover { border-color: var(--accent); color: var(--accent); background: none; }

button.linklike {
  background: none; border: none; padding: 0; font-weight: 400;
  color: var(--ink-soft); cursor: pointer; font-size: 0.95rem;
}
button.linklike:hover { color: var(--accent); background: none; transform: none; }

form.inline { display: inline; }
.muted { color: var(--muted); }
.error { color: var(--accent-deep); font-weight: 700; }
.ok { color: var(--ok); font-weight: 700; }

/* upload dropzone */
.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 9rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  background: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(34, 29, 20, 0.015) 14px 28px);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 1rem;
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--accent-deep); }
.dropzone input[type="file"] { display: none; }

/* ---------- exhibit (share page) ---------- */

.share-head { padding-top: 1.5rem; }
.share-head h1 {
  font-family: var(--serif);
  font-weight: 550;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.2rem;
}

.plate {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: baseline;
  margin: 0 0 1.4rem;
}
.plate .kind { color: var(--accent-deep); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.1rem 0.6rem; background: var(--panel); }
.plate .sep { color: var(--line-strong); }

/* the frame: mat + hairline, like a hung piece */
.viewer {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  outline: 1px solid var(--line);
  outline-offset: 6px;
  border-radius: 2px;
  box-shadow: var(--frame-shadow);
  padding: clamp(0.8rem, 2.5vw, 1.6rem);
  margin: 0.4rem 0 1.2rem;
}
.viewer img { display: block; max-width: 100%; margin: 0 auto; }
.viewer iframe.pdf, .viewer iframe.htmlbox {
  display: block; width: 100%; height: 72vh; border: none; background: #fff;
}
.viewer .markdown { max-width: 42rem; margin: 0 auto; }
.viewer .markdown h1, .viewer .markdown h2, .viewer .markdown h3 { font-family: var(--serif); letter-spacing: -0.015em; }
.viewer .markdown pre { background: rgba(34, 29, 20, 0.05); padding: 0.9rem 1.1rem; border-radius: 7px; overflow-x: auto; }

.rawline { font-size: 0.9rem; }

/* ---------- dashboard ---------- */

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 0.4rem;
}
.page-head h1 {
  font-family: var(--serif);
  font-weight: 550;
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  letter-spacing: -0.02em;
  margin: 0;
}

ul.grid {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.4rem;
}

.card.artifact { margin: 0; padding: 0.9rem 0.9rem 1.1rem; display: flex; flex-direction: column; gap: 0.8rem; }

.thumbwrap {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
}
.thumbwrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.card.artifact:hover .thumbwrap img { transform: scale(1.04); }

.typeicon {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  background: var(--panel);
}

.card.artifact .meta { display: flex; flex-direction: column; gap: 0.3rem; padding: 0 0.2rem; }
.card.artifact .title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.card.artifact .title:hover { color: var(--accent-deep); }
.card.artifact .muted { font-size: 0.82rem; margin: 0; }
.card.artifact .actions { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.card.artifact .actions button { font-size: 0.82rem; padding: 0.35rem 0.8rem; }

/* ---------- keys ---------- */

table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); text-align: left; font-weight: 500; }
th, td { padding: 0.55rem 0.9rem 0.55rem 0; border-bottom: 1px solid var(--line); }
.keyvalue { font-size: 0.95rem; padding: 0.3em 0.5em; overflow-wrap: anywhere; }
