/* ETMark portfolio: student and admin screens */

:root {
  --serif: "Newsreader", Georgia, serif;
  --sans: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --bg: #F5F6F3;
  --surface: #FFFFFF;
  --ink: #151A2B;
  --ink-2: #353C4E;
  --muted: #626A7C;
  --line: #E1E3E8;
  --line-strong: #C9CDD6;
  --brand: #2350D8;
  --brand-ink: #FFFFFF;
  --brand-tint: #EAF0FF;
  --ok: #1D7048;
  --ok-tint: #E6F4EC;
  --warn: #8F5208;
  --warn-tint: #FFF4E2;
  --err: #B3261E;
  --err-tint: #FDECEA;
  --radius: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 4vw, 40px); letter-spacing: -.01em; margin: 0 0 8px; }
h2 { font-size: 19px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 16px; font-weight: 600; margin: 24px 0 10px; }
h2 em, h3 em, .field em { font-style: normal; font-weight: 400; color: var(--muted); font-size: .85em; margin-left: 4px; }
code { background: var(--bg); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pre { white-space: pre-wrap; }

/* Wordmark */
.wordmark { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.wordmark span { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }

/* Plain layout (logins) */
.plain-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 32px 20px; }
.narrow { width: min(100%, 440px); }
.login h1 { margin-bottom: 4px; }

/* App layout */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap;
  padding: 14px clamp(16px, 3vw, 32px);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-right { margin-left: auto; display: flex; gap: 8px; }
.topbar form { margin: 0; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-right: auto; }
.admin-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; }
.admin-nav a:hover { color: var(--brand); }

.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; max-width: 1180px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 32px) 80px; }
.main { min-width: 0; }
.main-wide { max-width: 1240px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 32px) 80px; }

.steps { position: sticky; top: 88px; align-self: start; }
.steps ol { list-style: none; margin: 8px 0 0; padding: 0; }
.steps a { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; }
.steps a:hover { background: var(--surface); }
.steps a.is-current { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 0 var(--brand); }
.steps-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); flex: none; }
.steps a.is-current .steps-n { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.steps-home { font-weight: 600 !important; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 16px; }
  .steps { position: static; }
  .steps ol { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .steps li { flex: none; }
  .steps a { white-space: nowrap; }
}

/* Page heads */
.page-head { margin-bottom: 24px; }
.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.step-of { margin: 0 0 6px; color: var(--muted); font-size: 14px; font-weight: 500; }
.lede { margin: 0; color: var(--ink-2); max-width: 44em; font-size: 17px; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 12px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(20px, 3vw, 28px); margin-bottom: 20px; }
.card > :last-child { margin-bottom: 0; }
.card h2 + .hint { margin-top: -6px; }
.empty { text-align: left; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-2 + .grid-2 { margin-top: 20px; }
.grid-wide-left { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.grid-wide-left .card { margin-bottom: 20px; }
@media (max-width: 860px) { .grid-2, .grid-wide-left { grid-template-columns: 1fr; } }

.notice { border-radius: 14px; padding: 20px 24px; margin-bottom: 20px; border: 1px solid; }
.notice h2 { margin-bottom: 6px; }
.notice-warn { background: var(--warn-tint); border-color: #F1D2A4; }

/* Flash messages */
.flashes { display: grid; gap: 8px; margin-bottom: 20px; width: 100%; }
.plain .flashes { width: min(100%, 440px); }
.flash { margin: 0; padding: 12px 16px; border-radius: 10px; font-weight: 500; font-size: 15px; }
.flash-ok { background: var(--ok-tint); color: var(--ok); }
.flash-error { background: var(--err-tint); color: var(--err); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: #1B42B8; border-color: #1B42B8; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--bg); border-color: transparent; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger-quiet { border-color: transparent; background: transparent; color: var(--err); }
.btn-danger-quiet:hover { background: var(--err-tint); border-color: transparent; }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Forms */
.stack { display: grid; gap: 16px; }
.form fieldset { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
.form legend { font-weight: 600; font-size: 16px; margin-bottom: 10px; padding: 0; }
.form > h2 { margin-top: 32px; }
.form > h2:first-of-type { margin-top: 0; }
.field { display: grid; gap: 6px; margin-bottom: 20px; min-width: 0; }
.stack .field { margin-bottom: 0; }
.field > span { font-weight: 600; font-size: 15px; }
.field small { color: var(--muted); font-size: 14px; margin-top: -2px; }
.field-short { max-width: 320px; }
.field-tiny { max-width: 120px; }
.field-row { display: flex; flex-wrap: wrap; gap: 0 16px; }
.field-row > .field { flex: 1 1 200px; }
.field-row > .field-tiny { flex: 0 1 120px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.count { font-size: 13px; color: var(--muted); text-align: right; margin-top: -2px; }
.field-error { color: var(--err); font-weight: 500; font-size: 15px; margin: 0 0 12px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }
.repeat { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }
.inline-form { margin-top: -8px; }

/* Choice chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font-size: 15px; font-weight: 500; color: var(--ink-2);
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.chip:hover span { border-color: var(--ink-2); }
.chip input:checked + span { background: var(--brand-tint); border-color: var(--brand); color: #163A9E; }
.chip input:checked + span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-right: 8px; }
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.chips-lg .chip span { min-height: 44px; padding: 8px 16px; }

/* Status */
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); margin: 0; }
.badge-submitted { background: var(--brand-tint); color: #163A9E; border-color: #C9D6FB; }
.badge-changes_requested { background: var(--warn-tint); color: var(--warn); border-color: #F1D2A4; }
.badge-approved, .badge-live { background: var(--ok-tint); color: var(--ok); border-color: #BFE3CD; }
.badge-off { background: var(--err-tint); color: var(--err); border-color: #F5C6C2; }
.meter { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .6s var(--ease); }

.checklist { list-style: none; padding: 0; margin: 0 0 8px; }
.checklist li { position: relative; padding: 9px 0 9px 32px; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 11px;
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong);
}
.checklist li.is-done::before { background: var(--ok); border-color: var(--ok); }
.checklist li.is-done::after {
  content: ""; position: absolute; left: 7px; top: 15px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checklist li.is-done a, .checklist li.is-done { color: var(--muted); }
.checklist a { color: var(--ink); text-decoration: none; }
.checklist a:hover { color: var(--brand); text-decoration: underline; }

.copy-row { display: flex; gap: 8px; margin-bottom: 12px; }
.copy-row input { flex: 1; }

/* Projects list */
.project-list { list-style: none; margin: 0 0 20px; padding: 0; }
.project-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 20px; align-items: center; }
.project-row h2 { margin: 0 0 2px; font-size: 17px; }
.project-row .hint, .project-row .field-error { margin: 2px 0; }
.project-row .badge { margin-top: 6px; }
.project-thumb { width: 120px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--bg); display: grid; place-items: center; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.thumb-empty { font-size: 13px; color: var(--muted); }
.project-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.project-actions form { margin: 0; }
@media (max-width: 640px) {
  .project-row { grid-template-columns: 88px minmax(0, 1fr); }
  .project-thumb { width: 88px; }
  .project-actions { grid-column: 1 / -1; flex-direction: row; }
}

/* Media grids and uploader */
.media-grid { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.media-grid-small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.media-item { display: grid; gap: 8px; align-content: start; }
.media-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--bg); }
.media-item form { margin: 0; }
.media-caption { display: grid; gap: 6px; }
.media-caption input, .media-caption select { min-height: 38px !important; padding: 6px 10px !important; font-size: 14px; }
.media-item .hint { margin: 0; }

.uploader { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.drop { position: relative; display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border: 1.5px dashed var(--line-strong); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--ink-2); background: var(--bg); }
.drop:hover { border-color: var(--brand); color: var(--brand); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.upload-progress { flex-basis: 100%; height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.upload-progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s linear; }

.portrait-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.portrait-preview { width: 160px; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--bg); flex: none; }
.portrait-preview img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.portrait-empty { display: grid; place-items: center; color: var(--muted); font-size: 14px; border: 1.5px dashed var(--line-strong); }

.danger-zone { border-color: #F5C6C2; }
.danger-zone h2 { color: var(--err); }

/* Look and feel */
.swatches { display: flex; flex-wrap: wrap; gap: 14px 18px; }
.swatch { position: relative; display: grid; justify-items: center; gap: 6px; cursor: pointer; width: 76px; text-align: center; }
.swatch input[type=radio] { position: absolute; opacity: 0; }
.swatch-dot, .swatch-picker { width: 44px; height: 44px; border-radius: 50%; background: var(--sw); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); transition: box-shadow .15s var(--ease); }
.swatch-picker { padding: 0; cursor: pointer; background: none; }
.swatch-picker::-webkit-color-swatch-wrapper { padding: 0; }
.swatch-picker::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatch-picker::-moz-color-swatch { border: 0; border-radius: 50%; }
.swatch input[type=radio]:checked ~ .swatch-dot,
.swatch input[type=radio]:checked ~ .swatch-picker { box-shadow: 0 0 0 2px var(--ink); }
.swatch input[type=radio]:focus-visible ~ .swatch-dot { outline: 2px solid var(--brand); outline-offset: 3px; }
.swatch-name { font-size: 13px; color: var(--ink-2); line-height: 1.2; }

.look-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 8px 0 24px; }
.lp { position: relative; display: grid; gap: 10px; justify-items: start; padding: 22px; border-radius: 12px; border: 1px solid var(--line); min-height: 150px; overflow: hidden; }
.lp-light { background: #FAFAF8; color: #151A2B; }
.lp-dark { background: #12151C; color: #EDEFF4; border-color: #2A2F3B; }
.lp-block { position: absolute; right: 18px; top: 22px; width: 56px; height: 72px; background: var(--a); border-radius: 4px; }
.lp-dark .lp-block { background: color-mix(in srgb, var(--a) 72%, #12151C); }
.lp-name { font-family: var(--serif); font-size: 24px; max-width: calc(100% - 80px); line-height: 1.1; }
.lp-btn { background: var(--a); color: var(--on); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.lp-link { color: var(--a); font-size: 14px; font-weight: 600; text-decoration: underline; }
@media (max-width: 560px) { .look-preview { grid-template-columns: 1fr; } }

/* Admin */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { display: grid; gap: 2px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.tile strong { font-family: var(--serif); font-size: 32px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.tile span { font-size: 14px; color: var(--muted); font-weight: 500; }
.tile:hover { border-color: var(--line-strong); }
.tile.is-current { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters .field { margin: 0; flex: 0 1 220px; }
.filters .field:first-child { flex: 1 1 280px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.table td.wrap { white-space: normal; min-width: 220px; }
.table tr:last-child td { border-bottom: 0; }
.table td a { font-weight: 600; text-decoration: none; }
.table td a:hover { text-decoration: underline; }
.table .btn-small { text-decoration: none; }

.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager a { display: grid; place-items: center; min-width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.pager a[aria-current] { background: var(--brand); border-color: var(--brand); color: #fff; }

.review-projects { list-style: none; margin: 0; padding: 0; }
.review-projects li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.review-projects li:first-child { border-top: 0; }
.review-projects strong { flex-basis: 100%; }
.activity { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.activity li { padding: 8px 0; border-top: 1px solid var(--line); }
.activity li:first-child { border-top: 0; }
.request-form { margin: 20px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.card form + form { margin-top: 12px; }
