/* OpenRole — iOS-flavoured reading app
   Brand: --brand (signal blue), --ink (near-navy), --accent (mint confirm) */

:root {
  --brand: #2C63FF;
  --ink: #0E1220;
  --accent: #00BE8C;

  --bg: #F1F3F8;
  --surface: #FFFFFF;
  --surface-2: #F7F8FC;
  --hair: rgba(14, 18, 32, .09);
  --text: #14192B;
  --text-2: #5B6178;
  --text-3: #8B90A3;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --shadow-card: 0 1px 2px rgba(14, 18, 32, .05), 0 12px 28px -18px rgba(14, 18, 32, .35);
  --shadow-lift: 0 18px 48px -20px rgba(14, 18, 32, .45);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, white);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------------------------------------------------------------- loader */

.loader {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--bg);
}
.loader[hidden] { display: none; }
.loader--inline { position: static; padding: 72px 0; background: transparent; }

.loader__mark { display: flex; gap: 7px; }
.loader__mark span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand);
  animation: pulse 1.05s ease-in-out infinite;
}
.loader__mark span:nth-child(2) { animation-delay: .14s; background: color-mix(in srgb, var(--brand) 65%, white); }
.loader__mark span:nth-child(3) { animation-delay: .28s; background: color-mix(in srgb, var(--brand) 35%, white); }
@keyframes pulse { 0%, 100% { transform: translateY(0); opacity: .45; } 45% { transform: translateY(-7px); opacity: 1; } }

.loader__text { margin: 0; font-size: 14px; color: var(--text-3); letter-spacing: .01em; }

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

.chrome {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, white);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hair);
}
.chrome__inner {
  max-width: 680px; margin: 0 auto;
  padding: 11px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.chrome__brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 640; letter-spacing: -.015em; color: var(--ink); font-size: 17px;
}
.chrome__dot {
  width: 15px; height: 15px; border-radius: 5px;
  background: linear-gradient(150deg, var(--brand), color-mix(in srgb, var(--brand) 45%, var(--accent)));
}
.chrome__nav { display: flex; gap: 18px; font-size: 15px; }
.chrome__nav a { color: var(--text-2); font-weight: 520; }
.chrome__nav a.is-active { color: var(--brand); }

/* ------------------------------------------------------------------- app */

.app {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 20px calc(120px + var(--safe-b));
}
.app[hidden] { display: none; }

.eyebrow { margin: 0 0 8px; font-size: 14px; color: var(--brand); font-weight: 600; }
.largetitle {
  margin: 0 0 10px;
  font-size: clamp(30px, 7vw, 38px);
  line-height: 1.08;
  letter-spacing: -.028em;
  font-weight: 700;
  color: var(--ink);
}
.lede { margin: 0 0 26px; color: var(--text-2); font-size: 17.5px; max-width: 60ch; }
.section-title {
  margin: 32px 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-3);
  padding-inline: 4px;
}

/* iOS grouped inset list */
.list {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 15px 18px;
  background: none; border: 0; text-align: left;
  border-top: 1px solid var(--hair);
  cursor: pointer;
  transition: background .12s ease;
}
.row:first-child { border-top: 0; }
.row:active { background: var(--surface-2); }
.row__body { flex: 1; min-width: 0; }
.row__title { font-weight: 560; letter-spacing: -.01em; color: var(--ink); }
.row__meta { font-size: 14px; color: var(--text-3); margin-top: 2px; }
.row__chevron { color: var(--text-3); flex: none; }
.row__count {
  flex: none; font-size: 13px; font-weight: 600;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, white);
  padding: 3px 9px; border-radius: 999px;
}

/* segmented control */
.segment {
  display: grid; grid-auto-flow: column; gap: 3px;
  background: rgba(14, 18, 32, .06);
  padding: 3px; border-radius: 13px; margin-bottom: 26px;
}
.segment button {
  border: 0; background: none; padding: 8px 10px;
  border-radius: 10px; font-size: 15px; font-weight: 550; color: var(--text-2);
  cursor: pointer;
}
.segment button[aria-pressed="true"] {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 3px rgba(14, 18, 32, .16);
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; border: 0; border-radius: 14px;
  background: var(--brand); color: #fff;
  font-size: 16.5px; font-weight: 600; letter-spacing: -.01em;
  cursor: pointer;
  transition: transform .1s ease, filter .15s ease;
}
.btn:active { transform: scale(.985); filter: brightness(.94); }
.btn--block { width: 100%; }
.btn--quiet { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair); }
.btn--ghost { background: transparent; color: var(--brand); padding-inline: 6px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ------------------------------------------------------------ ad slots */

.ad {
  margin: 20px 0;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px dashed var(--hair);
  text-align: center;
  overflow: hidden;
}
.ad:empty { display: none; }

/* ---------------------------------------------------------- article page */

.article__head { margin-bottom: 22px; }
.article__meta {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  font-size: 13.5px; color: var(--text-3);
  padding-top: 12px; border-top: 1px solid var(--hair);
}
.progress { display: flex; align-items: center; gap: 8px; margin: 18px 0 4px; }
.progress__track { flex: 1; height: 4px; border-radius: 4px; background: rgba(14, 18, 32, .1); overflow: hidden; }
.progress__fill { height: 100%; background: var(--brand); border-radius: 4px; transition: width .3s ease; }
.progress__label { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.prose { font-size: 17.5px; line-height: 1.62; color: var(--text); max-width: 66ch; }
.prose p { margin: 0 0 1.1em; }
.prose h2, .prose h3 {
  font-size: 21px; letter-spacing: -.02em; color: var(--ink);
  margin: 1.8em 0 .55em; font-weight: 650; line-height: 1.25;
}
.prose h4 { font-size: 17.5px; margin: 1.5em 0 .4em; font-weight: 620; color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.15em; }
.prose li { margin-bottom: .5em; }
.prose blockquote {
  margin: 1.4em 0; padding: 2px 0 2px 16px;
  border-left: 3px solid color-mix(in srgb, var(--brand) 40%, white);
  color: var(--text-2);
}
.prose strong { font-weight: 620; color: var(--ink); }

/* job card */
.jobcard {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0 30px;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  scroll-margin-top: 90px;
}
.jobcard__body { flex: 1; min-width: 0; }
.jobcard__title { font-weight: 600; letter-spacing: -.012em; color: var(--ink); line-height: 1.3; }
.jobcard__salary { font-size: 14px; color: var(--text-2); margin-top: 3px; }
.jobcard__add {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 15px; border: 0; border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 10%, white);
  color: var(--brand); font-size: 14.5px; font-weight: 600;
  cursor: pointer; transition: transform .12s ease, background .2s ease, color .2s ease;
}
.jobcard__add:active { transform: scale(.96); }
.jobcard__add.is-added { background: color-mix(in srgb, var(--accent) 14%, white); color: color-mix(in srgb, var(--accent) 78%, black); }
.jobcard__add .tick { width: 16px; height: 16px; }
.jobcard__add.is-added .tick path { stroke-dasharray: 22; stroke-dashoffset: 0; animation: draw .32s ease forwards; }
@keyframes draw { from { stroke-dashoffset: 22; } to { stroke-dashoffset: 0; } }

/* sticky page bar */
.pagebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  padding: 12px 20px calc(12px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 78%, white);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--hair);
}
.pagebar__inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.pagebar .btn { flex: 1; }
.pagebar__count {
  font-size: 13.5px; color: var(--text-2); white-space: nowrap;
}

/* -------------------------------------------------------------- feed etc */

.post {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: 18px 20px; margin-bottom: 14px;
}
.post__title { font-weight: 620; color: var(--ink); letter-spacing: -.012em; }
.post__sub { font-size: 14px; color: var(--text-3); margin-top: 2px; }
.post__jobs { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.post__jobs li {
  font-size: 15px; padding: 10px 13px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text);
}

.empty {
  text-align: center; padding: 54px 24px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
}
.empty h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.02em; color: var(--ink); }
.empty p { margin: 0 0 18px; color: var(--text-2); }

/* --------------------------------------------------------- sheet / modal */

.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 13, 24, .42);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%; max-width: 520px;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lift);
  padding: 10px 22px calc(26px + var(--safe-b));
  max-height: 92vh; overflow-y: auto;
  animation: rise .28s cubic-bezier(.32, .72, 0, 1);
}
@keyframes rise { from { transform: translateY(6%); } to { transform: translateY(0); } }
@media (min-width: 560px) {
  .scrim { align-items: center; }
  .sheet { border-radius: 26px; }
}

.sheet__grab { width: 38px; height: 5px; border-radius: 3px; background: rgba(14, 18, 32, .16); margin: 0 auto 14px; }
.sheet h2 { margin: 4px 0 4px; font-size: 22px; letter-spacing: -.022em; color: var(--ink); }
.sheet p.sheet__sub { margin: 0 0 18px; color: var(--text-2); font-size: 15px; }

.tabs { display: grid; grid-auto-flow: column; gap: 3px; background: rgba(14, 18, 32, .06); padding: 3px; border-radius: 12px; margin-bottom: 20px; }
.tabs button { border: 0; background: none; padding: 8px; border-radius: 9px; font-weight: 550; font-size: 15px; color: var(--text-2); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(14, 18, 32, .16); }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 14px; font-weight: 550; color: var(--text-2); margin-bottom: 6px; }
.field input[type="text"], .field input[type="email"], .field input[type="url"], .field input[type="password"] {
  width: 100%; padding: 13px 14px; font-size: 16.5px;
  border: 1px solid var(--hair); border-radius: 13px;
  background: var(--surface-2); color: var(--text);
}
.field input:focus { border-color: var(--brand); background: var(--surface); outline: none; }
.field .hint { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.field .error { font-size: 13.5px; color: #D93A3A; margin-top: 6px; }

.check {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px; margin-top: 10px;
  background: var(--surface-2); border-radius: 13px;
  font-size: 14.5px; color: var(--text-2);
}
.check input { margin-top: 3px; accent-color: var(--brand); width: 18px; height: 18px; }
.notice {
  font-size: 13.5px; color: var(--text-2);
  background: color-mix(in srgb, var(--brand) 7%, white);
  border-radius: 12px; padding: 12px 14px; margin: 4px 0 16px;
}

/* ------------------------------------------------------------------ toast */

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%);
  z-index: 70;
  background: var(--ink); color: #fff;
  padding: 11px 18px; border-radius: 999px;
  font-size: 14.5px; font-weight: 520;
  box-shadow: var(--shadow-lift);
  animation: toast .22s ease;
}
.toast[hidden] { display: none; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ------------------------------------------------------------ preferences */

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

/* --------------------------------------------------- logos and social */

.jobcard__logo {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  object-fit: contain; background: var(--surface-2); padding: 4px;
}

.post__jobs li { display: flex; align-items: center; gap: 10px; }
.post__jobs img { width: 26px; height: 26px; border-radius: 7px; object-fit: contain; background: #fff; flex: none; }

.actions {
  display: flex; gap: 6px; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--hair);
}
.action {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border: 0; border-radius: 11px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 14px; font-weight: 550; cursor: pointer;
  transition: transform .12s ease, color .18s ease, background .18s ease;
}
.action:active { transform: scale(.95); }
.action.is-on { color: var(--brand); background: color-mix(in srgb, var(--brand) 11%, white); }
.action.is-on svg path { fill: currentColor; }

.comments { margin-top: 14px; display: grid; gap: 10px; }
.comment {
  position: relative;
  background: var(--surface-2); border-radius: 13px; padding: 11px 14px;
}
.comment__who { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.comment__body { font-size: 15px; color: var(--text); margin-top: 2px; padding-right: 54px; }
.comment__del {
  position: absolute; top: 10px; right: 10px;
  border: 0; background: none; color: var(--text-3); font-size: 12.5px; cursor: pointer;
}
.comment-form { display: flex; gap: 8px; }
.comment-form input {
  flex: 1; padding: 11px 14px; font-size: 15.5px;
  border: 1px solid var(--hair); border-radius: 12px; background: var(--surface-2); color: var(--text);
}
.comment-form input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.comment-form .btn { padding: 11px 16px; font-size: 15px; }

.tallies { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.tally {
  background: var(--surface); border-radius: var(--r-md); padding: 14px 16px;
  box-shadow: var(--shadow-card); font-size: 13.5px; color: var(--text-3);
  display: grid; gap: 2px;
}
.tally span { font-size: 23px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }

.row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
