/* Parker Works - drawing-sheet style */

:root {
  --vellum: #E8EDF1;      /* page background */
  --paper:  #F6F8FA;      /* sheets and cards */
  --white:  #FFFFFF;
  --ink:    #18293A;      /* text and linework */
  --ink-2:  #3D5063;      /* secondary text */
  --steel:  #2F5D84;      /* actions and loads */
  --steel-d:#234A6B;
  --dim:    #8C9DAC;      /* dimension lines, hints */
  --tint:   #D7E2EB;      /* fills */
  --grid:   rgba(47, 93, 132, .07);
  --vis:    #F0B400;      /* high-vis: focus and the one highlight */
  --lagoon:   #2BB3A3;  /* tropical accents, home page only */
  --mango:    #F5B83D;
  --hibiscus: #F2557E;
  --bad:    #A3341F;
  --good:   #2E6B3F;

  --f-head: "IBM Plex Sans Condensed", "Arial Narrow", sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative; isolation: isolate;
  background-color: #0F3D4A;
  color: var(--ink);
  font: 400 1rem/1.6 var(--f-body);
}

main { flex: 1; width: 100%; }

h1, h2, h3 { font-family: var(--f-head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.005em; }
h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }
p  { margin: 0 0 1em; }
a  { color: var(--steel); }

:focus-visible { outline: 3px solid var(--vis); outline-offset: 2px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lede { color: var(--ink-2); font-size: 1.0625rem; max-width: 62ch; }
.fine { color: var(--ink-2); font-size: .875rem; max-width: 70ch; margin-top: 1.25rem; }

/* ---------------- Top bar ---------------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  border-bottom: 1.5px solid var(--ink);
  background: var(--paper);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font: 700 1.25rem/1 var(--f-head);
}
.wordmark img { display: block; }
.topnav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.topnav a, .link-btn {
  font: 500 .9375rem/1.2 var(--f-body); color: var(--ink); text-decoration: none;
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  border-bottom: 1.5px solid transparent;
}
.topnav a:hover, .link-btn:hover { border-bottom-color: var(--steel); color: var(--steel); }
.link-btn.danger { color: var(--bad); }
.link-btn.danger:hover { border-bottom-color: var(--bad); }
form.inline { display: inline; margin: 0; }

/* ---------------- Buttons and fields ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 22px;
  background: var(--steel); color: var(--white);
  border: 1.5px solid var(--steel-d); border-radius: 3px;
  font: 600 1rem/1 var(--f-body); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--steel-d); }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: .875rem; }
.btn.ghost { background: transparent; color: var(--steel); }
.btn.ghost:hover { background: var(--tint); }

label { display: block; font-weight: 500; font-size: .9375rem; }
input, select {
  display: block; width: 100%; margin-top: 6px;
  padding: 10px 12px; min-height: 44px;
  font: 400 1rem/1.3 var(--f-body); color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--dim); border-radius: 3px;
}
input:focus, select:focus { border-color: var(--steel); outline: 3px solid var(--vis); outline-offset: 0; }
input.code { font: 600 1.375rem/1 var(--f-head); letter-spacing: .3em; max-width: 12ch; }
.hint { display: block; font-weight: 400; font-size: .8125rem; color: var(--ink-2); margin-top: 4px; }
.stack { display: grid; gap: 18px; margin: 0 0 8px; }
.stack .btn { justify-self: start; }

.note { padding: 10px 14px; border-left: 4px solid var(--steel); background: var(--white); max-width: 70ch; }
.note.ok  { border-left-color: var(--good); }
.note.bad { border-left-color: var(--bad); color: var(--bad); }

/* ---------------- Home ---------------- */

.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(32px, 6vw, 80px) var(--gutter) clamp(24px, 4vw, 56px);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px); align-items: center;
}
.hero-name {
  font-size: clamp(2.25rem, 4.6vw, 3.9rem); font-weight: 700;
  line-height: 1; letter-spacing: -0.015em; margin: 0 0 .3em;
  white-space: nowrap;
  color: var(--ink);
}
.hero-sub {
  font: 600 clamp(1.125rem, 2vw, 1.375rem)/1.2 var(--f-head);
  color: var(--steel);
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--lagoon) 0 34%, var(--mango) 34% 67%, var(--hibiscus) 67% 100%) 1;
  max-width: 22ch;
}
.hero-copy { font-size: 1.0625rem; color: var(--ink-2); max-width: 44ch; }
.hero-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.hero-note { color: var(--ink-2); font-size: .9375rem; }

.hero-art {
  margin: 0; background: #DDF4F1; overflow: hidden;
  border: 1.5px solid var(--ink); border-radius: 2px;
  padding: 0;
  box-shadow: 8px 8px 0 #BFE8E1;
}
.hero-art svg { display: block; width: 100%; height: auto; }

/* drawing classes */
.stroke-ink   { stroke: var(--ink);   stroke-width: 1.6; fill: none; }
.stroke-steel { stroke: var(--steel); stroke-width: 1.6; fill: none; }
.stroke-dim   { stroke: var(--dim);   stroke-width: 1.2; fill: none; }
.dashed { stroke-dasharray: 4 4; }
.fill-paper { fill: var(--paper); }
.fill-white { fill: var(--white); }
.fill-tint  { fill: var(--tint); }
.fill-ink   { fill: var(--ink); }
.fill-steel { fill: var(--steel); }
.fill-vis   { fill: var(--vis); }
rect.fill-paper.stroke-ink, path.fill-tint.stroke-ink, circle.fill-tint.stroke-ink,
circle.fill-vis.stroke-ink, rect.fill-white.stroke-ink { stroke: var(--ink); stroke-width: 1.6; }
rect.fill-paper.stroke-ink { fill: var(--paper); }
path.fill-tint.stroke-ink, circle.fill-tint.stroke-ink { fill: var(--tint); }
circle.fill-vis.stroke-ink { fill: var(--vis); }
rect.fill-white.stroke-ink { fill: var(--white); }
.hatch { stroke: var(--steel); stroke-width: 1.2; opacity: .45; }
.moment { fill: url(#hatch); stroke: var(--ink); stroke-width: 1.6; }
.t-label { font: 500 13px var(--f-head); fill: var(--ink); }
.t-tab   { font: 500 12px var(--f-body); fill: var(--white); }
.t-num text { font: 400 11px ui-monospace, "Consolas", monospace; fill: var(--dim); }
.t-code text { font: 400 12px ui-monospace, "Consolas", monospace; fill: var(--ink); white-space: pre; }
.t-code .k { fill: var(--steel); font-weight: 600; }
.t-code .c { fill: var(--dim); }
.t-code .s { fill: #7A5A00; }
.line-hl { fill: var(--vis); opacity: .18; }

/* one orchestrated moment: the moment diagram draws in */
@media (prefers-reduced-motion: no-preference) {
  .beam-group .moment { stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 1.4s .4s ease-out forwards; }
  .line-hl { animation: hl 1.2s 1.6s ease-out both; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes hl { from { opacity: 0; } to { opacity: .18; } }
}

.work {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) var(--gutter) clamp(40px, 6vw, 80px);
}
.work h2 { margin-bottom: 24px; }
.work-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1.5px solid var(--ink); border-left: 1.5px solid var(--ink);
}
.work-list li {
  padding: 24px 22px 20px;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  background: var(--paper);
}
.work-list img { display: block; margin-bottom: 14px; }
.work-list p { color: var(--ink-2); font-size: .9375rem; margin: 0; }

/* ---------------- Sheets (dashboard, admin) ---------------- */

.sheet { max-width: var(--maxw); margin: 0 auto; padding: clamp(28px, 5vw, 56px) var(--gutter) 64px; }
.sheet-head { margin-bottom: 28px; }

.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  align-items: start;
}
/* Business card proportion: 3.5 x 2 */
.card {
  position: relative;
  aspect-ratio: 3.5 / 2;
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px;
  padding: 20px 22px;
  background: var(--white);
  border: 1.5px solid var(--ink); border-radius: 4px;
  box-shadow: 4px 4px 0 var(--tint);
}
.card::after { /* registration corner, like a drawing sheet trim mark */
  content: ""; position: absolute; right: 8px; bottom: 8px; width: 10px; height: 10px;
  border-right: 1.5px solid var(--dim); border-bottom: 1.5px solid var(--dim);
}
.card-art img { display: block; width: 64px; height: 64px; }
.card-body { display: flex; flex-direction: column; min-width: 0; }
.card-name { font-size: 1.375rem; margin: 2px 0 6px; overflow-wrap: anywhere; }
.card-about { color: var(--ink-2); font-size: .9375rem; line-height: 1.45; margin: 0 0 12px; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.status {
  font: 500 .8125rem/1 var(--f-head);
  color: var(--steel); border: 1.2px solid var(--steel); border-radius: 2px;
  padding: 5px 8px;
}
.status.private { color: var(--ink-2); border-color: var(--dim); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.soon { font-size: .875rem; color: var(--ink-2); font-style: italic; }
.card-host { font-size: .75rem; color: var(--dim); margin: 8px 0 0; overflow-wrap: anywhere; }
.card.is-soon { background: var(--paper); }
.card-add { grid-template-columns: 1fr; background: transparent; border-style: dashed; box-shadow: none; }
.card-add .card-about { margin: 0; }

/* ---------------- Sign in / enroll ---------------- */

.auth { display: grid; place-items: start center; padding: clamp(28px, 7vw, 88px) var(--gutter) 64px; }
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--white); border: 1.5px solid var(--ink); border-radius: 4px;
  padding: clamp(22px, 4vw, 36px);
  box-shadow: 6px 6px 0 var(--tint);
}
.auth-card.wide { max-width: 720px; }
.auth-card h1 { font-size: 2rem; }

.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 24px; counter-reset: s; flex-wrap: wrap; }
.steps li {
  counter-increment: s; flex: 1 1 140px;
  font: 500 .8125rem/1.3 var(--f-head); color: var(--dim);
  padding-top: 8px; border-top: 3px solid var(--tint);
}
.steps li::before { content: counter(s) ". "; }
.steps li.on { color: var(--ink); border-top-color: var(--steel); }
.steps li.done { color: var(--steel); border-top-color: var(--steel); }

.enroll-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 28px; align-items: start; margin: 8px 0 20px; }
.howto { padding-left: 1.25em; margin: 0 0 16px; }
.howto li { margin-bottom: 8px; }
.qr { margin: 0; text-align: center; }
.qr #qr { background: var(--white); border: 1.5px solid var(--ink); padding: 6px; }
.qr #qr svg { display: block; width: 100%; height: auto; }
.qr figcaption { font-size: .8125rem; color: var(--ink-2); margin-top: 8px; }
.manual summary { cursor: pointer; color: var(--steel); font-weight: 500; }
.manual p { margin: 10px 0 0; font-size: .9375rem; }
.secret { font: 600 1.0625rem/1.4 ui-monospace, "Consolas", monospace; letter-spacing: .06em; background: var(--vellum); padding: 8px 10px; word-break: break-all; }
.verify { border-top: 1.5px solid var(--tint); padding-top: 20px; }

/* ---------------- Admin ---------------- */

.panel {
  background: var(--white); border: 1.5px solid var(--ink); border-radius: 4px;
  padding: clamp(18px, 3vw, 28px); margin-bottom: 28px;
}
.invite-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 16px; align-items: end; }
.invite-out {
  background: var(--white); border: 1.5px solid var(--steel); border-left-width: 6px;
  padding: 18px 22px; margin-bottom: 28px;
}
.copyrow { display: flex; gap: 10px; flex-wrap: wrap; }
.copyrow input { flex: 1 1 320px; margin: 0; font-size: .9375rem; }

.table-wrap { overflow-x: auto; }
.accounts { width: 100%; border-collapse: collapse; font-size: .9375rem; min-width: 640px; }
.accounts th { text-align: left; font: 600 .875rem var(--f-head); color: var(--ink-2); border-bottom: 1.5px solid var(--ink); padding: 8px 10px; }
.accounts td { border-bottom: 1px solid var(--tint); padding: 12px 10px; vertical-align: middle; }
.accounts .actions { display: flex; gap: 16px; flex-wrap: wrap; }
.accounts .actions form { margin: 0; }
.you { color: var(--ink-2); font-weight: 400; }
.pill { display: inline-block; font: 500 .8125rem/1 var(--f-head); padding: 4px 8px; border-radius: 2px; margin: 2px 4px 2px 0; }
.pill-on   { background: #DCEBDF; color: var(--good); }
.pill-off  { background: #F1DED9; color: var(--bad); }
.pill-wait { background: #FBEFC9; color: #6B4F00; }

/* ---------------- Title block footer ---------------- */

.titleblock {
  display: grid; grid-template-columns: 2fr 1.4fr 1.4fr 1fr;
  border-top: 1.5px solid var(--ink);
  background: var(--paper);
}
.tb-cell { padding: 10px var(--gutter) 12px 16px; border-left: 1.5px solid var(--ink); display: flex; flex-direction: column; gap: 2px; }
.tb-cell:first-child { border-left: 0; padding-left: var(--gutter); }
.tb-k { font-size: .75rem; color: var(--ink-2); }
.tb-v { font: 600 .9375rem/1.2 var(--f-head); }
.tb-name .tb-v { font-size: 1.125rem; }

/* ---------------- Small screens ---------------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .work-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invite-form { grid-template-columns: 1fr; }
  .invite-form .btn { justify-self: start; }
}
@media (max-width: 640px) {
  .work-list { grid-template-columns: 1fr; }
  .enroll-grid { grid-template-columns: 1fr; }
  .qr { max-width: 220px; }
  .titleblock { grid-template-columns: 1fr 1fr; }
  .tb-cell:nth-child(3) { border-left: 0; padding-left: var(--gutter); }
  .tb-cell:nth-child(n+3) { border-top: 1.5px solid var(--ink); }
  .card { aspect-ratio: auto; min-height: 200px; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; }
  .card-art img { width: 48px; height: 48px; }
  .topnav { gap: 14px; }
}

/* ---------------- Reef photo background (every page) ----------------
   The photo is assets/img/reef.jpg (reef-small.jpg on phones).
   To swap it, upload a new photo with the same name.
   The two rgba numbers darken it so panels stand out: lower = brighter photo. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(rgba(4, 26, 36, .30), rgba(4, 26, 36, .55)),
    url("img/reef.jpg") center / cover no-repeat;
}
@media (max-width: 700px) {
  body::before {
    background:
      linear-gradient(rgba(4, 26, 36, .30), rgba(4, 26, 36, .55)),
      url("img/reef-small.jpg") center / cover no-repeat;
  }
}

/* Panels that sit on the photo */
.hero-text {
  background: rgba(246, 248, 250, .94);
  border: 1.5px solid var(--ink); border-radius: 2px;
  padding: clamp(22px, 3vw, 36px);
  box-shadow: 8px 8px 0 rgba(191, 232, 225, .85);
}
@supports (backdrop-filter: blur(6px)) {
  .hero-text { background: rgba(246, 248, 250, .86); backdrop-filter: blur(6px); }
}
.work-list li { background: rgba(246, 248, 250, .95); }
.card-add { background: rgba(255, 255, 255, .82); }
.card.is-soon { background: var(--white); }

/* Headings and lines written directly on the photo */
.work h2,
.sheet-head h1,
.sheet-head .lede {
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 20, 30, .65), 0 0 18px rgba(0, 20, 30, .45);
}
.sheet-head .lede { color: #E8F6F4; }

/* Banner version label and Sign up button */
.ver { font: 500 .8125rem/1 var(--f-body); color: var(--steel); opacity: .8; }
.btn.signup { background: #E8663D; border-color: #B84A27; color: #fff; }
.btn.signup:hover { background: #B84A27; }
.topnav a.btn { border-bottom: 1.5px solid; padding: 6px 14px; }
.topnav a.btn.ghost { color: var(--steel); border-color: var(--steel-d); }
.topnav a.btn.signup { color: #fff; border-color: #B84A27; }
