/* Studio 500 — one stylesheet, no build step. */

:root {
  --paper: #f4f2ed;
  --paper-deep: #e9e6df;
  --ink: #1a1815;
  --ink-soft: #625d55;
  --ink-faint: #9a948a;
  --line: #d9d5cc;
  --white: #fdfcfa;
  --accent: #1f4d4a;
  --accent-ink: #fff;
  --ok: #3f7d4e;
  --warn: #b7791f;
  --bad: #b3261e;

  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --radius: 6px;
  --shadow-card: 0 1px 2px rgba(35, 32, 28, .12), 0 10px 24px -12px rgba(35, 32, 28, .35);
  --shadow-lift: 0 2px 4px rgba(35, 32, 28, .14), 0 22px 40px -18px rgba(35, 32, 28, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
.display { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.015em; line-height: 1; }
.display em, .display i { font-style: italic; color: var(--accent); }
h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; color: var(--ink-soft); margin-bottom: .5em; }
.empty { text-align: center; padding: 4rem 0; color: var(--ink-soft); }
code { background: var(--paper-deep); padding: .1em .35em; border-radius: 4px; font-size: .9em; }

/* ---------- chrome ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: rgba(243, 242, 238, .88);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.wordmark { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; letter-spacing: -.01em; line-height: 1; text-decoration: none; }
.wordmark--big { font-size: 3.4rem; }
.topnav { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; font-size: .95rem; }
.topnav a, .topnav .linkish { text-decoration: none; color: var(--ink-soft); }
.topnav a:hover, .topnav .linkish:hover, .topnav a.is-active { color: var(--ink); }
.topnav a.is-active { border-bottom: 1px solid var(--ink); }
.topnav form { display: inline; }
.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: inherit; text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; }
form.inline { display: inline; }

.page { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem; }
.page--minimal { display: grid; place-items: center; }
.footer { padding: 1.5rem; text-align: center; color: var(--ink-faint); font-size: .85rem; border-top: 1px solid var(--line); }

.flash { max-width: 1180px; margin: 1rem auto 0; padding: .7rem 1rem; border-radius: var(--radius); font-size: .95rem; width: calc(100% - 2rem); }
.flash--notice { background: #e6f0e8; color: #24502f; }
.flash--alert { background: #f8e3e0; color: #7a2119; }

/* ---------- login ---------- */
.login__card { text-align: center; background: var(--white); padding: 3rem 5rem; border-radius: 10px; box-shadow: var(--shadow-card); max-width: 460px; width: 100%; }
.login__blurb { color: var(--ink-soft); margin: .5rem 0 2rem; }
.btn.btn--google { display: inline-flex; align-items: center; gap: .6rem; background: var(--white); border: 1px solid var(--ink); font-weight: 500; }
.btn.btn--google:hover { background: var(--paper); }

/* ---------- the wall ---------- */
.wall-intro { margin: .5rem 0 2.5rem; }
.wall-intro .muted { max-width: 52ch; font-size: 1.02rem; }
.wall-group { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; padding: 2rem 0; border-top: 1px solid var(--ink); }
.wall-group:last-child { border-bottom: 1px solid var(--ink); }
.wall-group__head { display: flex; flex-direction: column; gap: .45rem; align-items: flex-start; }
.wall-group__name { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; line-height: 1.1; margin: 0; }
.wall-group__blurb { font-size: .85rem; line-height: 1.45; color: var(--ink-soft); margin: 0; }
.wall-group__site { font-size: .78rem; color: var(--ink-faint); text-decoration: none; }
.wall-group__site:hover { color: var(--accent); }
.wall { display: flex; flex-wrap: wrap; gap: 1.2rem; align-content: start; }
.wall--small { gap: 1.2rem 1rem; }
.wall--small .polaroid { width: 150px; padding: 8px 8px 12px; }

.polaroid {
  display: block; width: 200px; padding: 10px 10px 14px;
  background: var(--white); color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: box-shadow .15s ease, transform .15s ease;
}
.polaroid:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.polaroid--static, .polaroid--static:hover { transform: none; box-shadow: var(--shadow-card); }
.polaroid--big { width: min(360px, 100%); padding: 14px 14px 18px; }
.polaroid__photo { aspect-ratio: 4 / 5; background: var(--paper-deep); overflow: hidden; }
.polaroid__photo .headshot { filter: grayscale(1) contrast(1.04); transition: filter .25s ease; }
.polaroid:hover .polaroid__photo .headshot, .polaroid--static .polaroid__photo .headshot { filter: none; }
.polaroid__bio { color: var(--ink-soft); font-size: .78rem; line-height: 1.45; margin-top: .5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.polaroid__caption { padding-top: 10px; text-align: left; }
.polaroid__name { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.1; }
.polaroid__title { font-size: .78rem; color: var(--ink-soft); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.polaroid--big .polaroid__name { font-size: 1.6rem; }
.polaroid--big .polaroid__title { font-size: .9rem; white-space: normal; }

.headshot { display: block; width: 100%; height: 100%; object-fit: cover; }
.headshot--placeholder {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: hsl(var(--hue) 40% 82%); color: hsl(var(--hue) 35% 30%);
  font-family: var(--font-display); font-size: 2.4rem; font-weight: 600;
}

/* ---------- person page ---------- */
.card-page { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 3rem; align-items: start; }
.card-page__polaroid { display: flex; justify-content: center; }
.prose { max-width: 60ch; }
.links { list-style: none; padding: 0; margin: 1.2rem 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.links__icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink-soft); text-decoration: none; transition: color .12s, border-color .12s; }
.links__icon:hover { color: var(--ink); border-color: var(--ink); }
.actions { margin-top: 2rem; color: var(--ink-soft); }

/* ---------- forms ---------- */
.form-page { max-width: 720px; }
.form { background: var(--white); padding: 1.6rem; border-radius: 10px; box-shadow: var(--shadow-card); }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1.1rem; }
.field--narrow { max-width: 160px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-row--3 { grid-template-columns: 1fr 1fr 1fr; }
label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
input[type="text"], input[type="email"], input[type="url"], input[type="number"], select, textarea {
  font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(200,69,43,.35); outline-offset: 1px; border-color: var(--accent); }
textarea { resize: vertical; }
.hint { color: var(--ink-faint); font-size: .8rem; }
.headshot-preview { width: 96px; height: 96px; margin-bottom: .4rem; }
.headshot-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.form-actions { display: flex; gap: .8rem; align-items: center; margin-top: .5rem; }
.errors { background: #f8e3e0; color: #7a2119; padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.errors ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.danger-zone { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px dashed var(--line); }

.btn {
  display: inline-block; font: inherit; font-weight: 500; padding: .55rem 1.1rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.3;
}
.btn--primary { background: var(--ink); color: var(--white); }
.btn--primary:hover { background: #000; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-faint); }
.btn--danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn--danger:hover { background: var(--bad); color: #fff; }

/* ---------- admin / tenant ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head__actions { display: flex; gap: .6rem; }
.page-head .display { margin-bottom: 0; display: flex; align-items: center; gap: .6rem; }
.table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 10px; box-shadow: var(--shadow-card); overflow: hidden; }
.table th, .table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .thumb { width: 44px; padding-right: 0; }
.table .thumb .headshot, .table .thumb .headshot--placeholder { width: 36px; height: 36px; border-radius: 4px; font-size: .9rem; }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); text-transform: capitalize; vertical-align: middle; }
.pill--active { background: #e6f0e8; color: var(--ok); }
.pill--prospective, .pill--pending_verification { background: #fbf0d9; color: var(--warn); }
.pill--departed, .pill--none { background: var(--paper-deep); color: var(--ink-faint); }
.pill--failed { background: #f8e3e0; color: var(--bad); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
.facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.facts dd { margin: .15rem 0 0; font-weight: 500; }
.panel { background: var(--white); border-radius: 10px; box-shadow: var(--shadow-card); padding: 1.4rem 1.6rem; margin-bottom: 1.5rem; }
.panel h2 { margin-bottom: .8rem; }
.tenant-page { max-width: 860px; }

@media (max-width: 720px) {
  .card-page { grid-template-columns: 1fr; gap: 1.5rem; }
  .wall-group { grid-template-columns: 1fr; gap: 1rem; padding: 1.4rem 0; }
  .field-row, .field-row--3 { grid-template-columns: 1fr; }
  .wall { justify-content: center; gap: 1.6rem 1rem; }
  .polaroid { width: 150px; padding: 8px 8px 12px; }
  .wall { padding-left: 0; padding-right: 0; }
  .topbar { flex-direction: column; align-items: flex-start; gap: .5rem; padding-top: .75rem; padding-bottom: .75rem; }
  .topnav { gap: .9rem; font-size: .9rem; }
  .table th:nth-child(3), .table td:nth-child(3), .table th:nth-child(5), .table td:nth-child(5) { display: none; }
}

/* ---------- billing ---------- */
.callout { background: var(--white); border-left: 3px solid var(--warn); padding: .7rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; }
.callout--bad { border-left-color: var(--bad); }
.toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
.toolbar form { display: inline; }
.btn--small { padding: .4rem .85rem; font-size: .85rem; }
.small { font-size: .85rem; }
.stat { font-size: 1.05rem; }
.table + h2, .table + .h3 { margin-top: 2rem; }
.h3 { font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 1.6rem 0 .6rem; }
.pill--paid, .pill--trialing { background: #e6f0e8; color: var(--ok); }
.pill--open, .pill--draft, .pill--past_due, .pill--incomplete { background: #fbf0d9; color: var(--warn); }
.pill--disputed, .pill--uncollectible, .pill--canceled, .pill--unpaid { background: #f8e3e0; color: var(--bad); }
.pill--void { background: var(--paper-deep); color: var(--ink-faint); }

/* ---------- contracts ---------- */
.contract-page { max-width: 820px; }
.agreement { background: var(--white); padding: clamp(1.5rem, 5vw, 3.5rem); box-shadow: var(--shadow-card); margin: 1.5rem 0; line-height: 1.6; }
.agreement__title { font-family: var(--font-display); font-weight: 400; font-size: 2.2rem; margin: 0 0 .6rem; }
.agreement__preamble { font-size: 1.02rem; margin-bottom: 1.6rem; }
.agreement__h { font-family: var(--font-body); font-size: .95rem; font-weight: 600; margin: 1.6rem 0 .4rem; }
.agreement p { margin: 0 0 .7em; font-size: .95rem; }
.agreement hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0 1rem; }
.agreement__sig { font-family: var(--font-display); font-style: italic; font-size: 1.7rem; margin: .4rem 0; }
.sign-box { background: var(--white); border: 1px solid var(--ink); padding: 1.6rem; margin: 1.5rem 0; }
.sign-box .form { box-shadow: none; padding: 0; }
.sig-input { font-family: var(--font-display); font-style: italic; font-size: 1.5rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; font-weight: 400; color: var(--ink); margin: .5rem 0 .3rem; }
.check input { margin-top: .3rem; }
.callout--ok { border-left-color: var(--ok); }
.pill--sent { background: #fbf0d9; color: var(--warn); }
.pill--signed { background: #e6f0e8; color: var(--ok); }
.pill--superseded, .pill--terminated { background: var(--paper-deep); color: var(--ink-faint); }
.steps { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .6rem; }
.steps li { display: flex; gap: .9rem; align-items: flex-start; background: var(--white); padding: .8rem 1rem; border-radius: 10px; box-shadow: var(--shadow-card); }
.steps li strong { display: block; }
.steps__n { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 600; background: var(--paper-deep); color: var(--ink-soft); }
.steps .is-done .steps__n { background: var(--ok); color: #fff; }
.steps .is-now .steps__n { background: var(--ink); color: #fff; }
.steps .is-wait { opacity: .7; }
.pill--available { background: #e6f0e8; color: var(--ok); }
.pill--assigned { background: var(--paper-deep); color: var(--ink-soft); }
.pill--spare { background: #fbf0d9; color: var(--warn); }
.pill--faulty, .pill--lost, .pill--deactivated { background: #f8e3e0; color: var(--bad); }

/* tooltip */
.tip { position: relative; display: inline-block; margin-left: .3rem; vertical-align: middle; cursor: default; }
.tip__mark { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: .7rem; font-weight: 700; background: #fbf0d9; color: var(--warn); }
.tip__text { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: var(--white); font-size: .78rem; padding: .35rem .6rem; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5; }
.tip__text::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--ink); }
.tip:hover .tip__text, .tip:focus .tip__text { opacity: 1; }

/* ---------- admin sub-navigation ---------- */
.subnav { background: var(--white); border-bottom: 1px solid var(--line); }
.subnav__inner { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); display: flex; align-items: stretch; gap: 1.4rem; overflow-x: auto; }
.subnav__label { align-self: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-faint); margin-right: .4rem; }
.subnav a { display: inline-block; padding: .75rem 0; font-size: .92rem; color: var(--ink-soft); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav a:hover { color: var(--ink); }
.subnav a.is-active { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- legal pages ---------- */
.legal { max-width: 640px; margin: 2rem auto; line-height: 1.6; }
.legal h2 { font-family: var(--font-body); font-size: .95rem; font-weight: 600; margin: 1.8rem 0 .4rem; }
.legal p, .legal li { font-size: .95rem; }
.legal ul { padding-left: 1.2rem; }
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

.table--people td { padding-top: .5rem; padding-bottom: .5rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); vertical-align: middle; }
.dot--on { background: var(--ok); }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu__list { position: absolute; right: 0; top: calc(100% + 6px); background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lift); min-width: 200px; padding: .3rem; z-index: 20; display: flex; flex-direction: column; }
.menu__list a { padding: .5rem .7rem; text-decoration: none; border-radius: 5px; font-size: .92rem; white-space: nowrap; }
.menu__list a:hover { background: var(--paper); }
