:root{
  --color-bg: #ffffff;
  --color-ink: #0c1a24;
  --color-muted: #425563;

  --color-blue: #0077cc;
  --color-blue-deep: #005a9c;

  --color-orange: #ff8800;

  --panel-border: rgba(0, 119, 204, 0.35);
  --panel-border-strong: rgba(0, 119, 204, 0.55);
  --panel-shadow: 0 10px 30px rgba(12, 26, 36, 0.10);

  --scanline: rgba(0,0,0,0.04);
  --metal: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(242,247,252,0.85));

  --radius-lg: 18px;
  --radius-md: 14px;

  --font-title: "Orbitron", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-body: "Rajdhani", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --focus: 0 0 0 3px rgba(0, 119, 204, 0.25), 0 0 0 6px rgba(255, 136, 0, 0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body{
  margin: 0;
  color: var(--color-ink);
  background: var(--color-bg);
  font-family: var(--font-body);
  letter-spacing: 0.2px;
}

.skip-link{
  position: absolute;
  left: -999px;
  top: 10px;
  background: var(--color-ink);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 9999;
}
.skip-link:focus{ left: 10px; outline: none; box-shadow: var(--focus); }

.page{
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  max-width: 1100px;
  margin: 0 auto;
}

.console-panel{
  position: relative;
  background: var(--metal);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--panel-shadow);
  overflow: hidden;
}

.console-panel::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--scanline),
      var(--scanline) 1px,
      transparent 1px,
      transparent 6px
    );
  opacity: 0.35;
  pointer-events: none;
}

.console-panel::after{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55);
  pointer-events: none;
}

/* Header */
.top-header{
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 16px 14px 16px;
}

.header-left{ flex: 1; min-width: 0; }

.titlebar{
  display: grid;
  grid-template-columns: 10px 1fr;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--panel-border-strong);
  background: #ffffff;
}

.titlebar-accent{
  height: 100%;
  background: linear-gradient(180deg, var(--color-blue), var(--color-blue-deep));
}

.titlebar-text{ padding: 12px 14px 10px 14px; }

.site-title{
  font-family: var(--font-title);
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.8px;
  line-height: 1.2;
}

.site-tagline{
  margin: 6px 0 0 0;
  color: var(--color-muted);
  font-size: 15px;
}

.status-row{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-left: 2px;
}

.status-pill{
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--panel-border-strong);
  background: #fff;
}

.status-pill--ok{ box-shadow: inset 0 0 0 1px rgba(0, 119, 204, 0.12); }
.status-pill--warn{
  border-color: rgba(255, 136, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 136, 0, 0.18);
}

.status-mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Avatar */
.header-right{ display: flex; align-items: flex-start; justify-content: flex-end; }

.avatar-frame{
  width: 74px;
  height: 74px;
  border-radius: 999px;
  border: 1px solid var(--panel-border-strong);
  background: #fff;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.avatar-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.avatar-fallback{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
}

.silhouette{
  width: 100%;
  height: 100%;
  opacity: 0.95;
}

.avatar-ring{
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  border: 1px dashed rgba(0, 119, 204, 0.45);
  pointer-events: none;
}

/* Main grid */
.main{ flex: 1; }

.grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 900px){
  .grid{ grid-template-columns: 1fr; }
}

/* Cards */
.card{ padding: 14px; border-radius: var(--radius-lg); }

.card-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card-title{
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: 0.8px;
  margin: 0;
}

.card-header-line{
  height: 10px;
  flex: 1;
  border-top: 2px solid rgba(0, 119, 204, 0.28);
  border-bottom: 1px solid rgba(255, 136, 0, 0.18);
  border-radius: 12px;
  opacity: 0.85;
}

.card-footer{
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 119, 204, 0.18);
}

.mono-hint{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: var(--color-muted);
}

.mono-chip{
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 119, 204, 0.25);
  background: rgba(0, 119, 204, 0.06);
}

/* Links */
.link-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.link-item{ display: flex; }

.link-card{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid rgba(0, 119, 204, 0.22);
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  position: relative;
  overflow: hidden;
}

.link-card:hover{
  transform: translateY(-1px);
  border-color: rgba(0, 119, 204, 0.38);
  box-shadow: 0 10px 24px rgba(12, 26, 36, 0.10);
}

.link-card:focus{ outline: none; box-shadow: var(--focus); }

.link-card::after{
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    120deg,
    transparent 40%,
    rgba(255, 136, 0, 0.06) 50%,
    transparent 60%
  );
  transform: translateX(-60%) rotate(0.001deg);
  opacity: 0;
  pointer-events: none;
}

.link-card:hover::after,
.link-card:focus::after{
  opacity: 1;
  animation: console-scan 0.9s ease-out 1;
}

@keyframes console-scan{
  0%   { transform: translateX(-70%) rotate(0.001deg); }
  100% { transform: translateX(70%) rotate(0.001deg); }
}

@media (prefers-reduced-motion: reduce){
  .link-spark{ animation: none !important; }
  .link-card::after{ animation: none !important; }
}

.link-left{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.link-icon{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(0, 119, 204, 0.25);
  background: linear-gradient(180deg, rgba(0,119,204,0.08), rgba(0,0,0,0));
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-svg{
  width: 18px;
  height: 18px;
  fill: rgba(255, 136, 0, 0.90);
}

.link-card:hover .brand-svg{
  fill: rgba(0, 119, 204, 0.95);
}

.link-card:focus .brand-svg{
  fill: rgba(0, 119, 204, 0.95);
}


.link-name{
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-sub{
  font-size: 13px;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-right{
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* ===========================
   Segmented Spark (Robotech console indicator)
   - Idle: low-visibility shimmer
   - Hover/Focus: brighter + slight growth + chase animation
   =========================== */

.link-spark--seg{
  /* container: small pill that holds segments */
  width: 26px;
  height: 10px;
  border-radius: 999px;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  align-items: center;

  padding: 2px 3px;

  /* subtle housing */
  border: 1px solid rgba(0, 119, 204, 0.22);
  background: rgba(0, 119, 204, 0.04);

  /* idle presence */
  transform: scale(0.96);
  opacity: 0.85;

  /* idle animation */
  animation: seg-housing-idle 5.2s ease-in-out infinite;
  will-change: transform, opacity, box-shadow;
}

.link-spark--seg .seg{
  height: 100%;
  border-radius: 999px;

  /* default segment = dim orange */
  background: rgba(255, 136, 0, 0.22);
  box-shadow: 0 0 0 1px rgba(255, 136, 0, 0.06);

  /* each segment animates slightly out of phase (idle) */
  animation: seg-idle 4.2s ease-in-out infinite;
  will-change: transform, opacity, filter;
}

/* Offset phases so it looks like a faint “alive” sweep */
.link-spark--seg .seg:nth-child(1){ animation-delay: 0ms; }
.link-spark--seg .seg:nth-child(2){ animation-delay: 280ms; }
.link-spark--seg .seg:nth-child(3){ animation-delay: 560ms; }

/* Hover/Focus: brighten housing + switch to chase */
.link-card:hover .link-spark--seg,
.link-card:focus .link-spark--seg{
  border-color: rgba(255, 136, 0, 0.35);
  background: rgba(255, 136, 0, 0.05);

  transform: scale(1.05);
  opacity: 1;

  box-shadow:
    0 0 0 3px rgba(255, 136, 0, 0.08),
    0 0 14px rgba(255, 136, 0, 0.10);

  animation: seg-housing-hover 1.2s ease-in-out infinite;
}

/* Hover/Focus: segments become bright + chase */
.link-card:hover .link-spark--seg .seg,
.link-card:focus .link-spark--seg .seg{
  background: rgba(255, 136, 0, 0.55);
  box-shadow:
    0 0 0 1px rgba(255, 136, 0, 0.10),
    0 0 12px rgba(255, 136, 0, 0.16);

  animation: seg-chase 0.9s ease-in-out infinite;
}

/* Chase offsets for a clear “traveling” pulse */
.link-card:hover .link-spark--seg .seg:nth-child(1),
.link-card:focus .link-spark--seg .seg:nth-child(1){ animation-delay: 0ms; }

.link-card:hover .link-spark--seg .seg:nth-child(2),
.link-card:focus .link-spark--seg .seg:nth-child(2){ animation-delay: 140ms; }

.link-card:hover .link-spark--seg .seg:nth-child(3),
.link-card:focus .link-spark--seg .seg:nth-child(3){ animation-delay: 280ms; }

/* Keyframes */
@keyframes seg-idle{
  0%, 100% { opacity: 0.55; filter: brightness(0.95); transform: scaleY(0.95); }
  45%      { opacity: 0.78; filter: brightness(1.05); transform: scaleY(1.00); }
  55%      { opacity: 0.62; filter: brightness(0.98); transform: scaleY(0.98); }
}

/* “Chase” = a quick brighten + slight expansion on one segment at a time */
@keyframes seg-chase{
  0%, 100% { opacity: 0.55; filter: brightness(0.95); transform: scaleX(0.95); }
  50%      { opacity: 1.00; filter: brightness(1.25); transform: scaleX(1.08); }
}

@keyframes seg-housing-idle{
  0%, 100% { opacity: 0.82; transform: scale(0.96); }
  50%      { opacity: 0.92; transform: scale(0.985); }
}

@keyframes seg-housing-hover{
  0%, 100% { transform: scale(1.05); }
  50%      { transform: scale(1.08); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .link-spark--seg,
  .link-spark--seg .seg{
    animation: none !important;
  }
}


.link-card:hover .link-spark,
.link-card:focus .link-spark{
  background: rgba(255, 136, 0, 0.70);
  box-shadow:
    0 0 0 3px rgba(255, 136, 0, 0.12),
    0 0 14px rgba(255, 136, 0, 0.25);

  transform: scale(1.08);
  opacity: 1;

  animation: spark-hover 1.15s ease-in-out infinite;
}

@keyframes spark-idle{
  0%, 100% { transform: scale(0.92); opacity: 0.70; filter: brightness(0.95); }
  45%      { transform: scale(0.98); opacity: 0.88; filter: brightness(1.00); }
  55%      { transform: scale(0.95); opacity: 0.78; filter: brightness(0.98); }
}

@keyframes spark-hover{
  0%, 100% { transform: scale(1.06); opacity: 0.92; filter: brightness(1.05); }
  50%      { transform: scale(1.14); opacity: 1.00; filter: brightness(1.18); }
}

.link-arrow{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: rgba(0, 90, 156, 0.9);
}

/* Projects */
.projects{ display: grid; gap: 10px; }

.project-card{
  padding: 12px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid rgba(0, 119, 204, 0.22);
}

.project-card--featured{
  border-color: rgba(255, 136, 0, 0.50);
  box-shadow: inset 0 0 0 1px rgba(255, 136, 0, 0.12);
}

.project-title-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.project-title{
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.project-badges{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.project-pin{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 136, 0, 0.40);
  background: rgba(255, 136, 0, 0.10);
}

.project-status{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 119, 204, 0.28);
  background: rgba(0, 119, 204, 0.06);
}

.project-desc{
  margin: 8px 0 0 0;
  color: var(--color-muted);
  font-size: 14px;
}

.project-meta{
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.meta-row{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.meta-label{
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(12, 26, 36, 0.75);
}

.pill{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 119, 204, 0.20);
  background: rgba(0, 119, 204, 0.05);
  font-weight: 700;
  font-size: 13px;
}

.pill--accent{
  border-color: rgba(255, 136, 0, 0.28);
  background: rgba(255, 136, 0, 0.08);
}

.project-links{
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-link{
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 119, 204, 0.22);
  background: rgba(0, 119, 204, 0.06);
  text-decoration: none;
  color: var(--color-ink);
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.project-link:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(12, 26, 36, 0.08);
}

.project-link:focus{ outline: none; box-shadow: var(--focus); }

/* Empty state */
.empty-state{
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 119, 204, 0.04);
  border: 1px dashed rgba(0, 119, 204, 0.25);
}

.empty-state-title{
  font-weight: 900;
  font-size: 15px;
  margin-bottom: 4px;
}

.empty-state-subtitle{
  color: var(--color-muted);
  font-size: 14px;
}

/* Footer */
.footer{ padding-bottom: 6px; }

.footer-panel{
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.footer-text{
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(12, 26, 36, 0.8);
}

.footer-mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: rgba(66, 85, 99, 0.9);
}
