/* Owen Labs UI
   Paper column, serif titles, hairline lists.
   Portable copy of the Stuff surface. */

:root {
  --ink: #16181d;
  --ink-soft: #3a404c;
  --muted: #6b7280;
  --line: rgba(22, 24, 29, 0.12);
  --line-strong: rgba(22, 24, 29, 0.2);
  --paper: #f3f2ee;
  --surface: rgba(255, 255, 255, 0.55);
  --accent: #1f4a3c;
  --accent-hover: #16362c;
  --accent-soft: rgba(31, 74, 60, 0.1);
  --danger: #8b3a2f;
  --danger-soft: rgba(139, 58, 47, 0.08);
  --success: #1f4a3c;
  --radius: 2px;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-ui: "Figtree", "Segoe UI", sans-serif;
  --max: 720px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(31, 74, 60, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(70, 85, 100, 0.1), transparent 50%),
    linear-gradient(165deg, #f6f5f1 0%, #ecefeb 42%, #e4e8e6 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: multiply;
  z-index: 0;
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--accent-hover);
}

.site-header {
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  background: rgba(246, 245, 241, 0.72);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  animation: rise 0.7s var(--ease) both;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav__user {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  max-width: 10rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-main {
  flex: 1;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer p {
  margin: 0;
}

.hero {
  padding: 2.5rem 0 3rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
  animation: rise 0.8s var(--ease) both;
}

.hero__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero__brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.hero__brand-name {
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero__lede {
  margin: 0 0 1.75rem;
  max-width: 28rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section {
  margin-bottom: 2.5rem;
  animation: rise 0.75s var(--ease) 0.08s both;
}

.section--narrow {
  max-width: 28rem;
}

.section__head {
  margin-bottom: 1.25rem;
}

.section__head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.section__head h1,
.section__head h2,
.detail-head h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.15rem);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.section__head p,
.detail-head__sub,
.detail-head__desc {
  margin: 0;
  color: var(--ink-soft);
}

.band {
  margin: 0 0 1.35rem;
  padding: 1rem 1.1rem 1.1rem;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form > .band {
  margin-bottom: 0;
}

.band > .section__head {
  margin-bottom: 0.85rem;
}

.band .section__head h2 {
  font-size: 1.45rem;
}

.section__head--sub {
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.band .section__head--sub h2 {
  font-size: 1.2rem;
  color: var(--ink-soft);
}

.band .empty {
  padding: 0.15rem 0 0.05rem;
  border: 0;
}

.detail-head__desc {
  margin-top: 0.75rem;
  max-width: 36rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.5rem;
}

.detail-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  animation: rise 0.55s var(--ease) both;
}

.crumbs a {
  color: var(--ink-soft);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--ink);
}

.entity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.entity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 0.15rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.25s var(--ease), padding-left 0.25s var(--ease);
}

.entity-row:hover {
  background: var(--accent-soft);
  padding-left: 0.5rem;
  color: inherit;
}

.entity-row__main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.entity-row__name {
  font-weight: 600;
  font-size: 1.02rem;
}

.entity-row__meta {
  font-size: 0.88rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entity-row__stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.entity-row__chevron {
  color: var(--accent);
  transition: transform 0.25s var(--ease);
}

.entity-row:hover .entity-row__chevron {
  transform: translateX(3px);
}

.id-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0.15rem;
  border-bottom: 1px solid var(--line);
}

.id-row__badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.id-row__label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.id-row__value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1;
  color: var(--ink);
}

.id-row__main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.id-row__title {
  font-weight: 600;
}

.id-row__meta {
  font-size: 0.88rem;
  color: var(--muted);
}

.id-row__actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.tag--match {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.empty {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

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

.form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label,
.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

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

.field__error {
  margin: 0;
  font-size: 0.82rem;
  color: var(--danger);
}

.input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input--area {
  resize: vertical;
  min-height: 5rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.check-row input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: #f7f6f2;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #f7f6f2;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn--ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.4);
}

.btn--danger {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
}

.btn--danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn--small {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
}

.flash-stack {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flash {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  font-size: 0.9rem;
  animation: rise 0.45s var(--ease) both;
}

.flash--success {
  border-left-color: var(--success);
}

.flash--error {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

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

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

@media (max-width: 560px) {
  .hero {
    padding-top: 1.75rem;
  }

  .id-row {
    grid-template-columns: auto 1fr;
  }

  .id-row__actions {
    grid-column: 1 / -1;
    padding-left: calc(3.5rem + 1rem);
  }
}
