:root {
  color-scheme: dark;
  --bg: #07110f;
  --ink: #fffdf0;
  --muted: #c0c8bd;
  --line: rgba(255, 253, 240, 0.16);
  --blue: #8fc7ff;
  --blue-2: #fff2bd;
  --blue-soft: rgba(143, 199, 255, 0.12);
  --card: rgba(255, 253, 240, 0.055);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 16%, rgba(10, 79, 62, 0.78), transparent 34rem),
    radial-gradient(circle at 80% 0%, rgba(55, 48, 19, 0.38), transparent 30rem),
    linear-gradient(90deg, #06100f 0%, #0d2a23 28%, #12170f 72%, #18180f 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.ambient-field {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-field::before,
.ambient-field::after {
  content: "";
  position: absolute;
  width: 38vmax;
  height: 38vmax;
  border-radius: 50%;
  opacity: 0.16;
}

.ambient-field::before {
  left: -8vmax;
  top: 10vmax;
  background: radial-gradient(circle, rgba(26, 143, 114, 0.6), transparent 68%);
}

.ambient-field::after {
  right: -10vmax;
  top: -8vmax;
  background: radial-gradient(circle, rgba(178, 141, 52, 0.52), transparent 68%);
}

::selection {
  color: #07110f;
  background: #e8ce75;
}

a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 750;
}

button,
input {
  font: inherit;
}

button,
.button-link {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: #07110f;
  background: #fffdf0;
  font-weight: 800;
  padding: 0 16px;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 240, 0.08);
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

input:focus {
  border-color: rgba(229, 200, 105, 0.72);
  box-shadow: 0 0 0 4px rgba(229, 200, 105, 0.12);
}

.hidden {
  display: none !important;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

p,
li,
span {
  line-height: 1.65;
}

p,
li,
.quiet,
.meta,
.status {
  color: var(--muted);
}

.quiet,
.meta,
.status {
  font-size: 0.92rem;
}

.gate {
  min-height: 100vh;
  width: min(520px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.gate h1 {
  margin-bottom: 10px;
}

.unlock-form {
  display: grid;
  gap: 10px;
  margin: 34px auto 0;
  width: min(380px, 100%);
  text-align: left;
}

.unlock-form button {
  width: 100%;
}

.site {
  width: min(880px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) 0 clamp(54px, 9vw, 96px);
}

.site header,
.site section {
  text-align: center;
}

.site header {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: clamp(28px, 5vh, 52px) 0 clamp(28px, 5vw, 44px);
}

.site header p {
  max-width: 680px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: clamp(28px, 5vw, 52px);
  margin-bottom: 8px;
}

nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 240, 0.055);
  padding: 0 15px;
}

.site section {
  border-top: 1px solid var(--line);
  padding: clamp(40px, 6vw, 72px) 0;
}

.site header + section {
  padding-top: clamp(44px, 6vw, 68px);
}

.site header + section h2 {
  margin-bottom: clamp(18px, 3vw, 28px);
}

.site-footer {
  border-top: 4px solid var(--ink);
  padding: 40px 0 48px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

.footer-brand,
.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand {
  flex-wrap: wrap;
}

.footer-logo,
.footer-link {
  border: 4px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(255, 253, 240, 0.24);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  background: var(--ink);
  color: #07110f;
  padding: 3px 11px;
}

.footer-divider {
  width: 4px;
  height: 22px;
  background: var(--ink);
}

.footer-copy {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.footer-links {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  background: rgba(255, 253, 240, 0.08);
  color: var(--ink);
  padding: 3px 11px;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.footer-link:hover {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.footer-link-email:hover {
  background: #e8ce75;
  color: #07110f;
}

.footer-link-linkedin:hover {
  background: #8fc7ff;
  color: #07110f;
}

.footer-link-resume:hover {
  background: #65d6b5;
  color: #07110f;
}

.footer-link-admin:hover {
  background: #d99bff;
  color: #07110f;
}

.site ul {
  width: min(660px, 100%);
  margin: 0 auto;
  padding-left: 20px;
  text-align: left;
}

.site li + li {
  margin-top: 8px;
}

.list,
.project-list {
  display: grid;
  gap: 12px;
}

.item,
.project,
.signal-card,
.panel,
.metric-grid article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition:
    border-color 180ms ease,
    background 180ms ease;
}

.item,
.project,
.signal-card {
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(var(--lift, 0));
  transform-style: preserve-3d;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.tilt-surface.is-tilting {
  --lift: -2px;
  will-change: transform;
}

.item::before,
.project::before,
.signal-card::before,
.panel::before,
.custom-row::before,
.metric-grid article::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(232, 206, 117, 0.13), transparent 34%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.item:hover::before,
.project:hover::before,
.signal-card:hover::before,
.panel:hover::before,
.custom-row:hover::before,
.metric-grid article:hover::before {
  opacity: 1;
}

.item,
.project {
  padding: 18px;
  text-align: left;
}

.project {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
}

.signal-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.signal-card {
  padding: 18px;
  text-align: left;
}

.signal-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.signal-items span,
.signal-items a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 240, 0.06);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  padding: 5px 9px;
}

.signal-items a:hover {
  border-color: rgba(232, 206, 117, 0.5);
  background: rgba(232, 206, 117, 0.12);
}

.admin-shell {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 40px 0;
}

.admin-header {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.admin-header h1 {
  font-size: clamp(3rem, 7vw, 5.6rem);
}

.admin-header p {
  max-width: 620px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.metric-grid article {
  padding: 18px;
}

.metric-grid span {
  display: block;
  color: var(--blue-2);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 950;
  line-height: 1;
}

.metric-grid p {
  margin: 8px 0 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.panel-heading {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 320px);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.compact-heading {
  grid-template-columns: 1fr;
  margin-bottom: 12px;
}

.issue-grid {
  grid-template-columns: minmax(320px, 0.65fr) minmax(0, 1.35fr);
  margin: 18px 0;
}

.issue-panel {
  display: grid;
  gap: 10px;
}

.input-combo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.custom-list {
  display: grid;
  gap: 10px;
}

.custom-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 240, 0.055);
  padding: 14px;
  position: relative;
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(var(--lift, 0));
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

.custom-row > * {
  position: relative;
  z-index: 1;
}

.custom-row.inactive {
  opacity: 0.55;
}

.custom-row strong,
.custom-row span,
.password-title strong,
.password-title span {
  display: block;
}

.custom-row p {
  margin: 2px 0 0;
  font-size: 0.9rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.row-actions button {
  min-height: 36px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.access-table {
  display: grid;
  gap: 8px;
}

.access-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(110px, 0.75fr) 110px 90px minmax(150px, 0.85fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 253, 240, 0.055);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.access-row:hover {
  border-color: rgba(229, 200, 105, 0.42);
  background: var(--blue-soft);
}

.access-row span,
.event-item span {
  color: var(--muted);
  font-size: 0.88rem;
}

.detail-panel {
  position: sticky;
  top: 18px;
}

.detail-block {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.detail-block span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-block p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.event-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.event-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 240, 0.055);
  padding: 10px;
}

.event-item p {
  margin: 0;
  font-size: 0.9rem;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

@media (max-width: 980px) {
  .metric-grid,
  .dashboard-grid,
  .issue-grid,
  .signal-groups,
  .panel-heading {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .custom-row,
  .input-combo {
    grid-template-columns: 1fr;
    display: grid;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-height: 820px) and (min-width: 900px) {
  h1 {
    font-size: clamp(3rem, 7vw, 5.4rem);
  }

  .site header {
    padding-top: 24px;
  }

  nav {
    margin-top: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .item,
  .project,
  .signal-card,
  .custom-row {
    transform: none !important;
    transition: none;
  }
}
