:root {
  --paper: #f7f4ee;
  --paper-deep: #ede6d9;
  --surface: #fffdf8;
  --ink: #202932;
  --muted: #66727d;
  --line: #d9d2c5;
  --line-strong: #b9ad9c;
  --copper: #b86232;
  --copper-deep: #87441f;
  --teal: #1f6f73;
  --green: #2f8f63;
  --red: #b84d42;
  --steel: #43505a;
  --shadow: 0 18px 50px rgba(53, 43, 30, 0.14);
  --radius: 8px;
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body.site-shell {
  background:
    linear-gradient(90deg, rgba(32, 41, 50, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(32, 41, 50, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 52px 52px, 52px 52px, auto;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: rgba(184, 98, 50, 0.22);
}

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--copper), var(--teal), var(--ink));
  transform: scaleX(0);
  transform-origin: left;
  animation: loaderPass 850ms ease forwards;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--max), calc(100% - 32px));
  margin: 14px auto 0;
  padding: 10px 12px;
  border: 1px solid rgba(32, 41, 50, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 10px 30px rgba(53, 43, 30, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(32, 41, 50, 0.2);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(184, 98, 50, 0.16), rgba(31, 111, 115, 0.12)),
    var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
}

.brand-name {
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a,
.admin-sidebar nav a {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--steel);
  font-weight: 700;
  font-size: 0.92rem;
}

.site-nav a:hover,
.site-nav a.active,
.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  background: rgba(184, 98, 50, 0.1);
  color: var(--ink);
}

.site-nav .nav-cta {
  margin-left: 6px;
  border: 1px solid rgba(184, 98, 50, 0.32);
  background: rgba(184, 98, 50, 0.08);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(620px, 58svh);
  width: min(1440px, calc(100% - 28px));
  margin: 18px auto 0;
  padding: clamp(2rem, 7vw, 5.4rem);
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(247, 244, 238, 0.94), rgba(247, 244, 238, 0.78) 43%, rgba(247, 244, 238, 0.25) 76%),
    linear-gradient(0deg, rgba(32, 41, 50, 0.18), rgba(32, 41, 50, 0)),
    url("/static/img/powellforge-hero.jpg") center right / cover no-repeat;
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(32, 41, 50, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(32, 41, 50, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(90deg, #000, transparent 70%);
  animation: gridDrift 14s linear infinite;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--copper-deep);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 9ch;
  font-size: clamp(3rem, 13vw, 9.4rem);
  font-weight: 900;
}

.hero-lede {
  max-width: 620px;
  margin: 1.2rem 0 0;
  color: #35414a;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-actions,
.heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.7rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.76rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 800;
  line-height: 1;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--ink);
  color: #fffdf8;
  box-shadow: 0 10px 24px rgba(32, 41, 50, 0.18);
}

.button.ghost {
  border-color: rgba(32, 41, 50, 0.22);
  background: rgba(255, 253, 248, 0.66);
  color: var(--ink);
}

.signal-panel {
  position: absolute;
  right: clamp(1rem, 4vw, 3.5rem);
  bottom: clamp(1rem, 4vw, 3rem);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 42px;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(32, 41, 50, 0.12);
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.84);
  color: var(--steel);
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(53, 43, 30, 0.13);
}

.signal,
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.signal.good,
.status-dot.good {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(47, 143, 99, 0.13);
}

.status-dot.bad {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(184, 77, 66, 0.13);
}

.status-dot.idle {
  background: var(--line-strong);
}

.metric-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  width: min(var(--max), calc(100% - 32px));
  margin: 18px auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.metric-band div {
  min-height: 112px;
  padding: 1.2rem;
  background: rgba(255, 253, 248, 0.9);
}

.metric-band strong,
.metric-band span {
  display: block;
}

.metric-band strong {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.metric-band span {
  color: var(--muted);
  font-size: 0.95rem;
}

.section,
.capability-band,
.service-list,
.about-grid,
.contact-layout,
.project-detail {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.section,
.capability-band,
.service-list,
.about-grid,
.contact-layout {
  padding: clamp(2.6rem, 5vw, 4.5rem) 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 1.4rem;
}

.section-heading h2,
.page-hero h1,
.project-detail-hero h1,
.contact-copy h1,
.about-copy h2,
.principles h2 {
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 4.2rem);
}

.section-heading .eyebrow {
  grid-column: 1 / -1;
}

.text-link {
  color: var(--copper-deep);
  font-weight: 900;
}

.project-grid,
.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-card,
.capability {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(32, 41, 50, 0.12);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(53, 43, 30, 0.08);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.project-card:hover,
.capability:hover {
  transform: translateY(-5px);
  border-color: rgba(184, 98, 50, 0.42);
  box-shadow: 0 22px 54px rgba(53, 43, 30, 0.16);
}

.project-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(31, 111, 115, 0.16), rgba(184, 98, 50, 0.18)),
    linear-gradient(90deg, rgba(32, 41, 50, 0.06) 1px, transparent 1px),
    var(--paper-deep);
  background-size: auto, 22px 22px, auto;
  color: var(--ink);
}

.project-media img {
  position: absolute;
  inset: 1.6rem;
  width: calc(100% - 3.2rem);
  height: calc(100% - 3.2rem);
  max-width: none;
  max-height: none;
  object-fit: contain;
  transition: transform 260ms ease;
}

.project-card:hover .project-media img {
  transform: scale(1);
}

.project-media span {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(32, 41, 50, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.76);
  font-weight: 900;
  font-size: 1.7rem;
}

.project-card-body,
.capability {
  padding: 1.15rem;
}

.project-kicker {
  margin: 0 0 0.35rem;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-card h2,
.project-card h3,
.capability h3 {
  margin-bottom: 0.55rem;
  font-size: 1.35rem;
}

.project-card p,
.capability p,
.service-row p,
.about-copy p,
.principles li,
.page-hero p,
.project-detail-hero p,
.contact-copy p {
  color: var(--muted);
}

.project-card-body > p:not(.project-kicker) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-feature-list {
  display: grid;
  gap: 0.38rem;
  margin: 1rem 0 0;
  padding: 0.9rem 0 0 1.1rem;
  border-top: 1px solid rgba(32, 41, 50, 0.1);
  color: var(--steel);
  font-size: 0.94rem;
}

.project-feature-list li::marker {
  color: var(--copper-deep);
}

.detail-features {
  max-width: 760px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 1rem;
}

.tag-row span,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(32, 41, 50, 0.12);
  border-radius: 999px;
  background: rgba(237, 230, 217, 0.42);
  color: var(--steel);
  font-size: 0.8rem;
  font-weight: 800;
}

.capability-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.capability-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 1rem;
  border-radius: 6px;
  background: rgba(31, 111, 115, 0.12);
  color: var(--teal);
  font-weight: 900;
}

.cta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto clamp(3rem, 7vw, 6rem);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  border: 1px solid rgba(32, 41, 50, 0.12);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--surface);
}

.cta-strip h2 {
  max-width: 780px;
  font-size: clamp(1.6rem, 4vw, 3rem);
}

.cta-strip .eyebrow {
  color: #e0a378;
}

.cta-strip .button.primary {
  background: var(--surface);
  color: var(--ink);
}

.page-hero {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(2.8rem, 7vw, 5rem) 0 clamp(1.4rem, 3vw, 2.4rem);
}

.page-hero p {
  max-width: 720px;
  font-size: 1.1rem;
}

.compact-hero {
  min-height: 58svh;
  display: grid;
  align-content: center;
}

.inline-logout {
  margin-top: 1.5rem;
}

.client-app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.client-app-card {
  display: grid;
  gap: 0.7rem;
  min-height: 220px;
  padding: 1.2rem;
  border: 1px solid rgba(32, 41, 50, 0.12);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(53, 43, 30, 0.08);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.client-app-card:hover {
  transform: translateY(-4px);
  border-color: rgba(31, 111, 115, 0.36);
  box-shadow: 0 20px 48px rgba(53, 43, 30, 0.14);
}

.client-app-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: rgba(31, 111, 115, 0.12);
  color: var(--teal);
  font-weight: 900;
}

.client-app-icon.image-icon {
  background: transparent;
}

.client-app-icon img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
}

.client-app-card strong {
  font-size: 1.3rem;
}

.client-app-card p {
  margin: 0;
  color: var(--muted);
}

.all-projects {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-detail {
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.project-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 2rem;
  align-items: end;
  padding: clamp(4rem, 9vw, 7rem) 0 2.5rem;
}

.detail-panel {
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.78);
}

.detail-panel dl {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.detail-panel div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 1rem;
}

.detail-panel dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-panel dd {
  margin: 0;
  font-weight: 800;
}

.project-story {
  margin-top: 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.project-story h2 {
  margin-bottom: 0.8rem;
}

.service-list {
  display: grid;
  gap: 1px;
  padding-top: 1rem;
}

.service-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 1.5rem;
  padding: clamp(1.3rem, 4vw, 2.4rem) 0;
  border-top: 1px solid var(--line);
}

.service-row span {
  color: var(--copper-deep);
  font-weight: 900;
}

.service-row h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.about-grid,
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.principles,
.contact-form,
.admin-login {
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 14px 38px rgba(53, 43, 30, 0.09);
}

.principles ul {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.contact-aside {
  display: grid;
  gap: 0.2rem;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.contact-aside span {
  color: var(--muted);
}

form label {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
  color: var(--steel);
  font-weight: 800;
}

form label span em {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0.78rem 0.85rem;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(31, 111, 115, 0.12);
}

small {
  color: var(--red);
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.flash-wrap {
  position: fixed;
  top: 86px;
  left: 50%;
  z-index: 80;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
}

.flash {
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(32, 41, 50, 0.12);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.flash.success {
  border-color: rgba(47, 143, 99, 0.28);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto 24px;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-brand {
  color: var(--ink);
}

.footer-intro {
  min-width: 0;
}

.footer-intro p {
  max-width: 38rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-weight: 800;
}

.footer-fine {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.9rem;
}

/* Admin */
.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--paper);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1rem;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.admin-sidebar nav {
  display: grid;
  gap: 0.25rem;
  margin-top: 1.3rem;
}

.sidebar-logout {
  width: 100%;
  margin-top: 1.3rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--steel);
  font-weight: 800;
}

.admin-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.admin-heading h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-stats article,
.admin-panel,
.table-wrap,
.submission,
.admin-form,
.danger-zone,
.log-view {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-stats article {
  padding: 1rem;
}

.admin-stats span {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
}

.admin-stats strong {
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.admin-panel {
  padding: 1rem;
  overflow: hidden;
}

.wide-panel {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-heading h2 {
  font-size: 1.2rem;
}

.panel-heading a,
.row-actions a {
  color: var(--copper-deep);
  font-weight: 900;
}

.status-list {
  display: grid;
  gap: 0.5rem;
}

.status-row,
.mini-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem 0;
  border-top: 1px solid rgba(32, 41, 50, 0.08);
}

.mini-item {
  grid-template-columns: minmax(0, 1fr);
}

.mini-item span,
.status-row small,
td small {
  color: var(--muted);
}

.log-snippet,
.log-view {
  width: 100%;
  max-height: 330px;
  overflow: auto;
  margin: 0;
  padding: 1rem;
  background: #182027;
  color: #e9f0ed;
  white-space: pre-wrap;
}

.log-view {
  max-height: none;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.9rem;
  border-bottom: 1px solid rgba(32, 41, 50, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--steel);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.row-actions form {
  margin: 0;
}

.row-actions button,
.danger-zone button {
  border: 0;
  background: transparent;
  color: var(--red);
  font-weight: 900;
  padding: 0;
}

.admin-form,
.danger-zone {
  padding: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-grid label {
  margin: 0;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-line input {
  width: auto;
}

.app-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0;
  padding: 0.85rem;
  border: 1px solid rgba(32, 41, 50, 0.12);
  border-radius: var(--radius);
}

.app-checklist legend {
  padding: 0 0.35rem;
  color: var(--steel);
  font-weight: 900;
}

.admin-form .button {
  margin-top: 1rem;
}

.clients-panel {
  margin-top: 1rem;
}

.client-access-list {
  display: grid;
  gap: 1rem;
}

.client-access-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(32, 41, 50, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.74);
}

.client-access-card header,
.client-meta,
.client-access-form,
.client-password-form {
  display: grid;
  gap: 0.8rem;
}

.client-access-card header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.client-access-card header span,
.client-meta span {
  display: block;
  color: var(--muted);
}

.client-meta {
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
}

.client-meta code {
  overflow-wrap: anywhere;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(32, 41, 50, 0.12);
  border-radius: 6px;
  background: var(--paper-deep);
  color: var(--ink);
}

.client-access-form,
.client-password-form {
  align-items: end;
}

.danger-zone {
  margin-top: 1rem;
}

.submission-list {
  display: grid;
  gap: 1rem;
}

.submission {
  padding: 1rem;
}

.submission.unread {
  border-color: rgba(184, 98, 50, 0.45);
}

.submission header,
.submission footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.submission h2 {
  font-size: 1.3rem;
}

.submission span,
.submission small,
.submission footer {
  color: var(--muted);
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 74svh;
  padding: 2rem;
}

.admin-login {
  width: min(440px, 100%);
}

.admin-login h1 {
  margin: 1rem 0;
  font-size: 2.3rem;
}

.status-pill.good {
  border-color: rgba(47, 143, 99, 0.26);
  color: var(--green);
}

.status-pill.bad {
  border-color: rgba(184, 77, 66, 0.26);
  color: var(--red);
}

.status-pill.idle {
  color: var(--muted);
}

.compact-table {
  border: 0;
}

body.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

body.reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.is-exiting main {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

@keyframes loaderPass {
  0% {
    transform: scaleX(0);
    opacity: 1;
  }
  70% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

@keyframes gridDrift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 48px 0, 0 48px;
  }
}

@media (max-width: 900px) {
  .site-header {
    width: calc(100% - 20px);
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    width: min(300px, calc(100vw - 20px));
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: grid;
  }

  .site-nav .nav-cta {
    margin-left: 0;
  }

  .hero {
    min-height: 56svh;
    padding: clamp(1.5rem, 8vw, 3rem);
    background:
      linear-gradient(90deg, rgba(247, 244, 238, 0.96), rgba(247, 244, 238, 0.82) 62%, rgba(247, 244, 238, 0.42)),
      url("/static/img/powellforge-hero.jpg") center right / cover no-repeat;
  }

  .signal-panel {
    position: relative;
    right: auto;
    bottom: auto;
    width: max-content;
    margin-top: 1.5rem;
  }

  .metric-band,
  .project-grid,
  .capability-grid,
  .client-app-grid,
  .all-projects,
  .compact,
  .project-detail-hero,
  .about-grid,
  .contact-layout,
  .admin-grid,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .cta-strip,
  .submission header,
  .submission footer,
  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .footer-intro {
    display: grid;
    gap: 0.65rem;
  }

  .footer-intro p {
    margin: 0;
  }

  .footer-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, auto));
    justify-content: start;
    gap: 0.45rem;
  }

  .footer-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(32, 41, 50, 0.1);
    border-radius: 6px;
    background: rgba(255, 253, 248, 0.58);
    white-space: nowrap;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero {
    width: calc(100% - 16px);
    min-height: 54svh;
  }

  .hero-actions,
  .heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .section,
  .capability-band,
  .service-list,
  .about-grid,
  .contact-layout,
  .project-detail,
  .page-hero,
  .metric-band,
  .cta-strip,
  .site-footer {
    width: calc(100% - 20px);
  }

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

  .detail-panel div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .admin-main {
    width: calc(100% - 20px);
  }

  .site-footer {
    gap: 1rem;
    padding-top: 1rem;
  }

  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .footer-links a {
    width: 100%;
  }

  .footer-fine {
    font-size: 0.86rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
