:root{
  --bg: #060a14;
  --panel: #0b111f;
  --panel-alt: #101a2c;
  --border: #1c2a45;
  --text: #e7ecf5;
  --text-dim: #6c7a99;
  --gold: #3b82f6;
  --teal: #38bdf8;
  --danger: #e2635a;
  --radius: 8px;
  --radius-sm: 4px;
  font-size: 16px;
}

*{ box-sizing: border-box; }

html,body{
  margin:0; padding:0; height:100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  -webkit-font-smoothing: antialiased;
}

h1,h2,.brand,.tab{
  font-family: 'Space Grotesk', sans-serif;
}

button{ font-family: inherit; }

.app{
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== TAB BAR ===== */
.tabbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex-shrink:0;
}

.brand{
  font-weight:700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}
.brand span{ color: var(--gold); }

.tabs{
  display:flex;
  gap: 4px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}

.tab{
  border:none;
  background: transparent;
  color: var(--text-dim);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor:pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color .15s ease, background .15s ease;
}
.tab:hover{ color: var(--text); }
.tab.is-active{
  background: var(--bg);
  color: var(--gold);
  border: 1px solid var(--border);
}

/* ===== SLIDING VIEWPORT ===== */
.viewport{
  flex: 1;
  overflow: hidden;
  position: relative;
}

.track{
  display:flex;
  width: 300%;
  height: 100%;
  transition: transform .45s cubic-bezier(.65,0,.35,1);
}

.page{
  width: calc(100% / 3);
  height: 100%;
  overflow-y: auto;
  padding: 28px 20px 60px;
}

.page-head h2{
  margin: 0 0 4px;
  font-size: 1.4rem;
}
.page-sub{
  margin: 0 0 24px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ===== HOME ===== */
.home-grid{
  display:flex;
  flex-direction: column;
  gap: 24px;
  max-width: 760px;
  margin: 0 auto;
}

.profile-card{
  text-align:center;
  padding: 28px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.profile-photo{
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  background: var(--panel-alt);
  box-shadow: 0 0 0 6px rgba(56,189,248,0.08), 0 0 26px rgba(59,130,246,0.35);
}

.profile-name{
  margin: 16px 0 4px;
  font-size: 1.3rem;
}

.profile-role{
  margin: 0 0 18px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.contact-row{
  display:flex;
  justify-content:center;
  gap: 10px;
  flex-wrap: wrap;
}

.contact-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration:none;
  font-size: 0.8rem;
  background: var(--panel-alt);
  transition: border-color .15s ease, color .15s ease;
}
.contact-btn:hover{ border-color: var(--teal); color: var(--teal); }

.code-block{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px 20px;
}

.code-block__label{
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===== SKILL LIST (logo + progress bar) ===== */
.skill-list{
  list-style:none;
  margin:0; padding:0;
  display:flex;
  flex-direction:column;
  gap: 24px;
}

.skill-item{
  display:flex;
  flex-direction:column;
  gap: 6px;
}

.skill-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.skill-head-left{
  display:flex;
  align-items:center;
  gap: 9px;
}

.skill-icon{
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  padding: 4px;
}
.skill-icon img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.skill-icon--fallback{
  color: #ff7a3d;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.skill-name{
  font-size: 0.88rem;
  font-weight: 500;
}

.skill-pct{
  font-size: 0.8rem;
  color: var(--teal);
  font-weight: 600;
}

.skill-bar{
  height: 6px;
  border-radius: 4px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  overflow: hidden;
}
.skill-bar__fill{
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  width: 0%;
  transition: width 1s cubic-bezier(.3,.8,.4,1);
}

/* ===== PROJECT LIST (clickable, opens detail) ===== */
.project-list{
  list-style:none;
  margin:0; padding:0;
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.project-item{
  display:flex;
  align-items:center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, transform .15s ease;
}
.project-item:hover{ border-color: var(--teal); }
.project-item:active{ transform: scale(.99); }

.project-logo{
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--gold);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}
.project-logo svg{ width: 16px; height: 16px; }

.project-name{
  font-size: 0.85rem;
}
.project-hint{
  display:block;
  color: var(--text-dim);
  font-size: 0.72rem;
  margin-top: 2px;
}

/* ===== FILE LIST ===== */
.file-list{
  list-style:none;
  margin:0; padding:0;
  max-width: 560px;
  margin-inline: auto;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.file-item{
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  cursor:pointer;
  text-align:left;
  width:100%;
  color: var(--text);
  transition: border-color .15s ease, transform .15s ease;
}
.file-item:hover{ border-color: var(--gold); }
.file-item:active{ transform: scale(.99); }

.file-thumb{
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  flex-shrink:0;
}

.file-name{
  font-size: 0.95rem;
  font-weight: 500;
}
.file-hint{
  display:block;
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-top: 2px;
}

/* ===== REPORT FORM ===== */
.report-form{
  max-width: 480px;
  margin: 0 auto;
  display:flex;
  flex-direction:column;
  gap: 16px;
}

.field{
  display:flex;
  flex-direction:column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.field input,
.field textarea{
  font-family: inherit;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.9rem;
  resize: vertical;
}
.field input:focus,
.field textarea:focus{
  outline: none;
  border-color: var(--teal);
}

.btn{
  border:none;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 0.9rem;
  cursor:pointer;
  font-weight: 600;
}

.btn-send{
  background: var(--gold);
  color: #1a1305;
}
.btn-send:hover{ filter: brightness(1.08); }

/* ===== OVERLAY PANELS (file detail / project detail / report success) ===== */
.overlay-panel{
  position: absolute;
  inset: 0;
  top: 65px;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.65,0,.35,1);
  overflow-y: auto;
  z-index: 5;
}
.overlay-panel.is-open{ transform: translateX(0); }

.overlay-panel__inner{
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.overlay-panel__inner--center{
  text-align:center;
  padding-top: 80px;
}

.btn-back{
  background:none;
  border:none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.85rem;
  cursor:pointer;
  padding: 6px 0 20px;
}
.btn-back:hover{ color: var(--teal); }

.detail-photo{
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  margin-bottom: 20px;
}

.detail-list{
  margin:0;
  border-top: 1px solid var(--border);
}
.detail-row{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.detail-row dt{ color: var(--text-dim); }
.detail-row dd{ margin:0; text-align:right; word-break: break-all; }
.detail-row a{ color: var(--teal); }

.detail-desc{
  margin: 16px 0 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-dim);
  white-space: pre-line;
}

.success-mark{
  font-size: 2.4rem;
  color: var(--teal);
  margin-bottom: 12px;
}
.success-text{
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 28px;
}

.btn-back-solid{
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-back-solid:hover{ border-color: var(--teal); color: var(--teal); }

/* ===== PIN GATE ===== */
.pin-title{
  margin: 4px 0 4px;
  font-size: 1.25rem;
}
.pin-sub{
  margin: 0 0 20px;
  color: var(--text-dim);
  font-size: 0.8rem;
}
.pin-input{
  width: 100%;
  text-align: center;
  letter-spacing: 0.4em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text);
}
.pin-input:focus{
  outline: none;
  border-color: var(--teal);
}
.pin-error{
  min-height: 1.2em;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 0.78rem;
}
.pin-submit{
  width: 100%;
  margin-top: 14px;
}
.pin-tutorial{
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: left;
}
.pin-tutorial p{
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.6;
  margin: 0 0 14px;
}
.pin-tutorial .contact-btn{
  display: flex;
  justify-content: center;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 720px){
  .home-grid{
    flex-direction: row;
    align-items: flex-start;
  }
  .profile-card{ flex: 0 0 260px; }
  .info-stack{
    flex:1;
    display:flex;
    flex-direction:column;
    gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce){
  .track, .overlay-panel, .skill-bar__fill{ transition: none; }
}
