:root {
  --bg: #07111f;
  --bg-2: #020617;
  --panel: rgba(15, 23, 42, 0.70);
  --panel-soft: rgba(15, 23, 42, 0.44);
  --text: #eef3ff;
  --muted: #a9b7cc;
  --line: rgba(148, 163, 184, 0.17);
  --accent: #38bdf8;
  --accent-2: #6366f1;
  --good: #22c55e;
  --radius: 18px;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.15), transparent 26rem),
    radial-gradient(circle at 78% 8%, rgba(99, 102, 241, 0.13), transparent 28rem),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 48%, #030712 100%);
  min-height: 100vh;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.20;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 68%);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(2, 6, 23, 0.78);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #020617;
  font-weight: 950;
  box-shadow: 0 10px 28px rgba(56, 189, 248, 0.20);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-links a:hover { color: var(--text); }

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 42px 22px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.75fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding-top: 52px;
  padding-bottom: 34px;
}

.eyebrow {
  color: #7cc7ff;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

h1, h2, h3 {
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 620px;
  font-size: clamp(2.35rem, 4.4vw, 4.05rem);
}

h2 { font-size: clamp(1.35rem, 2.2vw, 2rem); }
h3 { font-size: 1.04rem; margin-top: 10px; }

.lead {
  max-width: 650px;
  color: #cad6e6;
  font-size: clamp(0.94rem, 1.05vw, 1.04rem);
  margin: 18px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.btn {
  --btn-accent-rgb: 56, 189, 248;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.56);
  font-weight: 800;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--btn-accent-rgb), 0.52);
  background: rgba(30, 41, 59, 0.82);
  box-shadow: 0 10px 26px rgba(var(--btn-accent-rgb), 0.12);
}

.btn.primary {
  color: var(--text);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.32);
}

.social-github { --btn-accent-rgb: 203, 213, 225; }
.social-gitlab { --btn-accent-rgb: 251, 146, 60; }
.social-youtube { --btn-accent-rgb: 239, 68, 68; }
.social-linkedin { --btn-accent-rgb: 56, 189, 248; }

.btn-icon {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 0.64rem;
  line-height: 1;
  background: rgba(var(--btn-accent-rgb), 0.17);
  border: 1px solid rgba(var(--btn-accent-rgb), 0.20);
}

.ops-card,
.card,
.panel,
.tool-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ops-card {
  padding: 20px;
  background:
    radial-gradient(circle at 82% 4%, rgba(56, 189, 248, 0.18), transparent 14rem),
    var(--panel-soft);
}

.ops-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.ops-header strong,
.ops-header span { display: block; }
.ops-header span { color: var(--muted); font-size: 0.85rem; margin-top: 1px; }

.pulse-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.12);
  flex: 0 0 auto;
}

.ops-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.ops-grid div {
  min-height: 80px;
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.24);
}

.ops-grid strong,
.ops-grid span { display: block; }
.ops-grid strong { font-size: 0.92rem; }
.ops-grid span { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }

.compact-section {
  padding-top: 30px;
  padding-bottom: 30px;
}

.section-title {
  max-width: 760px;
  margin-bottom: 20px;
}

.compact-title {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 0.66fr);
  gap: 8px 22px;
  align-items: end;
  max-width: none;
}

.compact-title .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.compact-title p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.grid,
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  display: block;
  min-height: 112px;
  padding: 18px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.card {
  min-height: 164px;
  padding: 18px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.card:hover,
.tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.46);
  background: rgba(15, 23, 42, 0.82);
}

.card p,
.tool-card span {
  color: var(--muted);
  margin: 9px 0 0;
  font-size: 0.88rem;
}

.tool-card strong { display: block; }

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.70rem;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.bottom-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding-top: 24px;
  padding-bottom: 30px;
}

.bottom-layout .panel {
  width: 100%;
}

.panel {
  padding: 18px;
  background: var(--panel-soft);
}

.stack-panel {
  padding-bottom: 20px;
}

.panel h2 {
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-list span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.28);
  color: #dbeafe;
  font-size: 0.82rem;
  font-weight: 650;
}

.identity-card {
  box-shadow: none;
  background: rgba(2, 6, 23, 0.22);
}

.identity-card .eyebrow {
  color: rgba(124, 199, 255, 0.76);
  font-size: 0.66rem;
  margin-bottom: 8px;
}

.identity-card p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.48;
}

.identity-card p:last-child { margin-bottom: 0; }
.identity-card strong { color: var(--text); }
.identity-keywords { opacity: 0.62; }

.footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 22px 34px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.85rem;
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 42px;
  }

  .grid,
  .tools-grid {
    grid-template-columns: 1fr 1fr;
  }

  .compact-title {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .nav { align-items: flex-start; flex-direction: column; }
  .nav-links { flex-wrap: wrap; }
  .section { padding: 34px 18px; }
  .hero { gap: 26px; }
  h1 { font-size: clamp(2.05rem, 11vw, 3.25rem); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .ops-grid,
  .grid,
  .tools-grid,
  .bottom-layout { grid-template-columns: 1fr; }
  .footer { flex-direction: column; align-items: flex-start; }
}


/* Camera live preview page */
.tool-card--camera {
  background:
    radial-gradient(circle at 90% 6%, rgba(34, 197, 94, 0.16), transparent 9rem),
    var(--panel);
}

.camera-hero {
  padding-top: 52px;
}

.camera-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
  gap: 14px;
  margin-top: 22px;
}

.camera-layout--single {
  grid-template-columns: 1fr;
}

.camera-view-panel {
  min-width: 0;
}

.camera-view-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.camera-view-toolbar h2 {
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}

.camera-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(2, 6, 23, 0.34);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.camera-status.is-ok {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.10);
}

.camera-status.is-error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(248, 113, 113, 0.10);
}

.camera-frame-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(280px, 56vw, 650px);
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.80), rgba(2, 6, 23, 0.55)),
    repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.06) 0 10px, transparent 10px 20px);
}

.camera-video {
  display: block;
  width: 100%;
  min-height: clamp(280px, 56vw, 650px);
  max-height: 650px;
  object-fit: contain;
  background: #020617;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  padding: 34px;
  color: var(--muted);
  background: rgba(2, 6, 23, 0.34);
}

.camera-placeholder[hidden] {
  display: none;
}

.camera-placeholder strong {
  color: var(--text);
  font-size: 1rem;
}

.camera-placeholder span {
  max-width: 360px;
  font-size: 0.86rem;
}

.camera-placeholder__icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.22);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.camera-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.camera-info-grid div {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.24);
}

.camera-info-grid strong,
.camera-info-grid span {
  display: block;
}

.camera-info-grid strong {
  font-size: 0.82rem;
}

.camera-info-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

@media (max-width: 920px) {
  .camera-layout,
  .camera-info-grid {
    grid-template-columns: 1fr;
  }
}

/* Camera local login */
.camera-login-panel {
  max-width: 560px;
}

.camera-login-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.camera-login-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.camera-login-form input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  padding: 0.85rem 1rem;
  outline: none;
}

.camera-login-form input:focus {
  border-color: rgba(96, 165, 250, 0.72);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

.primary-action {
  border: 0;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  color: #020617;
  font-weight: 800;
  cursor: pointer;
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.camera-auth-message {
  margin-top: 1rem;
  border-radius: 16px;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
}

.camera-auth-message--error {
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.26);
  color: #fecaca;
}

/* Portfolio public update 2026-06-25 */
.card {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.card-link {
  display: inline-block;
  margin-top: 14px;
  color: #7cc7ff;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: -0.01em;
  transition: transform 0.18s ease, color 0.18s ease;
}

.card:hover .card-link {
  color: #bae6fd;
  transform: translateX(3px);
}

.card:focus-visible,
.tool-card:focus-visible,
.btn:focus-visible,
.nav-links a:focus-visible,
.brand:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.9);
  outline-offset: 4px;
}

#projects .card {
  min-height: 178px;
}

#services .tool-card {
  min-height: 104px;
}
